/* ─────────────────────────────────────────────────────────────
   base.css — Typographie, body, éléments HTML de base
   ───────────────────────────────────────────────────────────── */

/* ── Google Fonts (Inter) ────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* ── Base document ───────────────────────────────────────────── */
html {
  font-size: 16px;
  scroll-padding-top: calc(var(--header-height) + var(--space-6));
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: var(--font-weight-normal);
  line-height: var(--leading-normal);
  color: var(--color-text);
  background-color: var(--color-bg);
}

/* ── Titres ──────────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-weight: var(--font-weight-bold);
  line-height: var(--leading-tight);
  color: var(--color-gray-900);
  letter-spacing: -0.02em;
}

h1 { font-size: var(--text-5xl); }
h2 { font-size: var(--text-4xl); }
h3 { font-size: var(--text-3xl); }
h4 { font-size: var(--text-2xl); }
h5 { font-size: var(--text-xl); }
h6 { font-size: var(--text-lg); }

@media (max-width: 768px) {
  h1 { font-size: var(--text-4xl); }
  h2 { font-size: var(--text-3xl); }
  h3 { font-size: var(--text-2xl); }
}

@media (max-width: 480px) {
  h1 { font-size: var(--text-3xl); }
  h2 { font-size: var(--text-2xl); }
  h3 { font-size: var(--text-xl); }
}

/* ── Paragraphes & texte ─────────────────────────────────────── */
p {
  line-height: var(--leading-relaxed);
  color: var(--color-gray-700);
}

.lead {
  font-size: var(--text-lg);
  line-height: var(--leading-relaxed);
  color: var(--color-gray-600);
}

.text-muted  { color: var(--color-text-muted); }
.text-subtle { color: var(--color-text-subtle); }
.text-primary{ color: var(--color-primary); }
.text-success{ color: var(--color-success); }
.text-warning{ color: var(--color-warning); }
.text-error  { color: var(--color-error); }

.text-xs   { font-size: var(--text-xs); }
.text-sm   { font-size: var(--text-sm); }
.text-base { font-size: var(--text-base); }
.text-lg   { font-size: var(--text-lg); }
.text-xl   { font-size: var(--text-xl); }

.font-medium   { font-weight: var(--font-weight-medium); }
.font-semibold { font-weight: var(--font-weight-semibold); }
.font-bold     { font-weight: var(--font-weight-bold); }

/* ── Liens ───────────────────────────────────────────────────── */
a {
  color: var(--color-primary);
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 3px;
  transition: text-decoration-color var(--transition-fast);
}

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

/* ── Code ────────────────────────────────────────────────────── */
code, pre {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

code {
  background: var(--color-primary-50);
  color: var(--color-primary-700);
  padding: 0.125em 0.375em;
  border-radius: var(--radius-sm);
}

pre {
  background: var(--color-gray-900);
  color: var(--color-gray-100);
  padding: var(--space-6);
  border-radius: var(--radius-lg);
  overflow-x: auto;
}

/* ── Listes ──────────────────────────────────────────────────── */
.prose ul {
  list-style: disc;
  padding-left: var(--space-6);
}

.prose ol {
  list-style: decimal;
  padding-left: var(--space-6);
}

.prose li { margin-bottom: var(--space-2); }

/* ── HR ──────────────────────────────────────────────────────── */
hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: var(--space-8) 0;
}

/* ── Selection ───────────────────────────────────────────────── */
::selection {
  background-color: var(--color-primary-200);
  color: var(--color-primary-900);
}

/* ── Scrollbar custom (WebKit) ───────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--color-gray-100); }
::-webkit-scrollbar-thumb {
  background: var(--color-gray-300);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover { background: var(--color-gray-400); }

/* ── Utilitaires de layout rapide ────────────────────────────── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border-width: 0;
}

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

@media (max-width: 640px) {
  .container { padding-inline: var(--space-4); }
}
