/*
 * typography.css
 * Échelle typographique, fonts, styles de base du texte
 */

/* ── Variables ── */
:root {
  --f-display : 'Playfair Display', Georgia, serif;
  --f-body    : 'DM Sans', system-ui, sans-serif;

  /* Échelle modulaire (ratio 1.25) */
  --f-xs  : 0.64rem;   /* 10.9px — labels, eyebrows   */
  --f-sm  : 0.75rem;   /* 12.75px — dates, captions   */
  --f-base: 1rem;      /* 17px — corps de texte       */
  --f-md  : 1.15rem;   /* 19.5px — intro, lead        */
  --f-lg  : 1.4rem;    /* 23.8px — h2                 */
  --f-xl  : 1.8rem;    /* 30.6px — h1 post            */
  --f-2xl : 2.4rem;    /* 40.8px — hero               */
  --f-3xl : 3.2rem;    /* 54.4px — hero large         */

  /* Espacement lettre */
  --ls-tight : -0.025em;
  --ls-normal:  0;
  --ls-wide  :  0.1em;
  --ls-wider :  0.16em;
  --ls-widest:  0.2em;

  /* Hauteur de ligne */
  --lh-tight  : 1.08;
  --lh-snug   : 1.25;
  --lh-normal : 1.5;
  --lh-relaxed: 1.75;
  --lh-loose  : 1.85;
}

/* ── Base ── */
html {
  font-size: 17px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--f-body);
  font-weight: 400;
  line-height: var(--lh-relaxed);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Titres ── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--f-display);
  font-weight: 700;
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-tight);
  color: var(--ink);
  margin: 0 0 0.75em;
}

h1 { font-size: clamp(var(--f-xl), 3.5vw, var(--f-2xl)); font-weight: 900; }
h2 { font-size: var(--f-lg); }
h3 { font-size: var(--f-base); letter-spacing: var(--ls-normal); }
h4 { font-size: var(--f-sm); text-transform: uppercase; letter-spacing: var(--ls-wide); font-family: var(--f-body); font-weight: 500; }

/* ── Corps de texte ── */
p {
  margin: 0 0 1.4rem;
  max-width: 65ch;
}

/* ── Liens ── */
a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.15s;
}

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

/* ── Emphases ── */
strong, b { font-weight: 700; }
em, i     { font-style: italic; }

/* ── Blockquote ── */
blockquote {
  border-left: 2px solid var(--accent);
  padding-left: 1.4rem;
  margin: 2rem 0;
  font-family: var(--f-display);
  font-style: italic;
  font-size: var(--f-md);
  line-height: var(--lh-snug);
  max-width: 52ch;
  color: var(--ink);
}

blockquote cite {
  display: block;
  margin-top: 0.6rem;
  font-size: var(--f-sm);
  font-style: normal;
  font-family: var(--f-body);
  color: var(--ink-soft);
}

/* ── Code ── */
code, kbd, samp {
  font-family: 'Fira Code', 'Courier New', monospace;
  font-size: 0.88em;
  background: var(--bg-alt);
  padding: 0.1em 0.35em;
  border-radius: 2px;
}

pre {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  padding: 1.2rem 1.4rem;
  overflow-x: auto;
  margin: 2rem 0;
  font-size: 0.85rem;
  line-height: 1.6;
}

pre code { background: none; padding: 0; }

/* ── Listes ── */
ul, ol {
  padding-left: 1.4rem;
  margin-bottom: 1.4rem;
  max-width: 60ch;
}

li { margin-bottom: 0.35rem; }

/* ── Figcaption ── */
figcaption {
  font-size: var(--f-sm);
  color: var(--ink-soft);
  font-style: italic;
  margin-top: 0.5rem;
}

/* ── Helpers texte ── */
.eyebrow {
  font-family: var(--f-body);
  font-size: var(--f-xs);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: var(--ls-widest);
  color: var(--ink-soft);
}

.eyebrow--accent { color: var(--accent); }

.section-label {
  font-size: var(--f-xs);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: var(--ls-widest);
  color: var(--ink-soft);
  margin-bottom: 1.8rem;
  display: block;
}
