/**
 * Vision Jeunesse Nouvelle — Homepage Hero Slider
 *
 * Editorial, full-bleed hero. Crossfade + a restrained Ken Burns drift; no
 * slide-in, no bounce. Everything here is scoped to .hero so it cannot leak
 * into the rest of the site.
 */

.hero {
    --hero-navy: #071a3a;
    --hero-accent: #ffc107;
    --hero-overlay: 0.72;

    position: relative;
    isolation: isolate;
    overflow: hidden;
    background: var(--hero-navy);
    /* Substantial without eating the whole page (§7) */
    min-height: clamp(600px, 76vh, 800px);

    /* Viewport and controls share one grid cell: the controls float over the
       photography, and — unlike an absolutely positioned viewport — a slide
       whose copy runs taller than min-height grows the hero instead of being
       clipped. That matters most at 320px, where the headline wraps hardest. */
    display: grid;
}

/* ---------------------------------------------------------------- viewport */

.hero__viewport {
    grid-area: 1 / 1;
    display: grid;
    min-width: 0;
}

/* Every slide occupies the same grid cell; only opacity separates them. */
.hero-slide {
    grid-area: 1 / 1;
    position: relative;
    display: flex;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 900ms cubic-bezier(0.4, 0, 0.2, 1),
                visibility 0s linear 900ms;
    z-index: 0;
}

.hero-slide.is-active {
    opacity: 1;
    visibility: visible;
    transition: opacity 900ms cubic-bezier(0.4, 0, 0.2, 1),
                visibility 0s linear 0s;
    z-index: 1;
}

/* ------------------------------------------------------------------- media */

