/* Hero - feuille de styles de la homepage. */

/* ---------------------------------------------------------
   1. VARIABLES :root - spécifiques au hero
   --------------------------------------------------------- */
:root {
    /* Fond du hero : délégué à --ya-bg-primary qui est surchargé par
       light-mode.css en light theme. Résultat : le hero bascule tout
       seul quand l'utilisateur switch dark/light.
       - dark  → #1D252D (fond du site)
       - light → #FFFFFF (fond du site)
       Le fade-out final des colonnes révèle ce fond, donc transition
       seamless avec la section suivante dans les deux thèmes. */
    --hero-bg: var(--ya-bg-primary, #1D252D);
    --hero-fg: #ffffff;                                                          /* Blanc pur - titre reste lisible grâce à l'overlay radial central */
    --hero-accent: #0BCFE0;                                                      /* Aligné avec --ya-accent-500 */

    /* Fonts du site - réutilisent Montserrat (titres) chargé par main.php */
    --hero-font: var(--ya-font-titles, 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif);
    --hero-font-serif: var(--ya-font-titles, 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif);

    --col-width: 296px;
    --col-hgap: 16px;
    --img-gap-y: 16px;

    --img-ratio: 296 / 420;
}

@media (max-width: 767px) {
    :root {
        --col-width: 160px;
        --col-hgap: 12px;
    }
}

/* ---------------------------------------------------------
   2. HOMEPAGE - ya-header initial state
   ---------------------------------------------------------
   Sur la homepage uniquement, on masque le header jusqu'à la
   fin de l'animation scroll. Le JS le révèle à MENU_APPEAR_AT
   (0.75 par défaut).
   --------------------------------------------------------- */
body.page-home .ya-header {
    opacity: 0;
    pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
    body.page-home .ya-header {
        opacity: 1;
        pointer-events: auto;
    }
}

/* ---------------------------------------------------------
   3. SECTION HERO + SPACER
   ---------------------------------------------------------
   Pattern Framer-like : le hero est `position: fixed` (collé
   au viewport) pendant que `.hero-spacer` occupe la place dans
   le doc flow et donne la distance de scroll. Les sections
   suivantes (#decouvrir etc.) sont en flux normal - elles
   remontent naturellement par-dessus le hero (z-index 50 vs 1)
   quand l'utilisateur scrolle. Synchronisation parfaite par
   construction, pas de pin GSAP, pas de "scroll dans rien".
   --------------------------------------------------------- */
.hero {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;             /* fallback pour les vieux navigateurs */
    height: 100dvh;            /* hauteur dynamique = viewport visible (mobile URL bar) */
    z-index: 1;                /* sous les sections post-hero (z-index 50) */
    background: var(--hero-bg);
    overflow: hidden;
    touch-action: pan-y;
}

/* Spacer : occupe la place dans le doc flow pour donner la distance
   de scroll qui pilote l'animation hero. Hauteur ≈ 150vh desktop,
   100vh mobile (calibré sur prod Framer = 1.64vp desktop). */
.hero-spacer {
    width: 100%;
    height: 150vh;
    pointer-events: none;
}

@media (max-width: 767px) {
    .hero-spacer { height: 100vh; }
}

.hero__columns {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: calc((var(--col-width) * 7) + (var(--col-hgap) * 6));
    height: 100%;
    overflow: hidden;
    will-change: transform, opacity;
    opacity: 0;
    touch-action: pan-y;
}

.column {
    position: absolute;
    top: 0;
    height: 100%;
    width: var(--col-width);
    overflow: hidden;
    will-change: transform, opacity;
    transform-origin: center center;
    touch-action: pan-y;
}

.column__track {
    display: flex;
    flex-direction: column;
    gap: var(--img-gap-y);
    width: 100%;
    will-change: transform;
}

.column__track img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: var(--img-ratio);
    object-fit: cover;
    /* object-position appliqué inline par <img> (point de focus admin) */
    object-position: 50% 50%;
    user-select: none;
    -webkit-user-drag: none;
    pointer-events: none;
}

