/*
 * Feuille commune du site GEMENU : polices, jetons de couleur des thèmes, mise en page générale, composants communs.
 * Aucune couleur écrite en dur ailleurs que dans les jeux de jetons ci-dessous (un thème de plus = un jeu de plus).
 * Le jeu sombre est écrit deux fois (selon l'appareil, et choix « Sombre ») faute de light-dark() sur les anciens
 * téléphones : les deux copies restent identiques (contrôlé par AppCssTest).
 * Couleurs tirées du nouveau logo (CLAUDE.md, section 4) ; mobile d'abord, puis tablette (768 px) et bureau (1024 px).
 */

@font-face {
    font-family: 'Montserrat';
    src: url("../fonts/montserrat-LaWOCQv.woff2") format('woff2');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Source Sans 3';
    src: url("../fonts/source-sans-3-u4wvMPu.woff2") format('woff2');
    font-weight: 200 900;
    font-style: normal;
    font-display: swap;
}

:root {
    --fond: #ffffff;
    --fond-alterne: #eef4fb;
    --creme: #fdf3e4;
    --bordure: #dce4ee;
    --texte: #14233a;
    --texte-doux: #4a5a70;
    --titre: #0a4486;
    --bleu: #0a4486;
    --bleu-survol: #072f5e;
    --vert: #237a12;
    --feuille: #aad200;
    --feuille-texte: #0b2a12;
    --brun: #8a3f08;
    --sur-couleur: #ffffff;
    --entete: #ffffff;
    --barre-contact: #072f5e;
    --barre-contact-texte: #c9d6e8;
    --bandeau-fond: #072f5e;
    --bandeau-texte: #ffffff;
    --bandeau-surtitre: #c8e86a;
    --voile: rgba(4, 24, 50, 0.58);
    --pied: #051f3f;
    --pied-texte: #ffffff;
    --pied-doux: #c9d6e8;
    --pied-filet: rgba(255, 255, 255, 0.16);
    --focus: #aad200;
    --succes: #237a12;
    --alerte: #8a5a00;
    --erreur: #b3261e;
    --information: #0a4486;
    --carte: #ffffff;
    --champ-fond: #ffffff;
    --bouton-fond: #0a4486;
    --bouton-texte: #ffffff;
    --erreur-fond: #fdecea;
    --succes-fond: #e8f3e4;
    /* Barre de l'administration (depitsho/admin-bundle) : renvois vers les jetons du site, valables dans les deux thèmes. */
    --barre-admin-fond: var(--barre-contact);
    --barre-admin-texte: var(--barre-contact-texte);
    --barre-admin-actif: var(--bandeau-texte);
    --barre-admin-repere: var(--feuille);
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    body:not([data-theme="light"]) {
        --fond: #0b1626;
        --fond-alterne: #0f1c30;
        --creme: #13294a;
        --bordure: #243652;
        --texte: #e9eef5;
        --texte-doux: #a9b6c8;
        --titre: #f0f5fa;
        --bleu: #8db8f0;
        --bleu-survol: #b5cfee;
        --vert: #9bd45a;
        --feuille: #aad200;
        --feuille-texte: #0b2a12;
        --brun: #a9541a;
        --sur-couleur: #ffffff;
        --entete: #0f1c30;
        --barre-contact: #081a30;
        --barre-contact-texte: #a9b6c8;
        --bandeau-fond: #081a30;
        --bandeau-texte: #ffffff;
        --bandeau-surtitre: #c8e86a;
        --voile: rgba(2, 10, 22, 0.66);
        --pied: #050c16;
        --pied-texte: #e9eef5;
        --pied-doux: #a9b6c8;
        --pied-filet: rgba(255, 255, 255, 0.12);
        --focus: #aad200;
        --succes: #9bd45a;
        --alerte: #e8b04a;
        --erreur: #f2938c;
        --information: #8db8f0;
        --carte: #0f1c30;
        --champ-fond: #0b1626;
        --bouton-fond: #8db8f0;
        --bouton-texte: #0b1626;
        --erreur-fond: #3a1714;
        --succes-fond: #16290f;
        color-scheme: dark;
    }
}

