/* Wedding Journal design tokens — ported 1:1 from WeddingAssistant/Theme/Theme.swift.
   Warm-paper "cozy" system with full light & dark support.

   Light is the default. Dark applies automatically under prefers-color-scheme,
   and can be forced either way with [data-theme="dark"] / [data-theme="light"]
   on any ancestor (ThemeProvider sets this attribute). */

:root {
  /* Warm-paper neutrals */
  --wj-background: #f2e7d8;
  --wj-background-2: #efe2d0;
  --wj-surface: #fffbf4;
  --wj-surface-2: #fbf3e8;
  --wj-deep: #e7d6c0;

  /* Text */
  --wj-text-primary: #3a2e33;
  --wj-text-secondary: #8c7c76;
  --wj-text-faint: #b6a89f;

  /* Lines */
  --wj-hairline: rgba(58, 46, 51, 0.1);
  --wj-card-border: rgba(255, 255, 255, 0.6);

  /* Brand accents — rose */
  --wj-primary: #b76e79;
  --wj-primary-deep: #9c5560;
  --wj-primary-soft: #f3e2e1;

  /* Brand accents — sage */
  --wj-secondary: #899a78;
  --wj-secondary-deep: #6e7f5e;
  --wj-secondary-soft: #e5eadd;

  /* Brand accents — gold */
  --wj-accent: #c39a5a;
  --wj-accent-deep: #a97f3f;
  --wj-accent-soft: #f2e7d0;

  /* Warn */
  --wj-warn: #c58a5b;
  --wj-warn-soft: #f6e6d6;
  --wj-warn-text: #9e6334;

  /* Muted plum — the "might invite" guest state */
  --wj-plum: #8d6e97;

  /* Spacing — 8pt grid */
  --wj-space-xs: 4px;
  --wj-space-s: 8px;
  --wj-space-m: 16px;
  --wj-space-l: 24px;
  --wj-space-xl: 32px;

  /* Radii */
  --wj-radius-hero: 30px;
  --wj-radius: 24px;
  --wj-radius-medium: 18px;
  --wj-radius-small: 13px;
  --wj-radius-pill: 999px;

  /* Soft warm shadows */
  --wj-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
  --wj-shadow: 0 10px 26px rgba(0, 0, 0, 0.1), 0 2px 6px rgba(0, 0, 0, 0.05);
  --wj-shadow-lg: 0 22px 50px rgba(0, 0, 0, 0.16), 0 6px 16px rgba(0, 0, 0, 0.09);

  /* Type families — mirrors SwiftUI's .serif design (New York) and the system sans (SF) */
  --wj-font-serif: ui-serif, "New York", "Iowan Old Style", Georgia, Cambria, "Times New Roman", serif;
  --wj-font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  /* Type scale — the semantic styles from Theme.swift's Text extensions */
  --wj-size-display: 34px;
  --wj-size-screen-title: 34px;
  --wj-size-section-title: 22px;
  --wj-size-card-title: 20px;
  --wj-size-body: 15px;
  --wj-size-meta: 12.5px;
  --wj-size-eyebrow: 11px;
}

/* Dark — automatic */
@media (prefers-color-scheme: dark) {
  :root {
    --wj-background: #1f1a1c;
    --wj-background-2: #271f22;
    --wj-surface: #2b2326;
    --wj-surface-2: #342b2f;
    --wj-deep: #3a2f33;

    --wj-text-primary: #f4eae3;
    --wj-text-secondary: #b7a8a0;
    --wj-text-faint: #837069;

    --wj-hairline: rgba(255, 255, 255, 0.14);
    --wj-card-border: rgba(255, 255, 255, 0.07);

    --wj-primary-soft: #42292e;
    --wj-secondary-soft: #2c352a;
    --wj-accent-soft: #3c3220;
    --wj-warn-soft: #402f20;
  }
}

/* Dark — forced */
[data-theme='dark'] {
  --wj-background: #1f1a1c;
  --wj-background-2: #271f22;
  --wj-surface: #2b2326;
  --wj-surface-2: #342b2f;
  --wj-deep: #3a2f33;

  --wj-text-primary: #f4eae3;
  --wj-text-secondary: #b7a8a0;
  --wj-text-faint: #837069;

  --wj-hairline: rgba(255, 255, 255, 0.14);
  --wj-card-border: rgba(255, 255, 255, 0.07);

  --wj-primary-soft: #42292e;
  --wj-secondary-soft: #2c352a;
  --wj-accent-soft: #3c3220;
  --wj-warn-soft: #402f20;
}

/* Light — forced (wins back inside a dark page) */
[data-theme='light'] {
  --wj-background: #f2e7d8;
  --wj-background-2: #efe2d0;
  --wj-surface: #fffbf4;
  --wj-surface-2: #fbf3e8;
  --wj-deep: #e7d6c0;

  --wj-text-primary: #3a2e33;
  --wj-text-secondary: #8c7c76;
  --wj-text-faint: #b6a89f;

  --wj-hairline: rgba(58, 46, 51, 0.1);
  --wj-card-border: rgba(255, 255, 255, 0.6);

  --wj-primary-soft: #f3e2e1;
  --wj-secondary-soft: #e5eadd;
  --wj-accent-soft: #f2e7d0;
  --wj-warn-soft: #f6e6d6;
}

/* Per-tint aliases — every tinted component reads these three, so a component
   only has to set --wj-tint-* once (see .wj-tint-rose / -sage / -gold / -warn). */
.wj-tint-rose {
  --wj-tint-base: var(--wj-primary);
  --wj-tint-deep: var(--wj-primary-deep);
  --wj-tint-soft: var(--wj-primary-soft);
  /* rose is the one tint whose glyph uses the base colour, not the deep one */
  --wj-tint-glyph: var(--wj-primary);
}
.wj-tint-sage {
  --wj-tint-base: var(--wj-secondary);
  --wj-tint-deep: var(--wj-secondary-deep);
  --wj-tint-soft: var(--wj-secondary-soft);
  --wj-tint-glyph: var(--wj-secondary-deep);
}
.wj-tint-gold {
  --wj-tint-base: var(--wj-accent);
  --wj-tint-deep: var(--wj-accent-deep);
  --wj-tint-soft: var(--wj-accent-soft);
  --wj-tint-glyph: var(--wj-accent-deep);
}
.wj-tint-warn {
  --wj-tint-base: var(--wj-warn);
  --wj-tint-deep: var(--wj-warn-text);
  --wj-tint-soft: var(--wj-warn-soft);
  --wj-tint-glyph: var(--wj-warn-text);
}
.wj-tint-plum {
  --wj-tint-base: var(--wj-plum);
  --wj-tint-deep: var(--wj-plum);
  --wj-tint-soft: color-mix(in srgb, var(--wj-plum) 18%, transparent);
  --wj-tint-glyph: var(--wj-plum);
}
