/**
 * DEFCON Theme — Dark military intelligence design system
 *
 * Extends base theme. Overrides all 43 base variables with dark-first
 * design tokens and adds DEFCON-specific variables (level colors,
 * priority badges, navigation).
 *
 * Variable groups:
 *   - DEFCON design tokens (backgrounds, text, accent, borders)
 *   - DEFCON level colors (1-5)
 *   - Priority colors (alert badges)
 *   - Status colors
 *   - Base theme variable mappings (43 vars)
 *   - Engine page-template compatibility aliases
 *
 * Component overrides scoped to .theme-defcon:
 *   - Level bar, priority badges, level indicators
 *   - Engine site-header hidden (Defcon uses navbar)
 */

/* ================================================================
   DEFCON DESIGN TOKENS — Complete Design System
   ================================================================ */
:root {
  /* ── Backgrounds — Dark-first design ── */
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-tertiary: #1a1a24;
  --bg-card: #151520;
  --bg-elevated: #1e1e2a;
  --bg-secondary-transparent: rgba(18, 18, 26, 0.85);
  --bg-tertiary-transparent: rgba(26, 26, 36, 0.9);

  /* ── Text — WCAG AA contrast on dark backgrounds ── */
  --text-primary: #e5e5e7;
  --text-secondary: #a1a1aa;
  --text-muted: #b0b8c4;

  /* ── Accent — Sky blue (DEFCON branding — matches live site #0ea5e9) ── */
  --accent-primary: #0ea5e9;
  --accent-hover: #00b8e0;
  --accent-rgb: 14, 165, 233;

  /* ── Borders ── */
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-medium: rgba(255, 255, 255, 0.15);
  --border-primary: rgba(255, 255, 255, 0.18);

  /* ── DEFCON Level Colors (1-5) ── */
  --level-1: #FFFFFF;    /* COCKED PISTOL — White */
  --level-2: #DC2626;    /* FAST PACE — Red */
  --level-3: #EAB308;    /* ROUND HOUSE — Yellow */
  --level-4: #22C55E;    /* DOUBLE TAKE — Green */
  --level-5: #3B82F6;    /* FADE OUT — Blue */

  /* ── Priority Colors (alert badges) ── */
  --priority-critical: #DC2626;
  --priority-high: #EF4444;
  --priority-elevated: #F59E0B;
  --priority-standard: #3B82F6;
  --priority-low: #22C55E;

  /* ── Status Colors ── */
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #dc2626;
  --info: #3b82f6;

  /* ── Typography ── */
  --font-primary: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", sans-serif;
  --font-mono: "JetBrains Mono", "Fira Code", "Consolas", monospace;
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 2rem;
  --text-4xl: 2.5rem;

  /* ── Spacing ── */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-7: 1.75rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;

  /* ── Shadows ── */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.15);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.35);

  /* ── Navigation ── */
  --navbar-bg: #12121a;
  --navbar-hover-bg: #1a1a24;
  --navbar-text: #a1a1aa;
  --navbar-text-hover: #e5e5e7;

  /* ── Transitions ── */
  --transition: 0.2s ease;

  /* ── Layout ── */
  --max-width: 1200px;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;

  /* ── BASE THEME VARIABLE OVERRIDES (43 vars) ──
     Map base theme contract to DEFCON values.
     Used by engine base/layout.css and base/components.css. */

  /* Colors */
  --text: var(--text-primary);
  --text-light: var(--text-secondary);
  --muted: var(--text-muted);
  --bg: var(--bg-primary);
  --bg-alt: var(--bg-secondary);
  --border: var(--border-subtle);
  --link: var(--accent-primary);
  --link-hover: var(--accent-hover);
  --accent: var(--accent-primary);
  --accent-light: rgba(14, 165, 233, 0.1);
  --nav-bg: var(--navbar-bg);
  --header-bg: var(--bg-primary);
  --footer-bg: var(--bg-secondary);

  /* Typography */
  --font-body: var(--font-primary);
  --font-heading: var(--font-primary);

  /* Spacing — tightened for content density (old site parity) */
  --space-xs: var(--space-2);
  --space-sm: var(--space-3);
  --space-md: var(--space-4);
  --space-lg: var(--space-6);
  --space-xl: var(--space-8);

  /* Effects */
  --radius: var(--radius-md);

  /* Layout */
  --content-width: var(--max-width);
  --wide-width: var(--max-width);

  /* ── ENGINE PAGE-TEMPLATE COMPAT ──
     Long-name aliases used by engine/core/assets/ page-templates. */
  --color-text: var(--text-primary);
  --color-text-light: var(--text-secondary);
  --color-background: var(--bg-primary);
  --color-background-alt: var(--bg-secondary);
  --color-accent: var(--accent-primary);
  --color-accent-light: rgba(14, 165, 233, 0.1);
  --color-link: var(--accent-primary);
  --color-link-hover: var(--accent-hover);
  --color-border: var(--border-subtle);

  /* Mobile tap highlight removal */
  -webkit-tap-highlight-color: transparent;
}

/* ================================================================
   DEFCON PLUGIN COMPONENTS
   Level bar, priority badges, and level indicators.
   ================================================================ */

/* Level Bar (rendered by defcon-levels plugin hook) */
.theme-defcon .defcon-level-bar {
  text-align: center;
  padding: var(--space-2) var(--space-4);
  font-weight: 700;
  font-size: var(--text-sm);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.theme-defcon .defcon-level-bar a {
  color: inherit;
  text-decoration: none;
}

.theme-defcon .defcon-level-bar a:hover {
  opacity: 0.9;
}

/* Priority Badges — clean metadata labels */
.theme-defcon .priority-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  line-height: 1.5;
}

.theme-defcon .priority-badge--critical { background: rgba(220, 38, 38, 0.12); color: #f87171; border: 1px solid rgba(220, 38, 38, 0.2); }
.theme-defcon .priority-badge--high     { background: rgba(245, 158, 11, 0.12); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.2); }
.theme-defcon .priority-badge--elevated { background: rgba(234, 179, 8, 0.12); color: #fde047; border: 1px solid rgba(234, 179, 8, 0.2); }
.theme-defcon .priority-badge--standard { background: rgba(14, 165, 233, 0.12); color: #38bdf8; border: 1px solid rgba(14, 165, 233, 0.2); }
.theme-defcon .priority-badge--low      { background: rgba(34, 197, 94, 0.12); color: #4ade80; border: 1px solid rgba(34, 197, 94, 0.2); }

/* Level Indicators */
.theme-defcon .level-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  font-weight: 700;
  font-size: var(--text-sm);
}

.theme-defcon .level-indicator--1 { background: var(--level-1); color: #0f172a; }
.theme-defcon .level-indicator--2 { background: var(--level-2); color: #fff; }
.theme-defcon .level-indicator--3 { background: var(--level-3); color: #0f172a; }
.theme-defcon .level-indicator--4 { background: var(--level-4); color: #0f172a; }
.theme-defcon .level-indicator--5 { background: var(--level-5); color: #fff; }

/* ================================================================
   ENGINE OVERRIDES
   Hide engine default site-header — Defcon uses navbar for branding
   ================================================================ */
.theme-defcon .site-header {
  display: none;
}
