/* =============================================================
   Socle CSS 25ème Heure (front + aperçu dans l'éditeur)
   -------------------------------------------------------------
   CSS natif, sans préprocesseur :
   - tokens  : variables générées par theme.json (--wp--preset--color--primaire,
               --wp--preset--spacing--simple...) + tokens du thème ci-dessous ;
   - nesting : natif (& comme en SCSS) ;
   - @layer  : reset et base sont dans des couches → tout style non-layé
               (blocs core, nos sections) passe devant, sans !important.
   Les styles propres à une section sont dans blocks/<section>/style.css.

   Échelle : 1rem = 10px. Les tailles fluides vont de la maquette mobile
   (375px) à la maquette desktop (1512px).
   ============================================================= */

@layer reset, base;

/* ---------- Tokens du thème (complètent ceux de theme.json) ---------- */
:root {
    --h25-font: var(--wp--preset--font-family--principale);
    --h25-font-expressive: var(--wp--preset--font-family--expressive);

    --h25-container: 143rem;
    --h25-gutter: clamp(
        2rem,
        1.34rem + 1.76vw,
        4.1rem
    ); /* 20px mobile → 41px desktop */
    --h25-radius: 1rem;
    --h25-radius-l: 2rem;
    --h25-ease: cubic-bezier(0.22, 0.68, 0, 1);

    /* Échelle typographique (guide de style : desktop → mobile) */
    --h25-fs-h2: clamp(4.8rem, 4.272rem + 1.407vw, 6.4rem); /* 64 → 48 */
    --h25-fs-h3: clamp(3rem, 2.67rem + 0.88vw, 4rem); /* 40 → 30 */
    --h25-fs-h4: clamp(2.2rem, 1.936rem + 0.704vw, 3rem); /* 30 → 22 */
    --h25-fs-mot-l: clamp(
        3.6rem,
        3.204rem + 1.055vw,
        4.8rem
    ); /* mots-clés 48 → 36 */
    --h25-fs-mot: clamp(
        2.2rem,
        1.936rem + 0.704vw,
        3rem
    ); /* mots-clés 30 → 22 */
    --h25-fs-grand: var(--wp--preset--font-size--l); /* texte large 40 → 30 */
    --h25-fs-texte: var(--wp--preset--font-size--m); /* 18 */
    --h25-fs-petit: var(--wp--preset--font-size--s); /* 14 */
    --h25-fs-mini: 1.2rem;
    --h25-fs-bouton: 1.6rem;

    /* Couleurs "contextuelles" : changent selon le fond de la section */
    --h25-fg: var(--wp--preset--color--primaire);
    --h25-accent: var(--wp--preset--color--primaire);
    --h25-btn-bg: var(--wp--preset--color--primaire);
    --h25-btn-bg-hover: var(--wp--custom--couleur--primaire-fonce);
    --h25-btn-fg: var(--wp--preset--color--secondaire);
    --h25-etiquette-bg: var(--wp--preset--color--clair);
    --h25-etiquette-fg: var(--wp--preset--color--primaire);
}

/*
 * "Réglages de la section" (cf. inc/sections.php) → classes h25-fond--* et
 * h25-espace-haut/bas--*.
 *
 * CONTRAT DU SOCLE : la palette de chaque projet utilise ces slugs de RÔLE
 * — clair (fond de page), primaire, secondaire, blanc, accent. Seules les
 * valeurs (et les noms affichés au client) changent dans theme.json.
 * Couleurs fidèles à la maquette : leur accessibilité relève du design.
 */
.h25-fond {
    background-color: var(--h25-bg);
    color: var(--h25-fg);
}
.h25-fond--clair {
    --h25-bg: var(--wp--preset--color--clair);
}
.h25-fond--blanc {
    --h25-bg: var(--wp--preset--color--blanc);
}
.h25-fond--secondaire {
    --h25-bg: var(--wp--preset--color--secondaire);
}
.h25-fond--primaire,
.h25-fond-carte--primaire {
    --h25-bg: var(--wp--preset--color--primaire);
    --h25-fg: var(--wp--preset--color--secondaire);
    --h25-accent: var(--wp--preset--color--secondaire);
    --h25-btn-bg: var(--wp--preset--color--secondaire);
    --h25-btn-bg-hover: color-mix(
        in srgb,
        var(--wp--preset--color--secondaire) 55%,
        var(--wp--preset--color--blanc)
    );
    --h25-btn-fg: var(--wp--preset--color--primaire);
}

/*
 * Espaces haut/bas : Aucun / Simple / Double.
 * - Section transparente : tailles de theme.json (spacingSizes) — maquette :
 *   72px / 144px (deux sections "Simple" côte à côte = 144px).
 * - Section à FOND COLORÉ : marges intérieures plus serrées — maquette :
 *   Simple 64px, Double 112px en haut et 96px en bas.
 * Le client garde les mêmes 3 choix ; la charte décide des valeurs.
 */
