/*
 * Feuille de style du site de contenu.
 *
 * Elle ne définit **aucune couleur**. La palette arrive par `jetons.css`, engendré depuis
 * `web/src/style.css` — la feuille de l'application — et chargé avant celle-ci.
 *
 * Ce fichier a d'abord recopié les jetons à la main, en jugeant qu'une dépendance coûterait plus
 * que vingt lignes. Le compte était faux : huit valeurs avaient déjà divergé de la source, dont
 * l'accent en thème sombre et quatre teintes de texte. Aucune n'était assez fausse pour se voir,
 * ce qui est précisément le problème — un visiteur qui passe d'une fiche à l'application ne doit
 * pas sentir qu'il change de produit, et personne ne compare deux nuanciers à l'œil.
 *
 * Pour changer une couleur : `web/src/style.css`, puis `node tools/build-jetons.mjs`. La porte
 * `npm run verif:jetons` refuse toute divergence entre les trois surfaces.
 */

* { box-sizing: border-box; }
body {
  margin: 0; background: var(--fond); color: var(--texte);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 17px; line-height: 1.62; -webkit-font-smoothing: antialiased;
}
main { max-width: 760px; margin: 0 auto; padding: 32px 20px 80px; }
h1, h2, h3 { line-height: 1.2; text-wrap: balance; margin: 0; }
h1 { font-size: clamp(1.9rem, 5vw, 2.6rem); letter-spacing: -.02em; }
h2 { font-size: 1.4rem; margin-top: 40px; }
h3 { font-size: 1.1rem; margin-top: 26px; }
p { margin: 14px 0; }
a { color: var(--accent); text-underline-offset: 3px; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.entete {
  display: flex; flex-wrap: wrap; gap: 14px 22px; align-items: center;
  padding: 14px 20px; border-bottom: 1px solid var(--bord); background: var(--surface);
}
.marque { font-weight: 800; font-size: 1.15rem; color: var(--texte); text-decoration: none; }
.entete nav { display: flex; flex-wrap: wrap; gap: 16px; flex: 1; }
.entete nav a { color: var(--texte-2); text-decoration: none; font-size: .93rem; }
.entete nav a:hover { color: var(--accent); }
.cta {
  background: var(--accent); color: #fff; text-decoration: none;
  padding: 8px 16px; border-radius: 999px; font-size: .9rem; font-weight: 600;
}

.fil { max-width: 760px; margin: 0 auto; padding: 16px 20px 0; font-size: .84rem; color: var(--texte-3); }
.fil a { color: var(--texte-3); }
.fil span { margin: 0 6px; }
.fil-courant { color: var(--texte-2); }

.chapo { font-size: 1.12rem; color: var(--texte-2); margin: 16px 0 8px; }
.meta { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 4px; padding: 0; list-style: none; }
.meta li {
  font-size: .78rem; padding: 4px 10px; border-radius: 999px;
  background: var(--surface-2); color: var(--texte-2); border: 1px solid var(--bord);
}
.encart {
  background: var(--surface); border: 1px solid var(--bord); border-radius: var(--rayon);
  padding: 18px 20px; margin: 22px 0; box-shadow: var(--ombre);
}
.encart h2, .encart h3 { margin-top: 0; }
.encart-attention { border-left: 3px solid var(--accent); }
.encart-assiette { border-left: 3px solid var(--dom-assiette); }

ol.etapes { padding-left: 22px; }
ol.etapes li { margin: 10px 0; }

.liste { list-style: none; padding: 0; display: grid; gap: 1px; background: var(--bord);
  border: 1px solid var(--bord); border-radius: var(--rayon); overflow: hidden; }
.liste li { background: var(--surface); }
.liste a { display: flex; justify-content: space-between; gap: 14px; align-items: baseline;
  padding: 12px 16px; text-decoration: none; color: var(--texte); }
.liste a:hover { background: var(--surface-2); }
.liste small { color: var(--texte-3); font-size: .8rem; white-space: nowrap; }

.grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; padding: 0; list-style: none; }
.grille li { background: var(--surface); border: 1px solid var(--bord); border-radius: var(--rayon); }
.grille a { display: block; padding: 14px 16px; text-decoration: none; color: var(--texte); }
.grille a:hover { border-color: var(--accent); }
.grille strong { display: block; }
.grille small { color: var(--texte-3); }

table { border-collapse: collapse; width: 100%; font-size: .93rem; margin: 18px 0; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--bord); }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; }
thead th { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--texte-3); font-weight: 500; }

.pied { border-top: 1px solid var(--bord); background: var(--surface); padding: 26px 20px 40px; }
.pied p { max-width: 760px; margin: 8px auto; font-size: .86rem; color: var(--texte-3); }
.pied-liens { display: flex; flex-wrap: wrap; gap: 18px; }

/* ---------- calculateurs ----------
   Le résultat est au-dessus de la ligne de flottaison, avant tout texte : c'est ce que la page
   de résultats de « calcul imc » montre chez les six premiers, et c'est ce que les gens viennent
   chercher. L'explication vient après, jamais avant. */
.outil {
  background: var(--surface); border: 1px solid var(--bord); border-radius: var(--rayon);
  padding: 20px; margin: 22px 0; box-shadow: var(--ombre);
}
.champs { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.champ { display: flex; flex-direction: column; gap: 5px; }
.champ label { font-size: .82rem; color: var(--texte-2); font-weight: 600; }
.champ input, .champ select {
  font: inherit; font-size: 1rem; padding: 9px 11px; border-radius: 10px;
  border: 1px solid var(--bord-fort, var(--bord)); background: var(--fond); color: var(--texte);
  font-variant-numeric: tabular-nums;
}
.champ input:focus-visible, .champ select:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.champ small { color: var(--texte-3); font-size: .75rem; }

.resultat {
  margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--bord);
  display: flex; flex-direction: column; gap: 8px;
}
.resultat .valeur {
  font-size: clamp(2rem, 7vw, 2.9rem); font-weight: 800; line-height: 1;
  color: var(--accent); font-variant-numeric: tabular-nums;
}
.resultat .lecture { font-size: 1.02rem; color: var(--texte); }
.resultat .reserve { font-size: .88rem; color: var(--texte-3); }
.resultat[hidden] { display: none; }
.vide { color: var(--texte-3); font-size: .92rem; }

/* `display: flex` sur .champ écrase la règle par défaut de [hidden], et le champ restait visible.
   Le cas se produit dès qu'un calculateur bascule entre deux modes de saisie. */
.champ[hidden] { display: none; }

/* ---- le bloc de maillage ----
   Une navigation secondaire, pas un encart de contenu : bordure haute plutôt que carte, pour
   qu'elle se lise comme une sortie de page et non comme un paragraphe de plus. */
.maillage { margin: 44px 0 0; padding-top: 20px; border-top: 2px solid var(--bord); }
.maillage h2 { font-size: 1.05rem; margin: 0 0 14px; }
.maillage ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.maillage li { display: flex; flex-direction: column; gap: 2px; }
.maillage a { font-weight: 600; text-decoration: none; }
.maillage a:hover { text-decoration: underline; }
.maillage span { font-size: .86rem; color: var(--texte-2); }