body[data-theme="dark"] {
    --fond: #0b1626;
    --fond-alterne: #0f1c30;
    --creme: #13294a;
    --bordure: #243652;
    --texte: #e9eef5;
    --texte-doux: #a9b6c8;
    --titre: #f0f5fa;
    --bleu: #8db8f0;
    --bleu-survol: #b5cfee;
    --vert: #9bd45a;
    --feuille: #aad200;
    --feuille-texte: #0b2a12;
    --brun: #a9541a;
    --sur-couleur: #ffffff;
    --entete: #0f1c30;
    --barre-contact: #081a30;
    --barre-contact-texte: #a9b6c8;
    --bandeau-fond: #081a30;
    --bandeau-texte: #ffffff;
    --bandeau-surtitre: #c8e86a;
    --voile: rgba(2, 10, 22, 0.66);
    --pied: #050c16;
    --pied-texte: #e9eef5;
    --pied-doux: #a9b6c8;
    --pied-filet: rgba(255, 255, 255, 0.12);
    --focus: #aad200;
    --succes: #9bd45a;
    --alerte: #e8b04a;
    --erreur: #f2938c;
    --information: #8db8f0;
    --carte: #0f1c30;
    --champ-fond: #0b1626;
    --bouton-fond: #8db8f0;
    --bouton-texte: #0b1626;
    --erreur-fond: #3a1714;
    --succes-fond: #16290f;
    color-scheme: dark;
}

/* ---------- Base ---------- */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--fond);
    color: var(--texte);
    font-family: 'Source Sans 3', system-ui, -apple-system, 'Segoe UI', sans-serif;
    font-size: 1.125rem;
    line-height: 1.6;
}

h1,
h2,
h3,
.bandeau__titre {
    margin: 0;
    font-family: 'Montserrat', system-ui, sans-serif;
    font-weight: 800;
    line-height: 1.15;
    color: var(--titre);
    overflow-wrap: anywhere;
}

h1,
.bandeau__titre {
    font-size: 2.125rem;
}

h2 {
    font-size: 1.625rem;
}

p {
    margin: 0;
}

img {
    max-width: 100%;
    height: auto;
}

a {
    color: var(--bleu);
}

a:hover {
    color: var(--bleu-survol);
}

:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 2px;
}

.cadre {
    width: 100%;
    max-width: 1200px;
    margin-inline: auto;
    padding-inline: 20px;
}

/* Élément masqué (attribut hidden) : jamais réaffiché par la règle display d'une classe (.bouton, .barre-actions…). */
[hidden] {
    display: none !important;
}

.visuellement-cache {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

/* Lien d'évitement : hors de l'écran, visible dès qu'il reçoit le focus au clavier. */
.evitement {
    position: absolute;
    left: 8px;
    top: -100px;
    z-index: 10;
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 16px;
    border-radius: 8px;
    background: var(--feuille);
    color: var(--feuille-texte);
    font-weight: 700;
}

.evitement:focus {
    top: 8px;
}

/* ---------- Boutons et surtitres ---------- */

.bouton {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    padding: 0 28px;
    border: 2px solid transparent;
    border-radius: 999px;
    font-family: 'Montserrat', system-ui, sans-serif;
    font-weight: 700;
    font-size: 1rem;
    text-decoration: none;
    cursor: pointer;
}

.bouton--feuille {
    background: var(--feuille);
    color: var(--feuille-texte);
}

.bouton--feuille:hover {
    color: var(--feuille-texte);
    filter: brightness(1.06);
}

.surtitre {
    font-family: 'Montserrat', system-ui, sans-serif;
    font-weight: 700;
    font-size: 0.8125rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--vert);
}

/* ---------- Barre de contact (bureau seulement) ---------- */

.barre-contact {
    display: none;
    background: var(--barre-contact);
    color: var(--barre-contact-texte);
    font-size: 0.875rem;
}