:root {
    --h25-espace-simple: var(--wp--preset--spacing--simple);
    --h25-espace-double-haut: var(--wp--preset--spacing--double);
    --h25-espace-double-bas: var(--wp--preset--spacing--double);
}
.h25-fond {
    --h25-espace-simple: clamp(4rem, 3.208rem + 2.111vw, 6.4rem); /* 40 → 64 */
    --h25-espace-double-haut: clamp(
        7rem,
        5.615rem + 3.694vw,
        11.2rem
    ); /* 70 → 112 */
    --h25-espace-double-bas: clamp(
        6rem,
        4.813rem + 3.166vw,
        9.6rem
    ); /* 60 → 96 */
}
.h25-espace-haut--aucun {
    padding-block-start: 0;
}
.h25-espace-haut--simple {
    padding-block-start: var(--h25-espace-simple);
}
.h25-espace-haut--double {
    padding-block-start: var(--h25-espace-double-haut);
}
.h25-espace-bas--aucun {
    --h25-pb: 0px;
}
.h25-espace-bas--simple {
    --h25-pb: var(--h25-espace-simple);
}
.h25-espace-bas--double {
    --h25-pb: var(--h25-espace-double-bas);
}
[class*="h25-espace-bas--"] {
    padding-block-end: var(--h25-pb);
} /* --h25-pb réutilisable par les sections */

/* ---------- Reset ---------- */
@layer reset {
    *,
    *::before,
    *::after {
        box-sizing: border-box;
    }
    html {
        font-size: 62.5%; /* 1rem = 10px */
        -webkit-text-size-adjust: none;
        text-size-adjust: none;
        scroll-behavior: smooth; /* défilement animé vers les ancres */
    }
    body,
    h1,
    h2,
    h3,
    h4,
    p,
    figure,
    blockquote,
    ul,
    ol {
        margin: 0;
    }
    ul[class],
    ol[class] {
        padding: 0;
        list-style: none;
    }
    img,
    svg,
    video {
        display: block;
        max-width: 100%;
        height: auto;
    }
    input,
    button,
    textarea,
    select {
        font: inherit;
        color: inherit;
    }
    @media (prefers-reduced-motion: reduce) {
        html {
            scroll-behavior: auto;
        }
        *,
        *::before,
        *::after {
            animation-duration: 0.01ms !important;
            transition-duration: 0.01ms !important;
        }
    }
}

/* ---------- Base typographique ---------- */
@layer base {
    body {
        font-family: var(--h25-font);
        font-size: var(--h25-fs-texte);
        line-height: 1.556; /* 28/18 */
        color: var(--h25-fg);
        background: var(--wp--preset--color--clair);
        -webkit-font-smoothing: antialiased;
    }
    h1,
    h2,
    h3,
    h4 {
        font-weight: 600;
    }
    h2 {
        font-size: var(--h25-fs-h2);
        line-height: 1;
    }
    h3 {
        font-size: var(--h25-fs-h3);
        line-height: 1;
    }
    h4 {
        font-size: var(--h25-fs-h4);
        line-height: 1.2;
    }
    /* pas de text-wrap: balance/pretty : on garde les retours à la ligne de la maquette */
    strong,
    b {
        font-weight: 700;
    }
    a {
        color: inherit;
        text-underline-offset: 0.15em;
        text-decoration-thickness: from-font;
    }
    :focus-visible {
        outline: 2px solid currentColor;
        outline-offset: 3px;
    }
}

/*
 * Typo "expressive" (IvyPresto Display Light Italic) : format « Ivy » de
 * l'éditeur (span.h25-ivy) et texte barré (format « Barré » = <s>), comme
 * dans les titres doubles de la maquette (« Supposer. Mesurer. »).
 */
.h25-ivy,
:is(h1, h2, h3, h4, .h25-etiquette, [class*="is-style-etiquettes"] > li) s {
    font-family: var(--h25-font-expressive);
    font-weight: 300;
    font-style: italic;
}
s {
    text-decoration-thickness: from-font;
}

/*
 * Texte barré qui SE BARRE à l'apparition (cf. « Barré animé » dans main.js).
 * Un text-decoration ne s'anime pas : on le remplace par un trait dessiné
 * (dégradé d'une seule couleur) dont la largeur passe de 0 à 100 %. Sur un
 * élément en ligne, le fond suit les retours à la ligne : le trait barre la
 * 1re ligne puis continue sur la 2e, comme un stylo.
 *
 * Réglages (surchargeables par section si besoin) :
 *  --h25-barre-duree  : durée du tracé
 *  --h25-barre-delai  : attente une fois le texte à l'écran
 *  --h25-barre-courbe : ease-in-out marqué (départ lent, accélère, freine)
 *  --h25-barre-y / --h25-barre-epaisseur : position et épaisseur du trait
 *
 * Garde-fous : sans JS (scripting), avec « réduire les animations », ou dans
 * l'éditeur, on garde le line-through normal : le texte est TOUJOURS barré.
 */
