/* ============================================================
   Daily Nomad Design System — "The Editorial Voyager"
   Shared CSS custom properties for all product pages.
   ============================================================ */

/* Fonts: Noto Serif (headlines) + Plus Jakarta Sans (body/labels) */
@import url('https://fonts.googleapis.com/css2?family=Noto+Serif:ital,wght@0,400;0,700;1,400;1,700&family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:wght,FILL@100..700,0..1&display=swap');

/* ── Light mode tokens ─────────────────────────────────── */
:root {
  color-scheme: light;

  /* Primary */
  --primary: #004AC6;
  --primary-container: #2563EB;
  --primary-fixed: #DBE1FF;
  --primary-fixed-dim: #B4C5FF;
  --on-primary: #FFFFFF;
  --on-primary-container: #EEEFFF;
  --on-primary-fixed: #00174B;
  --on-primary-fixed-variant: #003EA8;

  /* Secondary */
  --secondary: #A93530;
  --secondary-container: #FD7369;
  --secondary-fixed: #FFDAD6;
  --secondary-fixed-dim: #FFB4AC;
  --on-secondary: #FFFFFF;
  --on-secondary-container: #6F080C;
  --on-secondary-fixed: #410003;
  --on-secondary-fixed-variant: #881D1C;

  /* Tertiary */
  --tertiary: #006058;
  --tertiary-container: #007B71;
  --tertiary-fixed: #89F5E7;
  --tertiary-fixed-dim: #6BD8CB;
  --on-tertiary: #FFFFFF;
  --on-tertiary-container: #B3FFF3;
  --on-tertiary-fixed: #00201D;
  --on-tertiary-fixed-variant: #005049;

  /* Error */
  --error: #BA1A1A;
  --error-container: #FFDAD6;
  --on-error: #FFFFFF;
  --on-error-container: #93000A;

  /* Surfaces */
  --background: #FBF8FC;
  --on-background: #1B1B1E;
  --surface: #FBF8FC;
  --surface-dim: #DCD9DD;
  --surface-bright: #FBF8FC;
  --surface-container-lowest: #FFFFFF;
  --surface-container-low: #F5F3F6;
  --surface-container: #F0EDF1;
  --surface-container-high: #EAE7EB;
  --surface-container-highest: #E4E1E5;
  --surface-variant: #E4E1E5;
  --surface-tint: #0053DB;
  --on-surface: #1B1B1E;
  --on-surface-variant: #434655;
  --inverse-surface: #303033;
  --inverse-on-surface: #F3F0F4;
  --inverse-primary: #B4C5FF;

  /* Outline */
  --outline: #737686;
  --outline-variant: #C3C6D7;

  /* Shadows & effects */
  --shadow-ambient: rgba(27, 27, 30, 0.06);
  --shadow-elevation-1: 0 2px 8px var(--shadow-ambient);
  --shadow-elevation-2: 0 4px 24px var(--shadow-ambient);
  --shadow-elevation-3: 0 8px 32px var(--shadow-ambient);

  /* Typography */
  --font-headline: 'Noto Serif', Georgia, serif;
  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-label: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Radii — "No-Line" Rule: xl or full, never md */
  --radius-xl: 1.5rem;
  --radius-full: 9999px;

  /* Spacing scale */
  --space-1: 0.25rem;
  --space-1-5: 0.5rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1.4rem;
  --space-5: 1.7rem;
  --space-6: 1.5rem;
  --space-8: 2.75rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 5.5rem;
  --space-20: 5rem;
  --space-24: 8.5rem;

  /* Glass */
  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-blur: blur(12px);

  /* Gradient */
  --gradient-primary: linear-gradient(135deg, var(--primary), var(--primary-container));
}

