/* Eleganza cinematic hero — ported from the rebuild branch (resources/css/cinema.css).
   Palette + fonts are scoped to .cinema so nothing else on the site changes. */
.cinema {
    --color-ink: #14120f;
    --color-sand: #f4f0e7;
    --color-gold: #cfab3b;
    --color-eg-gold: #cfab3b;
    --color-eg-gold-warm: #e1c45d;
    --color-eg-ivory: #f4f0e7;
    --color-eg-ink: #16271e;
    --font-display: 'Fraunces', 'Playfair Display', Georgia, serif;
    --font-body: 'Inter', ui-sans-serif, system-ui, sans-serif;
}
.cinema .btn-gold {
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
    border-radius: 999px; padding: .875rem 1.75rem;
    font-family: var(--font-body); font-size: .95rem; font-weight: 500; letter-spacing: .025em;
    background: var(--color-eg-gold); color: #14120f; text-decoration: none;
    transition: background-color .2s, color .2s, transform .2s;
}
.cinema .btn-gold:hover { background: #a8862a; color: var(--color-sand); }
.cinema-sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }

/* ──────────────────────────────────────────────────────────────
   Cinematic Egypt campaign — scroll-linked film section.
   Loaded only on /{locale}/egypt (see egypt/index.blade.php).

   Progressive enhancement contract:
     • no JS            → one viewport, poster + first headline + CTA
     • .cinema--live    → JS active, tall track drives the sticky stage
     • .cinema--fallback→ video failed, height PRESERVED, captions still run
     • reduced motion   → forced back to the single-viewport static state
   ────────────────────────────────────────────────────────────── */

.cinema {
    position: relative;
    background: var(--color-ink);
    color: var(--color-sand);
    overflow-x: clip;
}

/* The track owns the scroll distance. Default is a single screen so that a
   JS failure can never leave the user with dead space. */
.cinema__track {
    position: relative;
    height: 100svh;
}

.cinema--live .cinema__track {
    height: 500svh;
}

.cinema__stage {
    position: sticky;
    top: 0;
    height: 100svh;
    overflow: hidden;
    isolation: isolate;
}

/* ── Media layers ─────────────────────────────────────────────── */

.cinema__poster,
.cinema__videos,
.cinema__scrim {
    position: absolute;
    inset: 0;
}

.cinema__poster img,
.cinema__video {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cinema__video {
    opacity: 0;
    visibility: hidden;
}

/* Only a segment that is genuinely renderable gets promoted, so the poster
   stays visible instead of flashing black. */
.cinema__video.is-active {
    opacity: 1;
    visibility: visible;
}

.cinema--fallback .cinema__videos {
    display: none;
}

.cinema__scrim {
    pointer-events: none;
    background:
        linear-gradient(
            to top,
            rgba(20, 18, 15, 0.9) 0%,
            rgba(20, 18, 15, 0.45) 38%,
            rgba(20, 18, 15, 0.15) 62%,
            rgba(30, 61, 58, 0.4) 100%
        );
}

/* ── Caption layer ────────────────────────────────────────────── */

.cinema__captions {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    text-align: center;
    /* Top pad clears the fixed navbar (h-20 = 5rem) plus the notch. */
    padding-block-start: calc(6.5rem + env(safe-area-inset-top, 0px));
    padding-block-end: calc(3rem + env(safe-area-inset-bottom, 0px));
    padding-inline: calc(1.25rem + env(safe-area-inset-left, 0px));
}

.cinema__scene {
    grid-area: 1 / 1;
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 1.1rem;
    max-width: min(90vw, 46rem);
}

/* Static state: exactly one headline and the CTA — never a stack of five. */
.cinema__scene:first-of-type,
.cinema__scene--cta {
    display: flex;
}

.cinema--live .cinema__scene {
    display: flex;
    opacity: 0;
    transform: translate3d(0, 1.1rem, 0);
    will-change: opacity, transform;
}

.cinema__scene.is-hidden {
    pointer-events: none;
}

.cinema__kicker {
    margin: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.85rem;
    font-family: var(--font-body);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--color-gold);
}

.cinema__kicker::before {
    content: '';
    display: block;
    width: 2.25rem;
    height: 1px;
    background: currentColor;
}

/* Uppercased in CSS rather than in markup so assistive tech reads real words. */
.cinema__title {
    margin: 0;
    font-family: var(--font-display);
    font-weight: 500;
    font-size: clamp(2.05rem, 7.4vw, 4.75rem);
    /* 1.04 clipped descenders on the uppercase display face at mobile sizes. */
    line-height: 1.12;
    letter-spacing: 0.015em;
    text-transform: uppercase;
    text-wrap: balance;
    color: var(--color-sand);
    text-shadow: 0 12px 40px rgba(7, 18, 12, 0.35);
}

