/* ==========================================================================
   The Yellow Container — cinematic hero (unchanged)
   Below-hero chapters use the shared October 7 Stories system.
   ========================================================================== */

@import url('../story-chapters.css');

:root {
    --amb-bg-warm: #F4F0E3;
    --amb-bg-soft: var(--color-warm-light);
    --amb-ink: #2C2C2C;
    --amb-ink-muted: rgba(44, 44, 44, 0.74);
    --amb-ink-faint: var(--color-text-dim-on-light);
    --amb-cream: #F4F0E3;
    --amb-accent: var(--color-accent-on-light);
    --amb-prose: min(38rem, 100%);
    --amb-gutter: min(6vw, 3.5rem);
    --amb-max: min(90vw, 1160px);
    --amb-white: #fffefb;
}

body.no-hero.story-page.ambulance-doc-page {
    background: var(--amb-bg-warm);
    color: var(--amb-ink);
}

/* --------------------------------------------------------------------------
   Intro — dark cinematic
   -------------------------------------------------------------------------- */

.ambulance-doc__intro {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    margin-top: calc(-1 * var(--header-height));
    padding:
        var(--hero-immersive-pad-top)
        var(--amb-gutter)
        clamp(4rem, 11vw, 6.5rem);
    background: #2C2C2C;
    color: var(--amb-cream);
}

@media (min-width: 769px) {
    .ambulance-doc__intro {
        display: flex;
        flex-direction: column;
        justify-content: center;
        /* Bleeds under fixed header via negative margin-top — extend by header height */
        min-height: calc(100svh + var(--header-height));
    }
}

.ambulance-doc__intro-media {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

/*
 * Yellow container hero photograph: cover-fit so proportions stay intact,
 * then faded into charcoal so the metal emerges rather than sitting as a
 * bright rectangle. Opacity, saturation and edge masks do the softening;
 * the scrim handles text contrast without an opaque box.
 */
.yellow-container-page .ambulance-doc__intro-media::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: url("../../images/october-7-stories/the-yellow-container/yellowhero.png");
    background-size: cover;
    background-repeat: no-repeat;
    background-position: 72% 42%;
    opacity: 0.58;
    filter: saturate(0.7) brightness(0.86) contrast(0.96);
    -webkit-mask-image:
        linear-gradient(
            90deg,
            transparent 0%,
            rgba(0, 0, 0, 0.35) 10%,
            #000 24%,
            #000 78%,
            rgba(0, 0, 0, 0.38) 92%,
            transparent 100%
        ),
        linear-gradient(
            180deg,
            transparent 0%,
            rgba(0, 0, 0, 0.5) 10%,
            #000 26%,
            #000 74%,
            rgba(0, 0, 0, 0.32) 90%,
            transparent 100%
        );
    mask-image:
        linear-gradient(
            90deg,
            transparent 0%,
            rgba(0, 0, 0, 0.35) 10%,
            #000 24%,
            #000 78%,
            rgba(0, 0, 0, 0.38) 92%,
            transparent 100%
        ),
        linear-gradient(
            180deg,
            transparent 0%,
            rgba(0, 0, 0, 0.5) 10%,
            #000 26%,
            #000 74%,
            rgba(0, 0, 0, 0.32) 90%,
            transparent 100%
        );
    -webkit-mask-composite: source-in;
    mask-composite: intersect;
}

.ambulance-doc__intro-scrim {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(
            90deg,
            rgba(44, 44, 44, 0.92) 0%,
            rgba(44, 44, 44, 0.78) 20%,
            rgba(44, 44, 44, 0.4) 48%,
            rgba(44, 44, 44, 0.22) 70%,
            rgba(44, 44, 44, 0.5) 100%
        ),
        linear-gradient(
            180deg,
            rgba(44, 44, 44, 0.56) 0%,
            rgba(44, 44, 44, 0.14) 38%,
            rgba(44, 44, 44, 0.74) 100%
        );
}

