/*
 * RUSERIALS CAROUSEL SYSTEM V1
 * One final visual layer for ActorBase, DirectorBase and fullstory cast.
 * Native horizontal swipe on mobile; desktop arrows only.
 */

:root {
    --ruc-accent: #1eb196;
    --ruc-accent-dark: #138b74;
    --ruc-accent-soft: #edf9f6;
    --ruc-ink: #202a33;
    --ruc-muted: #74808c;
    --ruc-border: #dce8e6;
    --ruc-shadow: 0 8px 22px rgba(22, 64, 70, .14);
}

/* ------------------------------------------------------------------
   Shared track behavior
   ------------------------------------------------------------------ */
body.ruserials-dle-people .ab-carousel-wrap,
.ab-post-cast-carousel {
    position: relative;
    min-width: 0;
}

body.ruserials-dle-people .ab-carousel,
.ab-post-cast-scroll {
    overscroll-behavior-inline: contain;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

body.ruserials-dle-people .ab-carousel::-webkit-scrollbar,
.ab-post-cast-scroll::-webkit-scrollbar {
    display: none;
}

body.ruserials-dle-people .ab-carousel {
    display: flex;
    align-items: stretch;
    gap: 14px;
    min-width: 0;
    padding: 4px 2px 9px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
}

body.ruserials-dle-people .ab-carousel > * {
    scroll-snap-align: start;
    scroll-snap-stop: normal;
}

/* Film and series cards on actor/director profiles. */
body.ruserials-dle-people .ab-carousel .ab-card,
body.ruserials-dle-people .db-works-carousel .db-work-card {
    width: 160px;
    min-width: 160px;
    max-width: 160px;
    flex: 0 0 160px;
    border-color: var(--ruc-border);
    border-radius: 14px;
    background: #f8fafb;
    box-shadow: none;
    transform: none;
    transition: border-color .18s ease, background-color .18s ease, box-shadow .18s ease, color .18s ease;
}

body.ruserials-dle-people .ab-carousel .ab-card:hover,
body.ruserials-dle-people .ab-carousel .ab-card:focus-visible,
body.ruserials-dle-people .db-works-carousel .db-work-card:hover,
body.ruserials-dle-people .db-works-carousel .db-work-card:focus-visible {
    border-color: rgba(30, 177, 150, .34);
    background: #f1faf8;
    box-shadow: 0 8px 20px rgba(22, 64, 70, .09);
    transform: none;
    outline: 0;
}

/* People cards on actor and director profiles. */
body.ruserials-dle-people .ab-people .ab-person,
body.ruserials-dle-people .db-people-carousel .db-person-card {
    position: relative;
    width: 138px;
    min-width: 138px;
    max-width: 138px;
    flex: 0 0 138px;
    padding: 12px 9px 11px;
    overflow: hidden;
    border: 1px solid var(--ruc-border);
    border-radius: 15px;
    background: #f8fafb;
    color: var(--ruc-ink);
    box-shadow: none;
    text-align: center;
    text-decoration: none;
    transform: none;
    transition: border-color .18s ease, background-color .18s ease, box-shadow .18s ease, color .18s ease;
}

body.ruserials-dle-people .ab-people .ab-person:hover,
body.ruserials-dle-people .ab-people .ab-person:focus-visible,
body.ruserials-dle-people .db-people-carousel .db-person-card:hover,
body.ruserials-dle-people .db-people-carousel .db-person-card:focus-visible {
    border-color: rgba(30, 177, 150, .34);
    background: #f0faf7;
    color: var(--ruc-accent-dark);
    box-shadow: 0 8px 20px rgba(22, 64, 70, .08);
    transform: none;
    outline: 0;
}

body.ruserials-dle-people .ab-people .ab-person img,
body.ruserials-dle-people .ab-people .ab-person-empty,
body.ruserials-dle-people .db-people-carousel .db-person-card img,
body.ruserials-dle-people .db-people-carousel .db-person-empty {
    display: grid;
    width: 82px;
    height: 82px;
    margin: 0 auto 9px;
    place-items: center;
    overflow: hidden;
    border: 3px solid #fff;
    border-radius: 50%;
    background: var(--ruc-accent-soft);
    box-shadow: 0 0 0 1px #d7e5e3, 0 6px 15px rgba(25, 72, 69, .10);
    object-fit: cover;
    object-position: center 18%;
}

body.ruserials-dle-people .ab-people .ab-person b,
body.ruserials-dle-people .db-people-carousel .db-person-card b {
    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;
}

body.ruserials-dle-people .ab-people .ab-person > span:not(.ab-person-position),
body.ruserials-dle-people .ab-people .ab-person small,
body.ruserials-dle-people .db-people-carousel .db-person-card small {
    display: block;
    margin-top: 5px;
    color: var(--ruc-muted);
    font-size: 12px;
    font-weight: 400;
    line-height: 1.3;
}

/* ------------------------------------------------------------------
   Exact SVG arrow controls. The icon is real SVG, not a font glyph,
   clip-path or rotated border.
   ------------------------------------------------------------------ */
body.ruserials-dle-people button.ab-car-btn,
.ab-post-cast-section button.ab-post-cast-arrow {
    position: absolute;
    top: 50%;
    z-index: 20;
    display: grid;
    width: 40px;
    height: 40px;
    place-items: center;
    margin: 0;
    padding: 0;
    overflow: hidden;
    border: 1px solid rgba(30, 177, 150, .30);
    border-radius: 13px;
    outline: 0;
    background: rgba(255, 255, 255, .98);
    color: var(--ruc-accent-dark);
    box-shadow: var(--ruc-shadow);
    font-size: 0;
    line-height: 0;
    cursor: pointer;
    transform: translateY(-50%);
    transition: background-color .18s ease, border-color .18s ease, color .18s ease, box-shadow .18s ease, opacity .18s ease;
}

/* Required only because legacy people CSS used !important on these four properties. */
body.ruserials-dle-people button.ab-car-btn {
    top: 50% !important;
    display: grid !important;
    width: 40px !important;
    height: 40px !important;
    margin-top: 0 !important;
    font-size: 0 !important;
    transform: translateY(-50%) !important;
}

body.ruserials-dle-people button.ab-car-btn::before,
.ab-post-cast-section button.ab-post-cast-arrow::before {
    content: none;
    display: none;
}

body.ruserials-dle-people button.ab-car-btn svg,
.ab-post-cast-section button.ab-post-cast-arrow svg {
    display: block;
    width: 18px;
    height: 18px;
    overflow: visible;
    pointer-events: none;
}

body.ruserials-dle-people button.ab-car-btn svg path,
.ab-post-cast-section button.ab-post-cast-arrow svg path {
    fill: none;
    stroke: currentColor;
    stroke-width: 2.35;
    stroke-linecap: round;
    stroke-linejoin: round;
    vector-effect: non-scaling-stroke;
}

body.ruserials-dle-people button.ab-car-prev,
.ab-post-cast-section button.ab-post-cast-prev {
    left: -12px;
}

body.ruserials-dle-people button.ab-car-next,
.ab-post-cast-section button.ab-post-cast-next {
    right: -12px;
}

body.ruserials-dle-people button.ab-car-btn:hover,
body.ruserials-dle-people button.ab-car-btn:focus-visible,
.ab-post-cast-section button.ab-post-cast-arrow:hover,
.ab-post-cast-section button.ab-post-cast-arrow:focus-visible {
    border-color: var(--ruc-accent);
    background: var(--ruc-accent);
    color: #fff;
    box-shadow: 0 9px 22px rgba(30, 177, 150, .22);
    transform: translateY(-50%);
}

body.ruserials-dle-people button.ab-car-btn:hover,
body.ruserials-dle-people button.ab-car-btn:focus-visible,
body.ruserials-dle-people button.ab-car-btn:active {
    transform: translateY(-50%) !important;
}

body.ruserials-dle-people button.ab-car-btn:disabled,
.ab-post-cast-section button.ab-post-cast-arrow:disabled,
body.ruserials-dle-people .ab-carousel-wrap.is-static button.ab-car-btn,
.ab-post-cast-carousel.is-static button.ab-post-cast-arrow {
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
}

/* ------------------------------------------------------------------
   Fullstory cast: clean row on desktop and compact native swipe on phone.
   ------------------------------------------------------------------ */
.ab-post-cast-section {
    position: relative;
    margin: 24px 0;
    padding: 18px 20px 20px;
    overflow: hidden;
    border: 1px solid var(--ruc-border);
    border-radius: 18px;
    background: #fff;
    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: 15px;
}

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

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

.ab-post-cast-heading h2 {
    margin: 0;
    color: var(--ruc-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(--ruc-accent-soft);
    color: var(--ruc-accent-dark);
    font-size: 12px;
    font-weight: 550;
}

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

.ab-post-cast-scroll {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: calc((100% - 70px) / 6);
    align-items: start;
    gap: 14px;
    min-width: 0;
    padding: 3px 2px 5px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
}

.ab-post-cast-card {
    display: flex;
    min-width: 0;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    padding: 5px 2px 7px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--ruc-ink);
    box-shadow: none;
    text-align: center;
    text-decoration: none;
    scroll-snap-align: start;
    transform: none;
    transition: background-color .18s ease, color .18s ease;
}

.ab-post-cast-card:hover,
.ab-post-cast-card:focus-visible {
    background: #f1faf8;
    color: var(--ruc-accent-dark);
    box-shadow: none;
    transform: none;
    outline: 0;
}

.ab-post-cast-photo {
    display: grid;
    width: 82px;
    height: 82px;
    flex: 0 0 82px;
    place-items: center;
    overflow: hidden;
    border: 3px solid #fff;
    border-radius: 50%;
    background: var(--ruc-accent-soft);
    box-shadow: 0 0 0 1px #d7e5e3, 0 6px 15px rgba(25, 72, 69, .11);
}

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

.ab-post-cast-placeholder {
    color: var(--ruc-accent-dark);
    font-size: 28px;
    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.28;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.ab-post-cast-role {
    display: -webkit-box;
    min-height: 30px;
    overflow: hidden;
    color: var(--ruc-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-prev {
    left: 0;
}

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

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

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

@media screen and (max-width: 760px) {
    /* Every rewritten carousel is touch-first on phones: no arrow buttons. */
    body.ruserials-dle-people button.ab-car-btn,
    .ab-post-cast-section button.ab-post-cast-arrow {
        display: none !important;
    }

    body.ruserials-dle-people .ab-carousel {
        gap: 10px;
        padding: 3px 1px 8px;
        scroll-padding-inline: 1px;
    }

    body.ruserials-dle-people .ab-carousel .ab-card,
    body.ruserials-dle-people .db-works-carousel .db-work-card {
        width: 142px;
        min-width: 142px;
        max-width: 142px;
        flex-basis: 142px;
    }

    body.ruserials-dle-people .ab-people .ab-person,
    body.ruserials-dle-people .db-people-carousel .db-person-card {
        width: 88px;
        min-width: 88px;
        max-width: 88px;
        flex-basis: 88px;
        padding: 7px 3px 8px;
        border-color: transparent;
        border-radius: 12px;
        background: transparent;
    }

    body.ruserials-dle-people .ab-people .ab-person:hover,
    body.ruserials-dle-people .ab-people .ab-person:focus-visible,
    body.ruserials-dle-people .db-people-carousel .db-person-card:hover,
    body.ruserials-dle-people .db-people-carousel .db-person-card:focus-visible {
        border-color: transparent;
        background: #f1faf8;
        box-shadow: none;
    }

    body.ruserials-dle-people .ab-people .ab-person img,
    body.ruserials-dle-people .ab-people .ab-person-empty,
    body.ruserials-dle-people .db-people-carousel .db-person-card img,
    body.ruserials-dle-people .db-people-carousel .db-person-empty {
        width: 64px;
        height: 64px;
        margin-bottom: 7px;
        border-width: 2px;
    }

    body.ruserials-dle-people .ab-people .ab-person b,
    body.ruserials-dle-people .db-people-carousel .db-person-card b {
        min-height: 31px;
        font-size: 12px;
        line-height: 1.28;
    }

    body.ruserials-dle-people .ab-people .ab-person > span:not(.ab-person-position),
    body.ruserials-dle-people .ab-people .ab-person small,
    body.ruserials-dle-people .db-people-carousel .db-person-card small {
        font-size: 12px;
    }

    .ab-post-cast-section {
        margin: 18px 0;
        padding: 14px 10px 15px;
        border-radius: 15px;
    }

    .ab-post-cast-heading {
        margin-bottom: 12px;
    }

    .ab-post-cast-heading h2 {
        font-size: 18px;
    }

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

    .ab-post-cast-scroll {
        grid-auto-columns: 76px;
        gap: 8px;
        padding: 2px 0 5px;
        scroll-padding-inline: 0;
    }

    .ab-post-cast-card {
        gap: 6px;
        padding: 3px 1px 5px;
        border-radius: 10px;
    }

    .ab-post-cast-photo {
        width: 60px;
        height: 60px;
        flex-basis: 60px;
        border-width: 2px;
    }

    .ab-post-cast-name {
        min-height: 31px;
        font-size: 12px;
        line-height: 1.28;
    }

    .ab-post-cast-role {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    body.ruserials-dle-people .ab-carousel,
    .ab-post-cast-scroll {
        scroll-behavior: auto;
    }
}

/* ==================================================================
   RUSERIALS FULLSTORY CAST ARROW FINAL V1R2
   Isolates the fullstory cast arrow from the global DLE button hover.
   Geometry is identical in normal, hover, focus and active states.
   ================================================================== */
html body .ab-post-cast-section .ab-post-cast-carousel > button.ab-post-cast-arrow {
    top: 50%;
    display: block;
    width: 36px;
    min-width: 36px;
    max-width: 36px;
    height: 36px;
    min-height: 36px;
    max-height: 36px;
    margin: 0;
    padding: 0;
    overflow: hidden;
    appearance: none;
    border: 1px solid #cfe4df;
    border-radius: 50%;
    outline: 0;
    background: rgba(255, 255, 255, .98);
    color: #168b75;
    box-shadow: 0 5px 14px rgba(21, 66, 76, .12);
    font-size: 0;
    line-height: 0;
    transform: translateY(-50%);
    transition: background-color .16s ease, border-color .16s ease, color .16s ease, box-shadow .16s ease, opacity .16s ease;
}

html body .ab-post-cast-section .ab-post-cast-carousel > button.ab-post-cast-prev {
    left: -4px;
}

html body .ab-post-cast-section .ab-post-cast-carousel > button.ab-post-cast-next {
    right: -4px;
}

html body .ab-post-cast-section .ab-post-cast-carousel > button.ab-post-cast-arrow svg {
    position: absolute;
    top: 50%;
    left: 50%;
    display: block;
    width: 16px;
    height: 16px;
    margin: 0;
    overflow: visible;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

html body .ab-post-cast-section .ab-post-cast-carousel > button.ab-post-cast-arrow svg path {
    fill: none;
    stroke: currentColor;
    stroke-width: 2.1;
    stroke-linecap: round;
    stroke-linejoin: round;
    vector-effect: non-scaling-stroke;
}

html body .ab-post-cast-section .ab-post-cast-carousel > button.ab-post-cast-arrow:hover,
html body .ab-post-cast-section .ab-post-cast-carousel > button.ab-post-cast-arrow:focus-visible,
html body .ab-post-cast-section .ab-post-cast-carousel > button.ab-post-cast-arrow:active {
    top: 50%;
    margin: 0;
    border-color: #82cfc0;
    background: #edf8f5;
    color: #117a68;
    box-shadow: 0 6px 16px rgba(21, 139, 116, .16);
    transform: translateY(-50%);
}

@media screen and (max-width: 760px) {
    html body .ab-post-cast-section .ab-post-cast-carousel > button.ab-post-cast-arrow {
        display: none;
    }
}

/* ==================================================================
   RUSERIALS MOBILE FULLSTORY CAST POLISH V1
   iPhone-sized layout: larger portraits, compact height and native swipe.
   The sole priority override below keeps desktop carousel arrows off phones.
   ================================================================== */
@media screen and (max-width: 760px) {
    html body .ab-post-cast-section {
        min-height: 0;
        height: auto;
        margin: 18px 0;
        padding: 14px 10px 14px;
        overflow: hidden;
        border-radius: 16px;
    }

    html body .ab-post-cast-section .ab-post-cast-heading {
        align-items: flex-start;
        margin: 0 0 14px;
    }

    html body .ab-post-cast-section .ab-post-cast-heading h2 {
        font-size: 19px;
        line-height: 1.2;
    }

    html body .ab-post-cast-section .ab-post-cast-count {
        min-width: 34px;
        height: 34px;
        padding: 0 9px;
        font-size: 13px;
    }

    html body .ab-post-cast-section .ab-post-cast-carousel {
        min-height: 0;
        height: auto;
        padding: 0;
        overflow: visible;
    }

    html body .ab-post-cast-section .ab-post-cast-scroll {
        display: grid;
        height: auto;
        min-height: 0;
        grid-auto-flow: column;
        grid-auto-columns: 96px;
        grid-auto-rows: max-content;
        align-items: start;
        align-content: start;
        gap: 12px;
        padding: 2px 2px 5px;
        overflow-x: auto;
        overflow-y: hidden;
        scroll-padding-inline: 2px;
        scroll-snap-type: x mandatory;
        overscroll-behavior-x: contain;
        -webkit-overflow-scrolling: touch;
    }

    html body .ab-post-cast-section .ab-post-cast-card {
        width: 96px;
        min-width: 96px;
        max-width: 96px;
        min-height: 0;
        height: auto;
        align-self: start;
        gap: 7px;
        padding: 4px 2px 3px;
        border: 0;
        border-radius: 12px;
        background: transparent;
        box-shadow: none;
        transform: none;
        scroll-snap-align: start;
    }

    html body .ab-post-cast-section .ab-post-cast-card:hover,
    html body .ab-post-cast-section .ab-post-cast-card:focus-visible,
    html body .ab-post-cast-section .ab-post-cast-card:active {
        min-height: 0;
        background: #f1faf8;
        box-shadow: none;
        transform: none;
    }

    html body .ab-post-cast-section .ab-post-cast-photo {
        width: 86px;
        min-width: 86px;
        max-width: 86px;
        height: 86px;
        min-height: 86px;
        max-height: 86px;
        flex: 0 0 86px;
        margin: 0 auto;
        border-width: 2px;
        box-shadow: 0 0 0 1px #d7e5e3, 0 5px 13px rgba(25, 72, 69, .10);
    }

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

    html body .ab-post-cast-section .ab-post-cast-placeholder {
        font-size: 28px;
    }

    html body .ab-post-cast-section .ab-post-cast-name {
        display: -webkit-box;
        width: 96px;
        min-height: 34px;
        max-height: 34px;
        margin: 0;
        overflow: hidden;
        font-size: 13px;
        font-weight: 550;
        line-height: 1.28;
        text-align: center;
        overflow-wrap: normal;
        word-break: normal;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
    }

    html body .ab-post-cast-section .ab-post-cast-role {
        display: none;
    }

    html body .ab-post-cast-section .ab-post-cast-carousel > button.ab-post-cast-arrow {
        display: none !important;
    }
}

@media screen and (max-width: 390px) {
    html body .ab-post-cast-section .ab-post-cast-scroll {
        grid-auto-columns: 92px;
        gap: 10px;
    }

    html body .ab-post-cast-section .ab-post-cast-card,
    html body .ab-post-cast-section .ab-post-cast-name {
        width: 92px;
        min-width: 92px;
        max-width: 92px;
    }

    html body .ab-post-cast-section .ab-post-cast-photo {
        width: 82px;
        min-width: 82px;
        max-width: 82px;
        height: 82px;
        min-height: 82px;
        max-height: 82px;
        flex-basis: 82px;
    }
}

/* ==================================================================
   RUSERIALS MOBILE CAST FACE CROP FIX V1
   Keeps the top of portrait photos visible inside round mobile avatars.
   The previous 18% vertical focal point cropped foreheads on tall photos.
   ================================================================== */
@media screen and (max-width: 760px) {
    html body .ab-post-cast-section .ab-post-cast-photo img {
        object-fit: cover;
        object-position: 50% 0%;
    }
}

/* ==================================================================
   RUSERIALS ZERO CLS CAROUSEL CONTROLS V1
   Static-state detection changes only visibility, never track geometry.
   ================================================================== */
body.ruserials-dle-people .ab-carousel-wrap.is-static,
.ab-post-cast-carousel.is-static {
    min-width: 0;
}

body.ruserials-dle-people .ab-carousel-wrap.is-static button.ab-car-btn,
.ab-post-cast-carousel.is-static button.ab-post-cast-arrow {
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
}