:root {
    --h25-barre-duree: 0.9s;
    --h25-barre-delai: 0.35s;
    --h25-barre-courbe: cubic-bezier(0.77, 0, 0.175, 1);
    --h25-barre-y: 56%;
    --h25-barre-epaisseur: 0.06em;
}
@media (scripting: enabled) and (prefers-reduced-motion: no-preference) {
    body:not(.editor-styles-wrapper) s {
        text-decoration: none;
        background: linear-gradient(currentColor, currentColor) no-repeat 0
            var(--h25-barre-y) / 0% var(--h25-barre-epaisseur);
        transition: background-size var(--h25-barre-duree)
            var(--h25-barre-courbe) var(--h25-barre-delai);

        &.est-barre {
            background-size: 100% var(--h25-barre-epaisseur);
        }
    }
}

/* Graisses de la charte (formats "Fin", "Semi-gras" de l'éditeur) */
.h25-graisse-fine {
    font-weight: 300;
}
.h25-graisse-medium {
    font-weight: 500;
}
.h25-graisse-semi {
    font-weight: 600;
}

/*
 * Styles de texte du guide (Bloc > Styles, cf. inc/editor.php) — paragraphes et listes.
 * « Par défaut » = Paragraphe Base : 18/28, réglé sur body.
 */
.is-style-large {
    font-size: var(--h25-fs-grand);
    line-height: 1.25;
    font-weight: 300;
} /* 40/50 → 30/38 */
.is-style-small {
    font-size: var(--h25-fs-petit);
    line-height: 1.43;
} /* 14/20 */
.is-style-xs {
    font-size: var(--h25-fs-mini);
    line-height: 1.17;
} /* 12/14 */

/*
 * « Mise en avant » de la charte (accroche, « Faisons le point dès
 * maintenant. ») = GRAS + ITALIQUE (Ctrl+B puis Ctrl+I) → souligné.
 * Dans un texte Large (Light), le gras est un Medium, comme la maquette.
 */
:is(strong em, em strong) {
    text-decoration: underline;
    text-decoration-thickness: from-font;
    text-underline-offset: 0.15em;
}
.is-style-large strong {
    font-weight: 500;
}

/*
 * Pictogramme dans le texte (bouton « Pictogramme » de l'éditeur) :
 * <img class="h25-picto" data-picto="asterisque" src="…svg" alt="">.
 * Le SVG sert de masque sur un fond currentColor → le picto prend la COULEUR
 * du texte (y compris « Mettre en évidence ») et sa TAILLE (en em).
 * object-position repousse l'image elle-même hors de sa boîte : seul le fond
 * découpé s'affiche. --h25-picto est défini par picto (inc/assets.php).
 */
img.h25-picto {
    display: inline-block;
    width: auto;
    height: 0.75em;
    margin-inline: 0.08em;
    vertical-align: baseline;
    background: currentColor;
    mask: var(--h25-picto) center / contain no-repeat;
    object-position: -999em 0;
}

/* Éditeur : même fond de page que le site (WordPress impose du blanc, hors couche) */
.editor-styles-wrapper {
    background: var(--wp--preset--color--clair);
}

