/* ============================================================
   Base : reset léger, éléments racine, utilitaires
   ============================================================ */

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

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* Les ancres ne doivent pas passer sous le header sticky */
  scroll-padding-top: calc(var(--header-h) + 1rem);
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-body);
  color: var(--ink);
  background-color: var(--bg);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* Sur une page courte, c'est le footer qui s'étire (pas de blanc entre le
   dernier bandeau sombre et le footer). */
main {
  flex: 0 0 auto;
}

.site-footer {
  flex: 1 0 auto;
}

img,
svg,
video {
  display: block;
  max-width: 100%;
  height: auto;
}

h1, h2, h3, h4 {
  line-height: var(--leading-tight);
  font-weight: 700;
  color: var(--primary-dark);
  text-wrap: balance;
}

/* Titres éditoriaux en serif ; les h3/h4 de l'interface restent en sans */
h1,
h2,
.section-title {
  font-family: var(--font-display);
  letter-spacing: -0.01em;
}

p {
  text-wrap: pretty;
}

a {
  color: var(--secondary);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:hover {
  color: var(--primary);
}

button {
  font: inherit;
}

ul[class],
ol[class] {
  list-style: none;
  padding: 0;
}

:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
  border-radius: 2px;
}

::selection {
  background: var(--primary-soft);
  color: #fff;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ----- Utilitaires ----- */

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

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

.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-4);
  z-index: 100;
  padding: var(--space-2) var(--space-4);
  background: var(--primary-dark);
  color: #fff;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  text-decoration: none;
}

.skip-link:focus {
  top: 0;
  color: #fff;
}

/* ----- Sections ----- */

.section {
  padding-block: var(--section-y);
}

.section--primary {
  background: var(--primary-dark);
  color: #fff;
}

.section--primary h2 {
  color: #fff;
}

.section-head {
  max-width: 46rem;
  margin-bottom: var(--space-6);
}

.section-head--center {
  margin-inline: auto;
  text-align: center;
}

.section-eyebrow {
  display: inline-block;
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--space-2);
}

.section--primary .section-eyebrow {
  color: #d7efe4;
}

.section-title {
  font-size: var(--text-3xl);
  margin-bottom: var(--space-3);
}

.section-intro {
  color: var(--ink-soft);
  font-size: var(--text-lg);
}

.section--primary .section-intro {
  color: rgb(255 255 255 / 0.8);
}

/* ----- Page d'erreur (rendue hors moteur de templates) ----- */

.error-page {
  min-height: 70vh;
  display: flex;
  align-items: center;
}

.error-page__inner {
  text-align: center;
}

.error-page .section-intro {
  margin-inline: auto;
  margin-bottom: var(--space-6);
}

.error-page__nav {
  margin-top: var(--space-7);
}

.error-page__nav h2 {
  margin-bottom: var(--space-3);
  font-size: var(--text-lg);
}

.error-page__nav ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-2) var(--space-5);
}