.cinema__scene--cta {
    gap: 2rem;
}

.cinema__button {
    pointer-events: auto;
}

/* ── Hero supporting copy ─────────────────────────────────────── */

.cinema__micro {
    margin: 0;
    font-family: var(--font-body);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.26em;
    text-transform: uppercase;
    color: color-mix(in oklab, var(--color-eg-ivory) 65%, transparent);
}

.cinema__watch {
    display: inline-flex;
    align-items: center;
    gap: 0.85rem;
    margin-top: 1.25rem;
    pointer-events: auto;
    font-family: var(--font-body);
    font-size: 0.68rem;
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    text-align: start;
    color: var(--color-eg-ivory);
    text-decoration: none;
    transition: color 0.25s ease;
}

.cinema__watch:hover {
    color: var(--color-eg-gold);
}

.cinema__watch-icon {
    display: grid;
    place-items: center;
    width: 2.6rem;
    height: 2.6rem;
    font-size: 0.7rem;
    border: 1px solid color-mix(in oklab, var(--color-eg-gold) 60%, transparent);
    border-radius: 50%;
    transition: background-color 0.25s ease, color 0.25s ease;
}

.cinema__watch:hover .cinema__watch-icon {
    background: var(--color-eg-gold);
    color: var(--color-eg-ink);
}

/* ── Chapter rail ─────────────────────────────────────────────── */

.cinema__chapters {
    position: absolute;
    inset-inline-end: clamp(1rem, 3vw, 3rem);
    top: 50%;
    transform: translateY(-50%);
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 0.9rem;
    pointer-events: none;
}

.cinema__chapter-n {
    font-family: var(--font-display);
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.08em;
}

.cinema__chapter {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    font-family: var(--font-body);
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: color-mix(in oklab, var(--color-eg-ivory) 35%, transparent);
    transition: color 0.35s ease;
}

.cinema__chapter-rule {
    display: block;
    width: 1.5rem;
    height: 1px;
    background: currentColor;
    opacity: 0.5;
    transition: width 0.35s ease, opacity 0.35s ease;
}

.cinema__chapter.is-current {
    color: var(--color-eg-gold);
}

.cinema__chapter.is-current .cinema__chapter-rule {
    width: 2.75rem;
    opacity: 1;
}

.cinema__tagline {
    position: absolute;
    inset-inline-end: clamp(1rem, 3vw, 3rem);
    bottom: calc(2rem + env(safe-area-inset-bottom, 0px));
    margin: 0;
    max-width: 9rem;
    padding-block-start: 0.75rem;
    border-block-start: 1px solid color-mix(in oklab, var(--color-eg-gold) 45%, transparent);
    text-align: end;
    font-family: var(--font-body);
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: color-mix(in oklab, var(--color-eg-ivory) 40%, transparent);
}

/* The rail and tagline crowd small screens — the headlines carry the story. */
@media (max-width: 900px) {
    .cinema__chapters,
    .cinema__tagline {
        display: none;
    }
}

/* ── Scroll hint ──────────────────────────────────────────────── */

.cinema__hint {
    position: absolute;
    inset-inline: 0;
    bottom: calc(1.75rem + env(safe-area-inset-bottom, 0px));
    display: flex;
    justify-content: center;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.cinema__hint-line {
    display: block;
    width: 1px;
    height: 3rem;
    background: linear-gradient(to bottom, transparent, var(--color-gold));
    opacity: 0.6;
}

.cinema--live .cinema__hint.is-hidden {
    opacity: 0;
}

/* ── Reduced motion ───────────────────────────────────────────────
   A CSS-level guarantee: even if JS has already promoted the section,
   motion preferences collapse it back to a single static screen. */
@media (prefers-reduced-motion: reduce) {
    .cinema__track,
    .cinema--live .cinema__track {
        height: 100svh;
    }

    .cinema--live .cinema__scene {
        display: none;
        opacity: 1;
        transform: none;
    }

    .cinema--live .cinema__scene:first-of-type,
    .cinema--live .cinema__scene--cta {
        display: flex;
    }

    .cinema__videos,
    .cinema__hint {
        display: none;
    }
}

/* Production: keep the tagline clear of the floating WhatsApp button. */
.cinema__tagline { bottom: calc(7rem + env(safe-area-inset-bottom, 0px)); }

/* Production tuning: shorter film (less scrolling), hero tucked under the
   sticky navbar so the nav sits on the film instead of on a separate strip. */
.cinema--live .cinema__track { height: 380svh; }
#home { margin-top: -80px; }
@media (max-width: 1024px) { #home { margin-top: -72px; } }
.cinema__video { will-change: opacity; }
@media (max-height: 820px) { .cinema__tagline { display: none; } }