/* Texte lu par les lecteurs d'écran uniquement (classe standard WordPress) */
.screen-reader-text {
    position: absolute !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

/* ---------- Layout ---------- */
.h25-container {
    width: min(100% - 2 * var(--h25-gutter), var(--h25-container));
    margin-inline: auto;
}
.h25-section {
    /*
	 * Largeur (--h25-cw) et bord gauche (--h25-cx) du conteneur, utilisables
	 * par les décors positionnés dans la section : ils se calent sur le
	 * contenu (comme dans la maquette) et non sur la largeur de l'écran.
	 * Les % sont résolus là où la variable est utilisée (largeur de la section).
	 */
    --h25-cw: min(100% - 2 * var(--h25-gutter), var(--h25-container));
    --h25-cx: calc((100% - var(--h25-cw)) / 2);
    position: relative;
    /* les décors qui débordent sur les côtés ne créent jamais de défilement
	   horizontal ; "clip" (et non "hidden") laisse déborder en hauteur */
    overflow-x: clip;
}
/* Décors (doodles) : purement visuels, jamais cliquables */
.h25-decor {
    position: absolute;
    pointer-events: none;
    > svg {
        width: 100%;
        height: auto;
    }
}

/*
 * Nos <figure> : sans marge. Le reset (en @layer) ne suffit pas, une règle
 * "figure { margin: 0 0 1em }" de WordPress, hors couche, passe devant.
 */
figure[class*="h25-"] {
    margin: 0;
}

/* Cartes (fonds colorés arrondis de la maquette) */
.h25-carte {
    border-radius: var(--h25-radius);
}

/* Contenu libre (blocs natifs dans nos sections) : rythme vertical */
.h25-prose {
    > * + * {
        margin-block-start: 1em;
    }
    > :is(h2, h3, h4) + * {
        margin-block-start: clamp(2.4rem, 1.7rem + 1.8vw, 4rem);
    }
    > * + :is(h2, h3, h4) {
        margin-block-start: 1.4em;
    }
    ul:not([class]),
    ol:not([class]) {
        padding-inline-start: 1.2em;
    }
    li + li {
        margin-block-start: 0.4em;
    }
}

/* ---------- Boutons (guide de style : 3 variantes selon le fond) ----------
 * Mêmes règles pour nos boutons (.h25-btn, champs ACF) et pour les blocs
 * natifs « Bouton » du contenu libre (.wp-block-button > a). Le sélecteur
 * à 2 classes passe devant le CSS de WordPress (chargé après base.css).
 */
.h25-btn,
.wp-block-button > .wp-block-button__link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    padding: 1.4rem 3rem;
    border: 1px solid var(--h25-btn-bg);
    border-radius: 3rem;
    background: var(--h25-btn-bg);
    color: var(--h25-btn-fg);
    font-size: var(--h25-fs-bouton);
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    transition:
        background-color 0.2s var(--h25-ease),
        border-color 0.2s var(--h25-ease),
        color 0.2s var(--h25-ease);

    &:hover,
    &:focus-visible {
        background: var(--h25-btn-bg-hover);
        border-color: var(--h25-btn-bg-hover);
    }
}
.h25-btn--contour,
.wp-block-button.is-style-contour > .wp-block-button__link {
    background: transparent;
    color: var(--h25-btn-bg);
    /*
	 * Survol (guide de style) : le contour se REMPLIT, comme un bouton plein
	 * au survol. Le fond est redonné ici : « background: transparent » ci-dessus
	 * est plus spécifique que le survol générique pour les blocs Bouton
	 * (.wp-block-button.is-style-contour > a) et le gardait transparent
	 * → texte rose sur la bande rose du hero, invisible.
	 */
    &:hover,
    &:focus-visible {
        background: var(--h25-btn-bg-hover);
        border-color: var(--h25-btn-bg-hover);
        color: var(--h25-btn-fg);
    }
}
/* Boutons icône (téléphone, LinkedIn, flèches) : le pictogramme contient sa pilule */
.h25-btn-icone {
    display: inline-block;
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
    color: var(--h25-btn-bg);
    line-height: 0;
    border-radius: 3rem;
    transition: color 0.2s var(--h25-ease);
    &:hover,
    &:focus-visible {
        color: var(--h25-btn-bg-hover);
    }
    > svg {
        height: 4.5rem;
        width: auto;
    }
}
.h25-boutons {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

/* Blocs « Boutons » du contenu libre : un peu d'air après le texte (écart entre boutons : theme.json, 1rem comme .h25-boutons) */
.h25-prose > .wp-block-buttons {
    margin-block-start: 3.2rem;
}

/*
 * Styles « Téléphone » / « LinkedIn » (bloc Bouton) : pilule contour + picto,
 * comme les boutons icône du guide. Sur le site, le texte du bouton n'est
 * plus affiché mais reste lu par les lecteurs d'écran (libellé du lien) ;
 * dans l'éditeur, il reste visible pour pouvoir le modifier.
 */
.wp-block-button:is(.is-style-telephone, .is-style-linkedin)
    > .wp-block-button__link {
    min-width: 7.8rem;
    min-height: 4.5rem;
    padding-inline: 2.2rem;
    background: transparent;
    color: var(--h25-btn-bg);

    &::before {
        content: "";
        flex: none;
        width: 1.8rem;
        height: 1.7rem;
        background: currentColor;
        mask: var(--h25-picto) center / contain no-repeat;
    }
    &:hover,
    &:focus-visible {
        color: var(--h25-btn-fg);
    }
}
.wp-block-button.is-style-telephone > .wp-block-button__link {
    --h25-picto: url("../pictos/telephone.svg");
}
.wp-block-button.is-style-linkedin > .wp-block-button__link {
    --h25-picto: url("../pictos/linkedin.svg");
}
body:not(.editor-styles-wrapper)
    .wp-block-button:is(.is-style-telephone, .is-style-linkedin)
    > .wp-block-button__link {
    gap: 0;
    font-size: 0; /* texte masqué à l'écran, toujours lu par les lecteurs d'écran */
}

/* Bouton qui ressemble à un lien (ex. "Gérer mes cookies") */
.h25-lien-bouton {
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    text-decoration: underline;
    text-underline-offset: 0.2em;
    cursor: pointer;
}

/* ---------- Étiquettes de mots-clés (Ivy, encadrées, parfois inclinées) ----------
 * Style de liste « Étiquettes » / « Grandes étiquettes » (cf. inc/editor.php) :
 * chaque ligne de la liste = une étiquette, utilisable dans toute zone de
 * texte. Rythme de la maquette : une étiquette sur deux inclinée, en
 * alternant gauche / droite, légèrement chevauchées.
 * Alignement : à gauche par défaut, centré dans une section « Texte » centrée.
 */
.h25-etiquettes,
.wp-block-list:is(.is-style-etiquettes, .is-style-etiquettes-l) {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.8rem 0;
    padding: 1.6rem 1.6rem; /* place pour les étiquettes inclinées */
    list-style: none;

    > li {
        margin: 0 -0.4rem;
    }
    > li:nth-child(4n + 2) {
        rotate: -8deg;
    }
    > li:nth-child(4n) {
        rotate: 8deg;
    }
}
.wp-block-list:is(.is-style-etiquettes, .is-style-etiquettes-l) > li,
.h25-etiquette {
    display: inline-block;
    padding: 0.4em 0.8em 0.667em; /* 12 24 20px pour 30px (maquette), proportionnel */
    border: 1px solid var(--wp--preset--color--primaire);
    border-radius: var(--h25-radius);
    background: var(--h25-etiquette-bg);
    color: var(--h25-etiquette-fg);
    font-family: var(--h25-font-expressive);
    font-size: var(--h25-fs-mot);
    font-style: italic;
    font-weight: 300;
    line-height: 1;
    white-space: nowrap;
    /* une étiquette ne se coupe jamais — y compris dans l'éditeur, où WordPress
	   impose white-space: pre-wrap (style en ligne) au texte modifiable */
    width: max-content;
}
.wp-block-list.is-style-etiquettes-l > li,
.h25-etiquette--l {
    padding: 0.25em 0.5em 0.5em; /* 12 24 24px pour 48px */
    border-radius: var(--h25-radius-l);
    font-size: var(--h25-fs-mot-l);
    line-height: 1.125;
}
.h25-incline-g {
    rotate: -8deg;
}
.h25-incline-d {
    rotate: 8deg;
}

/* Astérisque-puce (mentions, labels) */
.h25-puce {
    display: flex;
    align-items: center;
    gap: 1rem;
    > svg {
        flex: none;
        width: 1.5rem;
        height: auto;
    }
}

/* Zones de texte ACF : les retours à la ligne saisis s'affichent (texte brut, sans <br>, cf. inc/typographie.php). */
.h25-lignes {
    white-space: pre-line;
}

/* ---------- Header (posé sur le hero, cf. maquette) ---------- */
.h25-skip {
    position: absolute;
    inset-block-start: -10rem;
    inset-inline-start: 1rem;
    z-index: 100;
    padding: 1rem 1.6rem;
    background: var(--wp--preset--color--blanc);
    color: var(--wp--preset--color--primaire);
    font-weight: 600;
    &:focus {
        inset-block-start: 1rem;
    }
}

/*
 * Header COLLANT : fixe en haut de l'écran. Transparent sur le hero (comme la
 * maquette), il prend un fond bleu et se resserre dès qu'on a défilé
 * (classe h25-header--defile posée par assets/js/main.js). Sur une page sans
 * hero (body.h25-sans-hero), il est plein d'emblée et le contenu démarre
 * sous lui.
 */
:root {
    --h25-header-h: 7.6rem; /* hauteur du header resserré (mobile) */
    @media (min-width: 64em) {
        --h25-header-h: 7.3rem;
    }
}
html {
    scroll-padding-top: calc(var(--h25-header-h) + 1.6rem);
} /* les ancres s'arrêtent sous le header */

.h25-header {
    position: fixed;
    inset: 0 0 auto;
    z-index: 50;
    /* sur fond bleu : mêmes couleurs qu'une section bleue */
    --h25-btn-bg: var(--wp--preset--color--secondaire);
    --h25-btn-bg-hover: color-mix(
        in srgb,
        var(--wp--preset--color--secondaire) 55%,
        var(--wp--preset--color--blanc)
    );
    --h25-btn-fg: var(--wp--preset--color--primaire);
    color: var(--wp--preset--color--secondaire);
    transition:
        background-color 0.3s var(--h25-ease),
        box-shadow 0.3s var(--h25-ease);
    .admin-bar & {
        inset-block-start: var(--wp-admin--admin-bar--height, 0);
    }
}
.h25-header--defile,
.h25-sans-hero .h25-header {
    background-color: var(--wp--preset--color--primaire);
    box-shadow: 0 0.4rem 2.4rem
        color-mix(in srgb, var(--wp--preset--color--primaire) 25%, transparent);
}
.h25-sans-hero main {
    padding-block-start: calc(var(--h25-header-h) + 2.4rem);
}
/* Hero sur fond clair (body.h25-hero-clair, cf. inc/navigation.php) : header transparent en couleurs « fond clair » */
.h25-hero-clair .h25-header:not(.h25-header--defile) {
    --h25-btn-bg: var(--wp--preset--color--primaire);
    --h25-btn-bg-hover: var(--wp--custom--couleur--primaire-fonce);
    --h25-btn-fg: var(--wp--preset--color--secondaire);
    color: var(--wp--preset--color--primaire);
}

.h25-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    padding-block: 2.4rem;
    transition: padding-block 0.3s var(--h25-ease);
    .h25-header--defile &,
    .h25-sans-hero & {
        padding-block: 1.4rem;
    }
}
/*
 * Marque du header : fenêtre (overflow clip) où se superposent l accroche et
 * le logo. État par défaut = accroche visible, logo en attente sous la
 * fenêtre. Header "défilé" (ou page sans accroche) = l accroche sort par le
 * haut, le logo entre par le bas. Animation 100 % CSS (transition) ;
 * désactivée sous prefers-reduced-motion (cf. reset).
 */
