/**
 * kp_persons.css — uakino-bay.net (Default skin)
 * @version 2026-04-04 v3.2
 *
 * Темна тема — нативна палітра Default-скіну.
 * Колірна схема: #0c1016 → #121820 → #18202a, accent #ffbb00.
 * Шрифт: Montserrat (self-hosted через /cf-fonts/).
 */

/* ─── Custom Properties ────────────────────────────────────────────────────── */
.pa, .pa-filmography {
    --pa-bg:         #0c1016;
    --pa-surface:    #121820;
    --pa-card:       #18202a;
    --pa-border:     #1e2d3d;
    --pa-text:       #aac2e0;
    --pa-heading:    #e8ecf0;
    --pa-muted:      #8fa7c6;
    --pa-light:      #5a7190;
    --pa-accent:     #ffbb00;
    --pa-accent-dim: rgba(255,187,0,.12);
    --pa-blue:       #2c69b7;
    --pa-red:        #ee3442;
    --pa-amber:      #ffbb00;
    --pa-green:      #83bf45;
    --pa-radius:     10px;
    --pa-radius-lg:  10px;
    --pa-shadow:     0 4px 10px rgba(0,0,0,.6);
    --pa-ff:         'Montserrat', sans-serif;
    --pa-ease:       cubic-bezier(.4,0,.2,1);
}

/* ─── Wrapper ──────────────────────────────────────────────────────────────── */
.pa {
    font-family: var(--pa-ff);
    color: var(--pa-text);
    font-size: 15px;
    line-height: 1.6;
    font-weight: 400;
    padding-bottom: 20px;
}

/* ─── HERO ─────────────────────────────────────────────────────────────────── */
.pa-hero {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 20px;
    align-items: start;
    margin-bottom: 30px;
    padding: 20px;
    background: var(--pa-surface);
    border-radius: var(--pa-radius);
}

@media (max-width: 640px) {
    .pa-hero {
        grid-template-columns: 140px 1fr;
        gap: 16px;
        padding: 16px;
    }
}

@media (max-width: 420px) {
    .pa-hero {
        grid-template-columns: 1fr;
    }
    .pa-hero-photo { max-width: 170px; margin: 0 auto; }
}

/* Photo */
.pa-hero-photo {
    position: sticky;
    top: 80px;
}

.pa-hero-photo img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 2/3;
    object-fit: cover;
    object-position: center top;
    border-radius: var(--pa-radius);
    box-shadow: var(--pa-shadow);
}

/* Profession */
.pa-profession {
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--pa-accent);
    margin-bottom: 6px;
}

/* Name */
.pa-name {
    font-family: var(--pa-ff);
    font-size: clamp(1.5rem, 3.5vw, 2rem);
    font-weight: 600;
    line-height: 1.2;
    margin: 0 0 4px;
    color: var(--pa-heading);
}

.pa-name-en {
    font-size: 14px;
    font-weight: 300;
    color: var(--pa-muted);
    margin-bottom: 16px;
}

/* Meta table */
.pa-meta {
    margin: 0;
    padding: 0;
    border-top: 1px solid var(--pa-border);
}

.pa-meta-row {
    display: flex;
    gap: 12px;
    padding: 7px 0;
    border-bottom: 1px solid var(--pa-border);
    font-size: 13px;
}

.pa-meta-row dt {
    flex-shrink: 0;
    width: 130px;
    color: var(--pa-muted);
    font-weight: 400;
}

.pa-meta-row dd {
    margin: 0;
    color: var(--pa-text);
    font-weight: 500;
}

.pa-meta-note {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 7px;
    background: var(--pa-bg);
    border: 1px solid var(--pa-border);
    border-radius: 6px;
    font-size: 12px;
    font-weight: 400;
    color: var(--pa-muted);
    vertical-align: middle;
}

@media (max-width: 640px) {
    .pa-meta-row { flex-wrap: wrap; gap: 2px; }
    .pa-meta-row dt { width: 100%; font-size: 12px; }
}

