/* ==========================================================================
   CERVOLAND — BASE
   Remise à plat, typographie, grille et utilitaires. Ne déclare aucune
   couleur en dur : tout vient de tokens.css.
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: var(--c-fond);
  color: var(--c-texte);
  font-family: var(--font-texte);
  font-size: var(--fs-base);
  font-weight: var(--fw-texte);
  line-height: var(--lh-texte);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--font-titre);
  font-weight: var(--fw-titre);
  line-height: var(--lh-titre);
  letter-spacing: var(--ls-titre);
  color: var(--c-titre);
  text-wrap: balance;
  overflow-wrap: break-word; /* « neurodéveloppementaux » en Poppins 30 px dépasse 358 px : coupure autorisée */
  hyphens: manual; /* pas de césure automatique : titres coupés (Nelly, 11 oct.) */
}
h1 { font-size: var(--fs-3xl); }
h2 { font-size: var(--fs-2xl); }
h3 { font-size: var(--fs-xl); }
h4 { font-size: var(--fs-lg); }

p, ul, ol, figure, blockquote { margin: 0; }
p { text-wrap: pretty; }
ul, ol { padding: 0; }
ul[class], ol[class] { list-style: none; }

a {
  color: var(--c-lien);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.2em;
  transition: color var(--dur-rapide) var(--ease-standard);
}
a:hover { color: var(--c-lien-survol); }

img, video { display: block; max-width: 100%; height: auto; }
svg { max-width: 100%; }
/* Icônes inline (sans classe) : 1 em, alignées sur le texte */
svg:not([class]) { width: 1.125em; height: 1.125em; flex: none; vertical-align: -0.2em; }
nav ul, .pied ul { list-style: none; padding: 0; }
[hidden] { display: none !important; }

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

strong { font-weight: var(--fw-semibold); }
small { font-size: var(--fs-sm); }

hr { border: 0; border-top: var(--bordure-fine) solid var(--c-bordure); margin: 0; }

/* Focus visible partout, jamais retiré (brief §17) */
:focus-visible {
  outline: 2px solid transparent;
  box-shadow: var(--anneau-focus);
  border-radius: var(--r-sm);
}
@media (forced-colors: active) {
  :focus-visible { outline: 2px solid CanvasText; }
}

/* Lien d'évitement */
.evitement {
  position: absolute;
  left: var(--sp-4);
  top: -100px;
  z-index: var(--z-toast);
  padding: var(--sp-3) var(--sp-5);
  background: var(--c-encre);
  color: var(--c-texte-inverse);
  border-radius: var(--r-sm);
  text-decoration: none;
}
.evitement:focus { top: var(--sp-4); }

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

/* --------------------------------------------------------------------------
   Grille et rythme
   -------------------------------------------------------------------------- */
.conteneur {
  width: min(100% - 2 * var(--gouttiere), var(--largeur-contenu));
  margin-inline: auto;
}
.conteneur--large  { width: min(100% - 2 * var(--gouttiere), var(--largeur-large)); }
.conteneur--etroit { max-width: var(--largeur-etroite); }
.conteneur--texte  { max-width: var(--largeur-texte); }

.section { padding-block: var(--sp-section); }
.section--serree { padding-block: var(--sp-7); }
.section--douce { background: var(--c-fond-doux); }
.section--univers { background: var(--univers-fond); }
.section--bordee {
  border-top: var(--bordure-epaisse) solid var(--c-bordure-forte);
  border-bottom: var(--bordure-epaisse) solid var(--c-bordure-forte);
}

.pile { display: flex; flex-direction: column; gap: var(--sp-4); }
.pile--serree { gap: var(--sp-2); }
.pile--large { gap: var(--sp-6); }
.pile--bloc { gap: var(--sp-bloc); }

.rang { display: flex; flex-wrap: wrap; gap: var(--sp-4); align-items: center; }
.rang--entre { justify-content: space-between; }
.rang--fin { justify-content: flex-end; }

.grille {
  display: grid;
  gap: var(--sp-6);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
}
.grille--2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); }
.grille--3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr)); }

/* Deux colonnes média + texte, empilées sous 768 px */
.duo {
  display: grid;
  gap: var(--sp-7);
  align-items: center;
}
.duo > * { min-width: 0; } /* une colonne ne s'élargit jamais au-delà de la grille */
@media (min-width: 48em) {
  .duo { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
  .duo--inverse { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
  .duo--egal { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* --------------------------------------------------------------------------
   Texte
   -------------------------------------------------------------------------- */
.surtitre {
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--ls-caps);
  text-transform: uppercase;
  color: var(--c-accent-fonce);
}
.intro {
  font-size: var(--fs-md);
  font-weight: var(--fw-leger);
  max-width: var(--mesure);
}
.mesure { max-width: var(--mesure); }
.mesure-etroite { max-width: var(--mesure-etroite); }
.texte-2 { color: var(--c-texte-2); }
.petit { font-size: var(--fs-sm); }
.centre { text-align: center; }
.centre > * { margin-inline: auto; }

.prose > * + * { margin-top: var(--sp-4); }
.prose h2 { margin-top: var(--sp-7); }
.prose h3 { margin-top: var(--sp-6); }
.prose ul, .prose ol { padding-left: 1.25em; }
.prose li + li { margin-top: var(--sp-2); }