.h25-marque {
    display: grid;
    align-items: center;
    height: 2.8rem;
    overflow: clip;
    text-decoration: none;
    /*
	 * Largeur de la marque = celle de son contenu visible : la phrase en haut
	 * de page, le logo une fois défilé. Le menu (juste après) suit donc le
	 * logo, en glissant. La largeur de la phrase est mesurée par main.js
	 * (--h25-marque-accroche-l, en px) : une transition entre deux longueurs
	 * s'anime dans tous les navigateurs (pas besoin d'interpolate-size).
	 * Sans JS : largeur naturelle, le menu se cale sans animation.
	 */
    > * {
        grid-area: 1 / 1;
        transition:
            translate 0.6s var(--h25-ease),
            opacity 0.6s var(--h25-ease),
            width 0.6s var(--h25-ease);
    }
}
.h25-marque__accroche {
    width: var(--h25-marque-accroche-l, auto);
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: var(--h25-fs-texte);
    font-weight: 500;
    white-space: nowrap;
    > svg {
        flex: none;
        width: 2.4rem;
        height: auto;
    }
    em {
        font-style: italic;
        font-weight: 700;
        text-decoration: underline;
        text-decoration-thickness: from-font;
        text-underline-offset: 0.15em;
    }
}
.h25-marque {
    /* taille du petit logo : hauteur fixée, largeur = hauteur × proportions du SVG (viewBox 1430 × 296.904) */
    --h25-marque-logo-h: 2.6rem;
    --h25-marque-logo-l: calc(var(--h25-marque-logo-h) * 1430 / 296.904);
}
.h25-marque__logo {
    line-height: 0;
    translate: 0 110%;
    opacity: 0;
    > svg {
        width: auto;
        height: var(--h25-marque-logo-h);
    }
}
/* Défilé, ou page sans accroche (le logo est alors seul) : le logo prend la place */
/* la phrase se resserre jusqu'à la largeur du logo : le menu glisse pendant toute la transition */
.h25-header--defile .h25-marque__accroche {
    translate: 0 -110%;
    opacity: 0;
    width: var(--h25-marque-logo-l);
}
.h25-header--defile .h25-marque__logo,
.h25-marque:not(:has(.h25-marque__accroche)) .h25-marque__logo {
    translate: 0 0;
    opacity: 1;
}
.h25-header__actions {
    display: flex;
    align-items: center;
    gap: 2rem;
}