.barre-contact__cadre {
    display: flex;
    align-items: center;
    gap: 24px;
}

.barre-contact a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    color: var(--barre-contact-texte);
    text-decoration: none;
}

.barre-contact a:hover {
    color: var(--sur-couleur);
    text-decoration: underline;
}

.barre-contact__villes {
    margin-left: auto;
}

/* ---------- En-tête ---------- */

.entete {
    position: sticky;
    top: 0;
    z-index: 5;
    background: var(--entete);
    border-bottom: 1px solid var(--bordure);
}

.entete__cadre {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 72px;
    padding-block: 8px;
}

.marque {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    text-decoration: none;
    min-width: 0;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.logo__embleme {
    width: 44px;
    height: 44px;
    object-fit: contain;
    flex: none;
}

.logo__embleme--sombre {
    display: none;
}

.logo--fond-sombre .logo__embleme--sombre {
    display: block;
}

@media (prefers-color-scheme: dark) {
    body:not([data-theme="light"]) .logo__embleme--clair {
        display: none;
    }

    body:not([data-theme="light"]) .logo__embleme--sombre {
        display: block;
    }
}

body[data-theme="dark"] .logo__embleme--clair {
    display: none;
}

body[data-theme="dark"] .logo__embleme--sombre {
    display: block;
}

.logo__texte {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.logo__nom {
    font-family: 'Montserrat', system-ui, sans-serif;
    font-weight: 800;
    font-size: 1.375rem;
    line-height: 1;
    letter-spacing: 0.02em;
    color: var(--titre);
}

.logo__sousnom {
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--vert);
}

/* Téléphone : le nom seul dans l'en-tête, le sous-titre reste au pied de page. */
@media (max-width: 599px) {
    .entete .logo__sousnom {
        display: none;
    }

    /* Le nom, la marque d'environnement, le menu, les langues et les thèmes ne tiennent pas sur 390 px : le menu et les
       outils passent sur une seconde ligne (rien n'est écrasé) et l'en-tête ne reste plus collé en haut, pour laisser
       l'écran au contenu. */
    .entete {
        position: static;
    }

    .entete__cadre {
        flex-wrap: wrap;
        row-gap: 0;
    }

    .marque,
    .environnement {
        flex-shrink: 0;
        white-space: nowrap;
    }

    .entete__droite {
        flex-basis: 100%;
    }
}

.logo--fond-sombre .logo__nom {
    color: var(--pied-texte);
}

.logo--fond-sombre .logo__sousnom {
    color: var(--pied-doux);
}

.environnement {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: 999px;
    background: var(--brun);
    color: var(--sur-couleur);
    font-size: 0.8125rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.entete__droite {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.entete__outils {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

/* Menu du site public : entrées de 44 px, la page en cours soulignée. */
.navigation {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.navigation a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 10px;
    border-radius: 8px;
    font-family: 'Montserrat', system-ui, sans-serif;
    font-weight: 700;
    font-size: 0.9375rem;
    color: var(--titre);
    text-decoration: none;
}

.navigation a:hover,
.navigation a[aria-current="page"] {
    text-decoration: underline;
    text-decoration-color: var(--vert);
    text-decoration-thickness: 3px;
    text-underline-offset: 8px;
}

.langues {
    display: flex;
}

.langues a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    border-radius: 8px;
    font-family: 'Montserrat', system-ui, sans-serif;
    font-weight: 700;
    font-size: 0.875rem;
    color: var(--texte-doux);
    text-decoration: none;
}

.langues a[aria-current="true"] {
    color: var(--titre);
    text-decoration: underline;
    text-underline-offset: 4px;
}

.themes {
    display: flex;
    gap: 2px;
    padding: 2px;
    border: 1px solid var(--bordure);
    border-radius: 999px;
}

.themes button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--texte-doux);
    cursor: pointer;
}

.themes button[aria-pressed="true"] {
    background: var(--fond-alterne);
    color: var(--titre);
}

.themes svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
}

.themes .icone-pleine {
    fill: currentColor;
    stroke: none;
}

