/* ==========================================================================
   The people of a title (2026-12-01) — the app's faces, on the site.
   app/Views/movies/_people.php draws them; /assets/js/title-people.js opens the folder.
   A face is the person's photo, or their initials on their own colour (the same colour
   as in the app). A ring and «+N» = Film Party has more of their work, and only then is
   it a link; the rest is information.
   ========================================================================== */

/* ---- the face ---------------------------------------------------------- */
.fp-face {
    position: relative;
    display: inline-grid;
    place-items: center;
    flex: none;
    border-radius: 50%;
    overflow: hidden;
    background: linear-gradient(135deg, var(--fp-face-a, #5b95ff), var(--fp-face-b, #1f45a0));
    color: #fff;
    font-weight: 700;
    letter-spacing: .02em;
    line-height: 1;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, .2), 0 6px 16px rgba(0, 0, 0, .3);
    user-select: none;
}
.fp-face::after { /* a soft sheen on the top half, as on the app's glass */
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: linear-gradient(180deg, rgba(255, 255, 255, .2), rgba(255, 255, 255, 0) 55%);
    pointer-events: none;
}
.fp-face-in { position: relative; z-index: 0; font-family: inherit; }
.fp-face img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 50% 20%;
    border-radius: 50%;
    z-index: 1;
}
.fp-face--md { width: 60px; height: 60px; font-size: 20px; }
.fp-face--lg { width: 64px; height: 64px; font-size: 22px; }
.fp-face--xs { width: 24px; height: 24px; font-size: 9px; letter-spacing: 0; box-shadow: 0 0 0 1px rgba(255, 255, 255, .22); }

