/* ==========================================================================
   layout.css — contenants, grilles, structure de page (header/main/footer).
   Aucune hauteur fixe : rien ne coupe un texte agrandi. Sans débordement à 320px.
   ========================================================================== */

.container {
  width: 100%;
  max-width: var(--max-content);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* Rythme vertical des grandes sections */
.section { padding-block: var(--section-y); }
.section + .section { border-top: var(--bw) solid var(--border); }

/* Alternance de fond pour distinguer nettement les sections */
.section--alt { background: var(--surface-2); }
.section--surface { background: var(--surface); }

/* Grilles fluides : min(100%, …) empêche tout débordement à 320px CSS */
.grid { display: grid; gap: var(--space-5); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr)); }

.stack { display: flex; flex-direction: column; gap: var(--space-4); }
.cluster { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; }

/* --- En-tête du site ----------------------------------------------------- */
.site-header {
  background: var(--surface);
  border-bottom: var(--bw) solid var(--border);
}
.site-header__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-4) var(--space-6);
  padding-block: var(--space-4);
}
.site-brand { display: flex; flex-direction: column; line-height: 1.25; flex: 0 0 auto; }
.site-brand__name { font-size: 1.0625rem; font-weight: 700; color: var(--text); white-space: nowrap; }
.site-brand__role { font-family: var(--font-mono); font-size: 0.75rem; color: var(--faint); }

/* --- Navigation ---------------------------------------------------------- */
.site-nav ul {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-5);
}
.site-nav a {
  display: inline-block;
  padding-block: var(--space-1);
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
}
.site-nav a:hover { color: var(--text); }
.site-nav a[aria-current="page"] {
  color: var(--primary);
  box-shadow: inset 0 -2px var(--primary);
}
.site-header__lang { margin-left: auto; }

/* --- Contenu principal --------------------------------------------------- */
main { display: block; }

/* --- Pied de page -------------------------------------------------------- */
.site-footer {
  background: var(--footer-bg);
  color: var(--footer-text);
  padding-block: var(--space-8) var(--space-6);
}
.site-footer a { color: var(--footer-text); }
.site-footer a:hover { color: #fff; }
.site-footer__nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-5);
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-footer__nav a { font-size: var(--fs-small); }
@media (max-width: 560px) { .site-footer__nav ul { flex-direction: column; gap: var(--space-2); } }
.site-footer__grid {
  display: grid;
  gap: var(--space-6);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr));
}
.site-footer__bottom {
  margin-top: var(--space-6);
  padding-top: var(--space-5);
  border-top: var(--bw) solid var(--border-strong);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  justify-content: space-between;
}

/* Badge « CSS valide » W3C (lot 13) — images officielles servies localement,
   dimensions d'origine (88 × 31). Un seul badge visible selon le thème actif :
   classique sur les thèmes clairs, bleu sur les thèmes sombres, y compris en
   mode « auto » (suit l'OS) et après bascule sans rechargement. */
.css-badge { display: inline-flex; line-height: 0; }
.footer-badges { display: inline-flex; align-items: center; gap: var(--space-3); }
.css-badge img { display: block; width: 88px; height: 31px; }
/* Badge texte « HTML valide » — harmonisé avec le badge CSS (hauteur 31px). */
.html-badge {
  display: inline-flex; align-items: stretch; height: 31px; overflow: hidden;
  border-radius: 4px; font-size: 0; line-height: 0;
  border: 1px solid color-mix(in oklab, var(--on-deep) 45%, transparent);
}
.html-badge__mark, .html-badge__label {
  display: inline-flex; align-items: center; padding: 0 8px;
  font-weight: 700; font-size: 12px; line-height: 1; letter-spacing: .02em;
}
.html-badge__mark { background: #005a9c; color: #fff; }
.html-badge__label { background: color-mix(in oklab, var(--on-deep) 12%, transparent); color: var(--on-deep); font-weight: 600; }
.html-badge:hover .html-badge__mark { background: #0866D9; }
