/* ==========================================================================
   CoBuy — Sage & Linen Theme
   This file is the single source of truth for all colour, typography and
   spacing tokens. Import it once (in index.html) before style.css.
   Every colour used anywhere in the app must come from a variable defined
   here. No hard-coded hex values in components or style.css.
   ========================================================================== */

/* --------------------------------------------------------------------------
   GOOGLE FONTS — Newsreader 500 · Hanken Grotesk 400 & 500
   Newsreader : wordmark, page titles, card/product names
   Hanken Grotesk : everything else
   -------------------------------------------------------------------------- */
@import url('https://fonts.googleapis.com/css2?family=Hanken+Grotesk:wght@400;500&family=Newsreader:wght@500&display=swap');

/* --------------------------------------------------------------------------
   LIGHT MODE — :root defaults
   -------------------------------------------------------------------------- */
:root {
  /* Sage & Linen palette */
  --bg:         #F2F4EE;
  --card:       #FBFCF8;
  --border:     #D9DFD2;
  --text:       #1E2B24;
  --text-2:     #55655B;
  --accent:     #2F5E48;
  --on-accent:  #FFFFFF;
  --chip-bg:    #F3E2A9;
  --chip-text:  #5A4510;
  --fill:       #2F5E48;
  --track:      #DCE3D5;

  /* Derived danger colour (used only for error states — not a status chip) */
  --danger:     #8B2020;
  --danger-bg:  #F9EDED;

  /* Typography */
  --font-serif: 'Newsreader', Georgia, 'Times New Roman', serif;
  --font-sans:  'Hanken Grotesk', system-ui, -apple-system, sans-serif;

  /* Type scale (px values converted to rem at 16px base) */
  --text-12: 0.75rem;   /* 12px — captions, secondary labels */
  --text-13: 0.8125rem; /* 13px — secondary body, form labels */
  --text-14: 0.875rem;  /* 14px — base body */
  --text-22: 1.375rem;  /* 22px — card titles */
  --text-24: 1.5rem;    /* 24px — wordmark */
  --text-30: 1.875rem;  /* 30px — page titles */

  /* Spacing */
  --gap-4:  4px;
  --gap-8:  8px;
  --gap-12: 12px;
  --gap-14: 14px;   /* inner card gap */
  --gap-16: 16px;
  --gap-20: 20px;   /* card padding */
  --gap-22: 22px;   /* between page sections */
  --gap-28: 28px;   /* page padding horizontal */
  --gap-32: 32px;   /* page padding vertical */

  /* Radius */
  --radius-pill: 9999px;
  --radius-btn:  8px;
  --radius-card: 12px;
  --radius-input: 8px;
  --radius-bar:  4px;
}

/* --------------------------------------------------------------------------
   DARK MODE — media query & data-theme overrides
   -------------------------------------------------------------------------- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:         #131916;
    --card:       #1B231F;
    --border:     #2B3731;
    --text:       #E8EFE9;
    --text-2:     #A6B5AB;
    --accent:     #86C3A0;
    --on-accent:  #0F1F17;
    --chip-bg:    #3A3418;
    --chip-text:  #EAD58A;
    --fill:       #86C3A0;
    --track:      #2B3731;

    --danger:    #E57373;
    --danger-bg: #2A1515;
  }
}

[data-theme="dark"] {
  --bg:         #131916;
  --card:       #1B231F;
  --border:     #2B3731;
  --text:       #E8EFE9;
  --text-2:     #A6B5AB;
  --accent:     #86C3A0;
  --on-accent:  #0F1F17;
  --chip-bg:    #3A3418;
  --chip-text:  #EAD58A;
  --fill:       #86C3A0;
  --track:      #2B3731;

  --danger:    #E57373;
  --danger-bg: #2A1515;
}

[data-theme="light"] {
  --bg:         #F2F4EE;
  --card:       #FBFCF8;
  --border:     #D9DFD2;
  --text:       #1E2B24;
  --text-2:     #55655B;
  --accent:     #2F5E48;
  --on-accent:  #FFFFFF;
  --chip-bg:    #F3E2A9;
  --chip-text:  #5A4510;
  --fill:       #2F5E48;
  --track:      #DCE3D5;

  --danger:     #8B2020;
  --danger-bg:  #F9EDED;
}