/* «there is more»: the brand ring, 2 px clear of the face */
.fp-face-wrap { position: relative; display: inline-flex; border-radius: 50%; transition: transform .22s cubic-bezier(.2, .8, .2, 1); }
.fp-person.is-more .fp-face-wrap::before,
.fp-folder__face::before {
    content: "";
    position: absolute;
    inset: -4.5px;
    border-radius: 50%;
    background: conic-gradient(from 200deg, #ff8fb3, #ff4d67, #e83250, #ff8fb3);
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2.5px), #000 calc(100% - 2px));
    mask: radial-gradient(farthest-side, transparent calc(100% - 2.5px), #000 calc(100% - 2px));
    pointer-events: none;
}
.fp-person.is-more .fp-face,
.fp-folder__face .fp-face { box-shadow: 0 6px 16px rgba(0, 0, 0, .3); }

.fp-face-more {
    position: absolute;
    left: 50%;
    bottom: -8px;
    transform: translateX(-50%);
    z-index: 2;
    padding: 1px 6px;
    border-radius: 999px;
    background: linear-gradient(90deg, #ff5f86, #e83250);
    border: 1.5px solid #141826;
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    line-height: 14px;
    white-space: nowrap;
    unicode-bidi: isolate;
}

/* ---- the cast row (movie.css drew the old portraits; these win over its img rules) ---- */
.movie-floating-page .movie-cast-row.fp-people-row { gap: 2px; padding: 6px 12px 14px; }
.movie-floating-page .movie-cast-row .movie-cast-card.fp-person {
    flex: 0 0 82px;
    gap: 6px;
    padding: 8px 2px 6px;
    color: inherit;
    text-decoration: none;
    border-radius: 16px;
}
.movie-floating-page .movie-cast-row .movie-cast-card.fp-person .fp-face img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    box-shadow: none;
    background: none;
    transform: none;
}
.movie-floating-page .movie-cast-row .movie-cast-card.fp-person.is-more .fp-face-wrap { margin-bottom: 6px; }
/* movie.css sizes every span in a cast card at 10px (the old «age» line); not the face */
.movie-floating-page .movie-cast-row .movie-cast-card.fp-person .fp-face-wrap,
.movie-floating-page .movie-cast-row .movie-cast-card.fp-person .fp-face,
.movie-floating-page .movie-cast-row .movie-cast-card.fp-person .fp-face-in { font-size: 20px; color: #fff; margin: 0; }
.movie-floating-page .movie-cast-row .movie-cast-card.fp-person .fp-face-more { font-size: 10px; }
.movie-floating-page .movie-cast-row .movie-cast-card.fp-person strong { font-size: 11.5px; font-weight: 700; color: rgba(255, 255, 255, .94); }
.movie-floating-page .movie-cast-row .movie-cast-card.fp-person:not(.is-more) strong { font-weight: 500; color: rgba(255, 255, 255, .7); }
.movie-floating-page .movie-cast-row .movie-cast-card.fp-person:not(.is-more):hover { background: none; cursor: default; }
.movie-floating-page .movie-cast-row .movie-cast-card.fp-person.is-more { cursor: pointer; }
.movie-floating-page .movie-cast-row .movie-cast-card.fp-person.is-more:hover { background: rgba(255, 255, 255, .045); }
.movie-floating-page .movie-cast-row .movie-cast-card.fp-person.is-more:hover .fp-face-wrap { transform: translateY(-2px); }
.movie-floating-page .movie-cast-row .movie-cast-card.fp-person.is-more:hover .fp-face img { transform: none; box-shadow: none; }
.fp-person.is-more:focus-visible,
.fp-person-chip.is-more:focus-visible { outline: 2px solid #ff6e9c; outline-offset: 2px; }

/* ---- the director, in «اطلاعات کامل» ---------------------------------- */
.fp-person-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.fp-person-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 100%;
    padding-block: 3px;
    padding-inline: 0 4px;
    border-radius: 999px;
    color: inherit;
    font-weight: 600;
    text-decoration: none;
}
.fp-person-chip > span[dir] { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fp-person-chip.is-more {
    padding-inline: 3px 4px;
    background: rgba(255, 255, 255, .07);
    border: 1px solid rgba(255, 255, 255, .16);
    cursor: pointer;
    transition: background .18s ease, border-color .18s ease;
}
.fp-person-chip.is-more:hover { background: rgba(255, 255, 255, .12); border-color: rgba(255, 95, 134, .55); }
/* no photo: no picture in the chip (owner, 2026-12-01) — just the name, with room on its side */
.fp-person-chip.is-more:not(.has-photo) { padding-inline: 10px 4px; }
.fp-person-chip .fp-face.is-tucked,
.full-info-grid .fp-person-chip .fp-face.is-tucked { display: none; }
.fp-person-chip.is-more .fp-face { box-shadow: 0 0 0 1.5px rgba(17, 21, 33, .95), 0 0 0 3px #ff4d67; margin: 2px; }
.fp-person-chip .fp-face-more { position: static; transform: none; border: 0; font-size: 9.5px; padding: 1px 5px; }
/* movie.css makes every span in «اطلاعات کامل» a 12px grey block with a bottom margin (the labels) */
.full-info-grid .fp-person-chip { display: inline-flex; margin: 0; color: inherit; font-size: 13px; }
.full-info-grid .fp-person-chip > span[dir] { display: inline; margin: 0; color: inherit; font-size: 13px; }
.full-info-grid .fp-person-chip .fp-face { display: inline-grid; margin: 0; color: #fff; font-size: 9px; }
.full-info-grid .fp-person-chip.is-more .fp-face { margin: 2px; }
.full-info-grid .fp-person-chip .fp-face-in { display: inline; margin: 0; color: #fff; font-size: 9px; }

/* ---- the folder ------------------------------------------------------ */
html.fp-folder-open { overflow: hidden; }
.fp-folder { position: fixed; inset: 0; z-index: 9000; display: flex; align-items: flex-end; justify-content: center; }
.fp-folder[hidden] { display: none; }
.fp-folder__scrim {
    position: absolute;
    inset: 0;
    background: rgba(4, 6, 12, .62);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    animation: fpFolderFade .2s ease;
}
.fp-folder__panel {
    position: relative;
    width: 100%;
    max-height: 84vh;
    display: flex;
    flex-direction: column;
    background: rgba(17, 21, 33, .97);
    border: 1px solid rgba(255, 255, 255, .1);
    border-bottom: 0;
    border-radius: 24px 24px 0 0;
    box-shadow: 0 -20px 60px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .06);
    color: #f1f4fa;
    animation: fpFolderUp .3s cubic-bezier(.2, .8, .2, 1);
}
.fp-folder__grip { width: 40px; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, .22); margin: 9px auto 0; }
.fp-folder__head { display: flex; align-items: center; gap: 14px; padding: 14px 20px 12px; }
.fp-folder__face { position: relative; display: inline-flex; border-radius: 50%; margin: 5px; }
.fp-folder__who { flex: 1; min-width: 0; }
.fp-folder__role { color: #ff8fb3; font-size: 12px; font-weight: 800; }
.fp-folder__name { margin: 2px 0 0; font-size: 17px; font-weight: 800; line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fp-folder__count { margin-top: 2px; font-size: 12.5px; color: rgba(255, 255, 255, .6); }
.fp-folder__close {
    flex: none;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .12);
    color: #fff;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}
.fp-folder__close:hover { background: rgba(255, 255, 255, .14); }
.fp-folder__body { overflow: auto; overscroll-behavior: contain; padding: 4px 20px 16px; }
.fp-folder__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 16px 10px; }
.fp-folder__item { display: block; min-width: 0; color: inherit; text-decoration: none; }
.fp-folder__poster {
    aspect-ratio: 2 / 3;
    border-radius: 12px;
    overflow: hidden;
    background: rgba(255, 255, 255, .06);
    border: 1px solid rgba(255, 255, 255, .1);
    transition: transform .22s cubic-bezier(.2, .8, .2, 1), box-shadow .22s ease;
}
.fp-folder__poster img { display: block; width: 100%; height: 100%; object-fit: cover; }
.fp-folder__item:hover .fp-folder__poster,
.fp-folder__item:focus-visible .fp-folder__poster { transform: translateY(-3px); box-shadow: 0 12px 26px rgba(0, 0, 0, .42); }
.fp-folder__item:focus-visible { outline: none; }
.fp-folder__item:focus-visible .fp-folder__poster { outline: 2px solid #ff6e9c; outline-offset: 2px; }
.fp-folder__item.is-current { cursor: default; }
/* the title on screen, as «مجموعه کامل» marks it (movie.css .movie-collection-card.current) */
.fp-folder__item.is-current .fp-folder__poster { border-color: rgba(250, 204, 21, .62); box-shadow: 0 0 0 1px rgba(250, 204, 21, .3); }
.fp-folder__item.is-current:hover .fp-folder__poster { transform: none; box-shadow: 0 0 0 1px rgba(250, 204, 21, .3); }
.fp-folder__here { display: block; margin-top: 2px; font-size: 11px; font-style: normal; font-weight: 900; color: rgba(250, 204, 21, .86); }
.fp-folder__title { margin-top: 7px; font-size: 12px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fp-folder__sub { margin-top: 1px; font-size: 11px; color: rgba(255, 255, 255, .55); }
.fp-folder__skel .fp-folder__poster,
.fp-folder__skel .fp-folder__line { background: rgba(255, 255, 255, .08); animation: fpFolderPulse 1.1s ease-in-out infinite alternate; }
.fp-folder__skel .fp-folder__poster { border-color: transparent; }
.fp-folder__line { height: 9px; width: 64%; margin-top: 9px; border-radius: 9px; }
.fp-folder__note { padding: 26px 0 10px; text-align: center; font-size: 13px; color: rgba(255, 255, 255, .65); }
.fp-folder__retry {
    display: inline-block;
    margin-top: 12px;
    padding: 8px 22px;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(90deg, #ff5f86, #e83250);
    color: #fff;
    font: inherit;
    font-size: 12.5px;
    font-weight: 800;
    cursor: pointer;
}
.fp-folder__foot {
    display: flex;
    justify-content: center;
    padding: 10px 20px max(16px, env(safe-area-inset-bottom));
    border-top: 1px solid rgba(255, 255, 255, .07);
}
.fp-folder__page { color: #9cc3ff; font-size: 12.5px; font-weight: 700; text-decoration: none; }
.fp-folder__page:hover { text-decoration: underline; }

@media (min-width: 700px) {
    .fp-folder { align-items: center; }
    .fp-folder__panel {
        width: min(640px, 92vw);
        max-height: 80vh;
        border-bottom: 1px solid rgba(255, 255, 255, .1);
        border-radius: 24px;
        box-shadow: 0 30px 80px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 255, 255, .06);
        animation: fpFolderPop .24s cubic-bezier(.2, .8, .2, 1);
    }
    .fp-folder__grip { display: none; }
    .fp-folder__head { padding-top: 20px; }
    .fp-folder__grid { grid-template-columns: repeat(auto-fill, minmax(116px, 1fr)); }
}

@keyframes fpFolderFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes fpFolderUp { from { transform: translateY(36px); opacity: .4; } to { transform: none; opacity: 1; } }
@keyframes fpFolderPop { from { transform: translateY(10px) scale(.97); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fpFolderPulse { from { opacity: .55; } to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
    .fp-folder__scrim, .fp-folder__panel, .fp-folder__skel .fp-folder__poster, .fp-folder__skel .fp-folder__line { animation: none; }
    .fp-face-wrap, .fp-folder__poster { transition: none; }
}

/* ---- light theme ----------------------------------------------------- */
:root[data-theme="light"] .fp-face { box-shadow: 0 0 0 1px rgba(15, 23, 42, .1), 0 6px 14px rgba(15, 23, 42, .14); }
:root[data-theme="light"] .fp-face-more { border-color: #fff; }
:root[data-theme="light"] .movie-floating-page .movie-cast-row .movie-cast-card.fp-person strong { color: #0f172a; }
:root[data-theme="light"] .movie-floating-page .movie-cast-row .movie-cast-card.fp-person:not(.is-more) strong { color: rgba(15, 23, 42, .66); }
:root[data-theme="light"] .movie-floating-page .movie-cast-row .movie-cast-card.fp-person.is-more:hover { background: rgba(15, 23, 42, .045); }
:root[data-theme="light"] .fp-person-chip.is-more { background: rgba(15, 23, 42, .045); border-color: rgba(15, 23, 42, .12); }
:root[data-theme="light"] .fp-person-chip.is-more .fp-face { box-shadow: 0 0 0 1.5px #fff, 0 0 0 3px #ff4d67; }
:root[data-theme="light"] .fp-folder__scrim { background: rgba(15, 23, 42, .4); }
:root[data-theme="light"] .fp-folder__panel { background: rgba(255, 255, 255, .98); border-color: rgba(15, 23, 42, .1); color: #0f172a; }
:root[data-theme="light"] .fp-folder__grip { background: rgba(15, 23, 42, .18); }
:root[data-theme="light"] .fp-folder__count,
:root[data-theme="light"] .fp-folder__sub,
:root[data-theme="light"] .fp-folder__note { color: rgba(15, 23, 42, .6); }
:root[data-theme="light"] .fp-folder__close { background: rgba(15, 23, 42, .06); border-color: rgba(15, 23, 42, .12); color: #0f172a; }
:root[data-theme="light"] .fp-folder__poster { background: rgba(15, 23, 42, .05); border-color: rgba(15, 23, 42, .1); }
:root[data-theme="light"] .fp-folder__skel .fp-folder__poster,
:root[data-theme="light"] .fp-folder__skel .fp-folder__line { background: rgba(15, 23, 42, .08); }
:root[data-theme="light"] .fp-folder__foot { border-top-color: rgba(15, 23, 42, .08); }
:root[data-theme="light"] .fp-folder__page { color: #1f5fd1; }
:root[data-theme="light"] .fp-folder__here { color: #a86a00; }