/* ─── SECTION TITLE ────────────────────────────────────────────────────────── */
.pa-section-title {
    font-family: var(--pa-ff);
    font-size: 18px;
    font-weight: 500;
    color: var(--pa-heading);
    margin: 0 0 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.pa-section-title .fas,
.pa-section-title .fal {
    color: var(--pa-accent);
    margin-right: 6px;
}

/* ─── BEST MOVIES horizontal scroll ───────────────────────────────────────── */
.pa-best {
    margin-bottom: 30px;
}

.pa-best-track {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 8px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #304054 transparent;
}

.pa-best-track::-webkit-scrollbar { height: 7px; }
.pa-best-track::-webkit-scrollbar-track { background: transparent; }
.pa-best-track::-webkit-scrollbar-thumb { background: #304054; border-radius: 20px; }

.pa-best-card {
    flex-shrink: 0;
    width: 110px;
    scroll-snap-align: start;
    position: relative;
}

.pa-best-inner {
    display: block;
    text-decoration: none;
    color: inherit;
}

.pa-best-poster {
    position: relative;
    border-radius: var(--pa-radius);
    overflow: hidden;
    background: var(--pa-surface);
    aspect-ratio: 2/3;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    box-shadow: var(--pa-shadow);
    transition: all .3s;
}

.pa-best-card--linked .pa-best-inner:hover .pa-best-poster {
    opacity: .8;
}

.pa-best-poster img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pa-best-rating {
    position: absolute;
    top: 6px;
    left: 6px;
    z-index: 1;
    font-size: 12px;
    font-weight: 600;
    padding: 0 6px;
    line-height: 22px;
    border-radius: 6px;
    background: rgba(0,0,0,.7);
    color: var(--pa-accent);
}

.pa-best-meta {
    padding: 0 2px;
}

.pa-best-name {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.3;
    color: var(--pa-text);
    margin-bottom: 2px;
}

.pa-best-card--linked .pa-best-inner:hover .pa-best-name {
    color: var(--pa-accent);
    text-decoration: underline;
}

.pa-best-year {
    display: block;
    font-size: 12px;
    color: var(--pa-muted);
    font-weight: 300;
}

/* ─── BIO + FACTS ──────────────────────────────────────────────────────────── */
.pa-content-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
    align-items: start;
}

@media (max-width: 768px) {
    .pa-content-cols { grid-template-columns: 1fr; gap: 20px; }
}

/* Bio collapsible (matches site .ftext-toggle pattern) */
.pa-bio-cb { display: none; }

.pa-bio-section,
.pa-facts-section {
    padding: 20px;
    background: var(--pa-surface);
    border-radius: var(--pa-radius);
}

.pa-bio-body {
    max-height: 5.5em;
    overflow: hidden;
    transition: max-height .4s var(--pa-ease);
    position: relative;
}

.pa-bio-body::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 2.5em;
    background: linear-gradient(transparent, var(--pa-surface));
    pointer-events: none;
    transition: opacity .3s;
}

.pa-bio-cb:checked ~ .pa-bio-body {
    max-height: 200em;
}

.pa-bio-cb:checked ~ .pa-bio-body::after {
    opacity: 0;
}

.pa-bio-body p {
    margin: 0 0 .75em;
    color: var(--pa-text);
    font-size: 14px;
    line-height: 1.7;
}

