/* ==========================================================================
   Team member portfolio page  —  /team/{slug}
   Built on the theme's "portfolio-2" markup (.works-wrapper-2), flattened to a
   plain 4-per-row flow so no cell is ever left empty.
   ========================================================================== */

/* The big display word. fa.css forces YekanBakh onto every h2 with !important,
   so put the theme's condensed Latin face back for this one heading. */
.page-title-wrapper .page-title {
    font-family: "Thunder", sans-serif !important;
    /* it is a <div> now (the H1 is the member name), so restore the h2 look */
    color: var(--primary);
}

/* screen-reader-only heading (section outline for SEO / assistive tech) */
.tp-sr-only {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* --- member line under the display title --------------------------------- */

.team-portfolio-meta {
    text-align: center;
    margin-bottom: 60px;
}

.team-portfolio-meta .name {
    font-size: 28px;
    font-weight: 700;
    line-height: 1.4;
    margin: 0;
}

.team-portfolio-meta .name-alt {
    display: block;
    margin-top: 2px;
    font-size: 16px;
    font-weight: 400;
    letter-spacing: .02em;
    color: #999999;
}

.team-portfolio-meta .role {
    font-size: 16px;
    line-height: 1.6;
    color: #999999;
    margin: 4px 0 0;
}

.team-portfolio-meta .caps {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin: 18px 0 0;
    padding: 0;
    list-style: none;
}

.team-portfolio-meta .caps li {
    font-size: 14px;
    line-height: 1;
    padding: 9px 16px;
    border: 1px solid var(--border, rgba(255, 255, 255, .15));
    border-radius: 50px;
    color: #cccccc;
}

.team-portfolio-meta .socials {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin: 22px 0 0;
    padding: 0;
    list-style: none;
}

.team-portfolio-meta .socials a {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    line-height: 1;
    color: #cccccc;
    border: 1px solid var(--border, rgba(255, 255, 255, .15));
    border-radius: 50%;
    transition: color .3s, background-color .3s, border-color .3s;
}

.team-portfolio-meta .socials a:hover {
    color: var(--black, #111111);
    background-color: var(--primary, #ffffff);
    border-color: var(--primary, #ffffff);
}

@media only screen and (max-width: 767px) {
    .team-portfolio-meta {
        margin-bottom: 40px;
    }

    .team-portfolio-meta .name {
        font-size: 22px;
    }

    .team-portfolio-meta .socials a {
        width: 40px;
        height: 40px;
        font-size: 15px;
    }
}

/* --- the grid ------------------------------------------------------------ */

.works-wrapper-2.works-flow {
    grid-template-columns: repeat(4, 1fr);
    gap: 56px 24px;
}

/* The theme staggers the cards with hard-coded grid-column-start values on
   :nth-child(3/4/6/7/9/12), which punches holes in the layout. Cancel them. */
.works-wrapper-2.works-flow > *:nth-child(n) {
    grid-column-start: auto;
}

@media only screen and (max-width: 1399px) {
    .works-wrapper-2.works-flow {
        gap: 48px 20px;
    }
}

@media only screen and (max-width: 1199px) {
    .works-wrapper-2.works-flow {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media only screen and (max-width: 991px) {
    .works-wrapper-2.works-flow {
        grid-template-columns: repeat(2, 1fr);
        gap: 40px 20px;
    }
}

@media (max-width: 575px) {
    .works-wrapper-2.works-flow {
        grid-template-columns: repeat(1, 1fr);
        gap: 32px;
    }
}

/* --- cards --------------------------------------------------------------- */

/* Uploaded artwork comes in every aspect ratio; lock the thumbs to one shape
   so the rows line up. */
.works-wrapper-2.works-flow .work-box .thumb {
    border-radius: 12px;
    aspect-ratio: 4 / 3;
}

.works-wrapper-2.works-flow .work-box .thumb a {
    display: block;
    width: 100%;
    height: 100%;
}

.works-wrapper-2.works-flow .work-box .thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.7s cubic-bezier(0.23, 1, 0.32, 1);
}

.works-wrapper-2.works-flow .work-box:hover .thumb img {
    transform: scale(1.06);
}

.works-wrapper-2.works-flow .work-box .content {
    margin-top: 14px;
}

.works-wrapper-2.works-flow .work-box .title a:hover {
    color: var(--secondary);
}

.works-wrapper-2.works-flow .empty-note {
    grid-column: 1 / -1;
    opacity: .6;
}

/* --- per-member "about" box  (resources/views/team/about/{slug}.blade.php) ---
   Same look & behaviour as #about-image-optimizer (.io-seo in
   image-optimizer-content.css): faded preview + "مشاهده بیشتر" toggle.
   ------------------------------------------------------------------------- */
.member-about-area { padding-bottom: 120px; }
@media only screen and (max-width: 767px) {
    .member-about-area { padding-bottom: 70px; }
}

.member-about {
    border: 1px solid #333;
    border-radius: 1.5rem;
    background: #1c1c1c;
    overflow: hidden;
    text-align: start;
}
.member-about__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .75rem 1rem;
    padding: 1.25rem 1.5rem;
}
.member-about__heading { min-width: 0; }
.member-about [data-ma-lang][hidden] { display: none !important; }
.member-about__title { display: block; font-size: 1.125rem; font-weight: 700; color: #fff; line-height: 1.8; }
.member-about__hint { display: block; margin-top: .125rem; font-size: .8125rem; font-weight: 400; color: #a1a1a1; }

.member-about__body {
    position: relative;
    border-top: 1px solid #333;
    padding: 1.5rem;
    font-size: .9375rem;
    line-height: 2.1;
    color: #d4d4d4;
}
@media (min-width: 640px) {
    .member-about__head { padding: 1.5rem 2rem; }
    .member-about__title { font-size: 1.25rem; }
    .member-about__body { padding: 2rem; }
}
.member-about__content { text-align: start; }
.member-about__content[dir="ltr"] { font-family: var(--font_dmsans, sans-serif); }
.member-about__content > * { margin: 0; }
.member-about__content > * + * { margin-top: 1rem; }
.member-about__body h2 { font-size: 1.375rem; font-weight: 800; color: #fff; line-height: 1.7; }
.member-about__body h3 { margin-top: 2rem; font-size: 1.125rem; font-weight: 700; color: #fff; line-height: 1.7; }
.member-about__body p { font-size: inherit; line-height: inherit; color: inherit; }
.member-about__body strong { color: #fff; font-weight: 700; }
.member-about__body ul { padding-inline-start: 1.25rem; list-style: disc; }
.member-about__body li { font-size: inherit; line-height: inherit; color: inherit; }
.member-about__body li + li { margin-top: .375rem; }
.member-about__body li::marker { color: #ff6a3a; }
.member-about__body h4 { margin-top: 1.5rem; font-size: 1rem; font-weight: 700; color: #fff; line-height: 1.7; }
.member-about__body h4 + p { margin-top: .375rem; }
.member-about__body a { color: #fa9170; text-decoration: underline; text-underline-offset: 3px; }
.member-about__body a:hover { color: #fff; }

/* language switcher (فارسی / English) */
.member-about__langs {
    display: inline-flex;
    flex-shrink: 0;
    padding: .25rem;
    border: 1px solid #333;
    border-radius: .75rem;
    background: #141414;
}
.member-about__lang {
    border: 0;
    border-radius: .5rem;
    background: transparent;
    padding: .375rem .875rem;
    font: inherit;
    font-size: .8125rem;
    font-weight: 700;
    line-height: 1.6;
    color: #a1a1a1;
    cursor: pointer;
    transition: background-color .2s, color .2s;
}
/* hidden without JS (buttons would do nothing); shown early with JS to avoid a layout shift */
.member-about__langs[hidden] { display: none; }
.ma-js .member-about__langs[hidden] { display: inline-flex; }
.member-about__lang:hover { color: #fff; }
.member-about__lang[aria-pressed="true"] { background: rgba(255, 106, 58, .16); color: #fa9170; }
.member-about__lang:focus-visible { outline: 2px solid #fa9170; outline-offset: 2px; }

/* collapsed state: faded preview */
.ma-js .member-about.is-collapsed .member-about__body { max-height: 22rem; overflow: hidden; }
.ma-js .member-about.is-collapsed .member-about__body::after {
    content: "";
    position: absolute;
    inset-inline: 0;
    bottom: 0;
    height: 9rem;
    background: linear-gradient(to bottom, rgba(28, 28, 28, 0), #1c1c1c 85%);
    pointer-events: none;
}
.member-about__more { display: flex; justify-content: center; padding: 0 1.5rem 1.5rem; }
.member-about__more[hidden] { display: none; }
.ma-js .member-about__more[hidden] { display: flex; }
.ma-js .member-about.is-collapsed .member-about__more { margin-top: -1rem; position: relative; }
.member-about__toggle {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    border: 1px solid rgba(255, 106, 58, .4);
    border-radius: .75rem;
    background: rgba(255, 106, 58, .12);
    padding: .625rem 1.25rem;
    font: inherit;
    font-size: .875rem;
    font-weight: 700;
    color: #fa9170;
    cursor: pointer;
    transition: background-color .2s, color .2s;
}
.member-about__toggle:hover { background: rgba(255, 106, 58, .22); color: #fff; }
.member-about__toggle:focus-visible { outline: 2px solid #fa9170; outline-offset: 2px; }
.member-about__toggle svg { transition: transform .3s; }
.member-about:not(.is-collapsed) .member-about__toggle svg { transform: rotate(180deg); }
