/* =========================================================================
   Luc Bodenghien — Expert Judiciaire
   Design tokens : couleurs, typographie, espacements
   ========================================================================= */

/* --- Fonts ---------------------------------------------------------------- */
@import url('https://fonts.googleapis.com/css2?family=Spectral:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400;1,600&family=Source+Serif+4:ital,opsz,wght@0,8..60,300;0,8..60,400;0,8..60,500;0,8..60,600;0,8..60,700;1,8..60,400&family=IBM+Plex+Sans:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  /* === Encre & papier ==================================================== */
  --paper:        #f5f3ed;   /* fond principal, crème parchemin */
  --paper-warm:   #faf8f2;   /* nuance plus claire pour cards sur fond sombre */
  --paper-deep:   #ebe7da;   /* zone secondaire, fond de section */

  --ink-100:      #14201c;   /* encre la plus dense, titres et corps gras */
  --ink-90:       #1f2c27;
  --ink-80:       #2a3833;
  --ink-70:       #3a4843;
  --ink-60:       #54635d;
  --ink-50:       #6e7c76;
  --ink-40:       #8a958f;
  --ink-30:       #b3bab5;   /* filets horizontaux dans les listes */
  --ink-20:       #d4d8d3;
  --ink-10:       #e5e7e2;

  /* === Couleurs primaires (héritées du paysage) ========================== */
  --green-900:    #0e2419;
  --green-800:    #14301f;
  --green-700:    #1c3a2e;   /* vert forêt — primaire */
  --green-600:    #2a4d3d;
  --green-500:    #3a6450;
  --green-400:    #587e6a;
  --green-200:    #b7c8be;
  --green-100:    #d8e0d8;
  --green-50:     #e9eee8;

  --blue-900:     #0f2230;
  --blue-800:     #15303f;
  --blue-700:     #1e3a4f;   /* bleu nuit — secondaire */
  --blue-600:     #2a4e66;
  --blue-500:     #3d6580;
  --blue-400:     #5b809a;
  --blue-200:     #b8c8d3;
  --blue-100:     #d6e0e7;
  --blue-50:      #e8eef2;

  /* === Accent ============================================================ */
  --bordeaux-900: #4a141c;
  --bordeaux-700: #6b1f2a;   /* bordeaux feutré — autorité, liens doctrinaux */
  --bordeaux-500: #8b3a44;
  --bordeaux-200: #d9bdc1;

  /* === Sémantique ======================================================== */
  --bg:               var(--paper);
  --bg-elevated:      var(--paper-warm);
  --bg-deep:          var(--paper-deep);
  --bg-inverted:      var(--green-700);
  --bg-inverted-alt:  var(--blue-700);

  --fg:               var(--ink-100);
  --fg-muted:         var(--ink-60);
  --fg-dim:           var(--ink-50);
  --fg-on-dark:       var(--paper);
  --fg-on-dark-muted: #c8cfc8;

  --rule:             var(--ink-30);   /* filets horizontaux */
  --rule-strong:      var(--ink-100);
  --rule-accent:      var(--bordeaux-700);

  --link:             var(--ink-100);
  --link-authority:   var(--bordeaux-700);   /* liens vers arrêts, doctrines */
  --link-external:    var(--blue-700);

  /* === Type families ===================================================== */
  --font-display: 'Spectral', 'Times New Roman', Georgia, serif;
  --font-body:    'Source Serif 4', 'Spectral', Georgia, serif;
  --font-ui:      'IBM Plex Sans', 'Helvetica Neue', Helvetica, system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', 'SF Mono', Menlo, monospace;

  /* === Echelle typographique (éditoriale) =============================== */
  --t-display-xl: 4.5rem;    /* 72 — manchette une */
  --t-display:    3.5rem;    /* 56 — titre de page */
  --t-h1:         2.5rem;    /* 40 — titre d'article */
  --t-h2:         1.75rem;   /* 28 — section */
  --t-h3:         1.25rem;   /* 20 — sous-section */
  --t-body:       1.125rem;  /* 18 — corps de lecture */
  --t-small:      0.9375rem; /* 15 — corps secondaire, captions */
  --t-meta:       0.8125rem; /* 13 — métadonnées, surtitres */
  --t-micro:      0.6875rem; /* 11 — labels, monospace, refs */

  --lh-display:   1.05;
  --lh-display-2: 1.10;
  --lh-h:         1.18;
  --lh-h-sub:     1.30;
  --lh-body:      1.55;
  --lh-tight:     1.35;

  --tracking-tight:   -0.015em;
  --tracking-display: -0.020em;
  --tracking-label:    0.10em;     /* IBM Plex en surtitre */
  --tracking-meta:     0.04em;

  /* === Espacement (grille de 4) ========================================= */
  --space-1:   4px;
  --space-2:   8px;
  --space-3:   12px;
  --space-4:   16px;
  --space-5:   24px;
  --space-6:   32px;
  --space-7:   48px;
  --space-8:   64px;
  --space-9:   96px;
  --space-10: 128px;

  /* === Layout ============================================================ */
  --container-max:    1280px;
  --container-narrow: 1040px;
  --container-read:   680px;    /* lecture d'article */
  --gutter:           24px;

  /* === Misc ============================================================= */
  --radius:        0;            /* franc, sauf portraits ronds */
  --radius-photo:  50%;
  --hairline:      1px solid var(--rule);
  --thickline:     3px solid var(--rule-strong);
  --accent-line:   3px solid var(--rule-accent);

  --shadow-photo:  0 12px 32px -16px rgba(28, 58, 46, .25);

  --ease:          cubic-bezier(.2, .8, .2, 1);
  --dur:           160ms;
}