.ambulance-doc__intro::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background:
        radial-gradient(ellipse 90% 55% at 12% 18%, rgba(189, 173, 123, 0.07), transparent 52%),
        radial-gradient(circle at 88% 76%, rgba(255, 255, 255, 0.03), transparent 35%);
    pointer-events: none;
}

@media (min-width: 900px) {
    .yellow-container-page .ambulance-doc__intro-media::before {
        background-position: 74% 40%;
    }
}

@media (min-width: 600px) and (max-width: 899px) {
    .yellow-container-page .ambulance-doc__intro-media::before {
        background-position: 70% 46%;
    }

    .yellow-container-page .ambulance-doc__intro-inner {
        max-width: min(32rem, 62vw);
    }
}

@media (max-width: 768px) {
    .yellow-container-page .ambulance-doc__intro {
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        min-height: min(92svh, 44rem);
        padding-bottom: clamp(7.5rem, 28vw, 12rem);
    }

    .yellow-container-page .ambulance-doc__intro-media::before {
        background-position: 78% 58%;
        opacity: 0.62;
    }

    .yellow-container-page .ambulance-doc__intro-scrim {
        background:
            linear-gradient(
                90deg,
                rgba(44, 44, 44, 0.9) 0%,
                rgba(44, 44, 44, 0.7) 36%,
                rgba(44, 44, 44, 0.28) 76%,
                rgba(44, 44, 44, 0.48) 100%
            ),
            linear-gradient(
                180deg,
                rgba(44, 44, 44, 0.7) 0%,
                rgba(44, 44, 44, 0.42) 34%,
                rgba(44, 44, 44, 0.16) 62%,
                rgba(44, 44, 44, 0.7) 100%
            );
    }

    .yellow-container-page .ambulance-doc__intro-inner {
        max-width: min(22.5rem, 78%);
        margin-inline: 0 auto;
    }
}

@media (max-width: 599px) {
    .yellow-container-page .ambulance-doc__intro-media::before {
        background-position: 82% 62%;
    }
}

.ambulance-doc__intro-inner {
    position: relative;
    z-index: 2;
    max-width: var(--amb-max);
    margin-inline: auto;
}

.ambulance-doc__lede {
    margin: 0 0 clamp(1.15rem, 2.8vw, 1.65rem);
    max-width: var(--amb-prose);
    color: rgba(189, 173, 123, 0.92);
    font-size: clamp(0.74rem, 0.2vw + 0.68rem, 0.84rem);
    font-weight: 650;
    letter-spacing: 0.18em;
    line-height: 1.62;
}

.ambulance-doc__intro h1 {
    margin: 0 0 clamp(1.35rem, 3.5vw, 2rem);
    max-width: var(--amb-prose);
    color: var(--amb-cream);
    font-size: clamp(2rem, 3.2vw + 1rem, 3.25rem);
    font-weight: 600;
    letter-spacing: 0.03em;
    line-height: 1.1;
    text-wrap: balance;
}

.ambulance-doc__intro-body > p {
    margin: 0;
    max-width: var(--amb-prose);
    color: rgba(244, 240, 227, 0.78);
    font-size: clamp(0.98rem, 0.35vw + 0.9rem, 1.12rem);
    font-weight: 400;
    line-height: 1.82;
}

.ambulance-doc__intro-body > p + p {
    margin-top: 1rem;
}

.ambulance-doc__intro-coda {
    margin: clamp(1.35rem, 3vw, 1.85rem) 0 0;
    max-width: var(--amb-prose);
    color: rgba(244, 240, 227, 0.88);
    font-size: clamp(1.02rem, 0.32vw + 0.94rem, 1.18rem);
    font-weight: 500;
    line-height: 1.72;
    letter-spacing: 0.01em;
}

@media (prefers-reduced-motion: reduce) {
    * {
        scroll-behavior: auto;
    }
}