/* Toggle — matching site .ftext-more pill style */
.pa-bio-toggle {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--pa-muted);
    cursor: pointer;
    border: none;
    background: var(--pa-border);
    padding: 6px 16px;
    border-radius: 8px;
    text-decoration: none;
    transition: all .3s;
}
.pa-bio-toggle:hover { background: var(--pa-blue); color: #fff; }

.pa-bio-less { display: none; }
.pa-bio-cb:checked ~ .pa-bio-toggle .pa-bio-more { display: none; }
.pa-bio-cb:checked ~ .pa-bio-toggle .pa-bio-less { display: inline; }

/* Facts */
.pa-facts-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pa-facts-list li {
    padding: 10px 14px;
    background: var(--pa-bg);
    border-left: 3px solid var(--pa-accent);
    border-radius: 0 6px 6px 0;
    font-size: 13px;
    line-height: 1.5;
    color: var(--pa-text);
}

/* ─── FILMOGRAPHY TABS ─────────────────────────────────────────────────────── */
.pa-filmography {
    margin-bottom: 20px;
}

/* Hide radio inputs */
.pa-tab-r { display: none; }

/* Tab nav — match site .fplayer .tabs-sel style */
.pa-tab-nav {
    display: flex;
    gap: 0;
    margin-bottom: 16px;
    overflow-x: auto;
    scrollbar-width: none;
}
.pa-tab-nav::-webkit-scrollbar { display: none; }

.pa-tab-lbl {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 0 20px;
    height: 40px;
    font-size: 14px;
    font-weight: 500;
    color: var(--pa-muted);
    cursor: pointer;
    white-space: nowrap;
    background: rgba(0,0,0,.6);
    transition: all .3s;
}

.pa-tab-lbl:first-of-type { border-radius: 10px 0 0 10px; }
.pa-tab-lbl:last-of-type { border-radius: 0 10px 10px 0; }

.pa-tab-lbl em {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 18px;
    padding: 0 5px;
    font-size: 11px;
    font-style: normal;
    font-weight: 600;
    color: var(--pa-light);
}

.pa-tab-lbl:hover { text-decoration: underline; color: var(--pa-text); }

/* Active tab */
#pa-tab-film:checked ~ .pa-tab-content #pa-panel-film,
#pa-tab-series:checked ~ .pa-tab-content #pa-panel-series,
#pa-tab-cartoon:checked ~ .pa-tab-content #pa-panel-cartoon { display: block; }

.pa-tab-panel { display: none; }

#pa-tab-film:checked ~ .pa-tab-nav [for="pa-tab-film"],
#pa-tab-series:checked ~ .pa-tab-nav [for="pa-tab-series"],
#pa-tab-cartoon:checked ~ .pa-tab-nav [for="pa-tab-cartoon"] {
    background: var(--pa-blue);
    color: #fff;
}

#pa-tab-film:checked ~ .pa-tab-nav [for="pa-tab-film"] em,
#pa-tab-series:checked ~ .pa-tab-nav [for="pa-tab-series"] em,
#pa-tab-cartoon:checked ~ .pa-tab-nav [for="pa-tab-cartoon"] em {
    color: rgba(255,255,255,.7);
}

/* Filmography table */
.pa-filmlist {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.pa-filmlist thead th {
    padding: 0 10px 8px;
    text-align: left;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--pa-light);
    border-bottom: 1px solid var(--pa-border);
}

.pa-filmlist thead th:last-child { text-align: right; }

.pa-fl-row {
    border-bottom: 1px solid var(--pa-border);
    transition: all .3s;
}
.pa-fl-row:hover { background: var(--pa-surface); }

.pa-filmlist td { padding: 7px 10px; vertical-align: middle; }

.pa-fl-year {
    width: 46px;
    color: var(--pa-muted);
    font-size: 13px;
    font-weight: 300;
    white-space: nowrap;
}

.pa-fl-title { font-weight: 500; color: var(--pa-text); }
.pa-fl-title a { color: inherit; text-decoration: none; }
.pa-fl-title a:hover { color: var(--pa-accent); text-decoration: underline; }

.pa-fl-role { color: var(--pa-muted); font-size: 13px; font-weight: 300; }

.pa-fl-r {
    text-align: right;
    width: 44px;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    color: var(--pa-light);
}
.pa-fl-r--hi  { color: var(--pa-green); }
.pa-fl-r--mid { color: var(--pa-amber); }
.pa-fl-r--lo  { color: var(--pa-red); }

@media (max-width: 540px) {
    .pa-fl-role { display: none; }
    .pa-filmlist thead th:nth-child(3) { display: none; }
}

/* ─── CAST MODAL (CSS-only :target) ───────────────────────────────────────── */
.cast-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity .2s var(--pa-ease), visibility .2s;
}

.cast-modal:target {
    opacity: 1;
    visibility: visible;
}

.cast-modal__bg {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.7);
    cursor: default;
    -webkit-tap-highlight-color: transparent;
}

