/* =========================================================
   BASE — remise à zéro et styles par défaut des éléments
   ========================================================= */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-text);
  font-weight: 400;
  font-size: var(--fs-sm);
  line-height: 1.6;
  letter-spacing: var(--ls-text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* Empêche le défilement de la page quand un panneau (menu, panier) est ouvert */
body.is-locked { overflow: hidden; }

/* L'attribut hidden doit toujours masquer, même si un style donne un display */
[hidden] { display: none !important; }

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

h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: var(--ls-display);
  line-height: 1.2;
}

p { margin: 0; }

a { color: inherit; text-decoration: none; }

button, input, select, textarea {
  font: inherit;
  letter-spacing: inherit;
  color: inherit;
}

button { cursor: pointer; background: none; border: 0; padding: 0; }

ul, ol { margin: 0; padding: 0; list-style: none; }

fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend { padding: 0; }

/* Focus clavier visible, couleur « éclipse » */
:focus-visible {
  outline: 1px solid var(--eclipse);
  outline-offset: 3px;
}

::selection { background: var(--stone-1); color: var(--ink); }

.nowrap { white-space: nowrap; }

/* Texte réservé aux lecteurs d'écran */
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}

/* Lien d'évitement (accessibilité clavier) */
.skip-link {
  position: absolute; left: var(--gutter); top: -100px;
  z-index: 100; padding: var(--space-1) var(--space-2);
  background: var(--ink); color: var(--paper);
}
.skip-link:focus { top: var(--space-1); }

/* Respect des personnes qui ont désactivé les animations */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
