/*
 * RUSERIALS FULLSTORY CAST V6
 * Clean single-source styling for "Состав проекта / Актёры и роли".
 * No person-page shell rules and no geometry-changing hover effects.
 */

:root {
    --rsc-accent: #1eb196;
    --rsc-accent-dark: #138b74;
    --rsc-accent-soft: #eaf8f5;
    --rsc-ink: #202a33;
    --rsc-muted: #697781;
    --rsc-border: #dce8e6;
    --rsc-surface: #ffffff;
}

.ab-post-cast-section {
    position: relative;
    margin: 24px 0;
    padding: 18px 20px 20px;
    overflow: hidden;
    border: 1px solid var(--rsc-border);
    border-radius: 18px;
    background: var(--rsc-surface);
    box-shadow: 0 8px 24px rgba(27, 67, 65, .07);
}

.ab-post-cast-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 16px;
}

.ab-post-cast-heading > div {
    min-width: 0;
}

.ab-post-cast-kicker {
    display: block;
    margin-bottom: 4px;
    color: var(--rsc-accent-dark);
    font-size: 12px;
    font-weight: 550;
    letter-spacing: .045em;
    line-height: 1.2;
    text-transform: uppercase;
}

.ab-post-cast-heading h2 {
    margin: 0;
    color: var(--rsc-ink);
    font-size: 20px;
    font-weight: 550;
    line-height: 1.2;
}

.ab-post-cast-count {
    display: grid;
    min-width: 32px;
    height: 32px;
    place-items: center;
    padding: 0 9px;
    border: 1px solid rgba(30, 177, 150, .18);
    border-radius: 999px;
    background: var(--rsc-accent-soft);
    color: var(--rsc-accent-dark);
    font-size: 12px;
    font-weight: 550;
}

.ab-post-cast-carousel {
    position: relative;
    min-width: 0;
    padding: 0 25px;
}

.ab-post-cast-scroll {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: calc((100% - 60px) / 6);
    gap: 12px;
    padding: 3px 2px 6px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    overscroll-behavior-inline: contain;
    scrollbar-width: none;
}

.ab-post-cast-scroll::-webkit-scrollbar {
    display: none;
}

.ab-post-cast-card {
    display: flex;
    min-width: 0;
    min-height: 150px;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 10px 6px;
    overflow: hidden;
    border: 0;
    border-radius: 14px;
    background: transparent;
    color: var(--rsc-ink);
    box-shadow: none;
    text-align: center;
    text-decoration: none;
    scroll-snap-align: start;
    transform: none;
    transition: background .18s ease, color .18s ease, box-shadow .18s ease;
}

.ab-post-cast-card:hover,
.ab-post-cast-card:focus-visible {
    background: #f1faf8;
    color: var(--rsc-accent-dark);
    box-shadow: inset 0 0 0 1px rgba(30, 177, 150, .18);
    transform: none;
    outline: 0;
}

.ab-post-cast-photo {
    display: grid;
    width: 90px;
    height: 90px;
    flex: 0 0 90px;
    place-items: center;
    overflow: hidden;
    border: 3px solid #fff;
    border-radius: 50%;
    background: var(--rsc-accent-soft);
    box-shadow: 0 0 0 1px #d7e5e3, 0 7px 17px rgba(25, 72, 69, .12);
    transition: box-shadow .18s ease;
}

.ab-post-cast-card:hover .ab-post-cast-photo,
.ab-post-cast-card:focus-visible .ab-post-cast-photo {
    box-shadow: 0 0 0 2px rgba(30, 177, 150, .38), 0 8px 19px rgba(25, 72, 69, .14);
}

.ab-post-cast-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 18%;
}

.ab-post-cast-placeholder {
    color: var(--rsc-accent-dark);
    font-size: 30px;
    font-weight: 550;
}

