/* === NAHIBU DESIGN SYSTEM — BASE TOKENS === */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ─── LIGHT MODE ─── */
:root {
  /* Brand */
  --nh-navy-900: #14224a;
  --nh-navy-800: #1b2c5b;
  --nh-navy-700: #23366b;
  --nh-navy-600: #2e457f;
  --nh-navy-500: #45598f;

  --nh-cyan-700: #0892b0;
  --nh-cyan-600: #0baed4;
  --nh-cyan-500: #2cc1e0;
  --nh-cyan-100: #d6f1f8;
  --nh-cyan-50:  #ecf8fc;

  /* Categories (real blog categories) */
  --nh-science:           #6b5cd9;
  --nh-science-soft:      #ede9ff;
  --nh-recettes:          #d97742;
  --nh-recettes-soft:     #fbeadd;
  --nh-alimentation:      #4a8a6b;
  --nh-alimentation-soft: #e3efe7;
  --nh-lifestyle:         #0baed4;
  --nh-lifestyle-soft:    #ecf8fc;
  --nh-sante:             #c4546a;
  --nh-sante-soft:        #fce8ec;
  --nh-nahibu:            #23366b;
  --nh-nahibu-soft:       #e6e9f2;
  /* Cat ink — darker variants for AA-compliant text on light/soft backgrounds (≥4.5:1 for small text) */
  --nh-science-ink:       #4f43c7; /* 5.7:1 on #ede9ff */
  --nh-recettes-ink:      #9c4416; /* 5.4:1 on #fbeadd (was #b85a25 = 3.95:1) */
  --nh-alimentation-ink:  #2f6a4d; /* 7.1:1 on #e3efe7 */
  --nh-lifestyle-ink:     #076578; /* 5.5:1 on #ecf8fc */
  --nh-sante-ink:         #a8344a; /* 5.5:1 on #fce8ec */
  --nh-nahibu-ink:        #1a2a55; /* 9.5:1 on #e6e9f2 */

  /* Neutral (warm) */
  --nh-ink:         #0f1429;
  --nh-ink-2:       #2a3148;
  --nh-ink-3:       #5b637b;
  --nh-ink-4:       #8a90a3;
  --nh-line:        #e6e3dc;
  --nh-line-strong: #d4d0c6;
  --nh-paper:       #faf8f3;
  --nh-paper-2:     #f3efe6;
  --nh-white:       #ffffff;

  /* Typography */
  --nh-serif: "Source Serif 4", "Source Serif Pro", Georgia, serif;
  --nh-sans:  "Geist", "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --nh-mono:  "JetBrains Mono", "IBM Plex Mono", ui-monospace, monospace;

  /* Type scale */
  --fs-display: clamp(48px, 6vw, 88px);
  --fs-h1:      clamp(36px, 4vw, 56px);
  --fs-h2:      clamp(28px, 3vw, 40px);
  --fs-h3:      22px;
  --fs-h4:      18px;
  --fs-body:    17px;
  --fs-small:   14px;
  --fs-mono:    12px;

  /* Spacing 8pt */
  --s-1: 4px;   --s-2: 8px;   --s-3: 12px;  --s-4: 16px;
  --s-5: 20px;  --s-6: 24px;  --s-7: 32px;  --s-8: 40px;
  --s-9: 48px;  --s-10: 64px; --s-11: 80px; --s-12: 120px;

  /* Radii */
  --r-sm:   8px;
  --r-md:   12px;
  --r-lg:   16px;
  --r-xl:   24px;
  --r-pill: 999px;

  /* Shadows */
  --sh-sm:   0 1px 2px rgba(20,34,74,.06);
  --sh-md:   0 4px 16px -4px rgba(20,34,74,.10);
  --sh-lg:   0 24px 48px -16px rgba(20,34,74,.18);
  --sh-card: 0 1px 0 rgba(20,34,74,.04), 0 8px 24px -8px rgba(20,34,74,.08);

  /* Motion */
  --ease-out:    cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.40, 0.60, 1);
  --t-fast: 150ms;
  --t-base: 220ms;
  --t-slow: 360ms;
}

