/* ============================================================
   BASE.CSS — Diggs for City Council
   Design tokens: type scale, spacing, color system, resets
   ============================================================ */

@font-face {
  font-display: swap;
}

:root {
  /* ---- Fluid Type Scale ---- */
  --text-xs: clamp(0.75rem, 0.7rem + 0.2vw, 0.8125rem);
  --text-sm: clamp(0.875rem, 0.82rem + 0.25vw, 0.9375rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-lg: clamp(1.125rem, 1.05rem + 0.5vw, 1.375rem);
  --text-xl: clamp(1.5rem, 1.3rem + 1vw, 2.125rem);
  --text-2xl: clamp(2rem, 1.4rem + 2.4vw, 3.25rem);
  --text-3xl: clamp(2.5rem, 1.2rem + 4vw, 4.75rem);
  --text-hero: clamp(2.75rem, 1rem + 6vw, 6.25rem);

  /* ---- Spacing (4px base) ---- */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;

  /* ---- Radius & Shadow ---- */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 999px;

  /* ---- Fonts ---- */
  --font-display: "DM Serif Display", "Georgia", serif;
  --font-body: "Source Sans 3", "Segoe UI", sans-serif;

  /* ---- Motion ---- */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-fast: 0.18s;
  --dur-base: 0.32s;
  --dur-slow: 0.6s;
}

/* ============================================================
   COLOR SYSTEM — Red / White / Blue, civic & editorial
   ============================================================ */

:root,
[data-theme="light"] {
  --color-bg: #f8f6f1;
  --color-surface: #ffffff;
  --color-surface-2: #f2efe6;
  --color-surface-offset: #ece7da;
  --color-divider: #e1dccd;
  --color-border: #d8d2c0;

  --color-text: #101e38;
  --color-text-muted: #4e5b76;
  --color-text-faint: #8b93a6;
  --color-text-inverse: #f8f6f1;

  /* Primary — Navy */
  --color-primary: #0f2a52;
  --color-primary-hover: #0a1d3b;
  --color-primary-active: #071528;
  --color-primary-highlight: #dde5f1;

  /* Accent — Americana Red */
  --color-accent: #ad1c2f;
  --color-accent-hover: #8a1626;
  --color-accent-active: #6c111e;
  --color-accent-highlight: #f6dcdf;

  --color-success: #1f7a4d;
  --color-success-highlight: #dbeee2;

  --shadow-sm: 0 1px 2px rgba(16, 30, 56, 0.06), 0 1px 1px rgba(16, 30, 56, 0.04);
  --shadow-md: 0 6px 20px rgba(16, 30, 56, 0.08), 0 2px 6px rgba(16, 30, 56, 0.05);
  --shadow-lg: 0 20px 48px rgba(16, 30, 56, 0.14), 0 6px 16px rgba(16, 30, 56, 0.08);
}

[data-theme="dark"] {
  --color-bg: #0a1526;
  --color-surface: #0f1d34;
  --color-surface-2: #142642;
  --color-surface-offset: #182c4b;
  --color-divider: #24385a;
  --color-border: #2b3f61;

  --color-text: #f3f1e8;
  --color-text-muted: #b3bccf;
  --color-text-faint: #75809a;
  --color-text-inverse: #0a1526;

  --color-primary: #7ea1d8;
  --color-primary-hover: #9db8e2;
  --color-primary-active: #b6c9ea;
  --color-primary-highlight: #1c3157;

  --color-accent: #e8697c;
  --color-accent-hover: #ee8a99;
  --color-accent-active: #f3a5b1;
  --color-accent-highlight: #3a1a22;

  --color-success: #5fbf8c;
  --color-success-highlight: #123326;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 6px 20px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 20px 48px rgba(0, 0, 0, 0.45);
}

/* ============================================================
   RESET
   ============================================================ */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background-color var(--dur-base) var(--ease-out), color var(--dur-base) var(--ease-out);
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.12;
  margin: 0;
  color: var(--color-text);
}

p {
  margin: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

img, svg {
  display: block;
  max-width: 100%;
}

button {
  font-family: inherit;
  cursor: pointer;
}

ul, ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

input, textarea, select {
  font-family: inherit;
  font-size: inherit;
}

:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

.container {
  width: 100%;
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: var(--space-6);
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--color-primary);
  color: var(--color-text-inverse);
  padding: var(--space-3) var(--space-5);
  z-index: 200;
  border-radius: 0 0 var(--radius-sm) 0;
}

.skip-link:focus {
  left: 0;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
