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

@import url('../story-chapters.css');
@import url('../stories-nav.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-page .ambulance-doc__intro-photo {
    display: 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-image: image-set(
        url("../../images/october-7-stories/the-yellow-container/yellowhero.webp") type("image/webp"),
        url("../../images/october-7-stories/the-yellow-container/yellowhero.png") type("image/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-end;
        /* Grow with content — avoid fixed height clipping long intros */
        min-height: calc(100svh + var(--header-height));
        height: auto;
        padding-top: calc(var(--header-height) + clamp(1.25rem, 4vw, 1.75rem));
        padding-bottom: clamp(1.75rem, 5vw, 2.5rem);
    }

    .yellow-container-page .ambulance-doc__intro-media::before {
        display: none;
    }

    .yellow-container-page .ambulance-doc__intro-photo {
        display: block;
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
    }

    .yellow-container-page .ambulance-doc__intro-photo-img {
        display: block;
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: 46% 58%;
        opacity: 0.78;
        filter: saturate(0.78) brightness(0.92) contrast(0.98);
    }

    .yellow-container-page .ambulance-doc__intro-scrim {
        background:
            linear-gradient(
                180deg,
                rgba(18, 16, 12, 0.42) 0%,
                rgba(18, 16, 12, 0.12) 36%,
                rgba(18, 16, 12, 0.28) 62%,
                rgba(18, 16, 12, 0.62) 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;
    }
}
