/* ==========================================================================
   Base — reset léger, typographie globale, accessibilité (cf. §13)
   ========================================================================== */

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

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  overflow-x: hidden;          /* garde-fou anti-débordement horizontal mobile */
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

body {
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  transition: background-color var(--duration-base) var(--ease-out),
    color var(--duration-base) var(--ease-out);
}

img,
picture,
svg {
  display: block;
  max-width: 100%;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  text-wrap: balance;
}

h1 {
  font-size: var(--text-display);
  text-transform: uppercase;
  overflow-wrap: break-word;   /* évite qu'un titre XXL ne pousse la page */
}

h2 {
  font-size: var(--text-2xl);
  text-transform: uppercase;
}

h3 {
  font-size: var(--text-xl);
}

p {
  text-wrap: pretty;
}

a {
  color: inherit;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

ul,
ol {
  padding-left: var(--space-md);
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

/* --- Accessibilité : focus visibles partout (§13) --- */
:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* --- Lien d'évitement clavier --- */
.skip-link {
  position: absolute;
  left: var(--space-sm);
  top: -100px;
  z-index: var(--z-skiplink);
  background: var(--color-text);
  color: var(--color-bg);
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-sm);
  font-weight: var(--weight-bold);
  transition: top var(--duration-fast) var(--ease-out);
}

.skip-link:focus {
  top: var(--space-sm);
}

/* --- Masqué visuellement mais lisible par lecteur d'écran --- */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* --- Honeypot anti-spam : masqué pour les humains, laissé dans le DOM
   pour piéger les bots. Hors flux, hors tabulation, invisible. --- */
.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* --- Conteneur de contenu --- */
.container {
  width: 100%;
  max-width: var(--content-max);
  margin-inline: auto;
  padding-inline: var(--content-pad);
}

.section {
  padding-block: var(--space-2xl);
}

.section__title {
  margin-bottom: var(--space-lg);
}

/* Un titre suivi d'un lead lui « appartient » : on resserre l'espace qui les
   sépare (16px) tout en gardant l'espace au-dessus du titre plus grand (§5). */
.section__title:has(+ .section__lead) {
  margin-bottom: var(--space-sm);
}

/* --- Utilitaires d'espacement (remplacent les styles inline, CSP-friendly) --- */
.mt-8 {
  margin-top: var(--space-lg);
}

.mt-12 {
  margin-top: var(--space-xl);
}

/* Colonne de texte à la mesure de lecture confortable (1.Regles.md §8 & §13).
   À poser sur les paragraphes de contenu qui ne vivent pas déjà dans un
   composant contraint (carte, lead…). */
.prose {
  max-width: var(--measure);
}