.hero-slide__media {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.hero-slide__picture,
.hero-slide__media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-slide__media img {
    transform: scale(1.02);
    transition: transform 1200ms cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

/* Ken Burns: a slow drift over the life of the slide, deliberately small
   enough that it reads as the photograph breathing (§10). */
.hero-slide.is-active .hero-slide__media img {
    animation: heroKenBurns 9s ease-out forwards;
}

@keyframes heroKenBurns {
    from { transform: scale(1.02); }
    to   { transform: scale(1.08); }
}

/* ------------------------------------------------------------------- scrim */

/* Directional gradient rather than a flat black wash, so the photograph
   survives on the side the text does not occupy (§17). */
.hero-slide__scrim {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.hero-slide--left .hero-slide__scrim {
    background:
        linear-gradient(90deg,
            rgba(4, 12, 30, calc(var(--hero-overlay) * 1.05)) 0%,
            rgba(4, 12, 30, calc(var(--hero-overlay) * 0.92)) 26%,
            rgba(4, 12, 30, calc(var(--hero-overlay) * 0.55)) 52%,
            rgba(4, 12, 30, calc(var(--hero-overlay) * 0.18)) 76%,
            rgba(4, 12, 30, 0.05) 100%),
        linear-gradient(0deg,
            rgba(4, 12, 30, 0.55) 0%,
            rgba(4, 12, 30, 0.10) 32%,
            rgba(4, 12, 30, 0.00) 60%);
}

.hero-slide--right .hero-slide__scrim {
    background:
        linear-gradient(270deg,
            rgba(4, 12, 30, calc(var(--hero-overlay) * 1.05)) 0%,
            rgba(4, 12, 30, calc(var(--hero-overlay) * 0.92)) 26%,
            rgba(4, 12, 30, calc(var(--hero-overlay) * 0.55)) 52%,
            rgba(4, 12, 30, calc(var(--hero-overlay) * 0.18)) 76%,
            rgba(4, 12, 30, 0.05) 100%),
        linear-gradient(0deg,
            rgba(4, 12, 30, 0.55) 0%,
            rgba(4, 12, 30, 0.10) 32%,
            rgba(4, 12, 30, 0.00) 60%);
}

/* ----------------------------------------------------------------- content */

.hero-slide__inner {
    position: relative;
    z-index: 2;
    width: 100%;
    padding-top: 3rem;
    padding-bottom: 6.5rem;
}

.hero-slide--right .hero-slide__inner {
    display: flex;
    justify-content: flex-end;
}

/* Text never runs the full width of a 1920px screen (§7), but is wide enough
   that an editor's two-line headline stays two lines. */
.hero-slide__content {
    max-width: 47rem;
}

.hero-slide--right .hero-slide__content {
    text-align: right;
}

/* Content lifts in just behind the crossfade — subtle, not a slide-in */
.hero-slide__eyebrow,
.hero-slide__title,
.hero-slide__desc,
.hero-slide__ctas,
.hero-slide__badge {
    opacity: 0;
    transform: translateY(14px);
}

.hero-slide.is-active .hero-slide__eyebrow { animation: heroRise 700ms cubic-bezier(0.16, 1, 0.3, 1) 180ms forwards; }
.hero-slide.is-active .hero-slide__title   { animation: heroRise 700ms cubic-bezier(0.16, 1, 0.3, 1) 280ms forwards; }
.hero-slide.is-active .hero-slide__desc    { animation: heroRise 700ms cubic-bezier(0.16, 1, 0.3, 1) 400ms forwards; }
.hero-slide.is-active .hero-slide__ctas    { animation: heroRise 700ms cubic-bezier(0.16, 1, 0.3, 1) 500ms forwards; }
.hero-slide.is-active .hero-slide__badge   { animation: heroRise 700ms cubic-bezier(0.16, 1, 0.3, 1) 600ms forwards; }

@keyframes heroRise {
    to { opacity: 1; transform: translateY(0); }
}

/* Eyebrow — restrained tracking, the editorial hierarchy cue (§18) */
.hero-slide__eyebrow {
    margin: 0 0 1.15rem;
    color: var(--hero-accent);
    font-family: 'Inter', sans-serif;
    font-size: clamp(0.72rem, 0.9vw, 0.82rem);
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.hero-slide__title {
    margin: 0 0 1.35rem;
    color: #fff;
    font-family: 'Poppins', sans-serif;
    /* 34-44 mobile, up to ~60 desktop (§16) */
    font-size: clamp(2.15rem, 1.25rem + 2.5vw, 3.75rem);
    font-weight: 700;
    line-height: 1.07;
    letter-spacing: -0.022em;
    text-wrap: balance;
    text-shadow: 0 2px 28px rgba(4, 12, 30, 0.45);
}

/* Editor-authored line breaks become real lines */
.hero-slide__line {
    display: block;
}

.hero-slide__desc {
    margin: 0 0 2rem;
    max-width: 34rem;
    color: rgba(233, 240, 250, 0.92);
    font-family: 'Inter', sans-serif;
    font-size: clamp(1rem, 0.93rem + 0.35vw, 1.1875rem);
    line-height: 1.65;
    text-shadow: 0 1px 16px rgba(4, 12, 30, 0.5);
}

.hero-slide--right .hero-slide__desc {
    margin-left: auto;
}

/* --------------------------------------------------------------------- CTA */

.hero-slide__ctas {
    display: flex;
    flex-wrap: wrap;
    gap: 0.875rem;
}

.hero-slide--right .hero-slide__ctas {
    justify-content: flex-end;
}

.hero-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    /* Refined rectangle, not a pill (§14) */
    border-radius: 6px;
    padding: 0.95rem 1.65rem;
    font-family: 'Inter', sans-serif;
    font-size: 0.9375rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    text-decoration: none;
    border: 1.5px solid transparent;
    transition: background-color 0.25s ease, border-color 0.25s ease,
                color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

.hero-btn i {
    font-size: 0.9em;
    transition: transform 0.25s ease;
}

.hero-btn--primary {
    background: var(--hero-accent);
    border-color: var(--hero-accent);
    color: #08203f;
    box-shadow: 0 8px 24px rgba(255, 193, 7, 0.22);
}

.hero-btn--primary:hover {
    background: #ffcd39;
    border-color: #ffcd39;
    color: #08203f;
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(255, 193, 7, 0.3);
}

.hero-btn--primary:hover i {
    transform: translateX(3px);
}

.hero-btn--ghost {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.42);
    color: #fff;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.hero-btn--ghost:hover {
    background: rgba(255, 255, 255, 0.16);
    border-color: #fff;
    color: #fff;
    transform: translateY(-2px);
}

.hero-btn:active {
    transform: translateY(0);
}

/* ------------------------------------------------------------------- badge */

.hero-slide__badge {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    margin: 1.9rem 0 0;
    color: rgba(219, 230, 245, 0.75);
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.hero-slide__badge-rule {
    width: 32px;
    height: 1px;
    background: var(--hero-accent);
}

/* ---------------------------------------------------------------- controls */

.hero__controls {
    grid-area: 1 / 1;
    align-self: end;
    z-index: 3;
    width: 100%;
    padding-bottom: 1.75rem;
    pointer-events: none;
}

/* Only the controls themselves take pointer events, so the strip does not
   swallow clicks aimed at the CTA buttons above it. */
.hero__controls-inner > * {
    pointer-events: auto;
}

.hero__controls-inner {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.5rem;
}

/* The tab strip yields before the nav buttons do, so the controls can never
   push past the container on a narrow screen. */
.hero__tabs {
    min-width: 0;
    flex: 0 1 auto;
}

.hero__nav {
    flex: 0 0 auto;
}

/* Numbered tabs with a thin progress track (§12, §13) */
.hero__tabs {
    display: flex;
    align-items: flex-end;
    gap: 1.1rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.hero__tab {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.5);
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    transition: color 0.3s ease;
}

.hero__tab:hover,
.hero__tab.is-active {
    color: #fff;
}

.hero__tab-track {
    display: block;
    width: 46px;
    height: 2px;
    background: rgba(255, 255, 255, 0.28);
    overflow: hidden;
    transition: width 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

.hero__tab.is-active .hero__tab-track {
    width: 92px;
    background: rgba(255, 255, 255, 0.3);
}

.hero__tab-fill {
    display: block;
    width: 0;
    height: 100%;
    background: var(--hero-accent);
}

/* Width is driven from JS so the bar tracks real elapsed time */
.hero__tab.is-active .hero__tab-fill {
    width: var(--hero-progress, 0%);
}

.hero__tab.is-done .hero__tab-fill {
    width: 100%;
}

/* Subtle nav — never giant Bootstrap arrows (§12) */
.hero__nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.hero__nav-btn {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    color: #fff;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background-color 0.25s ease, border-color 0.25s ease,
                transform 0.25s ease;
}

.hero__nav-btn:hover {
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.6);
    transform: translateY(-2px);
}

.hero__nav-btn:active {
    transform: translateY(0);
}

/* ------------------------------------------------------------------- focus */

.hero a:focus-visible,
.hero button:focus-visible {
    outline: 2px solid var(--hero-accent);
    outline-offset: 3px;
    border-radius: 4px;
}

/* -------------------------------------------------------------- responsive */

@media (max-width: 991.98px) {
    .hero {
        min-height: clamp(560px, 72vh, 680px);
    }

    .hero-slide__inner {
        padding-bottom: 6rem;
    }

    .hero-slide__content {
        max-width: 34rem;
    }
}

@media (max-width: 767.98px) {
    .hero {
        min-height: clamp(540px, 82vh, 660px);
    }

    /* Mobile art is a 3:4 crop, so weight the scrim to the bottom where
       the copy sits rather than to one side (§8). */
    .hero-slide--left .hero-slide__scrim,
    .hero-slide--right .hero-slide__scrim {
        background: linear-gradient(0deg,
            rgba(4, 12, 30, 0.94) 0%,
            rgba(4, 12, 30, 0.80) 34%,
            rgba(4, 12, 30, 0.52) 62%,
            rgba(4, 12, 30, 0.30) 100%);
    }

    .hero-slide {
        align-items: flex-end;
    }

    .hero-slide__inner,
    .hero-slide--right .hero-slide__inner {
        display: block;
        padding-top: 2rem;
        padding-bottom: 5.5rem;
    }

    .hero-slide__content,
    .hero-slide--right .hero-slide__content {
        max-width: none;
        text-align: left;
    }

    .hero-slide__desc {
        margin-left: 0;
        margin-bottom: 1.6rem;
        max-width: none;
        font-size: 0.9825rem;
        line-height: 1.6;
    }

    .hero-slide__ctas,
    .hero-slide--right .hero-slide__ctas {
        justify-content: flex-start;
        gap: 0.6rem;
    }

    /* Comfortable targets, never cramped (§29) */
    .hero-btn {
        flex: 1 1 auto;
        justify-content: center;
        min-height: 50px;
        padding: 0.85rem 1.1rem;
        font-size: 0.9rem;
    }

    .hero-slide__badge {
        margin-top: 1.4rem;
        font-size: 0.6875rem;
    }

    .hero__controls {
        padding-bottom: 1.15rem;
    }

    .hero__controls-inner {
        align-items: center;
        gap: 0.75rem;
    }

    .hero__tab-num {
        display: none;
    }

    .hero__tabs {
        gap: 0.5rem;
    }

    .hero__tab-track {
        width: 22px;
    }

    .hero__tab.is-active .hero__tab-track {
        width: 40px;
    }

    /* Bigger hit area than the visible bar, so a 2px line is still tappable */
    .hero__tab {
        padding: 10px 0;
    }

    .hero__nav {
        gap: 0.4rem;
    }

    .hero__nav-btn {
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 359.98px) {
    .hero__nav-btn {
        width: 36px;
        height: 36px;
    }

    .hero__tabs {
        gap: 0.4rem;
    }
}

@media (max-width: 400px) {
    .hero-slide__title {
        font-size: clamp(1.95rem, 1.2rem + 3.6vw, 2.4rem);
    }

    /* Stack rather than squeeze two buttons onto a 320px line */
    .hero-slide__ctas {
        flex-direction: column;
        align-items: stretch;
    }

    .hero-btn {
        width: 100%;
    }
}

/* --------------------------------------------------------------- reduced motion */

@media (prefers-reduced-motion: reduce) {
    .hero-slide {
        transition: opacity 200ms linear, visibility 0s linear 200ms;
    }

    .hero-slide.is-active {
        transition: opacity 200ms linear, visibility 0s linear 0s;
    }

    /* No drift, no rise — content is simply present */
    .hero-slide.is-active .hero-slide__media img {
        animation: none;
        transform: scale(1.02);
    }

    .hero-slide__eyebrow,
    .hero-slide__title,
    .hero-slide__desc,
    .hero-slide__ctas,
    .hero-slide__badge {
        opacity: 1;
        transform: none;
        animation: none !important;
    }

    .hero-btn:hover,
    .hero__nav-btn:hover {
        transform: none;
    }
}

/* ------------------------------------------------- header over hero (§20) */

/* Default is the solid navbar. The transparent state is added by JS only
   while the page is scrolled to the top of a hero, so a JS failure leaves a
   readable header rather than an invisible one. */
.navbar.is-over-hero {
    background: linear-gradient(180deg, rgba(4, 12, 30, 0.62) 0%, rgba(4, 12, 30, 0) 100%) !important;
    box-shadow: none !important;
    transition: background-color 0.4s ease, box-shadow 0.4s ease;
}

.navbar.is-over-hero .navbar-brand span {
    text-shadow: 0 1px 12px rgba(4, 12, 30, 0.6);
}