/* ---------------------------------------------------------
   4. OVERLAY CENTRAL - dégradé radial sombre
   ---------------------------------------------------------
   Le noir pur conserve l'effet d'assombrissement même si le
   fond est #1D252D (dark blue) : superposer du noir sur du
   bleu foncé donne un noir très sombre au centre.
   --------------------------------------------------------- */
.hero__columns-overlay {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(
            ellipse 65% 60% at 50% 50%,
            rgba(0, 0, 0, 0.88) 0%,
            rgba(0, 0, 0, 0.78) 35%,
            rgba(0, 0, 0, 0.60) 65%,
            rgba(0, 0, 0, 0.45) 100%
        );
    opacity: 0;
    pointer-events: none;
    z-index: 5;
    will-change: opacity;
}

/* ---------------------------------------------------------
   5. BLOC TITRE CENTRAL
   ---------------------------------------------------------
   Typo alignée sur la charte : Montserrat pour tout.
   Line 1 en 600 (comme les H1 site), line 2 en 500 italic +
   accent turquoise pour conserver le contraste narratif.
   --------------------------------------------------------- */
.hero__title-block {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    text-align: center;
    padding: 0 20px;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    opacity: 0;
    will-change: opacity, transform;
}

.hero__eyebrow {
    font-family: var(--hero-font);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--hero-accent);
    margin: 0 0 16px 0;
}

.hero__title {
    font-family: var(--hero-font-serif);
    font-weight: 600;
    font-size: clamp(2.5rem, 6.5vw, 6rem);
    line-height: 1.1;
    letter-spacing: -0.02em;
    margin: 0;
    text-align: center;
    color: var(--hero-fg);
}

.hero__title-line1 {
    display: block;
    color: #ffffff;
    font-style: normal;
    font-weight: 600;
}

.hero__title-line2 {
    display: block;
    color: var(--hero-accent);
    font-style: italic;
    font-weight: 500;
}

.hero__cta {
    display: inline-block;
    margin-top: 32px;
    padding: 16px 40px;
    border: 1px solid var(--hero-accent);
    background: transparent;
    color: #ffffff;
    font-family: var(--hero-font);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    text-decoration: none;
    white-space: nowrap;
    pointer-events: auto;
    transition: box-shadow 0.3s ease, background-color 0.3s ease, color 0.3s ease, transform 0.3s ease;
}

.hero__cta:hover,
.hero__cta:focus-visible {
    background: rgba(11, 207, 224, 0.12);
    box-shadow: 0 0 24px rgba(11, 207, 224, 0.35);
    color: #ffffff;
    text-decoration: none;
    outline: none;
}

@media (max-width: 767px) {
    .hero__title-block { padding: 0 16px; }
    .hero__eyebrow     { font-size: 11px; letter-spacing: 0.28em; margin-bottom: 14px; }
    .hero__cta         { padding: 14px 28px; font-size: 12px; letter-spacing: 0.18em; margin-top: 24px; }
}

@media (max-width: 390px) {
    .hero__cta { padding: 13px 22px; font-size: 11px; letter-spacing: 0.16em; }
}

/* ---------------------------------------------------------
   5.1 FLÈCHE SCROLL HINT - indicateur "scroll pour découvrir"
   ---------------------------------------------------------
   Placée juste sous le CTA dans le title-block (in-flow) pour
   former un bloc visuel unifié. Animation GSAP gère opacity/y,
   le chevron interne fait un bounce subtil pour attirer l'œil.
   --------------------------------------------------------- */
.hero__scroll-hint {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    opacity: 0;                           /* état initial, révélé par GSAP */
    pointer-events: auto;
    transition: color 0.25s ease, background 0.25s ease;
    -webkit-tap-highlight-color: transparent;
}

.hero__scroll-hint:hover,
.hero__scroll-hint:focus-visible {
    color: var(--hero-accent);
    text-decoration: none;
    outline: none;
}

