/* ==========================================================================
   base.css — Reset + body + typo de base
   Pas de classes spécifiques ici. Réf : §6 et §8 du cahier.
   ========================================================================== */

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

/* L'attribut HTML `hidden` doit toujours masquer l'élément, y compris quand
   un display: flex/grid utilisateur est appliqué (la cascade UA est plus
   faible). */
[hidden] {
  display: none !important;
}

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

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  padding-bottom: env(safe-area-inset-bottom, 20px);
  overflow-x: hidden;
}

/* ── Headings ── */
h1, h2, h3, h4 {
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

h1 { font-size: 22px; }
h2 { font-size: 18px; }
h3 { font-size: 15px; }

/* ── Liens ── */
a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease-out);
}

a:hover { color: var(--accent-light); }

/* ── Boutons (reset minimal — styles dans components.css) ── */
button {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

/* ── Inputs (reset minimal) ── */
input,
textarea,
select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  background: none;
  border: none;
  outline: none;
}

/* ── Code ── */
code,
kbd,
samp {
  font-family: var(--font-mono);
  font-size: 0.92em;
}

/* ── Focus visible (accessibilité clavier) ── */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ── Selection ── */
::selection {
  background: var(--accent-glow);
  color: var(--text);
}

/* ── Scrollbar (WebKit) ── */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-dim);
}