.ab-post-cast-name {
    display: -webkit-box;
    min-height: 34px;
    overflow: hidden;
    color: inherit;
    font-size: 13px;
    font-weight: 550;
    line-height: 1.3;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.ab-post-cast-role {
    display: -webkit-box;
    min-height: 30px;
    overflow: hidden;
    color: var(--rsc-muted);
    font-size: 12px;
    font-weight: 400;
    line-height: 1.25;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.ab-post-cast-section button.ab-post-cast-arrow {
    position: absolute;
    top: 50%;
    z-index: 8;
    display: flex;
    width: 42px;
    height: 42px;
    align-items: center;
    justify-content: center;
    margin-top: -21px;
    padding: 0;
    overflow: hidden;
    border: 1px solid rgba(30, 177, 150, .30);
    border-radius: 14px;
    outline: 0;
    background: rgba(255, 255, 255, .98);
    color: var(--rsc-accent-dark);
    box-shadow: 0 8px 22px rgba(21, 66, 76, .16);
    font-size: 0;
    line-height: 0;
    cursor: pointer;
    transform: none;
    transition: background .18s ease, border-color .18s ease, color .18s ease, box-shadow .18s ease;
}

.ab-post-cast-section button.ab-post-cast-arrow::before {
    content: "";
    display: block;
    width: 10px;
    height: 16px;
    margin: 0;
    border: 0;
    background: currentColor;
    transform: none;
}

.ab-post-cast-section button.ab-post-cast-prev {
    left: 0;
}

.ab-post-cast-section button.ab-post-cast-next {
    right: 0;
}

.ab-post-cast-section button.ab-post-cast-prev::before {
    clip-path: polygon(65% 0, 100% 0, 35% 50%, 100% 100%, 65% 100%, 0 50%);
}

.ab-post-cast-section button.ab-post-cast-next::before {
    clip-path: polygon(0 0, 35% 0, 100% 50%, 35% 100%, 0 100%, 65% 50%);
}

.ab-post-cast-section button.ab-post-cast-arrow:hover,
.ab-post-cast-section button.ab-post-cast-arrow:focus-visible {
    border-color: var(--rsc-accent);
    background: var(--rsc-accent);
    color: #fff;
    box-shadow: 0 10px 24px rgba(30, 177, 150, .22);
    transform: none;
}

.ab-post-cast-section button.ab-post-cast-arrow:active {
    background: var(--rsc-accent-dark);
    transform: none;
}

.ab-post-cast-section button.ab-post-cast-arrow:disabled {
    visibility: hidden;
    pointer-events: none;
}

.ab-post-cast-link,
.sd-line a[href^="/actors/"],
.sd-line a[href^="/directors/"] {
    color: var(--rsc-accent-dark);
    border-bottom: 1px dotted rgba(19, 139, 116, .42);
    font-weight: 550;
}

.ab-post-cast-link:hover,
.sd-line a[href^="/actors/"]:hover,
.sd-line a[href^="/directors/"]:hover {
    color: var(--rsc-accent);
    border-bottom-color: var(--rsc-accent);
}

@media (max-width: 950px) {
    .ab-post-cast-scroll {
        grid-auto-columns: calc((100% - 36px) / 4);
    }

    .ab-post-cast-photo {
        width: 84px;
        height: 84px;
        flex-basis: 84px;
    }
}

@media (max-width: 760px) {
    .ab-post-cast-section {
        margin: 18px 0;
        padding: 15px 12px 17px;
        border-radius: 15px;
    }

    .ab-post-cast-carousel {
        padding: 0 20px;
    }

    .ab-post-cast-scroll {
        grid-auto-columns: calc((100% - 20px) / 3);
        gap: 10px;
    }

    .ab-post-cast-card {
        min-height: 142px;
        padding: 9px 5px;
    }

    .ab-post-cast-photo {
        width: 78px;
        height: 78px;
        flex-basis: 78px;
    }

    .ab-post-cast-section button.ab-post-cast-arrow {
        width: 38px;
        height: 38px;
        margin-top: -19px;
        border-radius: 12px;
    }
}

@media (max-width: 430px) {
    .ab-post-cast-heading h2 {
        font-size: 18px;
    }

    .ab-post-cast-scroll {
        grid-auto-columns: calc((100% - 10px) / 2);
    }

    .ab-post-cast-photo {
        width: 76px;
        height: 76px;
        flex-basis: 76px;
    }
}
