/* ============================================
   Location Library — Design System: Tokens & Themes
   Dual theme: light (blueprint) + dark (field guide)
   Geist/Inter · Compact

   Loaded via <link> in index.html before all other partials.
   CSS is render-blocking, so load order does not cause FOUC;
   separate <link> tags load in parallel (no @import waterfall).
   ============================================ */

/* ---- Light Theme (default) ---- */
:root {
  --color-canvas: #ffffff;
  --color-surface: #ffffff;
  --color-surface-alt: #f2f2f2;
  --color-border: #e5e5e5;
  --color-border-hover: #0a0a0a;
  --color-text-primary: #0a0a0a;
  --color-text-heading: #000000;
  --color-text-muted: #737373;
  --color-text-secondary: #525252;
  --color-text-faint: #a1a1aa;
  --color-accent: #d97706;
  --color-accent-light: #f59e0b;
  --color-accent-bg: rgba(217, 119, 6, 0.08);
  --color-cta-bg: #000000;
  --color-cta-text: #ffffff;
  --color-cta-hover: #0a0a0a;
  --color-callout-red: #c22b10;
  --color-callout-red-bg: #fdf2f0;
  --color-success-green: #10c22b;
  --color-tag-bg: #f2f2f2;
  --color-tag-border: #e5e5e5;
  --color-tag-active-bg: #000000;
  --color-tag-active-text: #ffffff;
  --color-overlay: rgba(10, 10, 10, 0.4);
  --color-lightbox: rgba(0, 0, 0, 0.85);
  --color-card-shadow: oklab(0.145 -0.00000143796 0.00000340492 / 0.1) 0px 0px 0px 1px;
  --color-fab-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  --color-fab-primary-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
  --color-marker-stroke: #ffffff;

  /* Typography */
  --font-geist: 'Georgia', serif;
  --font-geist-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  --text-caption: 12px;
  --leading-caption: 1.5;
  --text-body: 14px;
  --leading-body: 1.43;
  --text-heading: 18px;
  --leading-heading: 1.33;
  --tracking-heading: -0.45px;
  --text-display: 48px;
  --leading-display: 1;
  --tracking-display: -2.4px;

  --font-weight-regular: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;

  /* Spacing */
  --spacing-4: 4px;
  --spacing-6: 6px;
  --spacing-8: 8px;
  --spacing-10: 10px;
  --spacing-12: 12px;
  --spacing-16: 16px;
  --spacing-20: 20px;
  --spacing-24: 24px;
  --spacing-32: 32px;

  /* Border radius */
  --radius-pill: 9999px;
  --radius-badge: 26px;
  --radius-cards: 14px;
  --radius-input: 10px;
  --radius-buttons: 10px;
  --radius-base: 8px;

  /* Layout */
  --drawer-width: 280px;
  --library-width: 420px;
  --panel-width: 360px;

  /* Top offset for fixed map chrome. Adds the iOS safe-area inset (Dynamic
     Island / notch) so controls clear the island; env() resolves to 0 on
     devices/browsers without a safe area, so this is a no-op elsewhere (#52). */
  --top-safe: calc(var(--spacing-10) + env(safe-area-inset-top, 0px));

  /* Animation */
  --duration-fast: 0.15s;
  --duration-base: 0.225s;
  --duration-slow: 0.375s;
  --ease-default: ease;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  /* Z-index */
  --z-map: 0;
  --z-drawer: 10;
  --z-panel: 20;
  --z-toolbar: 30;
  --z-modal: 100;
}

/* ---- Dark Theme ---- */
[data-theme="dark"] {
  --color-canvas: #080808;
  --color-surface: #111111;
  --color-surface-alt: #1c1c1c;
  --color-border: #222222;
  --color-border-hover: #333333;
  --color-text-primary: #e4e4e7;
  --color-text-heading: #ffffff;
  --color-text-muted: #71717a;
  --color-text-secondary: #a1a1aa;
  --color-text-faint: #3f3f46;
  --color-accent: #d97706;
  --color-accent-light: #f59e0b;
  --color-accent-bg: rgba(217, 119, 6, 0.1);
  --color-cta-bg: #ffffff;
  --color-cta-text: #000000;
  --color-cta-hover: #e4e4e7;
  --color-callout-red: #ef4444;
  --color-callout-red-bg: rgba(239, 68, 68, 0.1);
  --color-success-green: #22c55e;
  --color-tag-bg: #1c1c1c;
  --color-tag-border: #2a2a2a;
  --color-tag-active-bg: #ffffff;
  --color-tag-active-text: #000000;
  --color-overlay: rgba(0, 0, 0, 0.6);
  --color-lightbox: rgba(0, 0, 0, 0.92);
  --color-card-shadow: none;
  --color-fab-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  --color-fab-primary-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
  --color-marker-stroke: #333333;
}