.hero__scroll-hint:focus-visible {
    box-shadow: 0 0 0 2px var(--hero-accent);
}

/* Chevron : deux bords d'un carré tournés 45° = flèche vers le bas.
   Bounce appliqué à l'intérieur du conteneur (le parent garde son
   opacity/y pilotés par GSAP, le bounce ne perturbe pas l'anim). */
.hero__scroll-hint-chevron {
    display: block;
    width: 12px;
    height: 12px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: translateY(-2px) rotate(45deg);
    animation: hero-scroll-bounce 2.6s ease-in-out infinite;
}

@keyframes hero-scroll-bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(-2px) rotate(45deg); }
    40%                     { transform: translateY(2px) rotate(45deg); }
    60%                     { transform: translateY(0) rotate(45deg); }
}

@media (max-width: 767px) {
    .hero__scroll-hint {
        margin-top: 18px;
        width: 36px;
        height: 36px;
    }
    .hero__scroll-hint-chevron { width: 10px; height: 10px; }
}

@media (prefers-reduced-motion: reduce) {
    .hero__scroll-hint-chevron { animation: none; }
}

/* ---------------------------------------------------------
   6. SECTIONS POST-HERO - empilement au-dessus du hero fixed
   ---------------------------------------------------------
   Le hero étant `position: fixed; z-index: 1`, il reste collé au
   viewport. Les sections qui le suivent (en flux normal après le
   `.hero-spacer`) remontent naturellement quand l'utilisateur
   scrolle. Avec `z-index: 50` et un `background` opaque, elles
   passent par-dessus le hero - pas besoin de fade JS, le doc flow
   fait le travail. Les couleurs de fond identiques entre hero
   (#1D252D / blanc en light) et sections garantissent la
   transition seamless.
   --------------------------------------------------------- */
body.page-home main > section:not(.hero) {
    position: relative;
    z-index: 50;
    background: var(--ya-bg-primary);
}

body.page-home main > section.ya-section-alt {
    background: var(--ya-bg-alt);
}

/* Le footer est dans `body` (pas dans `main`) - il a besoin du même
   `z-index` pour passer au-dessus du hero `position: fixed`, sinon il
   est masqué quand l'utilisateur scrolle tout en bas. */
body.page-home > footer {
    position: relative;
    z-index: 50;
}

/* ---------------------------------------------------------
   7. COOKIE BANNER DIFFÉRÉ
   ---------------------------------------------------------
   Sur la homepage, la bannière cookie (et son overlay mobile)
   restent invisibles jusqu'à ce que l'utilisateur ait scrollé
   au-delà du hero (body.ya-cookie-reveal ajoutée par le JS).
   Évite que la bannière gâche l'effet d'intro.
   --------------------------------------------------------- */
body.page-home:not(.ya-cookie-reveal) .ya-cookie-banner,
body.page-home:not(.ya-cookie-reveal) .ya-cookie-overlay {
    opacity: 0 !important;
    pointer-events: none !important;
    visibility: hidden;
    transition: none;
}

body.page-home.ya-cookie-reveal .ya-cookie-banner,
body.page-home.ya-cookie-reveal .ya-cookie-overlay {
    transition: opacity 0.4s ease, transform 0.4s ease;
}

/* ---------------------------------------------------------
   8. ACCESSIBILITÉ - prefers-reduced-motion
   ---------------------------------------------------------
   En reduced-motion : on repasse le hero en flux normal
   (`position: relative`) et on supprime le spacer - comportement
   statique normal, pas d'animation.
   --------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    .hero {
        position: relative;
        min-height: 100vh;
        min-height: 100dvh;
    }
    .hero-spacer { display: none; }

    .hero__columns         { opacity: 1 !important; }
    .hero__title-block     { opacity: 1 !important; transform: translate(-50%, -50%) !important; }
    .hero__columns-overlay { opacity: 1 !important; }
    .hero__scroll-hint     { opacity: 1 !important; }
    .column__track         { transform: none !important; }
}