/* =========================================================================
   Styles sémantiques applicables
   ========================================================================= */

html { background: var(--bg); color: var(--fg); }

body {
  font-family: var(--font-body);
  font-size: var(--t-body);
  line-height: var(--lh-body);
  font-weight: 400;
  font-feature-settings: "kern", "liga", "onum";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.display-xl,
.display,
h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--fg);
  font-weight: 700;
  text-wrap: balance;
}

.display-xl {
  font-size: var(--t-display-xl);
  line-height: var(--lh-display);
  letter-spacing: var(--tracking-display);
  font-weight: 700;
}

.display {
  font-size: var(--t-display);
  line-height: var(--lh-display-2);
  letter-spacing: var(--tracking-display);
}

h1, .t-h1 {
  font-size: var(--t-h1);
  line-height: var(--lh-h);
  letter-spacing: var(--tracking-tight);
  font-weight: 700;
}

h2, .t-h2 {
  font-size: var(--t-h2);
  line-height: var(--lh-h);
  letter-spacing: var(--tracking-tight);
  font-weight: 600;
}

h3, .t-h3 {
  font-size: var(--t-h3);
  line-height: var(--lh-h-sub);
  font-weight: 600;
}

p, .t-body { font-size: var(--t-body); line-height: var(--lh-body); }
.t-small   { font-size: var(--t-small); line-height: var(--lh-body); }

/* Surtitres et métadonnées en IBM Plex */
.t-meta, .meta {
  font-family: var(--font-ui);
  font-size: var(--t-meta);
  letter-spacing: var(--tracking-meta);
  text-transform: uppercase;
  color: var(--fg-muted);
  font-weight: 500;
}

.t-label {
  font-family: var(--font-ui);
  font-size: var(--t-micro);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--fg-muted);
  font-weight: 600;
}

.t-mono, code, kbd {
  font-family: var(--font-mono);
  font-size: 0.95em;
}

/* Citation / pull quote */
.pull-quote {
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--t-h2);
  line-height: var(--lh-h);
  color: var(--fg);
  border-left: var(--accent-line);
  padding-left: var(--space-5);
  margin: var(--space-7) 0;
}

/* Lettrine (drop cap) à appliquer manuellement sur .lettrine */
.lettrine::first-letter {
  font-family: var(--font-display);
  font-weight: 700;
  float: left;
  font-size: 4.5em;
  line-height: 0.85;
  padding: 0.08em 0.08em 0 0;
  color: var(--fg);
}

/* Liens */
a {
  color: var(--link);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: var(--ink-40);
  transition: text-decoration-color var(--dur) var(--ease);
}
a:hover { text-decoration-color: var(--link); }
a.authority { color: var(--link-authority); text-decoration-color: var(--bordeaux-200); }
a.authority:hover { text-decoration-color: var(--link-authority); }

hr { border: 0; border-top: var(--hairline); margin: var(--space-6) 0; }
hr.thick { border-top: var(--thickline); }
hr.accent { border-top: var(--accent-line); }
