/* Shared chrome for every Daily Viz and the Gallery. Viz-specific styling lives in each page. */
:root {
  --bg: #f6f5f1;
  --surface: #ffffff;
  --ink: #1b1b1f;
  --ink-2: #5b5b66;
  --line: #e2e0d8;
  --accent: #d9480f;
  --radius: 14px;
  --gutter: 16px;
  --font: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Pretendard", "Segoe UI", "Noto Sans KR", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e0f12;
    --surface: #17191e;
    --ink: #ecebe6;
    --ink-2: #9a9aa6;
    --line: #2a2d34;
    --accent: #ff8a4c;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e0f12;
  --surface: #17191e;
  --ink: #ecebe6;
  --ink-2: #9a9aa6;
  --line: #2a2d34;
  --accent: #ff8a4c;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  line-height: 1.6;
  overflow-x: hidden;
}
a { color: var(--accent); }

/* Top bar shown on every Daily Viz page. Hidden when embedded on the home page. */
.cv-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(env(safe-area-inset-top) + 10px) max(var(--gutter), env(safe-area-inset-right)) 10px max(var(--gutter), env(safe-area-inset-left));
  font-size: 14px; color: var(--ink-2);
}
.cv-bar a { color: var(--ink); text-decoration: none; font-weight: 600; }
.cv-embedded .cv-bar { display: none; }

/* Readable text column for title, intro and notes. */
.cv-prose {
  max-width: 720px; margin: 0 auto;
  padding: 0 max(var(--gutter), env(safe-area-inset-left));
}
.cv-prose h1 { font-size: clamp(26px, 6vw, 40px); line-height: 1.2; margin: 8px 0 8px; letter-spacing: -0.02em; }
.cv-prose .cv-lede { color: var(--ink-2); font-size: 17px; margin: 0 0 16px; }

/* Sources footer, required on every Daily Viz. */
.cv-sources {
  max-width: 720px; margin: 32px auto 0;
  padding: 16px max(var(--gutter), env(safe-area-inset-left)) calc(env(safe-area-inset-bottom) + 32px);
  border-top: 1px solid var(--line);
  font-size: 13px; color: var(--ink-2);
}
.cv-sources ul { margin: 4px 0 0; padding-left: 18px; }
