/*
 * Socle commun du site, du back-office et de la vitrine (chargé avant style.css / admin.css par partials/_head) :
 * ce qui est identique partout, défini une seule fois (polices locales, quelques utilitaires).
 * Polices : cache d'un an (immutable) ; remplacer un fichier .woff2 impose d'augmenter son « ?v= » ici (et dans le
 * préchargement de partials/_head pour Inter et Sora), sinon les visiteurs garderaient l'ancienne pendant un an.
 * Pour y déplacer un composant encore dupliqué dans style.css et admin.css : il doit être identique des deux côtés et
 * aucune règle de même spécificité placée avant lui ne doit le concerner (sinon l'ordre de cascade changerait) ;
 * vérifier visuellement les deux espaces après le déplacement.
 */

@font-face { font-family: "Inter"; src: url("../fonts/inter-latin.woff2?v=1") format("woff2"); font-weight: 100 900; font-display: swap; }

@font-face { font-family: "Sora"; src: url("../fonts/sora-latin.woff2?v=1") format("woff2"); font-weight: 500 700; font-display: swap; }

@font-face { font-family: "Atkinson Hyperlegible"; src: url("../fonts/atkinson-hyperlegible-latin-400-normal.woff2?v=1") format("woff2"); font-weight: 400; font-display: swap; }

@font-face { font-family: "Atkinson Hyperlegible"; src: url("../fonts/atkinson-hyperlegible-latin-700-normal.woff2?v=1") format("woff2"); font-weight: 700; font-display: swap; }

@font-face { font-family: "OpenDyslexic"; src: url("../fonts/opendyslexic-latin-400-normal.woff2?v=1") format("woff2"); font-weight: 400; font-display: swap; }

@font-face { font-family: "OpenDyslexic"; src: url("../fonts/opendyslexic-latin-700-normal.woff2?v=1") format("woff2"); font-weight: 700; font-display: swap; }

.eyebrow {
    display: inline-flex; align-items: center; gap: var(--space-2);
    color: var(--c-secondary-ink); font-family: var(--font-mono); font-size: var(--fs-xs);
    font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase;
}

.htmx-indicator { display: none; }

.steps { display: grid; gap: var(--space-3); padding-left: var(--space-5); }

/* Logo envoyé par l'équipe (Apparence du site › Identité) : même hauteur que le logo d'origine, proportions gardées */
/* Logo rectangulaire intégrant le nom du site (App\Core\Brand::logo) : seul élément de marque des en-têtes.
   Hauteur fixe, largeur selon ses proportions, jamais plus large que sa place. */
.brand-mark { display: block; flex: 0 1 auto; min-width: 0; width: auto; height: 2.5rem; max-width: 100%; overflow: visible; }
img.brand-mark--image { max-width: min(14rem, 100%); object-fit: contain; object-position: left center; }
.brand-mark__disc { fill: var(--c-primary); }
.brand-mark__leaf path { fill: var(--c-on-primary); stroke: var(--c-on-primary); }
.brand-mark__leaf path:first-child { fill: none; }
.brand-mark__name {
    fill: var(--c-primary-ink); font-family: var(--font-display, "Sora", sans-serif); font-size: 21px; font-weight: 700;
}
@media (max-width: 599px) { .brand-mark { height: 2.1rem; } }

/* Région et pays d'un lieu, sous le lieu d'un événement (« Vaud, Suisse ») */
.place-area { display: block; color: var(--c-ink-soft); font-size: var(--fs-s); }

/* Aperçu de l'identité dans le back-office */
.brand-preview { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); }
.brand-preview__logo { height: 3rem; width: auto; max-width: 12rem; object-fit: contain; }
.brand-preview__favicon { width: 2rem; height: 2rem; object-fit: contain; }

/* ==========================================================================
   SOCLE COMMUN SITE / BACK-OFFICE (déplacé de style.css et admin.css, à l'identique et dans le même ordre :
   outils de revue, contrôle du style calculé de chaque page avant/après). Une règle propre à un espace reste dans sa feuille.
   ========================================================================== */
