/* ═══════════════════════════════════════════════════════════════════════════
   tokens.css — Variables de design, réinitialisation, thèmes.

   Charte graphique NLION, identique à celle des outils d'audit
   (audits/crawler.php, seo.php, rgpd.php) : mêmes couleurs, mêmes rayons,
   mêmes ombres, mêmes polices — Playfair Display pour les titres, Inter pour
   le texte, hébergées localement (voir fonts.css).
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
    color-scheme: light;

    /* ── Palette NLION — valeurs de référence de la charte ─────────────── */
    --cream:   #f0ece4;
    --cream-2: #e2ddd5;
    --cream-3: #d5d0c8;

    --orange:       #c4581a;
    --orange-h:     #a8450f;
    --orange-bg:    rgba(196, 88, 26, 0.07);
    --orange-light: rgba(196, 88, 26, 0.12);

    --noir:     #1a1510;
    --noir-mid: #2d2820;
    --text:     #3a3228;
    --muted:    #8a8070;
    --white:    #fdfaf5;

    --success:    #3a7d44;
    --success-bg: rgba(58, 125, 68, 0.09);
    --danger:     #b93030;
    --danger-bg:  rgba(185, 48, 48, 0.08);
    --warn:       #b97a00;
    --warn-bg:    rgba(185, 122, 0, 0.09);
    --info:       #1a6a9a;
    --info-bg:    rgba(26, 106, 154, 0.09);

    --border:        rgba(60, 45, 30, 0.13);
    --border-strong: rgba(60, 45, 30, 0.22);
    --shadow:        0 2px 14px rgba(30, 20, 10, 0.07);
    --shadow-lg:     0 8px 36px rgba(30, 20, 10, 0.13);

    --r:    14px;
    --r-sm:  9px;
    --r-xs:  6px;
    --ease: 0.22s cubic-bezier(0.4, 0, 0.2, 1);

    /* ── Typographie de la charte ──────────────────────────────────────── */
    --font-sans:  'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --font-serif: 'Playfair Display', 'Iowan Old Style', Georgia, 'Times New Roman', serif;
    --font-mono:  ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas,
                  'DejaVu Sans Mono', monospace;
}

/* ══════════════════════════════════════════════════════════════════════════
   Variante sombre — proposée par le bouton de la barre de navigation.

   Elle n'est PAS appliquée automatiquement d'après `prefers-color-scheme` :
   la charte NLION est claire, et l'outil doit rester cohérent avec les autres
   pages du site. La préférence système du visiteur reste bien sûr détectée et
   affichée dans le rapport — c'est justement l'un des signaux commentés.
   ══════════════════════════════════════════════════════════════════════════ */
:root[data-theme="dark"] {
    color-scheme: dark;

    --cream:   #16130f;
    --cream-2: #221d17;
    --cream-3: #2e2820;

    --orange:       #f0904a;
    --orange-h:     #ffa763;
    --orange-bg:    rgba(240, 144, 74, 0.13);
    --orange-light: rgba(240, 144, 74, 0.20);

    --noir:     #f4f0e8;
    --noir-mid: #cdc5b7;
    --text:     #ddd6ca;
    --muted:    #9a8f7e;
    --white:    #1d1914;

    --success:    #77c187;
    --success-bg: rgba(119, 193, 135, 0.13);
    --danger:     #f08a8a;
    --danger-bg:  rgba(240, 138, 138, 0.13);
    --warn:       #e2b55b;
    --warn-bg:    rgba(226, 181, 91, 0.13);
    --info:       #74bbe3;
    --info-bg:    rgba(116, 187, 227, 0.13);

    --border:        rgba(235, 225, 210, 0.14);
    --border-strong: rgba(235, 225, 210, 0.26);
    --shadow:        0 2px 14px rgba(0, 0, 0, 0.40);
    --shadow-lg:     0 8px 36px rgba(0, 0, 0, 0.55);
}

/* ── Réinitialisation ────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    scroll-behavior: smooth;
    /* Empêche iOS Safari de grossir arbitrairement le texte en paysage. */
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    font-family: var(--font-sans);
    background: var(--cream);
    color: var(--text);
    font-size: 15px;
    line-height: 1.55;
    min-height: 100vh;
    /* Garde-fou contre tout débordement horizontal.

       `clip` et non `hidden` : `overflow-x: hidden` force `overflow-y` à
       `auto`, ce qui fait du corps de page une boîte de défilement — et casse
       silencieusement les liens d'ancre, qui ne défilent plus. `clip` coupe
       sans créer de conteneur de défilement. Les navigateurs qui l'ignorent
       n'ont de toute façon rien à couper : la mise en page ne déborde pas. */
    overflow-x: clip;
}

img { max-width: 100%; height: auto; }

/* ── Accessibilité : focus toujours visible, y compris au clavier ─────────── */
:focus-visible {
    outline: 3px solid var(--orange);
    outline-offset: 2px;
    border-radius: 3px;
}

.visually-hidden {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 999;
    background: var(--orange);
    color: #fff;
    padding: 10px 18px;
    border-radius: 0 0 var(--r-sm) 0;
    font-weight: 700;
}
.skip-link:focus { left: 0; }

/* ── Respect de « animations réduites » ───────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
}