/* ─── DARK MODE ─── */
[data-theme="dark"] {
  --nh-paper:       #0c1023;
  --nh-paper-2:     #141c33;
  --nh-white:       #14224a;
  --nh-ink:         #f4ede0;
  --nh-ink-2:       #c8c3b5;
  --nh-ink-3:       #8c93a8;
  --nh-ink-4:       #5b637b;
  --nh-line:        #1b2c5b;
  --nh-line-strong: #23366b;
  --nh-navy-900:    #f4ede0;
  --nh-navy-800:    #d4cec0;
  --nh-navy-700:    #5a7acc;
  --nh-cyan-600:    #2cc1e0;
  --nh-cyan-500:    #4dd0ea;
  --sh-sm:   0 1px 2px rgba(0,0,0,.30);
  --sh-md:   0 4px 16px -4px rgba(0,0,0,.40);
  --sh-lg:   0 24px 48px -16px rgba(0,0,0,.50);
  --sh-card: 0 1px 0 rgba(0,0,0,.20), 0 8px 24px -8px rgba(0,0,0,.35);
}

/* ─── BASE ─── */
html { scroll-behavior: smooth; overflow-x: hidden; }

body {
  font-family: var(--nh-sans);
  font-size: var(--fs-body);
  color: var(--nh-ink);
  background: var(--nh-paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "ss01", "cv11";
  line-height: 1.6;
  overflow-x: hidden;
  transition: background var(--t-slow) var(--ease-out),
              color var(--t-slow) var(--ease-out);
}

img, video { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; }

/* ─── A11Y : visually hidden but available to screen readers ─── */
.nh-sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0,0,0,0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* ─── CONTAINER ─── */
.nh-container {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 var(--s-10);
}

@media (max-width: 880px) {
  .nh-container { padding: 0 var(--s-5); }
}

/* ════════════════════════════════════════════════════════════════════
   WCAG 2.2 AA contrast overrides — small text needs ≥4.5:1
   Applied last so they win the cascade for all light-mode contexts.
   ════════════════════════════════════════════════════════════════════ */

/* Reading time / read more / inline meta : was ink-4 #8a90a3 → ink-3 #5b637b (5.7:1 on white) */
.nh-reading-time,
.nh-read-more,
.nh-art-card-meta .nh-mono { color: var(--nh-ink-3) !important; }

/* Category card titles (homepage) — cat color on cat-soft */
.nh-cat-card[data-cat="science"]      .nh-cat-card-title { color: var(--nh-science-ink); }
.nh-cat-card[data-cat="alimentation"] .nh-cat-card-title { color: var(--nh-alimentation-ink); }
.nh-cat-card[data-cat="recettes"]     .nh-cat-card-title { color: var(--nh-recettes-ink); }
.nh-cat-card[data-cat="life-style"]   .nh-cat-card-title,
.nh-cat-card[data-cat="lifestyle"]    .nh-cat-card-title { color: var(--nh-lifestyle-ink); }
.nh-cat-card[data-cat="sante"]        .nh-cat-card-title { color: var(--nh-sante-ink); }
.nh-cat-card[data-cat="nahibu"]       .nh-cat-card-title { color: var(--nh-nahibu-ink); }

/* Category card counts — was 1.7-2.2:1 (too light), force readable grey */
.nh-cat-card-count { color: var(--nh-ink-3) !important; }

/* Cat section eyebrows (homepage section heads) — small mono on white paper */
.nh-cat-section-eyebrow { color: var(--nh-ink-3) !important; }

/* Cat hero eyebrow on archive — same issue */
.nh-cat-eyebrow,
.nh-cat-eyebrow-science      { color: var(--nh-science-ink); }
.nh-cat-eyebrow-alimentation { color: var(--nh-alimentation-ink); }
.nh-cat-eyebrow-recettes     { color: var(--nh-recettes-ink); }
.nh-cat-eyebrow-lifestyle    { color: var(--nh-lifestyle-ink); }
.nh-cat-eyebrow-sante        { color: var(--nh-sante-ink); }
.nh-cat-eyebrow-nahibu       { color: var(--nh-nahibu-ink); }

/* Keyword pills + cat tabs active — cat color on cat-soft */
.nh-keyword-pill,
.is-active > .nh-cat-tab-label,
.is-active > .nh-cat-tab-count {
  color: inherit; /* re-anchor; specific cat colors below */
}
body.category-science .nh-keyword-pill,
body.category-science .nh-cat-tab.is-active .nh-cat-tab-label,
body.category-science .nh-cat-tab.is-active .nh-cat-tab-count { color: var(--nh-science-ink); }
body.category-alimentation .nh-keyword-pill,
body.category-alimentation .nh-cat-tab.is-active .nh-cat-tab-label,
body.category-alimentation .nh-cat-tab.is-active .nh-cat-tab-count { color: var(--nh-alimentation-ink); }
body.category-recettes .nh-keyword-pill,
body.category-recettes .nh-cat-tab.is-active .nh-cat-tab-label,
body.category-recettes .nh-cat-tab.is-active .nh-cat-tab-count { color: var(--nh-recettes-ink); }
body.category-life-style .nh-keyword-pill,
body.category-life-style .nh-cat-tab.is-active .nh-cat-tab-label,
body.category-life-style .nh-cat-tab.is-active .nh-cat-tab-count { color: var(--nh-lifestyle-ink); }
body.category-sante .nh-keyword-pill,
body.category-sante .nh-cat-tab.is-active .nh-cat-tab-label,
body.category-sante .nh-cat-tab.is-active .nh-cat-tab-count { color: var(--nh-sante-ink); }
body.category-nahibu .nh-keyword-pill,
body.category-nahibu .nh-cat-tab.is-active .nh-cat-tab-label,
body.category-nahibu .nh-cat-tab.is-active .nh-cat-tab-count { color: var(--nh-nahibu-ink); }

/* Header nav active link — cat-soft bg + cat color text */
.nh-nav-link[data-cat="science"][aria-current="page"]      { color: var(--nh-science-ink); }
.nh-nav-link[data-cat="alimentation"][aria-current="page"] { color: var(--nh-alimentation-ink); }
.nh-nav-link[data-cat="recettes"][aria-current="page"]     { color: var(--nh-recettes-ink); }
.nh-nav-link[data-cat="lifestyle"][aria-current="page"]    { color: var(--nh-lifestyle-ink); }
.nh-nav-link[data-cat="sante"][aria-current="page"]        { color: var(--nh-sante-ink); }
.nh-nav-link[data-cat="nahibu"][aria-current="page"]       { color: var(--nh-nahibu-ink); }
.nh-nav-link[aria-current="page"]:not([data-cat])          { color: var(--nh-lifestyle-ink); } /* Home */

/* WP block post-terms (.nh-pill) — fix the post-card cat label */
.nh-pill[data-cat="science"] a[rel="tag"]      { color: var(--nh-science-ink); }
.nh-pill[data-cat="alimentation"] a[rel="tag"] { color: var(--nh-alimentation-ink); }
.nh-pill[data-cat="recettes"] a[rel="tag"]     { color: var(--nh-recettes-ink); }
.nh-pill[data-cat="life-style"] a[rel="tag"]   { color: var(--nh-lifestyle-ink); }
.nh-pill[data-cat="sante"] a[rel="tag"]        { color: var(--nh-sante-ink); }
.nh-pill[data-cat="nahibu"] a[rel="tag"]       { color: var(--nh-nahibu-ink); }