:root {
    --brand-primary: #f7811e;             /* orange pêche */
    --brand-secondary: #1aa3dc;           /* cyan */
    --brand-bg-light: #eef2f7;
    --brand-bg-dark: #0a1120;
    --brand-on-primary: #0e1020;          /* texte sur la couleur primaire (contraste calculé) */
    --brand-on-secondary: #0e1020;
    --brand-primary-ink-light: #a45614;   /* primaire utilisée en texte, ajustée ≥ 4.5:1 */
    --brand-primary-ink-dark: #f7811e;
    --brand-secondary-ink-light: #13749d;
    --brand-secondary-ink-dark: #1aa3dc;

    /* Jetons communs à tous les espaces (seul --c-shadow-ink est repris dans style.css, à la même valeur) */
    --c-shadow-ink: 0 0 0;                                                   /* teinte des ombres portées */
    --shadow-pop: 0 18px 40px -20px rgb(var(--c-shadow-ink) / 0.38);         /* menus, listes déroulantes, messages */
    --shadow-modal: 0 24px 64px -24px rgb(var(--c-shadow-ink) / 0.5);        /* fenêtres, guide */
    --shadow-hover: 0 10px 24px rgb(var(--c-shadow-ink) / 0.12);             /* tuile survolée */
    --fs-page-title: clamp(1.5rem, 1.2rem + 1.1vw, 2rem);                     /* titre (h1) de chaque page, tous espaces */
    --icon-s: 1rem; --icon-m: 1.25rem; --icon-l: 1.5rem;                     /* icônes posées seules */
    --control-s: 2rem; --control-m: 2.5rem;                                  /* petits boutons ronds (≥ 24 px) */
    /* Superpositions, de bas en haut */
    --z-sticky: 5; --z-nav: 20; --z-topbar: 30; --z-bottombar: 40; --z-drawer: 40; --z-float: 45;
    --z-menu: 50; --z-toast: 60; --z-skip: 100; --z-progress: 110; --z-guide: 1000;
}
:root[data-text-size="115"] { font-size: 115%; }
:root[data-text-size="130"] { font-size: 130%; }
:root[data-text-size="150"] { font-size: 150%; }
:root[data-spacing="wide"] { --lh: 1.9; letter-spacing: 0.12em; word-spacing: 0.16em; }
:root[data-font="lisible"] { --font-body: "Atkinson Hyperlegible", system-ui, sans-serif; --font-display: "Atkinson Hyperlegible", system-ui, sans-serif; }
:root[data-font="dyslexie"] { --font-body: "OpenDyslexic", "Atkinson Hyperlegible", sans-serif; --font-display: "OpenDyslexic", sans-serif; --lh: 1.75; }
*, *::before, *::after { box-sizing: border-box; }
h1, h2, h3, h4 { margin: 0; font-family: var(--font-display); font-weight: 600; line-height: 1.25; letter-spacing: -0.01em; text-wrap: balance; }
ul, ol { margin: 0; padding: 0; }
img, svg { display: block; max-width: 100%; }
a { color: var(--c-secondary-ink); text-decoration-thickness: 0.08em; text-underline-offset: 0.2em; }
a:hover { text-decoration-thickness: 0.14em; }
button, input, textarea, select { font: inherit; color: inherit; }
input, textarea, select { max-width: 100%; }
select { text-overflow: ellipsis; }
pre { max-width: 100%; overflow-x: auto; white-space: pre-wrap; overflow-wrap: anywhere; }
:focus-visible { outline: 3px solid var(--c-focus); outline-offset: 2px; border-radius: var(--radius-s); }
[tabindex="-1"]:not(a, button, input, select, textarea, summary):focus { outline: none; }
.visually-hidden {
    position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0;
    overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}
