/* ==========================================================================
   Forum Handicap Jura – feuille de styles principale
   Objectif : WCAG 2.2 AA (eCH-0059). Contrastes vérifiés pour chaque thème.
   ========================================================================== */

@font-face { font-family: "Atkinson Hyperlegible"; src: url("../fonts/atkinson-hyperlegible-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible"; src: url("../fonts/atkinson-hyperlegible-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible"; src: url("../fonts/atkinson-hyperlegible-700-normal.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "OpenDyslexic"; src: url("../fonts/opendyslexic-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "OpenDyslexic"; src: url("../fonts/opendyslexic-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }

/* ---------- Jetons de design : thème clair (par défaut) ---------- */
:root {
    --font: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    --font-system: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;

    --bg: #ffffff;
    --surface: #f4f7fb;
    --surface-2: #e8eef7;
    --card: #ffffff;
    --text: #15202e;            /* 16,1:1 sur blanc */
    --text-muted: #4a5668;      /* 7,4:1 sur blanc */
    --primary: #124c8f;         /* bleu du logo – 8,6:1 sur blanc */
    --primary-hover: #0c3768;
    --primary-soft: #e3edf9;
    --on-primary: #ffffff;
    --accent: #f5b800;          /* jaune de l'arc du logo – décoratif / fonds */
    --on-accent: #15202e;       /* texte sur jaune : 11:1 */
    --accent-ink: #7a5600;      /* jaune foncé lisible sur blanc : 6,3:1 */
    --border: #d3dbe6;
    --border-strong: #5f6e82;   /* bordures de champs : 5,1:1 (≥ 3:1 requis) */
    --link: #124c8f;
    --link-visited: #5b2a86;
    --success: #12672c;
    --success-bg: #e6f4ea;
    --danger: #b3261e;
    --on-danger: #ffffff;
    --danger-bg: #fdecea;
    --warning-bg: #fff6d6;
    --info-bg: #e3edf9;
    --hero-bg: #0f3f78;
    --hero-text: #ffffff;
    --focus: #ffd60a;
    --focus-ink: #0b0c0c;
    --shadow: 0 1px 2px rgba(16, 33, 56, .06), 0 6px 20px rgba(16, 33, 56, .08);
    --shadow-lg: 0 12px 36px rgba(16, 33, 56, .16);
    --radius: 16px;
    --radius-sm: 10px;
    --container: 1200px;
    /* Échelle d'espacement unique (tout le site) : petits écarts fixes, grands écarts qui suivent la largeur d'écran */
    --space-xs: .5rem;                        /* entre éléments très liés (icône et texte, lignes d'une liste) */
    --space-sm: 1rem;                         /* entre éléments d'un même bloc */
    --space-md: 1.5rem;                       /* entre blocs voisins, gouttière des grilles de cartes */
    --space-lg: clamp(2rem, 4vw, 3rem);       /* entre groupes de blocs dans une page */
    --space-xl: clamp(2.5rem, 5vw, 4.5rem);   /* entre les grandes sections */
    --leading: 1.6;
    --tracking: normal;
    --word-spacing: normal;
    --para-spacing: 1.1em;
    color-scheme: light;
}

/* ---------- Thème sombre : uniquement sur choix explicite (« Sombre », ou « Selon mon appareil » + appareil en mode sombre) ---------- */
@media (prefers-color-scheme: dark) {
    :root[data-theme="auto"] {
        --bg: #0e1520; --surface: #151f2c; --surface-2: #1d2a3a; --card: #172231;
        --text: #eef2f7; --text-muted: #b6c2d1;
        --primary: #8cbaf2; --primary-hover: #b0d0f7; --primary-soft: #1b2c42; --on-primary: #0b1726;
        --accent: #f5b800; --on-accent: #15202e; --accent-ink: #f5c842;
        --border: #2c3b4f; --border-strong: #8797ab;
        --link: #9cc4f5; --link-visited: #d0b0f0;
        --success: #7fd69a; --success-bg: #12301c; --danger: #ff9c94; --on-danger: #1a0706; --danger-bg: #3a1513;
        --warning-bg: #3a3010; --info-bg: #1b2c42;
        --hero-bg: #0a2546; --hero-text: #ffffff;
        --shadow: 0 1px 2px rgba(0,0,0,.4), 0 6px 20px rgba(0,0,0,.35); --shadow-lg: 0 12px 36px rgba(0,0,0,.5);
        color-scheme: dark;
    }
}
:root[data-theme="dark"] {
    --bg: #0e1520; --surface: #151f2c; --surface-2: #1d2a3a; --card: #172231;
    --text: #eef2f7; --text-muted: #b6c2d1;
    --primary: #8cbaf2; --primary-hover: #b0d0f7; --primary-soft: #1b2c42; --on-primary: #0b1726;
    --accent: #f5b800; --on-accent: #15202e; --accent-ink: #f5c842;
    --border: #2c3b4f; --border-strong: #8797ab;
    --link: #9cc4f5; --link-visited: #d0b0f0;
    --success: #7fd69a; --success-bg: #12301c; --danger: #ff9c94; --on-danger: #1a0706; --danger-bg: #3a1513;
    --warning-bg: #3a3010; --info-bg: #1b2c42;
    --hero-bg: #0a2546; --hero-text: #ffffff;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 6px 20px rgba(0,0,0,.35); --shadow-lg: 0 12px 36px rgba(0,0,0,.5);
    color-scheme: dark;
}

/* ---------- Contraste élevé : noir / blanc / jaune ---------- */
:root[data-theme="contrast"] {
    --bg: #000; --surface: #000; --surface-2: #000; --card: #000;
    --text: #fff; --text-muted: #fff;
    --primary: #ffe14d; --primary-hover: #fff; --primary-soft: #000; --on-primary: #000;
    --accent: #ffe14d; --on-accent: #000; --accent-ink: #ffe14d;
    --border: #fff; --border-strong: #fff;
    --link: #ffe14d; --link-visited: #8ff0ff;
    --success: #7dff9b; --success-bg: #000; --danger: #ff8a80; --on-danger: #000; --danger-bg: #000;
    --warning-bg: #000; --info-bg: #000;
    --hero-bg: #000; --hero-text: #fff;
    --focus: #8ff0ff; --focus-ink: #000;
    --shadow: none; --shadow-lg: none;
    color-scheme: dark;
}
:root[data-theme="contrast"] .card, :root[data-theme="contrast"] .info-box, :root[data-theme="contrast"] .org-card,
:root[data-theme="contrast"] .person, :root[data-theme="contrast"] .cta,
:root[data-theme="contrast"] .notice, :root[data-theme="contrast"] .access-box, :root[data-theme="contrast"] .empty-state { border: 2px solid #fff; }
:root[data-theme="contrast"] img { filter: none; }
@media (prefers-contrast: more) {
    :root:not([data-theme]) { --text-muted: var(--text); --border: var(--border-strong); }
}

/* ---------- Préférences de lecture ---------- */
:root[data-text-size="125"] { font-size: 125%; }
:root[data-text-size="150"] { font-size: 150%; }
:root[data-text-size="200"] { font-size: 200%; }
:root[data-font="dyslexia"] { --font: "OpenDyslexic", var(--font-system); }
:root[data-font="system"] { --font: var(--font-system); }
/* WCAG 1.4.12 Espacement du texte */
:root[data-spacing="large"] { --leading: 1.9; --tracking: .12em; --word-spacing: .16em; --para-spacing: 2em; }
:root[data-links="highlight"] a:not(.btn):not(.skip-link) { background: var(--accent) !important; color: var(--on-accent) !important; text-decoration: underline 2px !important; padding: 0 .15em; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
:root[data-motion="reduce"] *, :root[data-motion="reduce"] *::before, :root[data-motion="reduce"] *::after {
    animation: none !important; transition: none !important; scroll-behavior: auto !important;
}

/* ---------- Chargement d'une page sans rechargement (nav.js) ---------- */
.nav-progress {
    position: fixed; top: 0; left: 0; z-index: 10000; width: 0; height: 4px;
    background: var(--accent); box-shadow: 0 0 0 1px var(--primary);
    opacity: 0; pointer-events: none; transition: width 2s cubic-bezier(.1, .7, .3, 1), opacity .2s;
}
.nav-progress.is-active { opacity: 1; }
.nav-progress.is-done { transition: width .2s ease-out, opacity .3s .15s; opacity: 0; }
[aria-busy="true"] { cursor: progress; }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 1rem; }
body {
    margin: 0; background: var(--bg); color: var(--text);
    font-family: var(--font); font-size: 1.125rem; line-height: var(--leading);
    letter-spacing: var(--tracking); word-spacing: var(--word-spacing);
    -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
    overflow-wrap: break-word;
}
img, svg { max-width: 100%; height: auto; }
img { display: block; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .6em; font-weight: 700; letter-spacing: var(--tracking); }
h1 { font-size: clamp(2rem, 1.4rem + 2.6vw, 3rem); }
h2 { font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2rem); }
h3 { font-size: 1.25rem; }
p, ul, ol, dl, address { margin: 0 0 var(--para-spacing); }
address { font-style: normal; }
a { color: var(--link); text-decoration: underline; text-decoration-thickness: .08em; text-underline-offset: .18em; }
a:visited { color: var(--link-visited); }
a:hover { text-decoration-thickness: .16em; color: var(--primary-hover); }
strong { font-weight: 700; }
hr { border: 0; border-top: 2px solid var(--border); margin: 2rem 0; }
code { font-size: .9em; background: var(--surface-2); padding: .1em .35em; border-radius: 4px; }
[hidden] { display: none !important; }
/* :where() = priorité nulle : toute règle propre à une liste (marge intérieure…) l'emporte sur cette remise à zéro */
:where(ul[role="list"], ol[role="list"]) { list-style: none; padding: 0; }

/* Focus : très visible (jaune + contour sombre), jamais supprimé */
:focus { outline: none; }
:focus-visible {
    outline: 3px solid var(--focus-ink);
    outline-offset: 2px;
    box-shadow: 0 0 0 6px var(--focus);
    border-radius: 4px;
}
a:focus-visible {
    background: var(--focus); color: var(--focus-ink) !important; text-decoration: none;
    outline: none; box-shadow: 0 -2px var(--focus), 0 4px var(--focus-ink);
    border-radius: 0;
}
main:focus, [tabindex="-1"]:focus { outline: none; box-shadow: none; }

.visually-hidden {
    position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important;
    overflow: hidden !important; clip: rect(0 0 0 0) !important; white-space: nowrap !important; border: 0 !important;
}

.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: 1rem; }
@media (min-width: 640px) { .container { padding-inline: 1.5rem; } }

.icon { width: 1.25em; height: 1.25em; flex-shrink: 0; vertical-align: -.25em; }
.icon--sm { width: 1.05em; height: 1.05em; }

/* Liens vers les réseaux sociaux : logo officiel (une couleur) + nom du réseau */
.social-list { display: flex; flex-direction: column; gap: .35rem; margin: 0; padding: 0; }
.social-list a { display: inline-flex; align-items: center; gap: .55rem; min-height: 44px; }
.social-list .icon--brand { width: 1.4em; height: 1.4em; }
/* Logo envoyé (réseau « autre ») : même taille que les logos officiels, petit fond blanc pour rester visible sur tout fond */
.social-logo { object-fit: contain; border-radius: 5px; background: #fff; padding: 1px; }
.social-list--inline { flex-direction: row; flex-wrap: wrap; gap: .25rem 1.25rem; }
.social-list--inline a { min-height: 36px; }

/* Lien vers un autre site (ouvert dans un nouvel onglet) : petite flèche, sauf si le lien a déjà une icône.
   Le texte de remplacement vide la rend muette pour les lecteurs d'écran, qui entendent « s'ouvre dans un nouvel onglet ». */
a[data-external]:not(:has(svg, img))::after { content: "\2197"; content: "\2197" / ""; display: inline-block; margin-left: .2em; font-size: .85em; text-decoration: none; }
.icon--xl { width: 3rem; height: 3rem; }

/* ---------- Liens d'évitement ---------- */
.skip-links { position: absolute; top: 0; left: 0; z-index: 1000; }
.skip-link {
    position: absolute; left: 1rem; top: -10rem; white-space: nowrap;
    background: var(--focus); color: var(--focus-ink) !important; font-weight: 700;
    padding: .9rem 1.2rem; border: 3px solid var(--focus-ink); border-radius: 0 0 8px 8px; text-decoration: none;
}
.skip-link:focus, .skip-link:focus-visible { top: 0; box-shadow: none; }

/* ---------- En-tête ---------- */
.site-header { background: var(--bg); border-bottom: 1px solid var(--border); position: relative; z-index: 50; }
/* En-tête fixe au défilement : le bandeau bleu (--topbar-h, mesuré par site.js) sort de l'écran, le logo, le menu
   et la recherche restent visibles. Pas d'en-tête fixe avec un texte agrandi ou un écran peu haut (WCAG 1.4.10) :
   il masquerait une trop grande part de la page. */
@media (min-height: 560px) {
    :root:not([data-text-size]) .site-header { position: sticky; top: calc(-1 * var(--topbar-h, 0px)); box-shadow: 0 2px 10px rgba(16, 33, 56, .08); }
    :root:not([data-text-size]) { scroll-padding-top: calc(var(--sticky-h, 0px) + 1rem); }
}
.topbar { background: var(--primary); color: var(--on-primary); font-size: .95rem; }
:root[data-theme="contrast"] .topbar { border-bottom: 2px solid #fff; }
/* Aides à la lecture réunies à droite : « Facile à lire » (lien direct) et « Accessibilité » (panneau) */
.topbar__inner { display: flex; align-items: center; justify-content: flex-end; min-height: 2.75rem; padding-block: .65rem; }
.topbar__tools { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .5rem; margin: 0; }
.topbar__tool, .topbar__tool:visited {
    display: inline-flex; align-items: center; gap: .45rem; min-height: 38px; padding: .3rem 1rem;
    border: 2px solid rgba(255, 255, 255, .85); border-radius: 999px; color: var(--on-primary);
    font-weight: 700; text-decoration: none; white-space: nowrap;
}
.topbar__tool:hover { background: rgba(255, 255, 255, .14); color: var(--on-primary); }
.topbar__tool[aria-current="page"] { background: rgba(255, 255, 255, .18); }
.topbar__tool--main, .topbar__tool--main:visited { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.topbar__tool--main:hover { background: var(--accent); color: var(--on-accent); filter: brightness(1.06); }

.header__main { display: flex; align-items: center; gap: 1rem; padding-block: .75rem; flex-wrap: wrap; }
.brand { display: inline-flex; margin-right: auto; border-radius: 8px; }
/* Logo modifiable dans les paramètres : quelle que soit sa forme, il reste dans un cadre de 150 × 84 px environ */
.brand img { width: auto; height: auto; max-width: min(220px, 55vw); max-height: 84px; object-fit: contain; }
:root[data-theme="dark"] .brand img, :root[data-theme="contrast"] .brand img { background: #fff; border-radius: 8px; padding: 4px; }
@media (prefers-color-scheme: dark) { :root[data-theme="auto"] .brand img { background: #fff; border-radius: 8px; padding: 4px; } }

/* Menu principal : sur la ligne du logo */
.menu-toggle {
    display: none; align-items: center; gap: .5rem; font: inherit; font-weight: 700; cursor: pointer;
    background: var(--primary-soft); color: var(--primary); border: 2px solid var(--primary); border-radius: 999px; padding: .5rem 1rem; min-height: 44px;
}
.menu-toggle span { display: inline-flex; align-items: center; gap: .4rem; }
.menu-toggle__close { display: none !important; }
.menu-toggle[aria-expanded="true"] .menu-toggle__open { display: none !important; }
.menu-toggle[aria-expanded="true"] .menu-toggle__close { display: inline-flex !important; }

.main-nav__list { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .1rem .25rem; margin: 0; }
.main-nav a {
    display: flex; align-items: center; min-height: 48px; padding: .5rem .8rem; font-weight: 700; text-decoration: none;
    color: var(--text); border-bottom: 4px solid transparent;
}
.main-nav a:visited { color: var(--text); }
.main-nav a:hover { color: var(--primary); border-bottom-color: var(--border-strong); }
.main-nav a[aria-current="page"] { color: var(--primary); border-bottom-color: var(--accent); }

@media (max-width: 1023px) {
    .js .menu-toggle { display: inline-flex; }
    .main-nav { flex-basis: 100%; }
    .js .main-nav:not(.is-open) { display: none; }
    /* Menu ouvert dans l'en-tête fixe : il défile lui-même s'il dépasse l'écran */
    .main-nav.is-open { max-height: calc(100vh - var(--sticky-h, 0px)); max-height: calc(100dvh - var(--sticky-h, 0px)); overflow-y: auto; overscroll-behavior: contain; }
    .brand img { max-height: 64px; }
    .main-nav__list { flex-direction: column; padding-block: .25rem .5rem; border-top: 1px solid var(--border); }
    .main-nav a { border-bottom: 0; border-left: 5px solid transparent; }
    .main-nav a[aria-current="page"] { border-left-color: var(--accent); background: var(--primary-soft); }
}

/* Bouton « Rechercher » de l'en-tête : ouvre la fenêtre de recherche (après le menu sur grand écran,
   à côté du bouton Menu sur petit écran) */
.search-toggle, .search-toggle:visited {
    display: inline-flex; align-items: center; gap: .45rem; min-height: 44px; padding: .5rem 1.1rem;
    border: 2px solid var(--primary); border-radius: 999px; background: var(--primary); color: var(--on-primary);
    font-weight: 700; text-decoration: none; white-space: nowrap;
}
.search-toggle:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: var(--on-primary); }
@media (max-width: 1023px) {
    /* Menu déplié : sous la ligne logo / Rechercher / Menu */
    .main-nav { order: 10; }
}
/* Écran moyen : la place manque pour le libellé à côté du menu, l'icône suffit (nom gardé pour les lecteurs d'écran) */
@media (min-width: 1024px) and (max-width: 1239px) {
    .search-toggle { padding: .5rem .75rem; }
    .search-toggle__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
/* Petits écrans : loupe en bleu, sans fond, avec le mot « Rechercher » écrit dessous (comme les onglets des
   applications) : compris de tous, y compris sans connaître le symbole, et nommable en commande vocale.
   Logo, Rechercher et Menu tiennent toujours sur une même ligne. */
@media (max-width: 599px) {
    .search-toggle, .search-toggle:visited {
        flex-direction: column; justify-content: center; gap: .1rem; flex-shrink: 0;
        min-width: 56px; min-height: 52px; padding: .2rem .35rem; border-radius: var(--radius-sm);
        background: transparent; border-color: transparent; color: var(--primary);
    }
    /* Fond léger au survol et au focus clavier, pour voir où l'on se trouve */
    .search-toggle:hover, .search-toggle:focus-visible { background: var(--primary-soft); border-color: var(--primary-soft); color: var(--primary); }
    .search-toggle .icon { width: 1.5rem; height: 1.5rem; stroke-width: 2.4; }
    .search-toggle__label { position: static; width: auto; height: auto; overflow: visible; clip: auto; font-size: .8rem; line-height: 1.1; }
}
/* Plus petits téléphones : tout reste sur une ligne */
@media (max-width: 379px) {
    .search-toggle, .search-toggle:visited { min-width: 0; padding-inline: .15rem; }
    .search-toggle__label { font-size: .72rem; }
    .menu-toggle { padding: .4rem .65rem; gap: .35rem; }
    .brand img { max-width: 32vw; }
    .menu-toggle { flex-shrink: 0; min-height: 48px; }
    .brand { min-width: 0; flex: 0 1 auto; }
    .brand img { max-width: 100%; }
}

/* Fenêtre de recherche */
.search-dialog {
    width: min(680px, calc(100vw - 1.5rem)); max-height: calc(100vh - 2rem); margin: 10vh auto auto; padding: 0; overflow: auto;
    border: 0; border-radius: var(--radius); background: var(--bg); color: var(--text); box-shadow: var(--shadow-lg);
}
.search-dialog::backdrop { background: rgba(5, 15, 30, .65); }
.search-dialog__head {
    display: flex; align-items: center; justify-content: space-between; gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md); background: var(--primary); color: var(--on-primary);
}
.search-dialog__head h2 { margin: 0; font-size: 1.3rem; display: flex; align-items: center; gap: .5rem; }
.search-dialog__form { padding: var(--space-md); }
.search-dialog__field { display: flex; flex-wrap: wrap; gap: var(--space-xs); }
.search-dialog__field .input { flex: 1 1 260px; }
.search-dialog__form .hint { margin: var(--space-xs) 0 0; }
:root[data-theme="contrast"] .search-dialog { border: 3px solid #fff; }

/* Bandeau d'aperçu (contenu vu depuis l'administration, éventuellement non publié) */
.preview-banner { background: var(--accent); color: var(--on-accent); border-bottom: 3px solid var(--accent-ink); }
.preview-banner__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem; padding-block: .6rem; }
.preview-banner p { margin: 0; display: flex; align-items: center; gap: .45rem; font-weight: 700; }
.preview-banner .btn--on-dark, .preview-banner .btn--on-dark:visited { color: var(--on-accent); border-color: var(--on-accent); }
.preview-banner .btn--on-dark:hover { background: rgba(0, 0, 0, .08); color: var(--on-accent); }

/* ---------- Fil d'Ariane ---------- */
.breadcrumbs { background: var(--surface); font-size: .95rem; }
.breadcrumbs ol { display: flex; flex-wrap: wrap; margin: 0; padding-block: .6rem; }
.breadcrumbs li { display: inline-flex; align-items: center; }
.breadcrumbs li + li::before { content: "›"; margin: 0 .55rem; color: var(--text-muted); }
.breadcrumbs [aria-current] { color: var(--text-muted); }

/* ---------- Boutons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem; cursor: pointer;
    font: inherit; font-weight: 700; line-height: 1.2; text-decoration: none; text-align: center;
    min-height: 48px; padding: .7rem 1.3rem; border-radius: 999px; border: 2px solid transparent;
    transition: background-color .15s, transform .15s, box-shadow .15s;
}
.btn:visited { color: inherit; }
.btn:hover { transform: translateY(-1px); }
.btn--primary, .btn--primary:visited { background: var(--primary); color: var(--on-primary); }
.btn--primary:hover { background: var(--primary-hover); color: var(--on-primary); }
.btn--accent, .btn--accent:visited { background: var(--accent); color: var(--on-accent); }
.btn--accent:hover { color: var(--on-accent); filter: brightness(1.05); }
.btn--ghost, .btn--ghost:visited { background: transparent; color: var(--primary); border-color: var(--primary); }
.btn--ghost:hover { background: var(--primary-soft); color: var(--primary); }
.btn--on-dark, .btn--on-dark:visited { background: transparent; color: var(--hero-text); border-color: var(--hero-text); }
.btn--on-dark:hover { background: rgba(255, 255, 255, .12); color: var(--hero-text); }
.btn--danger, .btn--danger:visited { background: var(--danger); color: var(--on-danger); }
.btn--danger:hover { color: var(--on-danger); filter: brightness(1.08); }
.btn--large { min-height: 56px; padding: .9rem 1.6rem; font-size: 1.1rem; }
.btn--small { min-height: 44px; padding: .45rem 1rem; font-size: 1rem; }
.btn--icon { min-height: 44px; min-width: 44px; padding: .4rem; border-radius: 999px; background: var(--surface-2); color: var(--text); }
.btn:focus-visible { box-shadow: 0 0 0 3px var(--focus-ink), 0 0 0 7px var(--focus); outline: none; border-radius: 999px; }

/* ---------- Héros (accueil) ---------- */
/* Photo affichée en entier (toutes les personnes restent visibles) ; le texte est dans un bandeau plein
   qui chevauche seulement le bas de la photo (le sol de la place). Fond plein = contraste garanti. */
.hero { position: relative; }
/* Bandeau pleine largeur de fenêtre ; le format s'allonge avec l'écran et le cadrage reste sur les personnes
   (visages en haut, fauteuils et pieds en bas). Mobile : image entière. */
.hero__photo { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; object-position: 50% 60%; }
@media (min-width: 700px) { .hero__photo { aspect-ratio: 16 / 6.5; object-position: 50% 92%; } }
@media (min-width: 1200px) { .hero__photo { aspect-ratio: 16 / 5; max-height: 600px; object-position: 50% 78%; } }
@media (min-width: 2200px) { .hero__photo { object-position: 50% 58%; } }
.hero__inner { position: relative; }
@media (min-width: 900px) { .hero__inner { margin-top: -2.5rem; } }
/* Carte unique de l'accueil : titre | slogan et boutons, puis chiffres clés sous un filet.
   Une seule unité d'espacement (--hero-gap) pour que les écarts soient cohérents partout. */
.hero__text {
    --hero-gap: clamp(1.25rem, 2.5vw, 2rem);
    color: var(--hero-text); background: var(--hero-bg); border-radius: var(--radius);
    padding: var(--hero-gap) calc(var(--hero-gap) * 1.25);
    border-top: 6px solid var(--accent); box-shadow: var(--shadow-lg);
    display: grid; gap: var(--hero-gap);
}
.hero__heading > :last-child, .hero__side > :last-child { margin-bottom: 0; }
.hero__side { display: flex; flex-direction: column; gap: var(--hero-gap); }
@media (min-width: 900px) {
    /* Titre à gauche, slogan + boutons à droite, centrés sur la hauteur du titre */
    .hero__text { grid-template-columns: auto minmax(0, 1fr); column-gap: calc(var(--hero-gap) * 2.5); align-items: center; }
    .hero__stats { grid-column: 1 / -1; }
}
:root[data-theme="contrast"] .hero__text { background: #000; border: 2px solid #fff; border-top: 6px solid var(--accent); }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-weight: 700; font-size: .9rem; margin-bottom: .75rem; color: var(--accent-ink); }
.hero .eyebrow { color: var(--accent); }
.hero__title { font-size: clamp(2.2rem, 1.5rem + 3.4vw, 3.6rem); margin: 0; }
/* Titre court : un mot par ligne (« Forum / Handicap / Jura ») ; les espaces restent pour les lecteurs d'écran */
.hero__title--stacked span { display: block; }
/* Lettres nettement espacées ; avec le réglage « Espacement augmenté », l'écart de ce réglage (plus large) s'applique */
.hero__title--stacked { line-height: 1.1; letter-spacing: .1em; }
:root[data-spacing="large"] .hero__title--stacked { letter-spacing: .12em; }
.hero__lead { font-size: clamp(1.15rem, 1.05rem + .4vw, 1.35rem); margin: 0; line-height: 1.5; }
.hero__actions { display: flex; flex-wrap: wrap; gap: .75rem 1rem; }

/* Chiffres clés, dans la carte : valeur en jaune (contraste 7:1 sur le bleu), libellé à côté, séparés par un filet */
/* Chaque chiffre prend la largeur de son texte : un libellé n'est jamais coupé s'il tient sur une ligne ;
   faute de place, c'est l'élément entier qui passe à la ligne suivante. */
.hero__stats {
    display: flex; flex-direction: column; gap: .5rem var(--hero-gap);
    /* Bon espace entre le filet et les chiffres ; la carte garde sa marge du bas */
    margin: 0; padding: calc(var(--hero-gap) * 1.5) 0 calc(var(--hero-gap) * .25); border-top: 1px solid rgba(255, 255, 255, .25);
}
.hero-stat { display: flex; align-items: center; gap: .75rem; }
.hero-stat__value { font-size: clamp(1.9rem, 1.5rem + 1.2vw, 2.5rem); font-weight: 700; line-height: 1; color: var(--accent); flex-shrink: 0; }
.hero-stat__label { font-weight: 700; line-height: 1.3; }
@media (min-width: 600px) {
    .hero__stats { flex-direction: row; flex-wrap: wrap; align-items: center; }
    .hero-stat { flex: 1 1 auto; }
    .hero-stat__label { white-space: nowrap; }
}
@media (min-width: 900px) {
    .hero-stat + .hero-stat { border-left: 1px solid rgba(255, 255, 255, .25); padding-left: var(--hero-gap); }
}
/* Texte très agrandi (réglage d'affichage) : retour à la ligne permis pour ne jamais déborder */
:root[data-text-size="150"] .hero-stat__label, :root[data-text-size="200"] .hero-stat__label { white-space: normal; }
:root[data-theme="contrast"] .hero__stats, :root[data-theme="contrast"] .hero-stat + .hero-stat { border-color: #fff; }

/* ---------- Petits écrans (téléphones) : en-tête compact, carte d'accueil resserrée ---------- */
@media (max-width: 599px) {
    /* Barre du haut : les deux aides sur une ligne, centrées ; zones cliquables d'au moins 36 px */
    .topbar { font-size: .9rem; }
    .topbar__inner { justify-content: center; min-height: 0; padding-block: .55rem; }
    .topbar__tools { flex-wrap: nowrap; justify-content: center; }
    .topbar__tool, .topbar__tool:visited { min-height: 36px; padding: .25rem .85rem; gap: .35rem; }
    .brand img { max-height: 54px; }
    .header__main { padding-block: .6rem; gap: .6rem; }

    /* Carte d'accueil : marges et titre adaptés à la largeur */
    .hero__text { --hero-gap: 1.25rem; padding: 1.4rem 1.25rem 1.25rem; }
    .hero__title { font-size: clamp(1.9rem, 1.3rem + 4vw, 2.4rem); }
    .hero__title--stacked { letter-spacing: .06em; }
    .hero__lead { font-size: 1.05rem; }
    /* Boutons pleine largeur, de même taille, libellé sur une ligne */
    .hero__actions { flex-direction: column; gap: .6rem; }
    .hero__actions .btn { width: 100%; justify-content: center; min-height: 52px; padding: .7rem 1rem; font-size: 1.05rem; }

    /* Chiffres côte à côte en trois colonnes : valeur au-dessus, libellé court dessous */
    .hero__stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; padding: var(--hero-gap) 0 0; }
    .hero-stat { flex-direction: column; align-items: center; gap: .35rem; padding: 0 .4rem; text-align: center; }
    .hero-stat + .hero-stat { border-left: 1px solid rgba(255, 255, 255, .25); }
    .hero-stat__value { font-size: 1.9rem; }
    .hero-stat__label { font-size: .8rem; line-height: 1.25; white-space: normal; }
}
/* Très petits écrans : la barre du haut reste sur une ligne */
@media (max-width: 399px) {
    .topbar { font-size: .85rem; }
    .topbar__tool, .topbar__tool:visited { padding-inline: .7rem; }
    /* Logo, Rechercher et Menu restent sur la même ligne */
    .brand img { max-height: 44px; max-width: 42vw; }
    .header__main { gap: .45rem; }
    .menu-toggle { padding: .45rem .8rem; }
    /* Libellé du bouton principal sur une seule ligne */
    .hero__actions .btn { padding-inline: .75rem; font-size: 1rem; gap: .4rem; }
    .hero-stat__label { font-size: .75rem; }
}
/* Plus petits téléphones : la flèche décorative laisse la place au libellé */
@media (max-width: 359px) {
    .hero__text { padding-inline: 1rem; }
    .hero__actions .btn { white-space: nowrap; }
    .hero__actions .btn .icon { display: none; }
}
/* Texte agrandi sur petit écran : retours à la ligne permis, rien ne déborde */
@media (max-width: 599px) {
    :root[data-text-size] .topbar__tools { flex-wrap: wrap; }
    :root[data-text-size] .topbar__tool { white-space: normal; }
}

/* ---------- Sections ---------- */
.section { padding-block: var(--space-xl); }
/* Sous un en-tête de page, le contenu commence plus près du titre */
.page-header + .section { padding-top: var(--space-lg); }
.section--tinted { background: var(--surface); }
.section__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--space-xs) var(--space-md); margin-bottom: var(--space-md); }
.section__title { margin: 0; position: relative; padding-bottom: .4rem; }
.section__title::after { content: ""; position: absolute; left: 0; bottom: 0; width: 3rem; height: 5px; border-radius: 3px; background: var(--accent); }
.link-more { font-weight: 700; display: inline-flex; align-items: center; gap: .35rem; }
.link-back { font-weight: 700; display: inline-flex; align-items: center; gap: .35rem; margin-top: var(--space-lg); }

.page-header { background: linear-gradient(180deg, var(--primary-soft), var(--bg)); padding-block: var(--space-lg) var(--space-sm); }
.page-header h1 { margin-bottom: var(--space-xs); }
.page-header__sub { display: block; font-size: .5em; color: var(--text-muted); margin-top: .35rem; }
.lead { font-size: 1.25rem; color: var(--text-muted); margin-bottom: 0; }

/* ---------- Cartes ---------- */
.card-grid { display: grid; gap: var(--space-md); grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); margin: 0; }
.card-grid > li { display: flex; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; width: 100%; }
.card--link { position: relative; transition: transform .2s, box-shadow .2s; }
.card--link:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.card--link:focus-within { box-shadow: 0 0 0 3px var(--focus-ink), 0 0 0 7px var(--focus); }
.card__link { text-decoration: none; color: var(--text); }
.card__link:visited { color: var(--text); }
.card__link::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.card__link:hover { text-decoration: underline; }
.card__link:focus-visible { background: none; box-shadow: none; text-decoration: underline; color: var(--text) !important; }
.card__img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.card__body { padding: 1.25rem 1.4rem 1.5rem; display: flex; flex-direction: column; gap: .4rem; flex: 1; }
.card__meta { color: var(--text-muted); font-size: .95rem; display: flex; align-items: center; gap: .4rem; margin: 0; }
.card__title { font-size: 1.25rem; margin: .1rem 0 .3rem; }
.card__text { color: var(--text-muted); margin: 0; }
.card--event .card__body { flex-direction: row; gap: 1rem; align-items: flex-start; }
.date-badge { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 4rem; padding: .5rem; border-radius: var(--radius-sm); background: var(--primary); color: var(--on-primary); line-height: 1.05; margin: 0; }
.date-badge__day { font-size: 1.7rem; font-weight: 700; }
.date-badge__month { text-transform: uppercase; font-size: .85rem; font-weight: 700; letter-spacing: .05em; }
.meta-list { margin: 0 0 .5rem; color: var(--text-muted); font-size: 1rem; }
.meta-list li { display: flex; gap: .45rem; align-items: center; }

.access-badges { display: flex; flex-wrap: wrap; gap: .4rem; margin: .4rem 0 0; position: relative; z-index: 2; }
.access-badge { display: inline-flex; align-items: center; justify-content: center; width: 2.1rem; height: 2.1rem; border-radius: 50%; background: var(--primary-soft); color: var(--primary); border: 1px solid var(--primary); flex-shrink: 0; }

/* ---------- Mission ---------- */
/* Textes : toute la largeur du conteneur */
.prose--wide > p { font-size: 1.2rem; }
.prose h2 { margin-top: var(--space-lg); }
.prose h3 { margin-top: var(--space-md); }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li { margin-bottom: .4em; }
.prose blockquote { margin: var(--space-md) 0; padding: 1rem 1.25rem; border-left: 5px solid var(--accent); background: var(--surface); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.prose blockquote p { margin: 0; }
.prose img { width: auto; height: auto; max-width: 100%; max-height: min(30rem, 70vh); border-radius: var(--radius-sm); margin-block: var(--space-sm); }
.prose--falc { font-size: 1.3rem; line-height: 1.75; }
.prose--falc p, .prose--falc li { margin-bottom: .9em; }
.mission-grid { display: grid; gap: var(--space-md); grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); margin: var(--space-md) 0 0; padding: 0 !important; list-style: none; counter-reset: mission; }
.mission-card { padding: 1.5rem; counter-increment: mission; position: relative; border-top: 5px solid var(--primary); }
.mission-card::before { content: counter(mission, decimal-leading-zero); font-weight: 700; font-size: 1rem; color: var(--accent-ink); display: block; margin-bottom: .4rem; }
.mission-card h3 { margin: 0 0 .5rem; color: var(--primary); }
.mission-card p { margin: 0; color: var(--text-muted); }
.version-switch { margin: 0; }
.section > .version-switch:first-child { margin-bottom: var(--space-md); }
/* Version Facile à lire d'une rubrique : texte simplifié au-dessus du contenu habituel (listes, formulaire…) */
.easy-read-block { margin-bottom: var(--space-lg); padding-bottom: var(--space-md); border-bottom: 1px solid var(--border, #d6dbe3); }
.section--flush-bottom { padding-bottom: 0; }

/* ---------- Puces organisations ---------- */

/* ---------- Appel à l'action ---------- */
.cta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-md); background: var(--primary-soft); border-radius: calc(var(--radius) * 1.5); padding: clamp(1.5rem, 4vw, 3rem); border-left: 8px solid var(--accent); }
.cta > div { flex: 1 1 380px; }
.cta__title { margin-bottom: var(--space-xs); }
.cta p { margin: 0; }
.cta--small { margin-top: var(--space-lg); }

/* ---------- Comité ---------- */
/* Cartes du comité, style épuré : carte claire, fine barre bleue et jaune en haut (couleurs du logo), portrait en
   carré arrondi, nom et fonction (pastille jaune). La carte s'élève légèrement au survol.
   Sans photo : silhouette par défaut (assets/img/avatar-defaut.svg). */
.people-grid { display: grid; gap: var(--space-md); grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); margin: 0; }
.person {
    position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: var(--space-sm) 1.1rem;
    padding: calc(var(--space-md) + 3px) var(--space-md) var(--space-md);
    background: var(--card); border: 1px solid var(--border); border-radius: calc(var(--radius) + 4px);
    box-shadow: 0 1px 2px rgba(16, 33, 56, .05), 0 8px 24px -12px rgba(16, 33, 56, .18);
    overflow: hidden; transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.person::before {
    content: ""; position: absolute; inset: 0 0 auto; height: 4px;
    /* Barre bleue avec un court segment jaune, comme le soulignement des titres de section */
    background: linear-gradient(90deg, var(--accent) 0 4.5rem, var(--primary) 4.5rem);
}
.person:hover { transform: translateY(-3px); border-color: var(--primary-soft); box-shadow: 0 2px 4px rgba(16, 33, 56, .06), 0 18px 36px -16px rgba(16, 33, 56, .3); }
.person__media { width: 76px; height: 76px; flex-shrink: 0; }
.person__photo {
    display: block; width: 100%; height: 100%; object-fit: cover;
    border-radius: 22px; background: var(--primary-soft);
    box-shadow: 0 0 0 3px var(--card), 0 0 0 5px var(--primary-soft);
}
.person__body { display: flex; flex-direction: column; align-items: flex-start; gap: .3rem; min-width: 0; }
.person__name { font-size: 1.15rem; line-height: 1.3; margin: 0; overflow-wrap: anywhere; }
.person__role {
    display: inline-flex; align-items: center; gap: .45rem; margin: 0;
    color: var(--primary); font-weight: 700; font-size: .95rem;
}
.person__role::before { content: ""; width: .5rem; height: .5rem; border-radius: 50%; background: var(--accent); flex-shrink: 0; }
.person__org { display: inline-flex; align-items: flex-start; gap: .4rem; margin: 0; color: var(--text-muted); font-size: .95rem; line-height: 1.4; }
.person__org .icon { margin-top: .15em; }
/* Présentation : sous le nom et la fonction, sur toute la largeur de la carte */
.person__bio { grid-column: 1 / -1; padding-top: var(--space-sm); border-top: 1px solid var(--border); font-size: .95rem; color: var(--text-muted); }
.person__bio > :last-child { margin-bottom: 0; }
@media (prefers-reduced-motion: reduce) { .person, .person:hover { transition: none; transform: none; } }
:root[data-motion="reduce"] .person:hover { transform: none; }
:root[data-theme="contrast"] .person { border: 2px solid #fff; box-shadow: none; }
:root[data-theme="contrast"] .person::before { background: var(--accent); }

/* ---------- Membres ---------- */
.filter-bar { display: grid; gap: 1rem; grid-template-columns: 1fr; align-items: end; background: var(--surface); padding: var(--space-md); border-radius: var(--radius); margin-bottom: var(--space-sm); }
@media (min-width: 760px) { .filter-bar { grid-template-columns: 2fr 1.5fr auto; } }
.filter-bar .field { margin: 0; }
.filter-bar__actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.results-count { font-weight: 700; margin: var(--space-sm) 0 var(--space-md); font-size: 1.15rem; }
.org-grid { display: grid; gap: var(--space-md); grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); margin: 0; }
/* Carte verticale : bandeau du logo en haut (bien visible), texte en dessous, liens alignés en bas */
.org-card { display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.org-card__media {
    display: flex; align-items: center; justify-content: center; height: 170px; padding: .4rem; overflow: hidden;
    background: #fff; border-bottom: 1px solid var(--border); /* blanc dans tous les thèmes : les logos sont conçus pour un fond clair */
}
/* L'image s'adapte au bandeau (marge comprise) : agrandie ou réduite, jamais rognée ni déformée */
.org-card__logo { display: block; width: 100%; height: 100%; min-height: 0; object-fit: contain; object-position: center; }
.org-card__media--mark { background: var(--primary-soft); border-bottom: 4px solid var(--accent); padding: 1rem; }
.org-card__mark {
    font-size: 2.6rem; font-weight: 700; line-height: 1; letter-spacing: .02em; color: var(--primary);
    text-align: center; overflow-wrap: anywhere;
}
.org-card__mark--long { font-size: 1.8rem; }
.org-card__body { display: flex; flex-direction: column; flex: 1; padding: 1.25rem 1.25rem 1rem; min-width: 0; }
.org-card__title { font-size: 1.2rem; line-height: 1.3; margin-bottom: .5rem; overflow-wrap: anywhere; }
.org-card__acronym { color: var(--text-muted); font-weight: 400; }
.org-card__body .tag { align-self: flex-start; margin-bottom: .75rem; }
.org-card__desc { font-size: 1rem; color: var(--text-muted); margin-bottom: 1rem; }
.org-card__links { margin: auto 0 0; padding-top: .75rem; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: .15rem; }
.org-card__links a { display: inline-flex; align-items: center; gap: .45rem; min-height: 36px; overflow-wrap: anywhere; }
.org-card__links .icon { flex-shrink: 0; }
:root[data-theme="contrast"] .org-card__media { border-bottom: 2px solid #fff; }
:root[data-theme="contrast"] .org-card__media--mark { background: #000; }
:root[data-theme="contrast"] .org-card__mark { color: #fff; }
@media (min-width: 1200px) { .org-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.tag { display: inline-block; font-size: .875rem; font-weight: 700; padding: .15rem .65rem; border-radius: 999px; background: var(--surface-2); color: var(--text); margin: 0 0 .4rem; }

/* ---------- Agenda / événement ---------- */
.tabs-links { margin-bottom: var(--space-md); }
.month { margin-bottom: var(--space-lg); }
.month__title { font-size: 1.5rem; border-bottom: 2px solid var(--border); padding-bottom: .5rem; }
.legend { margin-top: var(--space-lg); padding: var(--space-md); background: var(--surface); border-radius: var(--radius); }
.legend__title { font-size: 1.15rem; }
.legend ul { display: grid; gap: .6rem 1.5rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); margin: 0; }
.legend li, .access-list li { display: flex; align-items: center; gap: .65rem; }
.access-list { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }

.article__header { margin-bottom: var(--space-md); }
.article__meta { color: var(--text-muted); display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
/* Image d'illustration : jamais agrandie au-delà de sa taille réelle (floue) et hauteur limitée, pour que le texte
   reste visible sans défiler ; une image en hauteur (affiche, code QR) ne prend plus tout l'écran */
.article__img { width: auto; height: auto; max-width: 100%; max-height: min(26rem, 60vh); border-radius: var(--radius); margin-bottom: var(--space-md); }
.article__lead { color: var(--text); font-weight: 700; }
.event-layout { display: grid; gap: var(--space-lg); }
@media (min-width: 900px) { .event-layout { grid-template-columns: 1fr 340px; align-items: start; } }
.info-box { background: var(--surface); border-radius: var(--radius); padding: var(--space-md); border-top: 5px solid var(--primary); }
.info-box__title { font-size: 1.25rem; }
.info-list { margin: 0 0 1rem; display: grid; gap: .9rem; }
.info-list dt { font-weight: 700; display: flex; align-items: center; gap: .4rem; }
.info-list dd { margin: .1rem 0 0; }
.info-box__actions { display: flex; flex-direction: column; gap: .6rem; }
.access-box { margin-top: var(--space-lg); padding: var(--space-md); border: 2px solid var(--primary); border-radius: var(--radius); }
.access-box h2 { display: flex; align-items: center; gap: .5rem; font-size: 1.4rem; }

.prev-next { display: grid; gap: var(--space-sm); margin-top: var(--space-lg); }
@media (min-width: 700px) { .prev-next { grid-template-columns: 1fr 1fr; } }
.prev-next__link { display: flex; flex-direction: column; gap: .25rem; padding: 1rem 1.25rem; border: 2px solid var(--border); border-radius: var(--radius); text-decoration: none; color: var(--text); }
.prev-next__link:visited { color: var(--text); }
.prev-next__link:hover { border-color: var(--primary); }
.prev-next__link--right { text-align: right; grid-column: -2; }
.prev-next__label { color: var(--text-muted); font-size: .95rem; display: inline-flex; align-items: center; gap: .3rem; }
.prev-next__link--right .prev-next__label { justify-content: flex-end; }
.prev-next__title { font-weight: 700; text-decoration: underline; }

/* ---------- Documents ---------- */
.doc-section { margin-bottom: var(--space-lg); }
.doc-list { display: grid; gap: var(--space-sm); margin: 0; }
.doc { display: flex; gap: 1rem; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem 1.25rem; }
.doc__icon { display: flex; flex-direction: column; align-items: center; color: var(--primary); font-size: .75rem; font-weight: 700; }
.doc__title { font-size: 1.15rem; margin-bottom: .25rem; }
.doc__meta { color: var(--text-muted); font-size: .95rem; margin: 0; }
.doc__a11y { display: flex; gap: .4rem; align-items: center; font-size: .95rem; margin: .4rem 0 0; }
.doc__a11y.is-ok { color: var(--success); }
.doc__a11y.is-warn { color: var(--text-muted); }

/* ---------- Pagination ---------- */
.pagination ul { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; margin: var(--space-lg) 0 0; }
.pagination a { display: inline-flex; align-items: center; gap: .3rem; min-width: 48px; min-height: 48px; justify-content: center; padding: .5rem 1rem; border: 2px solid var(--border); border-radius: 999px; text-decoration: none; font-weight: 700; color: var(--primary); }
.pagination a:hover { border-color: var(--primary); }
.pagination a[aria-current="page"] { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }

/* ---------- États vides / notices ---------- */
.empty-state { text-align: center; padding: var(--space-lg) var(--space-md); background: var(--card); border: 2px dashed var(--border-strong); border-radius: var(--radius); color: var(--text); }
.empty-state .icon { color: var(--primary); margin: 0 auto var(--space-sm); display: block; }
.empty-state p:last-child { margin-bottom: 0; }
.notice { display: flex; gap: .75rem; align-items: flex-start; padding: var(--space-sm) 1.25rem; border-radius: var(--radius-sm); border-left: 6px solid var(--primary); background: var(--info-bg); margin-block: var(--space-md); }
.notice p { margin: 0; }
.notice > .icon { margin-top: .2em; }
.notice--success { border-left-color: var(--success); background: var(--success-bg); }
.notice--success > .icon { color: var(--success); }
.notice--error { border-left-color: var(--danger); background: var(--danger-bg); }
.notice--error > .icon { color: var(--danger); }
.notice--warning { border-left-color: var(--accent-ink); background: var(--warning-bg); }
.notice--easy-read { font-size: 1.15rem; line-height: 1.6; }
.notice--easy-read p + p { margin-top: .5rem; }
.notice__actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .9rem !important; }
.notice--large { padding: 1.5rem; }
.notice--large h2 { font-size: 1.4rem; }
.notice--large p { margin-bottom: .5rem; }

/* ---------- Formulaires ---------- */
.field { margin-bottom: 1.4rem; }
.field-row { display: grid; gap: 0 1rem; }
@media (min-width: 640px) { .field-row { grid-template-columns: 1fr 1fr; } }
.label { display: block; font-weight: 700; margin-bottom: .35rem; font-size: 1.1rem; }
.required { font-weight: 400; color: var(--danger); font-size: .95rem; }
.optional { font-weight: 400; color: var(--text-muted); font-size: .95rem; }
.hint { color: var(--text-muted); font-size: 1rem; margin: 0 0 var(--space-xs); }
.input {
    display: block; width: 100%; font: inherit; color: var(--text); background: var(--bg);
    border: 2px solid var(--border-strong); border-radius: var(--radius-sm); padding: .7rem .9rem; min-height: 48px;
    line-height: 1.4;
}
.input:hover { border-color: var(--text); }
.input:focus-visible { border-color: var(--focus-ink); box-shadow: 0 0 0 4px var(--focus); outline: 3px solid var(--focus-ink); outline-offset: 0; }
.textarea { min-height: 8rem; resize: vertical; }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%); background-position: calc(100% - 20px) 55%, calc(100% - 14px) 55%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 2.5rem; }
.field--error .input, .field--error .input-file { border-color: var(--danger); border-width: 3px; }
.field--error { border-left: 5px solid var(--danger); padding-left: 1rem; }
.field-error { color: var(--danger); font-weight: 700; display: flex; gap: .4rem; align-items: flex-start; margin: 0 0 .5rem; }
.field-error .icon { margin-top: .15em; }
.fieldset { border: 0; padding: 0; margin: 0 0 1.4rem; min-width: 0; }
.fieldset > legend { padding: 0; }
.fieldset--section { border-top: 2px solid var(--border); padding-top: var(--space-md); margin-bottom: var(--space-lg); }
.fieldset--section > legend { font-size: 1.4rem; font-weight: 700; padding-right: .75rem; }
.fieldset--box { border: 2px solid var(--border); border-radius: var(--radius); padding: 1rem 1.25rem; }
.fieldset--box > legend { padding: 0 .5rem; }
.radios { display: flex; flex-direction: column; gap: .5rem; }
.radios--inline { flex-direction: row; flex-wrap: wrap; gap: .5rem 1.5rem; }
.check { display: flex; align-items: flex-start; gap: .65rem; }
.check input { width: 1.6rem; height: 1.6rem; margin: .1rem 0 0; flex-shrink: 0; accent-color: var(--primary); cursor: pointer; }
.check label { cursor: pointer; padding-top: .05rem; }
.field--check .hint { margin-left: 2.25rem; margin-top: .25rem; }
.checks-grid { display: grid; gap: .75rem 1.5rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }
.char-counter { font-size: .95rem; color: var(--text-muted); margin-top: .35rem; }
.char-counter.is-over { color: var(--danger); font-weight: 700; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.error-summary { border: 4px solid var(--danger); border-radius: var(--radius-sm); padding: 1.25rem var(--space-md); margin-bottom: var(--space-md); background: var(--danger-bg); }
.error-summary:focus { box-shadow: 0 0 0 3px var(--focus-ink), 0 0 0 7px var(--focus) !important; }
.error-summary__title { font-size: 1.3rem; display: flex; gap: .5rem; align-items: center; color: var(--danger); }
.error-summary ul { margin: 0; padding-left: 1.2em; }
.error-summary a { color: var(--danger); font-weight: 700; }

.contact-layout { display: grid; gap: var(--space-lg); }
/* Information sur les données (remplace la case de consentement : inutile pour répondre à une demande) */
.contact-privacy { display: flex; gap: .55rem; align-items: flex-start; margin: 0 0 var(--space-md); color: var(--text-muted); font-size: .95rem; }
.contact-privacy .icon { margin-top: .2em; color: var(--primary); }
.form-actions--contact { margin-top: var(--space-sm); }
@media (min-width: 960px) { .contact-layout { grid-template-columns: 1fr 360px; align-items: start; } }
.search-big { margin-bottom: var(--space-md); }
.search-big__row { display: flex; gap: .5rem; flex-wrap: wrap; }
.search-big__row .input { flex: 1 1 260px; }
.search-results { margin: 0; display: grid; gap: var(--space-sm); }
.search-result { padding: 1.1rem 1.25rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); }
.search-result__title { font-size: 1.2rem; margin-bottom: .3rem; }
.search-result p:last-child { margin: 0; }

.error-page { text-align: left; }
.error-page__code { font-size: 5rem; font-weight: 700; color: var(--accent-ink); line-height: 1; margin-bottom: .5rem; }
.page-updated { margin-top: var(--space-lg); color: var(--text-muted); font-size: .95rem; }

/* ---------- Pied de page ---------- */
.site-footer { background: #0b2d55; color: #fff; margin-top: 0; position: relative; }
:root[data-theme="contrast"] .site-footer { background: #000; border-top: 2px solid #fff; }
.footer__arc { height: 8px; background: linear-gradient(90deg, var(--accent), #ffd65a, var(--accent)); }
.footer__grid { display: grid; gap: 2rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); padding-block: 3rem 2rem; }
.footer__title { font-size: 1.15rem; color: #fff; margin-bottom: 1rem; }
.site-footer p, .site-footer address { color: #e3ebf5; }
.site-footer a, .site-footer a:visited { color: #fff; }
.site-footer a:hover { color: #ffd65a; }
.site-footer ul { margin: 0; display: grid; gap: .35rem; }
.site-footer li a { display: inline-flex; align-items: center; gap: .5rem; min-height: 36px; }
.footer__bottom { border-top: 1px solid rgba(255, 255, 255, .2); font-size: .95rem; }
.footer__bottom-inner { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; justify-content: space-between; align-items: center; padding-block: 1rem; }
.footer__bottom p { margin: 0; }
.footer__bottom a { display: inline-flex; gap: .4rem; align-items: center; min-height: 44px; }
.site-footer a:focus-visible { color: var(--focus-ink) !important; }

/* ---------- Panneau « Affichage » ---------- */
.a11y-panel {
    width: min(560px, calc(100vw - 1.5rem)); max-height: calc(100vh - 2rem); overflow: auto; padding: 0;
    border: 0; border-radius: var(--radius); background: var(--bg); color: var(--text); box-shadow: var(--shadow-lg);
}
:root[data-theme="contrast"] .a11y-panel { border: 3px solid #fff; }
.a11y-panel::backdrop { background: rgba(5, 15, 30, .65); }
.a11y-panel__head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.25rem; background: var(--primary); color: var(--on-primary); position: sticky; top: 0; z-index: 1; }
.a11y-panel__head h2 { margin: 0; font-size: 1.3rem; display: flex; align-items: center; gap: .5rem; }
/* Liens utiles en tête du panneau (site public) */
.a11y-panel__links { padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); }
.a11y-panel__links ul { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0; }
.a11y-panel__links a, .a11y-panel__links a:visited {
    display: inline-flex; align-items: center; gap: .4rem; min-height: 44px; padding: .4rem .9rem;
    border: 2px solid var(--primary); border-radius: 999px; color: var(--primary); font-weight: 700; text-decoration: none;
}
.a11y-panel__links a:hover { background: var(--primary-soft); }
.a11y-panel__subtitle { display: flex; align-items: center; gap: .45rem; margin: 0; padding: 1rem 1.25rem 0; font-size: 1.2rem; }
.a11y-panel__desc { padding: 1rem 1.25rem 0; color: var(--text-muted); margin: 0; }
.a11y-panel__subtitle + .a11y-panel__desc { padding-top: .35rem; }
.a11y-panel__form { padding: 1rem 1.25rem 1.25rem; }
.a11y-group { border: 0; padding: 0; margin: 0 0 1.25rem; }
.a11y-group legend { font-weight: 700; font-size: 1.1rem; margin-bottom: .5rem; }
.a11y-options { display: flex; flex-wrap: wrap; gap: .5rem; }
.a11y-option { position: relative; }
.a11y-option input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.a11y-option label {
    display: inline-flex; align-items: center; gap: .4rem; min-height: 44px; padding: .45rem 1rem; cursor: pointer;
    border: 2px solid var(--border-strong); border-radius: 999px; background: var(--bg); font-size: 1rem;
}
.a11y-option label::before { content: ""; width: 1rem; height: 1rem; border-radius: 50%; border: 2px solid currentColor; flex-shrink: 0; }
.a11y-option input:checked + label { background: var(--primary); color: var(--on-primary); border-color: var(--primary); font-weight: 700; }
.a11y-option input:checked + label::before { background: currentColor; box-shadow: inset 0 0 0 2px var(--primary); }
.a11y-option input:focus-visible + label { box-shadow: 0 0 0 3px var(--focus-ink), 0 0 0 7px var(--focus); }
.a11y-panel__actions { display: flex; flex-wrap: wrap; gap: .75rem; justify-content: space-between; border-top: 1px solid var(--border); padding-top: 1rem; }

/* ---------- Impression ---------- */
@media print {
    .topbar, .search-toggle, .search-dialog, .menu-toggle, .main-nav, .breadcrumbs, .site-footer, .skip-links, .a11y-panel { display: none !important; }
    body { font-size: 12pt; color: #000; background: #fff; }
    a::after { content: " (" attr(href) ")"; font-size: .85em; }
    .card, .org-card, .person { box-shadow: none; break-inside: avoid; }
}