/* ── Dark mode tokens (opt-in via .dark-mode class) ────── */
html.dark-mode {
  color-scheme: dark;
}
.dark-mode {
    /* Primary */
    --primary: #B4C5FF;
    --primary-container: #003EA8;
    --primary-fixed: #DBE1FF;
    --primary-fixed-dim: #B4C5FF;
    --on-primary: #002E7A;
    --on-primary-container: #DBE1FF;
    --on-primary-fixed: #00174B;
    --on-primary-fixed-variant: #003EA8;

    /* Secondary */
    --secondary: #FFB4AC;
    --secondary-container: #881D1C;
    --secondary-fixed: #FFDAD6;
    --secondary-fixed-dim: #FFB4AC;
    --on-secondary: #681114;
    --on-secondary-container: #FFDAD6;
    --on-secondary-fixed: #410003;
    --on-secondary-fixed-variant: #881D1C;

    /* Tertiary */
    --tertiary: #6BD8CB;
    --tertiary-container: #005049;
    --tertiary-fixed: #89F5E7;
    --tertiary-fixed-dim: #6BD8CB;
    --on-tertiary: #003731;
    --on-tertiary-container: #89F5E7;
    --on-tertiary-fixed: #00201D;
    --on-tertiary-fixed-variant: #005049;

    /* Error */
    --error: #FFB4AC;
    --error-container: #93000A;
    --on-error: #690005;
    --on-error-container: #FFDAD6;

    /* Surfaces */
    --background: #131316;
    --on-background: #E4E1E5;
    --surface: #131316;
    --surface-dim: #131316;
    --surface-bright: #39393C;
    --surface-container-lowest: #0E0E11;
    --surface-container-low: #1B1B1E;
    --surface-container: #1F1F23;
    --surface-container-high: #2A2A2D;
    --surface-container-highest: #353538;
    --surface-variant: #434655;
    --surface-tint: #B4C5FF;
    --on-surface: #E4E1E5;
    --on-surface-variant: #C3C6D7;
    --inverse-surface: #E4E1E5;
    --inverse-on-surface: #303033;
    --inverse-primary: #004AC6;

    /* Outline */
    --outline: #8D90A0;
    --outline-variant: #434655;

    /* Shadows */
    --shadow-ambient: rgba(0, 0, 0, 0.3);

    /* Glass */
    --glass-bg: rgba(31, 31, 35, 0.8);
}

/* ── Base reset ────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
}

body {
  font-family: var(--font-body);
  background: var(--background);
  color: var(--on-surface);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.6;
}

/* ── Typography ────────────────────────────────────────── */
h1, h2, h3, .font-headline {
  font-family: var(--font-headline);
}

.display-lg {
  font-family: var(--font-headline);
  font-size: 3.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.display-md {
  font-family: var(--font-headline);
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.15;
}

.headline-lg {
  font-family: var(--font-headline);
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.2;
}

.headline-md {
  font-family: var(--font-headline);
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.3;
}

.title-lg {
  font-family: var(--font-body);
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.4;
}

.title-sm {
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.4;
}

.body-lg {
  font-size: 1rem;
  line-height: 1.6;
}

.body-md {
  font-size: 0.875rem;
  line-height: 1.6;
}

.label-lg {
  font-family: var(--font-label);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.label-md {
  font-family: var(--font-label);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ── Buttons ───────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.9375rem;
  cursor: pointer;
  border: none;
  transition: opacity 0.15s, transform 0.1s, background 0.15s;
  min-height: 48px;
  padding: 0 1.75rem;
}

.btn:active {
  transform: scale(0.98);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--gradient-primary);
  color: var(--on-primary);
  border-radius: var(--radius-full);
  box-shadow: 0 4px 16px rgba(0, 74, 198, 0.2);
}

.btn-primary:hover {
  opacity: 0.92;
}

.btn-secondary {
  background: var(--surface-container-high);
  color: var(--on-surface);
  border-radius: var(--radius-full);
}

.btn-secondary:hover {
  background: var(--surface-variant);
}

.btn-tertiary {
  background: transparent;
  color: var(--primary);
  padding: 0;
  min-height: auto;
}

.btn-tertiary:hover {
  text-decoration: underline;
}

/* ── Cards ─────────────────────────────────────────────── */
.card {
  background: var(--surface-container-lowest);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-elevation-2);
  overflow: hidden;
}

/* ── Inputs ────────────────────────────────────────────── */
.input {
  width: 100%;
  min-height: 48px;
  padding: 0 1rem;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--on-surface);
  background: var(--surface-container-low);
  border: none;
  border-radius: var(--radius-xl);
  outline: none;
  transition: box-shadow 0.15s;
}

.input::placeholder {
  color: var(--outline-variant);
}

.input:focus {
  box-shadow: 0 0 0 2px var(--primary), 0 0 0 6px rgba(0, 74, 198, 0.1);
}

/* ── Material Symbols ──────────────────────────────────── */
.material-symbols-outlined {
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

/* ── Utility ───────────────────────────────────────────── */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Spinner */
@keyframes spin {
  to { transform: rotate(360deg); }
}

.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2.5px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  vertical-align: middle;
}
