/* Fait ou à faire. Feuille de style unique, sans dépendance externe.
   Cible WCAG 2.1 AAA sur les contrastes, plancher AA garanti.
   Aucune police distante, aucun script, aucune requête sortante. */

@font-face {
  font-family: "Luciole";
  src: url("../fonts/Luciole-Regular.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Luciole";
  src: url("../fonts/Luciole-Bold.woff2") format("woff2");
  font-weight: 700; font-style: normal; font-display: swap;
}

:root {
  --fond: #ffffff;
  --texte: #1a1a1a;          /* 17,4:1 sur blanc */
  --texte-doux: #4a4a4a;     /* 8,9:1 */
  --lien: #14532d;           /* 9,1:1, vert d'encre : se distingue du bleu de l'Etat */
  --lien-visite: #5b2547;    /* 8,6:1 */
  --trait: #767676;          /* 4,6:1, usage non textuel */
  --fond-alt: #f4f4f4;
  --focus: #b8003a;
}

@media (prefers-color-scheme: dark) {
  :root {
    --fond: #121212;
    --texte: #e8e8e8;        /* 15,8:1 */
    --texte-doux: #b4b4b4;   /* 9,1:1 */
    --lien: #7dd3a0;         /* 10,4:1 */
    --lien-visite: #e0a9cf;
    --trait: #8a8a8a;
    --fond-alt: #1e1e1e;
    --focus: #ffb3c6;
  }
}

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

body {
  margin: 0;
  background: var(--fond);
  color: var(--texte);
  font-family: "Luciole", "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  font-size: 1.125rem;
  line-height: 1.7;
  text-align: left;          /* jamais justify : crée des rivières sur texte long */
}

/* Lien d'évitement, visible au focus uniquement */
.evitement {
  position: absolute; left: -9999px; top: 0;
  background: var(--fond); color: var(--texte);
  padding: 1rem 1.5rem; border: 3px solid var(--focus); z-index: 10;
}
.evitement:focus { left: 0; }

a { color: var(--lien); text-underline-offset: 0.2em; }
a:visited { color: var(--lien-visite); }
a:hover { text-decoration-thickness: 3px; }

/* Focus très visible, contraste largement supérieur à 3:1 */
a:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 2px;
}

.bandeau, .pied, main { max-width: 46rem; margin: 0 auto; padding: 1.5rem 1.25rem; }

.bandeau { border-bottom: 2px solid var(--trait); }
.marque { font-weight: 700; font-size: 1.25rem; margin: 0 0 0.75rem; }
.marque a { color: var(--texte); text-decoration: none; }
.marque a:hover, .marque a:focus-visible { text-decoration: underline; }

.bandeau nav ul { list-style: none; display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; margin: 0; padding: 0; }
/* Cibles tactiles d'au moins 44 px de haut */
.bandeau nav a { display: inline-block; min-height: 44px; line-height: 44px; }

main { padding-top: 2rem; padding-bottom: 3rem; }

h1 { font-size: 1.9rem; line-height: 1.3; margin: 0 0 0.5rem; }
h2 { font-size: 1.45rem; line-height: 1.35; margin: 2.5rem 0 0.75rem; }
h3 { font-size: 1.2rem; margin: 2rem 0 0.5rem; }

.collection, .date, .soustitre { color: var(--texte-doux); margin: 0.25rem 0; }
.collection { text-transform: none; font-weight: 700; }
.entete-doc { border-bottom: 1px solid var(--trait); padding-bottom: 1.25rem; margin-bottom: 2rem; }
.chapo { font-size: 1.2rem; }

p, li { max-width: 42rem; }
li { margin-bottom: 0.4rem; }

blockquote {
  border-left: 4px solid var(--trait);
  margin: 1.5rem 0; padding: 0.25rem 0 0.25rem 1.25rem;
  color: var(--texte);
}

code { background: var(--fond-alt); padding: 0.1em 0.35em; font-size: 0.95em; }

/* Les tableaux larges défilent dans leur propre conteneur, jamais la page */
.tableau-large, table { display: block; overflow-x: auto; max-width: 100%; }
table { border-collapse: collapse; margin: 1.5rem 0; }
th, td { border: 1px solid var(--trait); padding: 0.5rem 0.75rem; text-align: left; vertical-align: top; }
th { background: var(--fond-alt); font-weight: 700; }

.liste-docs { list-style: none; padding: 0; }
.liste-docs li { border: 2px solid var(--trait); padding: 1.25rem; margin-bottom: 1.25rem; }
.liste-docs h3 { margin-top: 0; }

.pied { border-top: 2px solid var(--trait); color: var(--texte-doux); font-size: 1rem; }
.pied a { color: var(--lien); }

@media (prefers-contrast: more) {
  :root { --texte-doux: var(--texte); --trait: var(--texte); }
  a { text-decoration-thickness: 2px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}


/* --- Densité documentaire ------------------------------------------------ */

.bandeau { border-bottom: none; border-top: 5px solid var(--lien); }
.bandeau nav a { color: var(--texte); text-decoration: none; border-bottom: 2px solid transparent; }
.bandeau nav a:hover, .bandeau nav a:focus-visible { border-bottom-color: var(--lien); text-decoration: none; }

/* Fil d'Ariane */
.ariane { font-size: 0.95rem; color: var(--texte-doux); margin: 0 0 1.5rem; }
.ariane ol { list-style: none; display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0; padding: 0; }
.ariane li + li::before { content: "› "; color: var(--texte-doux); }
.ariane [aria-current="page"] { color: var(--texte); font-weight: 700; }

/* Sommaire des documents longs */
.sommaire {
  border: 2px solid var(--trait); border-left: 6px solid var(--lien);
  padding: 1.25rem 1.5rem; margin: 2rem 0; background: var(--fond-alt);
}
.sommaire > p { font-weight: 700; margin: 0 0 0.5rem; }
.sommaire ul { margin: 0; padding-left: 1.25rem; }
.sommaire li { margin-bottom: 0.25rem; }
.sommaire ul ul { margin-top: 0.25rem; }

/* Encadré de mise en garde, pour ce qu'un document ne dit pas */
.encadre {
  border: 2px solid var(--lien); border-left-width: 6px;
  padding: 1.25rem 1.5rem; margin: 2rem 0;
}
.encadre > :first-child { margin-top: 0; }
.encadre > :last-child { margin-bottom: 0; }

/* Titres : hiérarchie plus marquée, repère coloré sur les sections */
h2 { border-bottom: 2px solid var(--trait); padding-bottom: 0.35rem; }
.entete-doc { border-bottom-width: 4px; border-bottom-color: var(--lien); }
.collection { color: var(--lien); font-weight: 700; letter-spacing: 0.02em; }

/* Tableaux : lignes alternées pour suivre une ligne longue du regard */
tbody tr:nth-child(odd) { background: var(--fond-alt); }
caption { text-align: left; font-weight: 700; padding-bottom: 0.5rem; }

/* Liste des documents : allure de fiches, sans ornement */
.liste-docs li { border-width: 0 0 0 6px; border-left-color: var(--lien); background: var(--fond-alt); }
