/* Capture Co design tokens (CAP-45). Direction A, Editorial.
   Three layers, all custom properties so they can be overridden at runtime:
   --cc-*  brand tokens (this file owns the values)
   --ev-*  event tokens (CAP-33): guests see only these; defaults map to --cc-*
   --ui-*  roles the shared components read: --cc-* on brand surfaces, --ev-* inside .cc-event */

@font-face {
  font-family: "Newsreader";
  src: url("/fonts/newsreader-roman.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Schibsted Grotesk";
  src: url("/fonts/schibsted-grotesk.woff2") format("woff2");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light dark;

  /* palette */
  --cc-obsidian: #0D0E12;
  --cc-alabaster: #F8F9FA;
  --cc-platinum: #A0A0A0;
  --cc-graphite: #4A4C55;
  --cc-brass: #B08A4E;
  --cc-bronze: #7A5A2C;

  /* type */
  --cc-font-display: "Newsreader", Georgia, "Times New Roman", serif;
  --cc-font-body: "Schibsted Grotesk", "Helvetica Neue", Arial, sans-serif;
  --cc-text-xs: 0.75rem;
  --cc-text-sm: 0.875rem;
  --cc-text-md: 1rem;
  --cc-text-lg: 1.125rem;
  --cc-text-xl: 1.5rem;
  --cc-text-2xl: clamp(1.75rem, calc(1.2rem + 2vw), 2.5rem);
  --cc-text-3xl: clamp(2.25rem, calc(1.4rem + 3.4vw), 3.75rem);
  --cc-leading-tight: 1.05;
  --cc-leading-snug: 1.3;
  --cc-leading-body: 1.55;

  /* spacing (4 px base) */
  --cc-space-1: 4px;
  --cc-space-2: 8px;
  --cc-space-3: 12px;
  --cc-space-4: 16px;
  --cc-space-5: 24px;
  --cc-space-6: 32px;
  --cc-space-7: 48px;
  --cc-space-8: 64px;

  /* shape and motion */
  --cc-radius-sm: 6px;
  --cc-radius-md: 8px;
  --cc-radius-lg: 12px;
  --cc-radius-xl: 16px;
  --cc-radius-pill: 999px;
  --cc-target: 44px;
  --cc-dur-fast: 120ms;
  --cc-dur: 200ms;
  --cc-ease: cubic-bezier(0.2, 0, 0, 1);

  /* light theme */
  --cc-bg: var(--cc-alabaster);
  --cc-surface: #FFFFFF;
  --cc-surface-2: #ECECE9;
  --cc-text: var(--cc-obsidian);
  --cc-text-muted: var(--cc-graphite);
  --cc-border: #C9CACF;
  --cc-border-strong: #8A8C95;
  --cc-accent: var(--cc-bronze);
  --cc-accent-strong: #5E4421;
  --cc-accent-ink: #FFFFFF;
  --cc-focus: #1F5FBF;
  --cc-success: #1E6B3A;
  --cc-warning: #8A5A00;
  --cc-danger: #A12A2A;
  --cc-overlay: rgba(13, 14, 18, 0.55);
  --cc-shadow-sm: 0 1px 2px rgba(13, 14, 18, 0.08);
  --cc-shadow-md: 0 4px 16px rgba(13, 14, 18, 0.12);
  --cc-shadow-lg: 0 12px 40px rgba(13, 14, 18, 0.18);

  /* event tokens: guest pages render only these. Defaults follow the brand. */
  --ev-bg: var(--cc-bg);
  --ev-surface: var(--cc-surface);
  --ev-surface-2: var(--cc-surface-2);
  --ev-text: var(--cc-text);
  --ev-text-muted: var(--cc-text-muted);
  --ev-border: var(--cc-border);
  --ev-border-strong: var(--cc-border-strong);
  --ev-accent: var(--cc-accent);
  --ev-accent-strong: var(--cc-accent-strong);
  --ev-accent-ink: var(--cc-accent-ink);
  --ev-focus: var(--cc-focus);
  --ev-danger: var(--cc-danger);
  --ev-font-display: var(--cc-font-display);
  --ev-font-body: var(--cc-font-body);
  --ev-radius: var(--cc-radius-md);

  /* roles read by components */
  --ui-bg: var(--cc-bg);
  --ui-surface: var(--cc-surface);
  --ui-surface-2: var(--cc-surface-2);
  --ui-text: var(--cc-text);
  --ui-text-muted: var(--cc-text-muted);
  --ui-border: var(--cc-border);
  --ui-border-strong: var(--cc-border-strong);
  --ui-accent: var(--cc-accent);
  --ui-accent-strong: var(--cc-accent-strong);
  --ui-accent-ink: var(--cc-accent-ink);
  --ui-focus: var(--cc-focus);
  --ui-danger: var(--cc-danger);
  --ui-font-display: var(--cc-font-display);
  --ui-font-body: var(--cc-font-body);
  --ui-radius: var(--cc-radius-md);
}

/* dark theme: the system preference unless the page pins light */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --cc-bg: var(--cc-obsidian);
    --cc-surface: #15171C;
    --cc-surface-2: #1A1C22;
    --cc-text: var(--cc-alabaster);
    --cc-text-muted: var(--cc-platinum);
    --cc-border: #23252C;
    --cc-border-strong: #5A5C66;
    --cc-accent: var(--cc-brass);
    --cc-accent-strong: #C69E5E;
    --cc-accent-ink: var(--cc-obsidian);
    --cc-focus: #8AB4FF;
    --cc-success: #5CC184;
    --cc-warning: #E0B04A;
    --cc-danger: #F08080;
    --cc-overlay: rgba(0, 0, 0, 0.7);
    --cc-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5);
    --cc-shadow-md: 0 4px 16px rgba(0, 0, 0, 0.5);
    --cc-shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.6);
  }
}

/* dark theme: pinned by the page (the same values again; plain CSS cannot share a block between a media query and an attribute) */
:root[data-theme="dark"] {
  color-scheme: dark;
  --cc-bg: var(--cc-obsidian);
  --cc-surface: #15171C;
  --cc-surface-2: #1A1C22;
  --cc-text: var(--cc-alabaster);
  --cc-text-muted: var(--cc-platinum);
  --cc-border: #23252C;
  --cc-border-strong: #5A5C66;
  --cc-accent: var(--cc-brass);
  --cc-accent-strong: #C69E5E;
  --cc-accent-ink: var(--cc-obsidian);
  --cc-focus: #8AB4FF;
  --cc-success: #5CC184;
  --cc-warning: #E0B04A;
  --cc-danger: #F08080;
  --cc-overlay: rgba(0, 0, 0, 0.7);
  --cc-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5);
  --cc-shadow-md: 0 4px 16px rgba(0, 0, 0, 0.5);
  --cc-shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.6);
}

:root[data-theme="light"] {
  color-scheme: light;
}

/* guest pages: components read the event tokens only */
.cc-event {
  --ui-bg: var(--ev-bg);
  --ui-surface: var(--ev-surface);
  --ui-surface-2: var(--ev-surface-2);
  --ui-text: var(--ev-text);
  --ui-text-muted: var(--ev-text-muted);
  --ui-border: var(--ev-border);
  --ui-border-strong: var(--ev-border-strong);
  --ui-accent: var(--ev-accent);
  --ui-accent-strong: var(--ev-accent-strong);
  --ui-accent-ink: var(--ev-accent-ink);
  --ui-focus: var(--ev-focus);
  --ui-danger: var(--ev-danger);
  --ui-font-display: var(--ev-font-display);
  --ui-font-body: var(--ev-font-body);
  --ui-radius: var(--ev-radius);
}
