/* ==========================================================================
   KundliYatra design tokens — the single source of truth for colour, space,
   type and elevation. Light = ivory & champagne gold, Dark = charcoal & muted gold.
   Theme is set on <html data-theme="light|dark"> by /assets/js/theme.js.
   ========================================================================== */
:root,
:root[data-theme="light"] {
  color-scheme: light;

  /* surfaces */
  --ky-bg: #faf7ef;
  --ky-bg-glow: rgba(201, 162, 39, .10);
  --ky-header-bg: rgba(250, 247, 239, .82);
  --ky-surface: #fffdf8;
  --ky-surface-2: #f3eddf;
  --ky-line: #e7ddc9;
  --ky-line-strong: #d6c8a8;

  /* text */
  --ky-ink: #282316;
  --ky-muted: #6b6350;

  /* brand gold */
  --ky-gold: #b58a37;          /* decorative strokes/dividers */
  --ky-gold-strong: #80601f;   /* gold text on surfaces (AA) */
  --ky-gold-bright: #e2c05d;
  --ky-gold-soft: #f2e6c4;     /* tinted fills */
  --ky-on-gold: #2a1d08;       /* text on gold buttons */
  --ky-gold-grad: linear-gradient(180deg, #e9c25f 0%, #c99432 100%);

  --ky-shadow-sm: 0 1px 2px rgba(60, 45, 10, .06), 0 2px 8px rgba(60, 45, 10, .05);
  --ky-shadow-md: 0 12px 34px -14px rgba(120, 88, 20, .28), 0 2px 8px rgba(60, 45, 10, .06);
  --ky-focus: #a87912;
}

:root[data-theme="dark"] {
  color-scheme: dark;

  --ky-bg: #12141b;
  --ky-bg-glow: rgba(225, 191, 117, .08);
  --ky-header-bg: rgba(18, 20, 27, .82);
  --ky-surface: #1b1e27;
  --ky-surface-2: #242936;
  --ky-line: #333745;
  --ky-line-strong: #454a5c;

  --ky-ink: #f4efe4;
  --ky-muted: #b7b09f;

  --ky-gold: #d9b569;
  --ky-gold-strong: #f0d28e;
  --ky-gold-bright: #f0d28e;
  --ky-gold-soft: rgba(225, 191, 117, .14);
  --ky-on-gold: #17140d;
  --ky-gold-grad: linear-gradient(180deg, #f0d28e 0%, #d3a74e 100%);

  --ky-shadow-sm: 0 1px 2px rgba(0, 0, 0, .35), 0 2px 8px rgba(0, 0, 0, .25);
  --ky-shadow-md: 0 14px 38px -12px rgba(0, 0, 0, .55), 0 2px 8px rgba(0, 0, 0, .3);
  --ky-focus: #f0d28e;
}

/* No-JS fallback: follow the OS setting when theme.js has not run. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --ky-bg: #12141b; --ky-bg-glow: rgba(225,191,117,.08); --ky-header-bg: rgba(18,20,27,.82);
    --ky-surface: #1b1e27; --ky-surface-2: #242936; --ky-line: #333745; --ky-line-strong: #454a5c;
    --ky-ink: #f4efe4; --ky-muted: #b7b09f;
    --ky-gold: #d9b569; --ky-gold-strong: #f0d28e; --ky-gold-bright: #f0d28e;
    --ky-gold-soft: rgba(225,191,117,.14); --ky-on-gold: #17140d;
    --ky-gold-grad: linear-gradient(180deg,#f0d28e 0%,#d3a74e 100%);
    --ky-focus: #f0d28e;
  }
}

:root {
  /* spacing — 4px base */
  --ky-space-1: 4px;  --ky-space-2: 8px;   --ky-space-3: 12px; --ky-space-4: 16px;
  --ky-space-5: 24px; --ky-space-6: 32px;  --ky-space-7: 48px; --ky-space-8: 64px; --ky-space-9: 96px;

  --ky-radius-sm: 10px; --ky-radius: 16px; --ky-radius-lg: 24px; --ky-radius-pill: 999px;

  --ky-content: 1200px;
  --ky-content-narrow: 760px;
  --ky-gutter: clamp(16px, 4vw, 32px);
  --ky-header-h: 76px;

  --ky-font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Inter, Roboto, system-ui, sans-serif;
  --ky-font-serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
}

/* Printing always uses the light palette. */
@media print {
  :root, :root[data-theme="dark"] {
    --ky-bg:#fff; --ky-surface:#fff; --ky-surface-2:#f3eddf; --ky-line:#e7ddc9; --ky-line-strong:#d6c8a8;
    --ky-ink:#282316; --ky-muted:#6b6350; --ky-gold:#b58a37; --ky-gold-strong:#80601f; --ky-gold-soft:#f2e6c4;
  }
}