.skip-link {
    position: absolute; top: var(--space-2); left: var(--space-2); z-index: var(--z-skip);
    padding: var(--space-3) var(--space-4); border: 2px solid var(--c-focus); border-radius: var(--radius-m);
    background: var(--c-surface); color: var(--c-ink); font-weight: 700; transform: translateY(-200%);
}
.skip-link:focus { transform: none; }
.js .nojs-only { display: none; }
.icon {
    width: 1.25em; height: 1.25em; max-width: none; flex-shrink: 0; /* taille explicite : jamais écrasée dans un bouton étroit */
    fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
}
.theme-switch__button + .theme-switch__button { border-left: 1px solid var(--c-line); border-radius: 0 var(--radius-pill) var(--radius-pill) 0; }
.theme-switch__button:first-of-type:not(:only-of-type) { border-radius: var(--radius-pill) 0 0 var(--radius-pill); }
.theme-switch__button:hover { background: var(--c-surface-2); }
.theme-switch__button .icon { color: var(--c-secondary-ink); }
.theme-switch__button[value="light"] .theme-switch__icon--dark,
.theme-switch__button[value="light"] .theme-switch__label--dark,
.theme-switch__button[value="dark"] .theme-switch__icon--light,
.theme-switch__button[value="dark"] .theme-switch__label--light { display: none; }
.theme-switch__button[value="light"] .theme-switch__icon--light { color: var(--c-primary-ink); }
.theme-switch__button--auto[aria-pressed="true"] { background: var(--c-primary-soft); box-shadow: inset 0 0 0 2px var(--c-primary); }
.theme-switch__button--auto[aria-pressed="true"] .icon { color: var(--c-primary-ink); }
.menu__toggle, .display-menu__toggle { list-style: none; cursor: pointer; }
.display-menu__toggle .icon { color: var(--c-secondary-ink); }
.choice-list--inline { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.choice-list--inline legend { grid-column: 1 / -1; }
.choice input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.choice label .icon { color: var(--c-secondary-ink); }
.choice input:hover + label { background: var(--c-surface-2); }
/* Choix coché : bordure ≥ 3:1 (--c-primary-ink) et coche en pastille dans le coin, repère qui ne dépend pas de la
   couleur seule (WCAG 1.4.1, 1.4.11) ; les interrupteurs (.choice__switch) portent déjà leur état */
.choice input:checked + label { border: 2px solid var(--c-primary-ink); background: var(--c-primary-soft); }
.choice input:checked + label:not(:has(.choice__switch))::after {
    content: "\2713" / ""; position: absolute; top: 0.2rem; right: 0.2rem; z-index: 1; display: grid; place-items: center;
    width: 1.1rem; height: 1.1rem; border-radius: 50%; background: var(--c-primary-ink); color: var(--c-surface);
    font-size: var(--fs-min); font-weight: 700; line-height: 1;
}
.choice input:focus-visible + label { outline: 3px solid var(--c-focus); outline-offset: 2px; }
.choice--font-lisible .choice__label { font-family: "Atkinson Hyperlegible", sans-serif; }
.choice--font-dyslexie .choice__label { font-family: "OpenDyslexic", sans-serif; font-size: var(--fs-s); }
.btn--primary:hover { background: color-mix(in srgb, var(--c-primary) 86%, var(--c-ink)); box-shadow: var(--glow-primary); }
.btn--quiet:hover { background: var(--c-surface-2); }
.btn[disabled], .btn.htmx-request { cursor: progress; opacity: 0.7; }
.btn .icon { width: 1.15em; height: 1.15em; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { display: inline; }
.form-card form { display: grid; gap: var(--space-4); }
.wizard:not(.wizard--active) .wizard__step + .wizard__step { padding-top: var(--space-4); border-top: 1px solid var(--c-line); }
.wizard__nav > .btn { flex: 1 1 0; justify-content: center; min-width: 0; }
select.field__input { appearance: auto; }

/* ---------- Composants alignés site / back-office (identiques des deux côtés ; seules les marges restent propres
   à chaque feuille). Déplacés sans règle antérieure de même spécificité sur les mêmes éléments ; styles calculés
   comparés avant/après sur les deux espaces. ---------- */

/* Actions d'un formulaire : action secondaire (Annuler, Retour) à gauche, action principale à droite ; seule, elle
   va à droite. Le balisage place donc toujours l'action principale en dernier. */
.form-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3); }
.form-actions:has(> :only-child) { justify-content: flex-end; }
.form-actions.form-actions--start { justify-content: flex-start; }
.form-actions.form-actions--center { justify-content: center; }

