/* ==========================================================================
   Drama Online — Homepage Hero Slider Stability & Mobile Polish v2.0
   Fixes:
   1. Eliminates right-edge 1px GPU sub-pixel dancing/flicker on Chromium/Edge
      caused by continuous transform:scale() + blur(26px) + border-radius bleed.
   2. Locks steady container height across all slides (no position relative/absolute jumps).
   3. Gives generous clearance between right/left nav arrows and Arabic hero text.
   4. Complete cinematic mobile hero redesign (full-bleed crisp poster artwork,
      fixed balanced height, clean 2-col CTA buttons, sleek dots).
   ========================================================================== */

/* ---------- 1. CORE CONTAINER & ANTI-FLICKER HARDENING (DESKTOP + ALL) ---------- */
.do-home-v3 .do-hero-wrap {
    margin-top: 0.75rem;
    margin-bottom: 1.75rem;
}

.do-home-v3 .do-hero {
    position: relative;
    width: 100%;
    height: 475px !important;
    min-height: 475px !important;
    border-radius: 20px !important;
    overflow: hidden !important;
    overflow: clip !important;
    isolation: isolate;
    contain: layout paint;
    background: #0b101b !important;
    border: 1px solid rgba(245, 193, 108, 0.15) !important;
    box-shadow: 0 22px 54px rgba(0, 0, 0, 0.55) !important;
    transform: translateZ(0);
    backface-visibility: hidden;
}

@media (min-width: 1400px) {
    .do-home-v3 .do-hero {
        height: 515px !important;
        min-height: 515px !important;
    }
}

@media (max-width: 1199.98px) and (min-width: 992px) {
    .do-home-v3 .do-hero {
        height: 445px !important;
        min-height: 445px !important;
    }
}

@media (max-width: 991.98px) and (min-width: 768px) {
    .do-home-v3 .do-hero {
        height: 410px !important;
        min-height: 410px !important;
    }
}

.do-home-v3 .do-hero__track {
    position: relative;
    width: 100%;
    height: 100% !important;
    min-height: 0 !important;
}

/* Lock ALL slides to absolute positioning so height NEVER jumps on transition */
.do-home-v3 .do-hero__slide,
.do-home-v3 .do-hero__slide.is-active {
    position: absolute !important;
    inset: 0 !important;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    transition: opacity 0.55s ease, visibility 0.55s ease !important;
    backface-visibility: hidden;
}

/* Oversize bg & scrim by 4px on all sides to completely seal right/left rounded edges */
.do-home-v3 .do-hero__bg {
    position: absolute !important;
    inset: -4px !important;
    overflow: hidden;
    background: #0b101b;
    pointer-events: none;
}

.do-home-v3 .do-hero__bg picture {
    display: block;
    width: 100%;
    height: 100%;
}

/* Stop continuous 6.5s GPU scale jitter that caused the right edge to dance/flicker */
.do-home-v3 .do-hero__bg-img,
.do-home-v3 .do-hero__slide.is-active .do-hero__bg-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 22%;
    transform: translateZ(0) !important;
    transition: none !important;
    will-change: auto !important;
    backface-visibility: hidden;
}

