/* =====================================================================
   base.css — les réglages de base de toutes les pages
   (remise à zéro des styles du navigateur, textes, liens, accessibilité)
   ===================================================================== */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 20px); /* les ancres ne passent pas sous l'en-tête */
  -webkit-text-size-adjust: 100%;
  overflow-x: clip; /* empêche tout défilement horizontal sur mobile */
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color .35s ease, color .35s ease;
}

h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--font-heading);
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--text);
}
h2, h3, h4 { font-weight: 600; }

p { margin: 0; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}
input, textarea, select { font: inherit; }

::selection { background: var(--blue); color: var(--white); }

/* Contour visible quand on navigue au clavier (touche Tab) */
:focus-visible {
  outline: 2px solid var(--blue-light);
  outline-offset: 3px;
  border-radius: 6px;
}

/* Texte lu par les lecteurs d'écran mais invisible à l'écran */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Lien « Aller au contenu » (visible seulement au clavier) */
.skip-link {
  position: absolute;
  left: 16px; top: -60px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  background: var(--blue);
  color: var(--white);
  font-weight: 600;
}
.skip-link:focus { top: 12px; }

/* Afficher un élément seulement dans un thème (ex. le logo blanc en sombre) */
[data-theme="light"] .only-dark,
[data-theme="dark"] .only-light { display: none !important; }

[hidden] { display: none !important; }