.cast-modal__body {
    position: relative;
    z-index: 1;
    display: flex;
    gap: 18px;
    background: var(--pa-card, #18202a);
    border-radius: var(--pa-radius);
    box-shadow: 0 20px 60px rgba(0,0,0,.5);
    padding: 22px 24px;
    max-width: 380px;
    width: calc(100vw - 40px);
    max-height: 80vh;
    overflow-y: auto;
    border-top: 3px solid var(--pa-accent);
}

.cast-modal__close {
    position: absolute;
    top: 10px;
    right: 14px;
    font-size: 22px;
    line-height: 1;
    color: var(--pa-muted);
    text-decoration: none;
    z-index: 2;
    transition: color .3s;
}
.cast-modal__close:hover { color: var(--pa-accent); }

.cast-modal__photo { flex-shrink: 0; width: 90px; }
.cast-modal__photo img {
    width: 100%;
    border-radius: var(--pa-radius);
    aspect-ratio: 2/3;
    object-fit: cover;
    object-position: top;
    box-shadow: var(--pa-shadow);
}

.cast-modal__info {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
    padding-top: 2px;
}

.cast-modal__name {
    font-family: var(--pa-ff, sans-serif);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--pa-heading, #e8ecf0);
    line-height: 1.2;
}

.cast-modal__name-en {
    font-size: 12px;
    color: var(--pa-muted);
    font-weight: 300;
}

.cast-modal__prof {
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--pa-accent);
    margin-top: 2px;
}

.cast-modal__role {
    font-size: 13px;
    color: var(--pa-muted);
    font-weight: 300;
}

.cast-modal__movies {
    font-size: 12px;
    color: var(--pa-light);
    margin-top: auto;
    padding-top: 8px;
    border-top: 1px solid var(--pa-border);
}

/* ─── Persons cast block (film page) ──────────────────────────────────────── */
.persons-section {
    margin: 24px 0;
    padding: 16px 20px;
    background: var(--pa-surface, #121820);
    border-radius: var(--pa-radius, 10px);
}

.persons-block { margin-bottom: 16px; }
.persons-block:last-child { margin-bottom: 0; }

.persons-block--crew {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--pa-border, #1e2d3d);
}

.persons-crew-row { margin-bottom: 0; }

.persons-label {
    display: inline-block;
    margin-bottom: 10px;
    padding: 3px 12px;
    border-radius: 999px;
    background: rgba(44,105,183,.15);
    border: 1px solid rgba(44,105,183,.25);
    font: 600 10px/1.4 var(--pa-ff, 'Montserrat', sans-serif);
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--pa-blue, #2c69b7);
}

.persons-list {
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 6px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(44,105,183,.3) transparent;
}

.persons-list::-webkit-scrollbar        { height: 3px; }
.persons-list::-webkit-scrollbar-track  { background: transparent; }
.persons-list::-webkit-scrollbar-thumb  { background: rgba(44,105,183,.3); border-radius: 3px; }

.persons-list--crew { gap: 6px; }

.cast-item {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 76px;
    text-decoration: none !important;
    color: inherit;
    cursor: pointer;
    transition: transform .18s ease;
}

.cast-item:hover {
    transform: translateY(-3px);
}

/* Portrait */
.cast-poster {
    width: 62px;
    height: 84px;
    margin: 0 auto 6px;
    border-radius: 8px;
    overflow: hidden;
    background: var(--pa-card, #18202a);
    border: 2px solid transparent;
    box-shadow: 0 3px 8px rgba(0,0,0,.5);
    transition: border-color .18s ease;
}

.cast-item:hover .cast-poster {
    border-color: var(--pa-accent, #ffbb00);
}

.cast-poster img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    transition: transform .22s ease;
}

.cast-item:hover .cast-poster img {
    transform: scale(1.06);
}

/* Name */
.cast-name {
    display: block;
    font: 600 11px/1.3 var(--pa-ff, 'Montserrat', sans-serif);
    color: var(--pa-text, #aac2e0);
    max-width: 76px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: color .18s ease;
}

.cast-item:hover .cast-name {
    color: var(--pa-accent, #ffbb00);
}

/* Character role */
.cast-char {
    display: block;
    font: 400 10px/1.2 var(--pa-ff, 'Montserrat', sans-serif);
    color: var(--pa-muted, #8fa7c6);
    max-width: 76px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-top: 2px;
}

/* Crew cards — slightly smaller */
.persons-list--crew .cast-item   { width: 64px; }
.persons-list--crew .cast-poster { width: 54px; height: 72px; }
.persons-list--crew .cast-name   { max-width: 64px; font-size: 10px; }

@media (max-width: 480px) {
    .persons-section { padding: 12px 14px; }
    .cast-item   { width: 62px; }
    .cast-poster { width: 52px; height: 70px; }
    .cast-name   { max-width: 62px; font-size: 10px; }
}