/*
 * Menu mobile SANS JavaScript : attribut HTML "popover" + bouton
 * popovertarget. Fermeture au clic extérieur et à Échap gérée par le
 * navigateur. Au-delà de 64em, le popover est neutralisé et le menu
 * s'affiche en ligne.
 */
.h25-burger {
    display: grid;
    place-items: center;
    width: 4.8rem;
    height: 2.8rem;
    padding: 0;
    border: 1px solid currentColor;
    border-radius: 3rem;
    background: none;
    color: inherit;
    cursor: pointer;
    > svg {
        width: 1.6rem;
        height: auto;
    }
}
.h25-nav a {
    text-decoration: none;
    &:hover {
        text-decoration: underline;
    }
}
.h25-header__rdv {
    display: none;
}

/*
 * Menu mobile (maquette « ALM-Impact-Menu-Mobile ») : écran plein bleu foncé.
 * En-tête calé comme celui du site (le burger devient la croix, au même
 * endroit), grands liens, bouton rendez-vous pleine largeur, coordonnées.
 * Le popover passe dans la « top layer » du navigateur : au-dessus de tout,
 * sans z-index. La page derrière ne défile pas tant qu'il est ouvert.
 */
@media (max-width: 63.99em) {
    .h25-marque__accroche {
        font-size: 1.6rem;
    }

    .h25-nav {
        /* mêmes couleurs qu'une section bleue (boutons roses, texte rose) */
        --h25-btn-bg: var(--wp--preset--color--secondaire);
        --h25-btn-bg-hover: color-mix(
            in srgb,
            var(--wp--preset--color--secondaire) 55%,
            var(--wp--preset--color--blanc)
        );
        --h25-btn-fg: var(--wp--preset--color--primaire);
        position: fixed;
        inset: 0;
        width: 100%;
        max-width: none;
        height: 100dvh;
        max-height: none;
        margin: 0;
        padding: 0 var(--h25-gutter) 4rem;
        border: 0;
        overflow-y: auto;
        overscroll-behavior: contain;
        background: var(--wp--custom--couleur--primaire-fonce);
        color: var(--wp--preset--color--secondaire);

        &:popover-open {
            display: flex;
            flex-direction: column;
        }

        /* ouverture / fermeture : fondu + léger glissé (désactivé si mouvement réduit, cf. reset) */
        transition:
            opacity 0.3s var(--h25-ease),
            translate 0.3s var(--h25-ease),
            display 0.3s allow-discrete,
            overlay 0.3s allow-discrete;
        &:not(:popover-open) {
            opacity: 0;
            translate: 0 -1.6rem;
        }
        @starting-style {
            &:popover-open {
                opacity: 0;
                translate: 0 -1.6rem;
            }
        }
    }
    html:has(.h25-nav:popover-open) {
        overflow: hidden;
    }

    .h25-nav__entete {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding-block: 2.4rem; /* = header du site en haut de page : la croix prend la place du burger */
        .h25-burger > svg {
            width: 1.025rem;
        } /* croix de la maquette (10px dans la pilule) */
    }
    .h25-nav__logo {
        line-height: 0;
        > svg {
            width: auto;
            height: 3rem;
        }
    }
    .h25-nav__liste {
        display: grid;
        gap: 3.2rem;
        margin-block-start: 4.8rem; /* + 2,4rem sous le logo = 72px (maquette) */
        a {
            font-size: 4rem;
            font-weight: 300;
            line-height: 1.25;
        }
    }
    .h25-nav__plus {
        display: grid;
        gap: 6.4rem;
        margin-block-start: 6.4rem;
    }
    .h25-nav__rdv {
        width: 100%;
    }
    .h25-nav__coordonnees {
        display: grid;
        gap: 2rem;
    }
}