/* ---------- Bandeau d'accueil ---------- */

/* Bandeau : une diapositive visible à la fois (les autres « hidden », carrousel_controller.js). */
.bandeau {
    position: relative;
    overflow: hidden;
    background: var(--bandeau-fond);
    color: var(--bandeau-texte);
}

.bandeau__diapositive {
    position: relative;
    display: flex;
    align-items: flex-end;
    min-height: 580px;
}

.bandeau__diapositive[hidden] {
    display: none;
}

.bandeau:has(.bandeau__commandes) .bandeau__texte {
    padding-bottom: 88px;
}

.bandeau__commandes {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.bandeau__bouton,
.bandeau__point {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    border: 2px solid var(--bandeau-texte);
    border-radius: 999px;
    background: var(--voile);
    color: var(--bandeau-texte);
    font: inherit;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
}

.bandeau__points {
    display: flex;
    gap: 4px;
}

/* Point : cible de 44 px, pastille visible au centre. */
.bandeau__point {
    border-color: transparent;
    background: transparent;
}

.bandeau__point::before {
    content: '';
    width: 12px;
    height: 12px;
    border: 2px solid var(--bandeau-texte);
    border-radius: 50%;
}

.bandeau__point[aria-current="true"]::before {
    background: var(--feuille);
    border-color: var(--feuille);
}

.bandeau__photo {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bandeau__voile {
    position: absolute;
    inset: 0;
    background: var(--voile);
}

.bandeau__texte {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 18px;
    padding-block: 56px;
}

.bandeau h1,
.bandeau__titre {
    max-width: 760px;
    color: var(--bandeau-texte);
}

.surtitre--bandeau {
    color: var(--bandeau-surtitre);
}

.bandeau__phrase {
    max-width: 640px;
    font-size: 1.1875rem;
}

/* ---------- Sections ---------- */

.section {
    padding-block: 56px;
}

.section--creme {
    background: var(--creme);
}

.section__cadre {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.section__intro {
    max-width: 760px;
    color: var(--texte-doux);
}

/* ---------- Pied de page ---------- */

.pied {
    background: var(--pied);
    color: var(--pied-doux);
    font-size: 1rem;
}

.pied__cadre {
    display: grid;
    gap: 32px;
    padding-block: 48px 24px;
}

.pied__marque {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 420px;
}

/* Devise de l'association (reprise de l'ancien site). */
.pied__devise {
    font-family: 'Montserrat', system-ui, sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--feuille);
}

.pied__bloc {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.pied h2 {
    margin-bottom: 6px;
    font-size: 1rem;
    color: var(--pied-texte);
}

.pied a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    color: var(--pied-texte);
}

.pied a:hover {
    color: var(--pied-doux);
}

.pied__bas {
    padding-top: 20px;
    border-top: 1px solid var(--pied-filet);
    font-size: 0.875rem;
}

/* ---------- Tablette ---------- */

@media (min-width: 768px) {
    .cadre {
        padding-inline: 32px;
    }

    h1,
    .bandeau__titre {
        font-size: 2.875rem;
    }

    h2 {
        font-size: 2rem;
    }

    .logo__embleme {
        width: 56px;
        height: 56px;
    }

    .logo__nom {
        font-size: 1.625rem;
    }

    .pied__cadre {
        grid-template-columns: 2fr 1fr 1fr;
    }

    .pied__bas {
        grid-column: 1 / -1;
    }
}

/* ---------- Bureau ---------- */

@media (min-width: 1024px) {
    .cadre {
        padding-inline: 40px;
    }

    h1,
    .bandeau__titre {
        font-size: 3.625rem;
    }

    h2 {
        font-size: 2.25rem;
    }

    .barre-contact {
        display: block;
    }

    /* La diapositive porte la photo : c'est elle qui grandit (sinon une bande vide sous la photo). */
    .bandeau__diapositive {
        min-height: 640px;
        align-items: center;
    }

    .bandeau__texte {
        padding-block: 96px;
    }

    .section {
        padding-block: 96px;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
        animation: none !important;
    }
}
