/**
 * Airport Newswire — Core Design System Tokens & Global CSS
 * System Architecture: Graphite 80% / Airside Teal 15% / Aviation Amber 5%
 * Editorial Typography: Space Grotesk (Headlines) + Public Sans (Body) + JetBrains Mono (Data)
 */

@import url('https://fonts.googleapis.com/css2?family=Public+Sans:ital,wght@0,400;0,500;0,600;0,700;0,800;1,400&family=Space+Grotesk:wght@500;600;700&family=JetBrains+Mono:wght@500;600;700&display=swap');

/* ==========================================================================
   CSS CUSTOM PROPERTIES (THEME TOKENS)
   ========================================================================== */

:root {
  /* Typography Stacks */
  --font-heading: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-body: 'Public Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  /* Primary Brand Neutrals (80% Visual Mass) */
  --color-graphite-950: #0C0D0E;
  --color-graphite-900: #141416; /* Master Brand Graphite */
  --color-graphite-800: #1C1D21;
  --color-graphite-700: #242529;
  --color-graphite-600: #383A42;
  --color-graphite-400: #71717A;
  --color-graphite-200: #E2E0D8;
  --color-graphite-100: #EFEFE9;
  --color-graphite-50:  #F8F7F4; /* Default Light Ground */

  /* Secondary Brand Anchor: Airside Deep Teal (15% Authority) */
  --color-teal-900: #0D2C2B;
  --color-teal-800: #144A48;     /* Primary Institutional Teal */
  --color-teal-700: #1B6562;
  --color-teal-100: #E2ECEB;
  --color-teal-50:  #F0F6F5;

  /* Primary Signal Accent: Aviation Signal Amber (5% Punctuation) */
  --color-amber-500: #D4910A;    /* Master Airfield Amber */
  --color-amber-600: #B87D08;
  --color-amber-400: #E8A824;
  --color-amber-100: #FDF3E0;
  --color-amber-50:  #FEF9F0;

  /* Semantic Utility Colors */
  --color-alert-red: #C93B2B;    /* ICAO Mandatory Instruction Red (Breaking Only) */
  --color-alert-red-soft: #FDE8E6;

  /* Spacing Scale (4px Base Unit Grid) */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
  --space-8: 32px;
  --space-12: 48px;
  --space-16: 64px;

  /* Layout Boundaries */
  --max-width-site: 1240px;
  --max-width-article: 720px; /* Optimal measure: 68-75 characters */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-sign: 10px; /* Airfield chassis radius */

  /* Light Theme Semantic Mapping (Default) */
  --bg-canvas: var(--color-graphite-50);
  --bg-surface: #FFFFFF;
  --bg-surface-elevated: #FAF9F5;
  --bg-header: var(--color-graphite-900);
  --text-header: #FFFFFF;
  
  --text-primary: var(--color-graphite-900);
  --text-secondary: #52525B;
  --text-muted: #71717A;
  --text-accent: var(--color-amber-500);

  --border-subtle: var(--color-graphite-200);
  --border-strong: #D5D3CB;
  --border-accent: var(--color-amber-500);

  --chip-bg: var(--color-teal-50);
  --chip-text: var(--color-teal-800);
  --chip-border: #D1E5E3;
}

/* ==========================================================================
   DARK THEME SEMANTIC MAPPING
   ========================================================================== */

[data-theme='dark'],
.dark {
  --bg-canvas: #0E0F11;
  --bg-surface: var(--color-graphite-900);
  --bg-surface-elevated: var(--color-graphite-800);
  --bg-header: #0A0A0C;
  --text-header: #FFFFFF;

  --text-primary: #F4F4F6;
  --text-secondary: #A1A1AA;
  --text-muted: #71717A;
  --text-accent: var(--color-amber-400);

  --border-subtle: #27282D;
  --border-strong: #383A42;
  --border-accent: var(--color-amber-500);

  --chip-bg: #112827;
  --chip-text: #48B0AB;
  --chip-border: #184240;
}

/* ==========================================================================
   TYPOGRAPHY HIERARCHY
   ========================================================================== */

body {
  font-family: var(--font-body);
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  line-height: 1.6;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, .font-heading {
  font-family: var(--font-heading);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.15;
  color: var(--text-primary);
}

.font-mono, [data-code] {
  font-family: var(--font-mono);
  letter-spacing: -0.01em;
}

/* Display / Homepage Hero (44px) */
.type-display {
  font-size: 2.75rem;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

/* H1 / Article Headline (32px) */
.type-h1 {
  font-size: 2rem;
  line-height: 1.2;
  letter-spacing: -0.025em;
}

/* H2 / Section Title (24px) */
.type-h2 {
  font-size: 1.5rem;
  line-height: 1.25;
}

/* Category Chip / Kicker (11px Uppercase) */
.type-kicker {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* Article Measure Constraint */
.article-body {
  max-width: var(--max-width-article);
  font-size: 1.0625rem;
  line-height: 1.68;
}

/* ==========================================================================
   REUSABLE BRAND COMPONENTS
   ========================================================================== */

/* The Airfield Guidance Sign Logo Mark Container */
.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: var(--color-graphite-900);
  border-radius: var(--radius-sign);
  padding: 8px 12px;
  flex-shrink: 0;
}

.brand-mark-dark {
  background-color: var(--color-graphite-700);
  border: 1px solid var(--color-graphite-600);
}

/* Two-Tier Masthead (Stacked Authority) */
.edition-wordmark-twotier {
  display: inline-flex;
  align-items: center;
  gap: 0;
  text-decoration: none;
  user-select: none;
  flex-shrink: 0;
  white-space: nowrap;
}

.edition-wordmark-twotier .wordmark-emblem {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  line-height: 0;
}

.wordmark-baffle {
  display: inline-block;
  width: 1.5px;
  height: 28px;
  background-color: var(--border-subtle, #E2E0D8);
  margin: 0 12px;
  border-radius: 1px;
  flex-shrink: 0;
}

[data-theme='dark'] .wordmark-baffle,
.dark .wordmark-baffle {
  background-color: var(--color-graphite-600, #383A42);
}

.wordmark-tier-stack {
  display: flex;
  flex-direction: column;
  justify-content: center;
  line-height: 1.05;
  gap: 1px;
}

.wordmark-tier-stack .tier-lead {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-primary);
  line-height: 1.1;
  text-transform: uppercase;
}

.wordmark-tier-stack .tier-accent {
  font-family: var(--font-heading);
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--color-amber-500);
  line-height: 1.1;
  text-transform: uppercase;
}

[data-theme='dark'] .wordmark-tier-stack .tier-accent,
.dark .wordmark-tier-stack .tier-accent {
  color: var(--color-amber-400);
}

/* Institutional Category Badge (Deep Teal Grounding) */
.category-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background-color: var(--chip-bg);
  color: var(--chip-text);
  border: 1px solid var(--chip-border);
  border-radius: var(--radius-sm);
  padding: 3px 8px;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Live Wire News Ticker (Amber Signal Pulse) */
.live-wire-pulse {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--color-amber-500);
  box-shadow: 0 0 0 0 rgba(212, 145, 10, 0.7);
  animation: amberPulse 2s infinite;
}

@keyframes amberPulse {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(212, 145, 10, 0.7);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 6px rgba(212, 145, 10, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(212, 145, 10, 0);
  }
}

/* Editorial CTA Button */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: var(--color-amber-500);
  color: var(--color-graphite-950);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.8125rem;
  letter-spacing: 0.02em;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  transition: background-color 0.15s ease;
  border: none;
  cursor: pointer;
}

.btn-primary:hover {
  background-color: var(--color-amber-600);
}
