/* =========================================================================
   ESDI MANAGER — 02-typography.css
   Type system : Inter (sans, self-hosted) + Geist Mono (mono, self-hosted) + type scale
   Spec : UX spec ligne 623-653 ("Typography System")
   Fonts self-hosted dans /public/fonts/ (RGPD-safe, pas de CDN Google).
   --font-sans + --font-mono déclarés dans 01-tokens.css.
   ========================================================================= */

/* ---------------------------------------------------------------------------
   @font-face — Inter Variable (open source SIL OFL, source : rsms.me/inter)
   1 fichier WOFF2 ~352 KB couvre tous les weights 100-900 via font-variations.
   --------------------------------------------------------------------------- */
@font-face {
    font-family: 'Inter';
    src: local('Inter'),
         local('Inter Variable'),
         url('/fonts/Inter-Variable.woff2') format('woff2-variations'),
         url('/fonts/Inter-Variable.woff2') format('woff2');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

/* ---------------------------------------------------------------------------
   @font-face — Geist Mono Regular (open source SIL OFL, source : vercel/geist-font)
   --------------------------------------------------------------------------- */
@font-face {
    font-family: 'Geist Mono';
    src: local('Geist Mono'),
         local('GeistMono-Regular'),
         url('/fonts/GeistMono-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

/* ---------------------------------------------------------------------------
   Body — antialias + ligatures
   Spec UX ligne 652-653
   --------------------------------------------------------------------------- */
html,
body {
    font-family: var(--font-sans);
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-feature-settings: "calt" 1; /* ligatures OpenType activées */
    line-height: 1.55;
}

/* ---------------------------------------------------------------------------
   Type scale — Mobile-first (scale up desktop via @media min-width: 992px)
   Spec UX ligne 630-644 (table type scale)
   --------------------------------------------------------------------------- */

.text-h1 {
    font-family: var(--font-sans);
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1.1;
}

.text-h2 {
    font-family: var(--font-sans);
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.020em;
    line-height: 1.15;
}

.text-h3 {
    font-family: var(--font-sans);
    font-size: 18px;
    font-weight: 600;
    letter-spacing: -0.010em;
    line-height: 1.25;
}

.text-body {
    font-family: var(--font-sans);
    font-size: 15px;
    font-weight: 400;
    letter-spacing: 0;
    line-height: 1.55;
}

.text-body-strong {
    font-family: var(--font-sans);
    font-size: 15px;
    font-weight: 500;
    letter-spacing: -0.005em;
    line-height: 1.55;
}

.text-caption {
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 400;
    line-height: 1.45;
}

.text-eyebrow {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    line-height: 1.4;
    color: var(--ink-soft);
}

.text-eyebrow--accent { color: var(--accent-600); }
.text-eyebrow--faded { color: var(--ink-faded); }

.text-kpi {
    font-family: var(--font-sans);
    font-size: 28px;
    font-weight: 600;
    letter-spacing: -0.020em;
    line-height: 1.0;
    font-variant-numeric: tabular-nums;
}

.text-code {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 400;
    line-height: 1.4;
    font-variant-numeric: tabular-nums;
}

/* Desktop scale-up (≥992px) */
@media (min-width: 992px) {
    .text-h1 { font-size: 48px; }
    .text-h2 { font-size: 30px; }
    .text-h3 { font-size: 20px; }
    .text-kpi { font-size: 32px; }
}

/* ---------------------------------------------------------------------------
   Tabular-nums — appliqué partout où des chiffres apparaissent
   Spec UX ligne 647 (règle non-négociable)
   --------------------------------------------------------------------------- */
.kpi-card,
.kpi-card *,
.text-kpi,
.text-code,
table th,
table td,
.tabular-nums {
    font-variant-numeric: tabular-nums;
}

/* ---------------------------------------------------------------------------
   Heading defaults (Bootstrap h1-h6 alignés sur type scale)
   --------------------------------------------------------------------------- */
h1 { font-family: var(--font-sans); font-size: 32px; font-weight: 700; letter-spacing: -0.025em; line-height: 1.1; }
h2 { font-family: var(--font-sans); font-size: 24px; font-weight: 700; letter-spacing: -0.020em; line-height: 1.15; }
h3 { font-family: var(--font-sans); font-size: 18px; font-weight: 600; letter-spacing: -0.010em; line-height: 1.25; }
h4 { font-family: var(--font-sans); font-size: 16px; font-weight: 600; line-height: 1.3; }
h5 { font-family: var(--font-sans); font-size: 14px; font-weight: 600; line-height: 1.3; }
h6 { font-family: var(--font-sans); font-size: 12px; font-weight: 600; line-height: 1.3; text-transform: uppercase; letter-spacing: 0.05em; }

@media (min-width: 992px) {
    h1 { font-size: 48px; }
    h2 { font-size: 30px; }
    h3 { font-size: 20px; }
}

/* ---------------------------------------------------------------------------
   Link defaults — Bleu ESDI (primary)
   --------------------------------------------------------------------------- */
a {
    color: var(--primary-500);
    text-decoration: none;
    transition: color var(--duration-micro) var(--ease-default);
}

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

a:focus-visible {
    outline: none;
    box-shadow: var(--shadow-focus);
    border-radius: var(--radius-xs);
}