/* Desktop Split Slides: oversized steady blur well outside box boundaries (zero edge bleed!) */
@media (min-width: 768px) {
    .do-home-v3 .do-hero__slide--split .do-hero__bg-img,
    .do-home-v3 .do-hero__slide--split.is-active .do-hero__bg-img {
        filter: blur(24px) saturate(1.2) brightness(0.42) !important;
        transform: scale(1.26) translateZ(0) !important;
        transition: none !important;
    }

    /* Solid #0b101b right-edge seal guarantees 0px light leak on the right border */
    .do-home-v3 .do-hero__scrim {
        position: absolute !important;
        inset: -4px !important;
        z-index: 1;
        pointer-events: none;
        background:
            linear-gradient(270deg, #0b101b 0%, rgba(11, 16, 27, 0.96) 6%, rgba(11, 16, 27, 0.84) 40%, rgba(11, 16, 27, 0.42) 72%, rgba(11, 16, 27, 0.22) 100%),
            linear-gradient(0deg, #0b101b 0%, rgba(11, 16, 27, 0.65) 16%, rgba(11, 16, 27, 0.12) 48%, transparent 100%) !important;
    }
}

/* ---------- 2. DESKTOP ARROW & TEXT CLEARANCE ---------- */
@media (min-width: 1200px) {
    .do-home-v3 .do-hero__inner {
        padding: 2.75rem 5.25rem 4rem !important;
        gap: 2.5rem;
    }
}

@media (min-width: 992px) and (max-width: 1199.98px) {
    .do-home-v3 .do-hero__inner {
        padding: 2.25rem 4.75rem 3.75rem !important;
        gap: 2rem;
    }
}

@media (min-width: 768px) and (max-width: 991.98px) {
    .do-home-v3 .do-hero__inner {
        padding: 2rem 4.25rem 3.5rem !important;
        gap: 1.5rem;
    }
}

.do-home-v3 .do-hero__nav {
    width: 42px !important;
    height: 42px !important;
    background: rgba(11, 16, 27, 0.72) !important;
    border: 1px solid rgba(245, 193, 108, 0.24) !important;
    color: #f8fafc !important;
    opacity: 0.84;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, opacity 0.2s ease !important;
}

.do-home-v3 .do-hero__nav:hover {
    opacity: 1;
    background: #f5c16c !important;
    border-color: #f5c16c !important;
    color: #0b101b !important;
    transform: translateY(-50%) !important; /* no scale jitter on hover */
}

.do-home-v3 .do-hero__nav--prev { right: 16px !important; }
.do-home-v3 .do-hero__nav--next { left: 16px !important; }

/* Focus ring polish inside hero */
.do-home-v3 .do-hero button:focus,
.do-home-v3 .do-hero a:focus {
    outline: none !important;
}
.do-home-v3 .do-hero button:focus-visible,
.do-home-v3 .do-hero a:focus-visible {
    outline: 2px solid #f5c16c !important;
    outline-offset: 2px !important;
}

/* ---------- 3. CINEMATIC MOBILE HERO REDESIGN ( <= 767px ) ---------- */
@media (max-width: 767.98px) {
    .do-home-v3 .do-hero-wrap.container {
        padding-left: 12px !important;
        padding-right: 12px !important;
        margin-top: 0.35rem;
        margin-bottom: 1.35rem !important;
    }

    .do-home-v3 .do-hero {
        height: 460px !important;
        min-height: 460px !important;
        border-radius: 18px !important;
        border: 1px solid rgba(245, 193, 108, 0.18) !important;
        box-shadow: 0 16px 38px rgba(0, 0, 0, 0.55) !important;
    }

    /* Full-bleed crystal-clear artwork on mobile (remove heavy blur & awkward 82px mini poster) */
    .do-home-v3 .do-hero__poster-frame {
        display: none !important;
    }

    .do-home-v3 .do-hero__slide--split .do-hero__bg-img,
    .do-home-v3 .do-hero__slide--split.is-active .do-hero__bg-img,
    .do-home-v3 .do-hero__slide--wide .do-hero__bg-img,
    .do-home-v3 .do-hero__slide--wide.is-active .do-hero__bg-img {
        filter: none !important;
        transform: translateZ(0) !important;
        object-fit: cover !important;
        object-position: center 18% !important;
        transition: none !important;
    }

    /* Rich bottom-heavy cinematic scrim so top artwork shines clearly & bottom text pops */
    .do-home-v3 .do-hero__scrim {
        position: absolute !important;
        inset: -3px !important;
        z-index: 1;
        background: linear-gradient(
            180deg,
            rgba(11, 16, 27, 0.28) 0%,
            rgba(11, 16, 27, 0.08) 26%,
            rgba(11, 16, 27, 0.62) 52%,
            rgba(11, 16, 27, 0.94) 76%,
            #0b101b 100%
        ) !important;
    }

    .do-home-v3 .do-hero__inner {
        flex-direction: column !important;
        align-items: stretch !important;
        justify-content: flex-end !important;
        height: 100% !important;
        min-height: 0 !important;
        padding: 14px 16px 46px !important;
        gap: 0 !important;
    }

    .do-home-v3 .do-hero__info {
        max-width: 100% !important;
        width: 100%;
        flex: 0 0 auto;
    }

    .do-home-v3 .do-hero__eyebrow {
        gap: 6px;
        margin-bottom: 8px !important;
    }

    .do-home-v3 .do-hero__pill {
        padding: 3px 10px !important;
        font-size: 0.72rem !important;
        background: rgba(11, 16, 27, 0.65);
    }

    .do-home-v3 .do-hero__pill--gold {
        background: rgba(245, 193, 108, 0.20) !important;
        border-color: rgba(245, 193, 108, 0.48) !important;
    }

    .do-home-v3 .do-hero__title {
        font-size: 1.4rem !important;
        line-height: 1.24 !important;
        margin: 0 0 4px !important;
        -webkit-line-clamp: 2;
    }

    .do-home-v3 .do-hero__arabic {
        font-size: 0.9rem !important;
        margin: 0 0 8px !important;
        line-height: 1.3;
    }

    .do-home-v3 .do-hero__meta {
        gap: 6px 10px !important;
        margin-bottom: 10px !important;
        font-size: 0.78rem !important;
    }

    .do-home-v3 .do-hero__genres {
        gap: 5px;
    }

    .do-home-v3 .do-hero__genre-tag {
        padding: 2px 8px !important;
        font-size: 0.71rem !important;
    }

    /* Keep mobile card clean & visual: compact 1-line excerpt on phablets, hidden on compact phones */
    .do-home-v3 .do-hero__excerpt {
        font-size: 0.8rem !important;
        line-height: 1.5 !important;
        margin: 0 0 12px !important;
        -webkit-line-clamp: 1 !important;
        color: rgba(226, 232, 240, 0.82);
    }

    /* Clean 2-column equal-height CTA row (zero awkward wrapping!) */
    .do-home-v3 .do-hero__actions {
        display: grid !important;
        grid-template-columns: 1.35fr 1fr;
        gap: 9px !important;
        width: 100%;
    }

    .do-home-v3 .do-hero__actions .do-btn {
        width: 100%;
        min-height: 44px !important;
        padding: 0 12px !important;
        justify-content: center;
        font-size: 0.88rem !important;
        border-radius: 12px !important;
        white-space: nowrap;
    }

    .do-home-v3 .do-hero__dots {
        bottom: 12px !important;
        padding: 5px 10px !important;
        gap: 7px !important;
        background: rgba(11, 16, 27, 0.72) !important;
        border-color: rgba(255, 255, 255, 0.12) !important;
    }
}

@media (max-width: 430px) {
    .do-home-v3 .do-hero {
        height: 430px !important;
        min-height: 430px !important;
    }
    .do-home-v3 .do-hero__excerpt {
        display: none !important;
    }
    .do-home-v3 .do-hero__title {
        font-size: 1.28rem !important;
    }
}