/* Assistant d'étapes (partials/_wizard) : Retour / Annuler puis Suivant, à parts égales */
.wizard__nav { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); }
.wizard__nav > .btn[hidden] { display: none; }

/* Message : information (bleu) par défaut ; succès, avertissement et erreur explicites (--ok, --warm, --error) */
.notice {
    display: flex; align-items: center; gap: var(--space-2);
    padding: var(--space-3) var(--space-4);
    border: 1px solid color-mix(in srgb, var(--c-secondary) 35%, transparent); border-radius: var(--radius-m);
    background: var(--c-secondary-soft); color: var(--c-ink); font-weight: 600;
}
.notice .icon { color: var(--c-secondary-ink); }
.notice--ok { border-color: color-mix(in srgb, var(--c-success) 35%, transparent); background: var(--c-success-soft); }
.notice--ok .icon { color: var(--c-success); }
.notice--warm { border-color: color-mix(in srgb, var(--c-warn) 45%, transparent); background: var(--c-warn-soft); color: var(--c-ink); }
.notice--warm .icon { color: var(--c-warn); }
/* Lien sur fond chaud : la couleur de lien ordinaire n'y atteignait que 4,49:1 (sous le seuil AA de 4,5) */
.notice--warm a { color: var(--c-ink); }
/* Échec (flash « error », role=alert) : même gabarit, teinte d'erreur, bord marqué */
.notice--error { border-color: color-mix(in srgb, var(--c-error) 45%, transparent); border-inline-start: 4px solid var(--c-error); background: var(--c-error-soft); color: var(--c-ink); }
.notice--error .icon { color: var(--c-error); }
.notice--error a { color: var(--c-ink); }

/* États vides : une icône en pastille, une phrase claire et, si possible, l'action qui permet d'avancer */
.empty-state {
    display: grid; justify-items: center; align-items: center; gap: var(--space-3);
    padding: var(--space-6) var(--space-5);
    border: 1px dashed var(--c-line-strong); border-radius: var(--radius-l);
    background: color-mix(in srgb, var(--c-surface) 70%, transparent); box-shadow: var(--shadow-card);
    color: var(--c-ink-soft); text-align: center;
}
.empty-state[hidden] { display: none; }
.empty-state .icon { color: var(--c-secondary-ink); }
.empty-state > .icon:first-child {
    width: 3.25rem; height: 3.25rem; padding: 0.8rem; border-radius: 50%;
    background: linear-gradient(135deg, var(--c-primary-soft), var(--c-secondary-soft)); color: var(--c-primary-ink);
}
.empty-state > a:not(.btn) { font-weight: 600; }
.empty-state__title { color: var(--c-ink); font-size: var(--fs-l); font-weight: 700; }
.empty-state__badge { display: grid; place-items: center; width: 3.5rem; height: 3.5rem; border-radius: 50%; background: var(--c-secondary-soft); color: var(--c-secondary-ink); }
.empty-state__text { max-width: 46ch; color: var(--c-ink-soft); }

/* Barre de progression d'un changement de page sans rechargement (app.js, 12-actualisation) : décorative, en haut */
.nav-progress {
    position: fixed; inset: 0 0 auto 0; z-index: var(--z-progress); height: 3px; pointer-events: none;
    background: var(--c-primary); opacity: 0; transform: scaleX(0); transform-origin: left center;
    transition: opacity var(--dur, 200ms) ease;
}
.nav-progress.is-active { opacity: 1; animation: nav-progress 10s cubic-bezier(0.1, 0.7, 0.2, 1) forwards; }
@keyframes nav-progress { from { transform: scaleX(0.08); } to { transform: scaleX(0.92); } }
/* Animations réduites (compte ou système) : barre pleine et fixe, aucun mouvement */
:root[data-motion="reduce"] .nav-progress.is-active { transform: none; }
@media (prefers-reduced-motion: reduce) { .nav-progress.is-active { animation: none; transform: none; } }