/* Adresse, téléphone, LinkedIn (parts/coordonnees.php) : section Contact + menu mobile */
.h25-coordonnees__adresse {
    display: grid;
    font-size: var(--h25-fs-petit);
    font-style: normal;
    line-height: 1.43;
    a {
        display: inline-flex;
        align-items: center;
        gap: 0.6rem;
        text-decoration: none;
        &:hover {
            text-decoration: underline;
        }
    }
    svg {
        width: 1.2rem;
        height: auto;
    }
}
.h25-coordonnees__reseaux {
    gap: 0.6rem;
}

@media (min-width: 64em) {
    .h25-burger {
        display: none;
    }
    .h25-header__rdv {
        display: inline-flex;
    }
    /* maquette : menu 72px après l'accroche (ou après le logo une fois défilé), bouton calé à droite */
    .h25-header__inner {
        justify-content: flex-start;
        gap: 0;
    }
    .h25-nav {
        margin-inline-start: 7.2rem;
    }
    .h25-header__actions {
        margin-inline-start: auto;
    }
    /* le popover est neutralisé : menu en ligne, sans l'en-tête ni le bas du menu mobile */
    .h25-nav {
        display: block;
        position: static;
        margin-block: 0; /* annule le « margin: auto » du popover… */
        margin-inline-end: 0; /* …sans toucher aux 72px après l'accroche (ci-dessus) */
        padding: 0;
        border: 0;
        background: none;
        color: inherit;
        ul {
            display: flex;
            gap: 3.2rem;
        }
        a {
            font-size: var(--h25-fs-petit);
            font-weight: 400;
        }
    }
    .h25-nav__entete,
    .h25-nav__plus {
        display: none;
    }
}

/* ---------- Footer (suite du fond mauve de la section Contact) ---------- */
.h25-footer {
    padding-block: 0 4.1rem;
    background: var(--wp--preset--color--secondaire);
    color: var(--wp--preset--color--primaire);
    font-size: var(--h25-fs-mini);

    a {
        text-decoration: none;
        &:hover {
            text-decoration: underline;
        }
    }
}
.h25-footer__logo {
    display: block;
    margin-block-end: -1.5rem; /* la ligne du bas remonte à hauteur du jambage du « p » (maquette) */
    > svg {
        width: 100%;
        height: auto;
    }
}
.h25-footer__bas {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    text-align: center;

    ul {
        display: flex;
        flex-direction: column;
        gap: 1.6rem;
        padding: 0;
        list-style: none;
    }
    .h25-lien-bouton {
        text-decoration: none;
        &:hover {
            text-decoration: underline;
        }
    }
}
.h25-footer__credit {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    a {
        font-weight: 600;
        text-decoration: underline;
    }
    svg {
        width: 1.2rem;
        height: auto;
    }
}
@media (min-width: 48em) {
    .h25-footer__bas {
        flex-direction: row;
        justify-content: space-between;
        text-align: start;
        ul {
            flex-direction: row;
            gap: 2.4rem;
        }
    }
    .h25-footer__gauche {
        display: flex;
        gap: 2.4rem;
        align-items: center;
    }
}

/* ---------- Fenêtres légales (cf. inc/legal.php) ---------- */
.h25-dialog {
    width: min(100% - 2 * var(--h25-gutter), 80rem);
    max-height: min(90dvh, 100% - 2 * var(--h25-gutter));
    padding: 0;
    border: 0;
    border-radius: var(--h25-radius);
    background: var(--wp--preset--color--blanc);
    color: var(--wp--preset--color--primaire);

    &::backdrop {
        background: color-mix(
            in srgb,
            var(--wp--preset--color--primaire) 60%,
            transparent
        );
    }
}
.h25-dialog__panneau {
    position: relative;
    padding: clamp(2.4rem, 5vw, 4.8rem);
}
.h25-dialog__titre {
    margin-block-end: 2.4rem;
    padding-inline-end: 4rem;
    font-size: var(--h25-fs-h3);
}
.h25-dialog__fermer {
    position: absolute;
    inset: 1.6rem 1.6rem auto auto;

    button {
        display: grid;
        place-items: center;
        width: 4.4rem; /* cible tactile ≥ 44 px */
        height: 4.4rem;
        border: 1px solid currentColor;
        border-radius: 50%;
        background: none;
        font-size: 2.4rem;
        line-height: 1;
        cursor: pointer;
    }
}
/* Les sections d'une page légale perdent fonds et espacements dans la fenêtre */
.h25-dialog__contenu {
    font-size: var(--h25-fs-petit);

    .h25-section {
        padding: 0;
        background: none;
        color: inherit;
    }
    .h25-section + .h25-section {
        margin-block-start: 2.4rem;
    }
    .h25-container {
        width: auto;
    }
    .h25-texte__contenu {
        max-width: none;
    }
    h2 {
        font-size: var(--h25-fs-h4);
    }
}

/* ---------- Défilement infini (« marquee », cf. main.js) ----------
 * Le JS pose data-h25-defilement-actif + la largeur d'un passage
 * (--h25-defilement-decalage) et la durée (--h25-defilement-duree, vitesse
 * constante). Pas de pause : défilement continu (arrêté seulement par
 * « réduire les animations »).
 */
@media (prefers-reduced-motion: no-preference) {
    [data-h25-defilement-actif] {
        animation: h25-defilement var(--h25-defilement-duree, 30s) linear
            infinite;
    }
}
@keyframes h25-defilement {
    to {
        transform: translateX(calc(-1 * var(--h25-defilement-decalage, 50%)));
    }
}

/* ---------- Apparition au scroll (passe animation : à affiner) ---------- */
@supports (animation-timeline: view()) {
    @media (prefers-reduced-motion: no-preference) {
        /* pas dans l'éditeur (body.editor-styles-wrapper) : le client doit tout voir */
        body:not(.editor-styles-wrapper) .h25-reveal {
            animation: h25-reveal linear both;
            animation-timeline: view();
            animation-range: entry 0% entry 40%;
        }
    }
}
@keyframes h25-reveal {
    from {
        opacity: 0;
        translate: 0 3rem;
    }
    to {
        opacity: 1;
        translate: 0 0;
    }
}

/* ---------- Éditeur uniquement : aide visuelle au client ---------- */
.h25-placeholder {
    display: grid;
    place-items: center;
    min-height: 24rem;
    padding: 2rem;
    border: 2px dashed currentColor;
    border-radius: var(--h25-radius);
    opacity: 0.6;
    font-size: var(--h25-fs-petit);
    text-align: center;
}
