@import url('https://fonts.googleapis.com/css2?family=Share+Tech+Mono&family=Rajdhani:wght@700;800&family=Inter:wght@400;600;700&display=swap');

/* ==========================================
   BATTLE-WORN VETERAN HUD & CODES
   ========================================== */
:root {
  /* Fonts */
  --font-display: 'Rajdhani', -apple-system, sans-serif;
  --font-mono: 'Share Tech Mono', monospace;
  --font-body: 'Inter', sans-serif;

  /* Transitions */
  --transition-fast: 0.1s linear;
  --transition-smooth: 0.25s ease-out;
  
  /* flat edges */
  --radius-sm: 0px !important;
  --radius-md: 0px !important;
  --radius-lg: 0px !important;

  /* BATTLEFIELD PALETTE (Dusty Canvas, Gun-oil, and Dried Mud) */
  --bg-primary: #090807;       /* Dusty Charcoal Carbon */
  --bg-secondary: #100f0c;     /* Gun-Oil Dark Slate */
  --bg-tertiary: #161410;      /* Dried Mud Brown-Gray */
  --text-primary: #d6cbaf;     /* Faded Canvas Off-White */
  --text-secondary: #ab9d85;   /* Weathered desert tan */
  --text-muted: #574f41;       /* Dried Clay Mud */

  /* DEFAULT THEME: RUSTED AMBER ORANGE */
  --hud-accent: #b24d05;       /* Rusted copper orange */
  --hud-accent-hover: #cf5e12;
  --hud-accent-rgb: 178, 77, 5;
  --hud-accent-glow: rgba(178, 77, 5, 0.2);
  --hud-accent-dim: rgba(178, 77, 5, 0.08);

  /* Heavy steel borders */
  --border-color: rgba(178, 77, 5, 0.25);
  --border-glow: rgba(178, 77, 5, 0.4);
  
  /* Shadows representing CRT fade */
  --hud-shadow: 0 0 10px rgba(178, 77, 5, 0.05);
  --hud-shadow-strong: 0 0 20px rgba(178, 77, 5, 0.12);
}

/* THEME 2: DIRTY CAMO GREEN */
[data-theme="green"] {
  --hud-accent: #52603f;       /* Muddy Camouflage Green */
  --hud-accent-hover: #677850;
  --hud-accent-rgb: 82, 96, 63;
  --hud-accent-glow: rgba(82, 96, 63, 0.2);
  --hud-accent-dim: rgba(82, 96, 63, 0.08);

  --border-color: rgba(82, 96, 63, 0.3);
  --border-glow: rgba(82, 96, 63, 0.45);
  
  --hud-shadow: 0 0 10px rgba(82, 96, 63, 0.05);
  --hud-shadow-strong: 0 0 20px rgba(82, 96, 63, 0.12);
}

/* THEME 3: STAINED BLOOD RED */
[data-theme="red"] {
  --hud-accent: #8a1313;       /* Dried blood/rust red */
  --hud-accent-hover: #ab1f1f;
  --hud-accent-rgb: 138, 19, 19;
  --hud-accent-glow: rgba(138, 19, 19, 0.2);
  --hud-accent-dim: rgba(138, 19, 19, 0.08);

  --border-color: rgba(138, 19, 19, 0.35);
  --border-glow: rgba(138, 19, 19, 0.5);
  
  --hud-shadow: 0 0 15px rgba(138, 19, 19, 0.1);
  --hud-shadow-strong: 0 0 25px rgba(138, 19, 19, 0.18);
}

/* THEME 4: ARID DESERT DIGITAL CAMO HUD */
[data-theme="camo"] {
  --hud-accent: #968165;       /* Desert Digital Dusty Tan */
  --hud-accent-hover: #ad9678;
  --hud-accent-rgb: 150, 129, 101;
  --hud-accent-glow: rgba(150, 129, 101, 0.2);
  --hud-accent-dim: rgba(150, 129, 101, 0.08);

  --border-color: rgba(150, 129, 101, 0.35);
  --border-glow: rgba(150, 129, 101, 0.5);
  
  --hud-shadow: 0 0 15px rgba(150, 129, 101, 0.08);
  --hud-shadow-strong: 0 0 25px rgba(150, 129, 101, 0.16);
  
  --bg-primary: #090806;       /* Muddy Dark Sand */
  --bg-secondary: #12100b;     /* Weathered Gun Grease Brown */
}

/* ==========================================
   RESET & SYSTEM BACKDROPS & FLICKER
   ========================================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  border-radius: 0px !important;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  background-color: var(--bg-primary);
}

/* Subtle CRT monitor aging flicker (螢幕線路老化微閃爍) */
@keyframes crt-flicker {
  0% { opacity: 0.991; }
  50% { opacity: 0.999; }
  100% { opacity: 0.991; }
}

body {
  background-color: var(--bg-primary);
  color: var(--text-secondary);
  font-family: var(--font-body);
  line-height: 1.5;
  position: relative;
  overflow-x: hidden;
  letter-spacing: 0.04em;
  transition: color var(--transition-smooth);
  animation: crt-flicker 0.18s infinite;
}

/* Faint Desert Camo Watermark backdrop in Camo Theme */
[data-theme="camo"] body {
  background-image: 
    linear-gradient(rgba(9, 8, 6, 0.975), rgba(9, 8, 6, 0.975)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64' viewBox='0 0 64 64'%3E%3Crect width='64' height='64' fill='%23ab9b85'/%3E%3Crect x='0' y='0' width='8' height='8' fill='%23c2b4a0' opacity='0.85'/%3E%3Crect x='16' y='8' width='16' height='8' fill='%23c2b4a0' opacity='0.85'/%3E%3Crect x='8' y='24' width='8' height='16' fill='%23c2b4a0' opacity='0.85'/%3E%3Crect x='32' y='16' width='16' height='8' fill='%23c2b4a0' opacity='0.85'/%3E%3Crect x='48' y='40' width='8' height='8' fill='%23c2b4a0' opacity='0.85'/%3E%3Crect x='24' y='48' width='16' height='8' fill='%23c2b4a0' opacity='0.85'/%3E%3Crect x='8' y='8' width='8' height='8' fill='%237a6b57' opacity='0.8'/%3E%3Crect x='40' y='0' width='16' height='8' fill='%237a6b57' opacity='0.8'/%3E%3Crect x='24' y='24' width='8' height='8' fill='%237a6b57' opacity='0.8'/%3E%3Crect x='0' y='40' width='16' height='12' fill='%237a6b57' opacity='0.8'/%3E%3Crect x='48' y='24' width='12' height='16' fill='%237a6b57' opacity='0.8'/%3E%3Crect x='32' y='40' width='8' height='8' fill='%237a6b57' opacity='0.8'/%3E%3Crect x='24' y='0' width='8' height='8' fill='%23574c3e' opacity='0.7'/%3E%3Crect x='8' y='16' width='16' height='8' fill='%23574c3e' opacity='0.7'/%3E%3Crect x='32' y='8' width='8' height='8' fill='%23574c3e' opacity='0.7'/%3E%3Crect x='16' y='32' width='12' height='8' fill='%23574c3e' opacity='0.7'/%3E%3Crect x='40' y='48' width='8' height='16' fill='%23574c3e' opacity='0.7'/%3E%3Crect x='0' y='56' width='16' height='8' fill='%23574c3e' opacity='0.7'/%3E%3C/svg%3E");
  background-size: 64px 64px;
}

/* Tactical HUD Radar Grid Overlay */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    linear-gradient(rgba(var(--hud-accent-rgb), 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(var(--hud-accent-rgb), 0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: -100;
}

/* CRT Vignette Scanline & Oil Smudges Effect */
body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(circle, transparent 40%, rgba(2, 2, 2, 0.98) 100%),
    linear-gradient(rgba(18, 22, 28, 0.15) 50%, rgba(0, 0, 0, 0.25) 50%),
    /* Heavy mud and grease overlays */
    radial-gradient(circle at 85% 15%, rgba(92, 83, 68, 0.12) 0%, transparent 200px),
    radial-gradient(circle at 10% 85%, rgba(30, 25, 20, 0.20) 0%, transparent 250px);
  background-size: 100% 100%, 100% 4px, 100% 100%, 100% 100%;
  pointer-events: none;
  z-index: 1002;
  opacity: 0.95;
}

/* Custom Scrollbar (Dirty Metal Style) */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
  border-left: 2px solid var(--border-color);
}
::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border: 2px solid var(--bg-primary);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--hud-accent);
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  color: var(--text-primary);
  text-transform: uppercase;
  font-weight: 800;
  letter-spacing: 0.12em;
  line-height: 1.15;
}

/* Mono elements */
.code-mono, .post-meta, .logo, .nav-link, .tag-badge, .filter-chip, .btn-submit, .widget-title, .toc-link, .terminal-header, .console-cell-label, .console-cell-value, .vital-label, .vital-value, .weapon-spec, .threat-banner, .classified-stamp, .ops-ticker, .decryption-percentage, .decryption-log-line {
  font-family: var(--font-mono);
}

a {
  color: inherit;
  text-decoration: none;
  transition: all var(--transition-fast);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
  filter: grayscale(75%) contrast(160%) brightness(65%) sepia(30%);
  border: 2px solid var(--border-color);
  transition: filter var(--transition-smooth);
}

img:hover {
  filter: grayscale(35%) contrast(135%) brightness(75%) sepia(15%);
}

/* ==========================================
   TACTICAL IMAGE GLITCH EFFECT
   ========================================== */
@keyframes img-glitch-anim {
  0% {
    clip-path: inset(15% 0 70% 0);
    transform: translateX(-6px) skewX(3deg);
    filter: grayscale(100%) contrast(300%) brightness(130%) sepia(50%) hue-rotate(90deg);
  }
  20% {
    clip-path: inset(55% 0 15% 0);
    transform: translateX(6px) skewX(-3deg);
    filter: grayscale(0%) contrast(150%) brightness(80%) sepia(10%) hue-rotate(180deg);
  }
  40% {
    clip-path: inset(5% 0 85% 0);
    transform: translateX(-4px) translateY(-3px);
  }
  60% {
    clip-path: inset(80% 0 5% 0);
    transform: translateX(4px) translateY(3px) skewX(2deg);
    filter: invert(10%);
  }
  80% {
    clip-path: inset(45% 0 45% 0);
    transform: translateX(-2px);
  }
  100% {
    clip-path: inset(0 0 0 0);
    transform: none;
    filter: grayscale(75%) contrast(160%) brightness(65%) sepia(30%);
  }
}

/* Active glitch triggers on JS loop */
.hud-img-glitch-active {
  animation: img-glitch-anim 0.22s steps(2) 1 !important;
}

/* Interactive card hover glitch */
.post-card:hover .post-card-img,
.featured-card:hover .featured-img {
  animation: img-glitch-anim 0.2s steps(2) 1;
}

/* ==========================================
   DESERT DIGITAL CAMOUFLAGE REPEATING SVG PATTERN
   ========================================== */
.hud-camo-pattern {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64' viewBox='0 0 64 64'%3E%3Crect width='64' height='64' fill='%23ab9b85'/%3E%3Crect x='0' y='0' width='8' height='8' fill='%23c2b4a0' opacity='0.85'/%3E%3Crect x='16' y='8' width='16' height='8' fill='%23c2b4a0' opacity='0.85'/%3E%3Crect x='8' y='24' width='8' height='16' fill='%23c2b4a0' opacity='0.85'/%3E%3Crect x='32' y='16' width='16' height='8' fill='%23c2b4a0' opacity='0.85'/%3E%3Crect x='48' y='40' width='8' height='8' fill='%23c2b4a0' opacity='0.85'/%3E%3Crect x='24' y='48' width='16' height='8' fill='%23c2b4a0' opacity='0.85'/%3E%3Crect x='8' y='8' width='8' height='8' fill='%237a6b57' opacity='0.8'/%3E%3Crect x='40' y='0' width='16' height='8' fill='%237a6b57' opacity='0.8'/%3E%3Crect x='24' y='24' width='8' height='8' fill='%237a6b57' opacity='0.8'/%3E%3Crect x='0' y='40' width='16' height='12' fill='%237a6b57' opacity='0.8'/%3E%3Crect x='48' y='24' width='12' height='16' fill='%237a6b57' opacity='0.8'/%3E%3Crect x='32' y='40' width='8' height='8' fill='%237a6b57' opacity='0.8'/%3E%3Crect x='24' y='0' width='8' height='8' fill='%23574c3e' opacity='0.7'/%3E%3Crect x='8' y='16' width='16' height='8' fill='%23574c3e' opacity='0.7'/%3E%3Crect x='32' y='8' width='8' height='8' fill='%23574c3e' opacity='0.7'/%3E%3Crect x='16' y='32' width='12' height='8' fill='%23574c3e' opacity='0.7'/%3E%3Crect x='40' y='48' width='8' height='16' fill='%23574c3e' opacity='0.7'/%3E%3Crect x='0' y='56' width='16' height='8' fill='%23574c3e' opacity='0.7'/%3E%3C/svg%3E");
  background-size: 64px 64px;
}

/* ==========================================
   TACTICAL CORNER BRACKETS, RIVETS & BATTLE-SCARRED CARDS
   ========================================== */
.hud-border {
  border: 2px solid;
  border-image: linear-gradient(
    135deg,
    var(--border-color) 0%,
    var(--border-color) 15%,
    transparent 16%,
    transparent 18%,
    var(--border-color) 19%,
    var(--border-color) 45%,
    transparent 46%,
    transparent 47%,
    var(--border-color) 48%,
    var(--border-color) 75%,
    transparent 76%,
    transparent 78%,
    var(--border-color) 79%,
    var(--border-color) 100%
  ) 2;
  position: relative;
  box-shadow: var(--hud-shadow);
  background: var(--bg-secondary);
}

/* Dirt Smudges & Heavy Scuffs Overlay on every panel */
.hud-border::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: 
    /* Oil & mud smudges */
    radial-gradient(circle at 90% 10%, rgba(92, 83, 68, 0.12) 0%, transparent 140px),
    radial-gradient(circle at 10% 90%, rgba(30, 26, 20, 0.22) 0%, transparent 150px),
    /* CSS Scratch lines */
    repeating-linear-gradient(55deg, transparent, transparent 40px, rgba(0, 0, 0, 0.18) 41px, transparent 43px),
    repeating-linear-gradient(-35deg, transparent, transparent 60px, rgba(255, 255, 255, 0.015) 61px, transparent 62px);
  pointer-events: none;
  z-index: 2;
}

.hud-double-border {
  border: 4px double var(--border-color);
  position: relative;
  background: var(--bg-secondary);
}

/* Heavy Screws/Rivets at corners (鉚釘) */
.hud-rivet {
  width: 6px;
  height: 6px;
  background: #090a0d;
  border: 1px solid var(--border-color);
  border-radius: 50% !important;
  position: absolute;
  box-shadow: inset 1px 1px 1.5px #000, 0.5px 0.5px 0.5px rgba(255,255,255,0.05);
  z-index: 12;
}
.rivet-tl { top: 8px; left: 8px; }
.rivet-tr { top: 8px; right: 8px; }
.rivet-bl { bottom: 8px; left: 8px; }
.rivet-br { bottom: 8px; right: 8px; }

/* Corner Brackets decoration */
.hud-brackets::before,
.hud-brackets::after {
  content: '';
  position: absolute;
  width: 12px;
  height: 12px;
  border-color: var(--hud-accent);
  border-style: solid;
  pointer-events: none;
  z-index: 10;
  transition: border-color var(--transition-smooth);
}

.hud-brackets::before {
  top: -2px;
  left: -2px;
  border-width: 4px 0 0 4px;
}
.hud-brackets::after {
  bottom: -2px;
  right: -2px;
  border-width: 0 4px 4px 0;
}

.hud-brackets-full-extra {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
}
.hud-brackets-full-extra::before,
.hud-brackets-full-extra::after {
  content: '';
  position: absolute;
  width: 12px;
  height: 12px;
  border-color: var(--hud-accent);
  border-style: solid;
  pointer-events: none;
  z-index: 10;
  transition: border-color var(--transition-smooth);
}
.hud-brackets-full-extra::before {
  top: -2px;
  right: -2px;
  border-width: 4px 4px 0 0;
}
.hud-brackets-full-extra::after {
  bottom: -2px;
  left: -2px;
  border-width: 0 0 4px 4px;
}

.hud-card-hover:hover {
  box-shadow: var(--hud-shadow-strong);
}

.hud-card-hover:hover .hud-brackets::before,
.hud-card-hover:hover .hud-brackets::after,
.hud-card-hover:hover .hud-brackets-full-extra::before,
.hud-card-hover:hover .hud-brackets-full-extra::after {
  border-color: var(--hud-accent-hover);
  filter: drop-shadow(0 0 6px var(--hud-accent-hover));
}

.hud-card-hover:hover .hud-rivet {
  border-color: var(--hud-accent);
}

/* Hazard Warning Stripe block */
.hud-hazard {
  position: relative;
}

.hud-hazard::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 5px;
  background: repeating-linear-gradient(
    -45deg,
    var(--hud-accent),
    var(--hud-accent) 8px,
    #000 8px,
    #000 16px
  );
  opacity: 0.8;
}

/* Weathered Mud Stamp: TOP SECRET / CLASSIFIED (戰火油印) */
.classified-stamp {
  border: 2px dashed #8a1313;
  color: #8a1313;
  font-size: 13px;
  font-weight: 800;
  padding: 4px 10px;
  text-transform: uppercase;
  transform: rotate(-8deg);
  display: inline-block;
  letter-spacing: 3px;
  background: rgba(10, 9, 8, 0.7);
  opacity: 0.85;
  background-image: repeating-linear-gradient(45deg, rgba(138, 19, 19, 0.08), rgba(138, 19, 19, 0.08) 1px, transparent 1px, transparent 3px);
}

[data-theme="green"] .classified-stamp {
  border-color: #52603f;
  color: #52603f;
  background-image: repeating-linear-gradient(45deg, rgba(82, 96, 63, 0.08), rgba(82, 96, 63, 0.08) 1px, transparent 1px, transparent 3px);
}
[data-theme="red"] .classified-stamp {
  border-color: #8a1313;
  color: #8a1313;
  box-shadow: 0 0 8px rgba(138, 19, 19, 0.15);
}
[data-theme="camo"] .classified-stamp {
  border-color: #4a3e2f;
  color: #4a3e2f;
  background-image: repeating-linear-gradient(45deg, rgba(74, 62, 47, 0.08), rgba(74, 62, 47, 0.08) 1px, transparent 1px, transparent 3px);
}

/* Threat Alert Banner */
.threat-banner {
  background: var(--hud-accent);
  color: var(--bg-primary);
  font-weight: 800;
  font-size: 11px;
  padding: 4px 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 0.1em;
}

[data-theme="red"] .threat-banner {
  background: #ff003c;
  color: #fff;
  box-shadow: 0 0 10px rgba(255, 0, 60, 0.4);
}

/* Apply Desert Digital Camo in Desert Theme */
[data-theme="camo"] .threat-banner {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64' viewBox='0 0 64 64'%3E%3Crect width='64' height='64' fill='%23ab9b85'/%3E%3Crect x='0' y='0' width='8' height='8' fill='%23c2b4a0' opacity='0.85'/%3E%3Crect x='16' y='8' width='16' height='8' fill='%23c2b4a0' opacity='0.85'/%3E%3Crect x='8' y='24' width='8' height='16' fill='%23c2b4a0' opacity='0.85'/%3E%3Crect x='32' y='16' width='16' height='8' fill='%23c2b4a0' opacity='0.85'/%3E%3Crect x='48' y='40' width='8' height='8' fill='%23c2b4a0' opacity='0.85'/%3E%3Crect x='24' y='48' width='16' height='8' fill='%23c2b4a0' opacity='0.85'/%3E%3Crect x='8' y='8' width='8' height='8' fill='%237a6b57' opacity='0.8'/%3E%3Crect x='40' y='0' width='16' height='8' fill='%237a6b57' opacity='0.8'/%3E%3Crect x='24' y='24' width='8' height='8' fill='%237a6b57' opacity='0.8'/%3E%3Crect x='0' y='40' width='16' height='12' fill='%237a6b57' opacity='0.8'/%3E%3Crect x='48' y='24' width='12' height='16' fill='%237a6b57' opacity='0.8'/%3E%3Crect x='32' y='40' width='8' height='8' fill='%237a6b57' opacity='0.8'/%3E%3Crect x='24' y='0' width='8' height='8' fill='%23574c3e' opacity='0.7'/%3E%3Crect x='8' y='16' width='16' height='8' fill='%23574c3e' opacity='0.7'/%3E%3Crect x='32' y='8' width='8' height='8' fill='%23574c3e' opacity='0.7'/%3E%3Crect x='16' y='32' width='12' height='8' fill='%23574c3e' opacity='0.7'/%3E%3Crect x='40' y='48' width='8' height='16' fill='%23574c3e' opacity='0.7'/%3E%3Crect x='0' y='56' width='16' height='8' fill='%23574c3e' opacity='0.7'/%3E%3C/svg%3E");
  background-size: 64px 64px;
  color: #1e1915;
  border: 1px solid #4a3e2f;
  font-weight: 900;
  text-shadow: 0.5px 0.5px 0px rgba(255,255,255,0.5);
}

[data-theme="camo"] .navbar {
  border-bottom: 3px solid #a89476;
}

[data-theme="camo"] .terminal-header {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64' viewBox='0 0 64 64'%3E%3Crect width='64' height='64' fill='%23ab9b85'/%3E%3Crect x='0' y='0' width='8' height='8' fill='%23c2b4a0' opacity='0.85'/%3E%3Crect x='16' y='8' width='16' height='8' fill='%23c2b4a0' opacity='0.85'/%3E%3Crect x='8' y='24' width='8' height='16' fill='%23c2b4a0' opacity='0.85'/%3E%3Crect x='8' y='8' width='8' height='8' fill='%237a6b57' opacity='0.8'/%3E%3Crect x='24' y='24' width='8' height='8' fill='%237a6b57' opacity='0.8'/%3E%3Crect x='24' y='0' width='8' height='8' fill='%23574c3e' opacity='0.7'/%3E%3C/svg%3E");
  background-size: 64px 64px;
  color: #1a1510;
  border-bottom: 2px solid #5a4b38;
  font-weight: 800;
  text-shadow: 0.5px 0.5px 0px rgba(255,255,255,0.4);
}

[data-theme="camo"] .tag-badge {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64' viewBox='0 0 64 64'%3E%3Crect width='64' height='64' fill='%23ab9b85'/%3E%3Crect x='0' y='0' width='8' height='8' fill='%23c2b4a0' opacity='0.85'/%3E%3Crect x='8' y='8' width='8' height='8' fill='%237a6b57' opacity='0.8'/%3E%3C/svg%3E");
  background-size: 48px 48px;
  color: #1a1510;
  font-weight: 900;
  border: 1px solid #5a4b38;
  text-shadow: 0.5px 0.5px 0px rgba(255,255,255,0.3);
}

/* Tactical Terminal Header Bar */
.terminal-header {
  border-bottom: 2px solid var(--border-color);
  padding: 8px 16px;
  background: var(--bg-tertiary);
  font-size: 11px;
  color: var(--hud-accent);
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.terminal-header-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--hud-accent);
  box-shadow: 0 0 6px var(--hud-accent);
  border-radius: 50% !important;
  margin-right: 6px;
}

/* Live pulsing indicators */
.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50% !important;
  background: var(--hud-accent);
  box-shadow: 0 0 8px var(--hud-accent);
  animation: pulse-hud 2s infinite;
}

.status-dot.green {
  background: #4a6639;
  box-shadow: 0 0 6px #4a6639;
}

[data-theme="green"] .status-dot.green {
  background: #00ff55;
  box-shadow: 0 0 8px #00ff55;
}

@keyframes pulse-hud {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(var(--hud-accent-rgb), 0.8);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 6px rgba(var(--hud-accent-rgb), 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(var(--hud-accent-rgb), 0);
  }
}

.alert-pulse {
  animation: alert-pulse-anim 1.5s infinite;
}
@keyframes alert-pulse-anim {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; color: var(--hud-accent); text-shadow: 0 0 8px var(--hud-accent-glow); }
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.text-gradient {
  color: var(--text-primary);
  text-shadow: 0 0 6px var(--hud-accent-glow);
}

/* ==========================================
   NAVIGATION BAR (HUD Slate Panel)
   ========================================== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 72px;
  background: rgba(10, 9, 8, 0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 2px solid var(--border-color);
  box-shadow: 0 4px 25px rgba(0, 0, 0, 0.9);
  z-index: 1000;
  display: flex;
  align-items: center;
  transition: all var(--transition-smooth);
}

.navbar.scrolled {
  height: 60px;
  background: rgba(10, 9, 8, 0.99);
}

.navbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.logo {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--hud-accent);
  text-shadow: 0 0 6px var(--hud-accent-glow);
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo::before {
  content: '⚡';
  font-size: 18px;
}

.nav-menu {
  display: flex;
  align-items: center;
  list-style: none;
  gap: 28px;
}

.nav-link {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-secondary);
  padding: 6px 12px;
  border: 2px solid transparent;
  transition: all var(--transition-fast);
}

.nav-link:hover,
.nav-link.active {
  color: var(--hud-accent);
  border-color: var(--border-color);
  background: var(--hud-accent-dim);
  text-shadow: 0 0 4px var(--hud-accent-glow);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Search Bar (Tactical Terminal Look) */
.search-container {
  position: relative;
}

.search-input {
  background: var(--bg-primary);
  border: 2px solid var(--border-color);
  padding: 8px 12px 8px 36px;
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--hud-accent);
  width: 150px;
  transition: all var(--transition-smooth);
}

.search-input::placeholder {
  color: rgba(var(--hud-accent-rgb), 0.5);
}

.search-input:focus {
  width: 200px;
  border-color: var(--hud-accent);
  box-shadow: 0 0 8px var(--hud-accent-glow);
  background: var(--bg-tertiary);
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--hud-accent);
  opacity: 0.8;
  pointer-events: none;
}

/* HUD Theme Toggler */
.theme-toggle-btn {
  width: 36px;
  height: 36px;
  border: 2px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: var(--bg-tertiary);
  color: var(--hud-accent);
  transition: all var(--transition-fast);
}

.theme-toggle-btn:hover {
  background: var(--hud-accent-dim);
  border-color: var(--hud-accent);
  box-shadow: 0 0 10px var(--hud-accent-glow);
}

.theme-toggle-btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

/* Mobile Toggle */
.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  border: 2px solid var(--border-color);
  padding: 8px;
}

.menu-toggle span {
  width: 20px;
  height: 2px;
  background: var(--hud-accent);
  box-shadow: 0 0 4px var(--hud-accent-glow);
  transition: all var(--transition-fast);
}

/* ==========================================
   TACTICAL MISSION CONTROL PANEL / DASHBOARD
   ========================================== */
.tactical-dashboard-section {
  padding-top: 100px;
  padding-bottom: 20px;
}

.ops-dashboard {
  background: var(--bg-secondary);
  border: 2px solid var(--border-color);
  margin-bottom: 12px;
}

/* Apply Faint Desert Camo background to control dashboard under Camo theme */
[data-theme="camo"] .ops-dashboard {
  background-image: 
    linear-gradient(rgba(18, 16, 12, 0.92), rgba(18, 16, 12, 0.92)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64' viewBox='0 0 64 64'%3E%3Crect width='64' height='64' fill='%23ab9b85'/%3E%3Crect x='0' y='0' width='8' height='8' fill='%23c2b4a0' opacity='0.85'/%3E%3Crect x='16' y='8' width='16' height='8' fill='%23c2b4a0' opacity='0.85'/%3E%3Crect x='8' y='24' width='8' height='16' fill='%23c2b4a0' opacity='0.85'/%3E%3Crect x='32' y='16' width='16' height='8' fill='%23c2b4a0' opacity='0.85'/%3E%3Crect x='48' y='40' width='8' height='8' fill='%23c2b4a0' opacity='0.85'/%3E%3Crect x='24' y='48' width='16' height='8' fill='%23c2b4a0' opacity='0.85'/%3E%3Crect x='8' y='8' width='8' height='8' fill='%237a6b57' opacity='0.8'/%3E%3Crect x='40' y='0' width='16' height='8' fill='%237a6b57' opacity='0.8'/%3E%3Crect x='24' y='24' width='8' height='8' fill='%237a6b57' opacity='0.8'/%3E%3Crect x='0' y='40' width='16' height='12' fill='%237a6b57' opacity='0.8'/%3E%3Crect x='48' y='24' width='12' height='16' fill='%237a6b57' opacity='0.8'/%3E%3Crect x='32' y='40' width='8' height='8' fill='%237a6b57' opacity='0.8'/%3E%3Crect x='24' y='0' width='8' height='8' fill='%23574c3e' opacity='0.7'/%3E%3Crect x='8' y='16' width='16' height='8' fill='%23574c3e' opacity='0.7'/%3E%3Crect x='32' y='8' width='8' height='8' fill='%23574c3e' opacity='0.7'/%3E%3Crect x='16' y='32' width='12' height='8' fill='%23574c3e' opacity='0.7'/%3E%3Crect x='40' y='48' width='8' height='16' fill='%23574c3e' opacity='0.7'/%3E%3Crect x='0' y='56' width='16' height='8' fill='%23574c3e' opacity='0.7'/%3E%3C/svg%3E");
  background-size: 64px 64px;
}

.ops-ticker {
  background: rgba(0, 0, 0, 0.9);
  padding: 8px 16px;
  border-bottom: 2px dashed var(--border-color);
  display: flex;
  overflow: hidden;
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: 11px;
}

.ops-ticker-content {
  display: inline-block;
  padding-left: 100%;
  animation: ticker-roll 30s linear infinite;
  color: var(--hud-accent);
  font-weight: bold;
}

@keyframes ticker-roll {
  0% { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(-100%, 0, 0); }
}

.ops-split-panel {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  background: var(--bg-secondary);
}

.ops-left-vitals {
  padding: 24px;
  border-right: 2px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: relative;
}

.ops-right-map {
  padding: 24px;
  display: flex;
  flex-direction: column;
}

/* Vital Signs / Roster Panel */
.roster-header {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--hud-accent);
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 8px;
  letter-spacing: 0.1em;
}

.operator-vital-row {
  display: grid;
  grid-template-columns: 100px 1.35fr 1.15fr;
  align-items: center;
  gap: 20px;
  padding: 12px 0;
  border-bottom: 2px dashed rgba(var(--hud-accent-rgb), 0.2);
  position: relative;
  z-index: 2;
}
.operator-vital-row:last-child {
  border-bottom: none;
}

.operator-vital-name {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
}

.operator-vital-stats {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.vital-stat-bar-container {
  display: flex;
  align-items: center;
  gap: 10px;
}

.vital-label {
  font-size: 10px;
  width: 55px;
  color: var(--text-muted);
  font-weight: bold;
}

.vital-bar {
  flex-grow: 1;
  height: 8px;
  background: #020304;
  border: 1px solid var(--border-color);
  position: relative;
}

.vital-bar-fill {
  height: 100%;
  background: var(--hud-accent);
  box-shadow: 0 0 6px var(--hud-accent-glow);
}

.vital-bar-fill.green {
  background: #4a6639;
  box-shadow: 0 0 6px rgba(74, 102, 57, 0.4);
}

[data-theme="green"] .vital-bar-fill.green {
  background: #00ff55;
  box-shadow: 0 0 6px rgba(0, 255, 85, 0.5);
}

.vital-value {
  font-size: 11px;
  width: 60px;
  text-align: right;
  color: var(--text-primary);
  font-weight: bold;
}

.operator-weapon-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 11px;
  text-align: right;
}

.weapon-spec {
  color: var(--hud-accent);
  font-weight: bold;
  font-size: 12px;
}

/* Tactical Vector Map Styling */
.hud-map-title {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--hud-accent);
  margin-bottom: 12px;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 8px;
  letter-spacing: 0.1em;
}

.hud-map-container {
  flex-grow: 1;
  background: var(--bg-primary);
  border: 2px solid var(--border-color);
  position: relative;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 220px;
}

.hud-svg-map {
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, rgba(var(--hud-accent-rgb), 0.06) 0%, transparent 85%);
}

@keyframes radar-sweep-anim {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

#radar-sweep, #radar-sweep-sidebar {
  transform-origin: 200px 110px;
  animation: radar-sweep-anim 8s linear infinite;
}

/* ==========================================
   HERO / FEATURED OPERATION BRIEFING
   ========================================== */
.hero-section {
  padding-top: 10px;
  padding-bottom: 40px;
}

.featured-card {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  overflow: hidden;
}

.featured-img-wrapper {
  position: relative;
  overflow: hidden;
  height: 100%;
  min-height: 420px;
  border-right: 2px solid var(--border-color);
}

.featured-img-wrapper::after {
  content: '[ AAR / DECLASSIFIED FIELD RECORD ]';
  position: absolute;
  top: 16px;
  left: 16px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--hud-accent);
  background: rgba(10, 9, 8, 0.95);
  padding: 4px 8px;
  border: 1px solid var(--border-color);
  z-index: 10;
}

.featured-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-smooth);
}

.featured-card:hover .featured-img {
  transform: scale(1.02);
}

.featured-content {
  padding: 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.tag-badge {
  display: inline-block;
  align-self: flex-start;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  background: var(--hud-accent-dim);
  border: 2px solid var(--border-color);
  color: var(--hud-accent);
  margin-bottom: 16px;
  text-shadow: 0 0 4px var(--hud-accent-glow);
}

.featured-title {
  font-size: 32px;
  margin-bottom: 16px;
  line-height: 1.25;
}

.featured-title:hover {
  color: var(--hud-accent);
  text-shadow: 0 0 8px var(--hud-accent-glow);
}

.featured-excerpt {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 24px;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--text-muted);
}

.author-avatar {
  width: 32px;
  height: 32px;
  border: 1px solid var(--border-color);
  object-fit: cover;
}

.meta-dot {
  width: 4px;
  height: 4px;
  border-radius: 50% !important;
  background: var(--hud-accent);
  box-shadow: 0 0 4px var(--hud-accent);
}

/* ==========================================
   BLOG MAIN GRID & CATEGORIES
   ========================================== */
.blog-section {
  padding-bottom: 80px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 16px;
}

.section-title {
  font-size: 24px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-title::before {
  content: '>>';
  color: var(--hud-accent);
  font-family: var(--font-mono);
}

/* Category Filter Chips */
.category-filter {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-chip {
  padding: 6px 14px;
  background: var(--bg-tertiary);
  border: 2px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 12px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.filter-chip:hover {
  background: var(--hud-accent-dim);
  border-color: var(--hud-accent);
  color: var(--hud-accent);
}

.filter-chip.active {
  background: var(--hud-accent);
  border-color: var(--hud-accent);
  color: var(--bg-primary);
  font-weight: 700;
  box-shadow: 0 0 12px var(--hud-accent-glow);
}

/* Post Grid */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 28px;
}

.post-card {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.post-img-wrapper {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16/9;
  border-bottom: 2px solid var(--border-color);
}

.post-img-wrapper::after {
  content: 'UNCLASSIFIED.LOG';
  position: absolute;
  bottom: 8px;
  right: 8px;
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--hud-accent);
  background: rgba(10, 9, 8, 0.95);
  padding: 2px 6px;
  border: 1px solid var(--border-color);
}

.post-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-smooth);
}

.post-card:hover .post-card-img {
  transform: scale(1.03);
}

.post-card-content {
  padding: 24px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.post-card-tag {
  align-self: flex-start;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  background: var(--hud-accent-dim);
  border: 1px solid var(--border-color);
  color: var(--hud-accent);
  margin-bottom: 12px;
}

.post-card-title {
  font-size: 18px;
  margin-bottom: 12px;
  line-height: 1.35;
}

.post-card-title:hover {
  color: var(--hud-accent);
}

.post-card-excerpt {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 20px;
  flex-grow: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card-meta {
  border-top: 2px solid var(--border-color);
  padding-top: 12px;
  margin-top: auto;
}

.post-card.hidden {
  display: none;
}

/* ==========================================
   TACTICAL DECRYPTION LOADING OVERLAY
   ========================================== */
#decryption-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: #060504;
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  transition: opacity 0.5s cubic-bezier(0.85, 0, 0.15, 1), visibility 0.5s;
  pointer-events: all;
}

#decryption-overlay::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: 
    linear-gradient(rgba(178, 77, 5, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(178, 77, 5, 0.03) 1px, transparent 1px);
  background-size: 30px 30px;
}

#decryption-overlay.loaded {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.decryption-box {
  width: 90%;
  max-width: 480px;
  padding: 32px;
  background: #0d0b09;
  border: 2px solid #b24d05;
  box-shadow: 0 0 30px rgba(178, 77, 5, 0.15);
  position: relative;
  z-index: 10;
}

.decryption-status {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: #b24d05;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.decryption-log {
  height: 120px;
  background: #040302;
  border: 1px solid rgba(178, 77, 5, 0.3);
  padding: 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: #ab9d85;
  overflow-y: hidden;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.decryption-log-line {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #ab9d85;
}

.decryption-progress-bar {
  height: 14px;
  background: #020100;
  border: 1px solid #b24d05;
  position: relative;
  margin-bottom: 8px;
}

.decryption-progress-fill {
  height: 100%;
  width: 0%;
  background: repeating-linear-gradient(
    -45deg,
    #b24d05,
    #b24d05 10px,
    #000 10px,
    #000 20px
  );
  transition: width 0.1s linear;
}

.decryption-percentage-row {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 11px;
  color: #b24d05;
  font-weight: 800;
}

/* ==========================================
   POST DETAIL PAGE (post.html)
   ========================================== */
.reading-progress-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  z-index: 1001;
  background: transparent;
}

.reading-progress-bar {
  height: 100%;
  width: 0%;
  background: var(--hud-accent);
  box-shadow: 0 0 10px var(--hud-accent);
  transition: width 0.1s ease-out;
}

/* Post Hero Header */
.post-header-section {
  padding-top: 120px;
  padding-bottom: 40px;
  text-align: center;
  border-bottom: 2px solid var(--border-color);
}

.post-header-meta {
  justify-content: center;
  margin-bottom: 16px;
}

.post-large-title {
  font-size: 38px;
  max-width: 850px;
  margin: 0 auto 24px auto;
  line-height: 1.25;
}

.post-hero-image {
  max-width: 960px;
  margin: 0 auto;
  overflow: hidden;
  border: 2px solid var(--border-color);
}

.post-hero-image img {
  width: 100%;
  height: 460px;
  object-fit: cover;
}

/* Layout Grid & Edge Fixes */
.post-layout-grid {
  display: grid;
  grid-template-columns: 2.4fr 1fr;
  gap: 40px;
  padding-top: 40px;
  padding-bottom: 60px;
}

/* Forces grid items to keep size bounds in Edge */
.post-layout-grid > * {
  min-width: 0;
}

/* Typography styles for Article Body & Edge Word-Wrap */
.article-body {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.7;
  overflow-wrap: break-word;
  word-wrap: break-word;
  word-break: normal;
}

.article-body h2 {
  font-size: 22px;
  margin-top: 36px;
  margin-bottom: 16px;
  border-bottom: 1px dashed var(--border-color);
  padding-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  scroll-margin-top: 88px;
}

.article-body h2::before {
  content: '▶';
  font-size: 12px;
  color: var(--hud-accent);
}

.article-body h3 {
  font-size: 18px;
  margin-top: 28px;
  margin-bottom: 12px;
  color: var(--text-primary);
  scroll-margin-top: 88px;
}

.article-body p {
  margin-bottom: 20px;
  text-wrap: pretty;
}

.article-body blockquote {
  font-size: 15px;
  border-left: 2px solid var(--hud-accent);
  padding: 12px 20px;
  margin: 24px 0;
  color: var(--hud-accent);
  background: var(--bg-tertiary);
  border: 2px solid var(--border-color);
  border-left: 3px solid var(--hud-accent);
  font-style: italic;
  font-family: var(--font-mono);
}

/* Edge overflow prevention for wide code blocks */
.article-body pre {
  background: var(--bg-secondary);
  border: 2px solid var(--border-color);
  padding: 16px 20px;
  overflow-x: auto;
  max-width: 100%;
  margin: 24px 0;
}

.article-body code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--bg-tertiary);
  padding: 2px 6px;
  color: var(--hud-accent);
  border: 1px solid var(--border-color);
}

.article-body pre code {
  padding: 0;
  background: none;
  color: var(--text-primary);
  font-size: 13px;
  border: none;
  word-break: break-all;
  white-space: pre-wrap;
}

.article-body ul {
  list-style: none;
  margin-bottom: 24px;
}

.article-body ul li {
  position: relative;
  padding-left: 20px;
  margin-bottom: 8px;
}

.article-body ul li::before {
  content: '¤';
  position: absolute;
  left: 0;
  color: var(--hud-accent);
  font-family: var(--font-mono);
}

/* Sidebar components */
.post-sidebar {
  display: flex;
  flex-direction: column;
  gap: 28px;
  position: sticky;
  top: 88px;
  height: fit-content;
}

.sidebar-widget {
  padding: 24px;
}

/* Apply Faint Desert Camo background to footer under Camo theme */
[data-theme="camo"] .footer {
  background-image: 
    linear-gradient(rgba(18, 16, 12, 0.95), rgba(18, 16, 12, 0.95)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64' viewBox='0 0 64 64'%3E%3Crect width='64' height='64' fill='%23ab9b85'/%3E%3Crect x='0' y='0' width='8' height='8' fill='%23c2b4a0' opacity='0.85'/%3E%3Crect x='16' y='8' width='16' height='8' fill='%23c2b4a0' opacity='0.85'/%3E%3Crect x='8' y='24' width='8' height='16' fill='%23c2b4a0' opacity='0.85'/%3E%3Crect x='32' y='16' width='16' height='8' fill='%23c2b4a0' opacity='0.85'/%3E%3Crect x='48' y='40' width='8' height='8' fill='%23c2b4a0' opacity='0.85'/%3E%3Crect x='24' y='48' width='16' height='8' fill='%23c2b4a0' opacity='0.85'/%3E%3Crect x='8' y='8' width='8' height='8' fill='%237a6b57' opacity='0.8'/%3E%3Crect x='40' y='0' width='16' height='8' fill='%237a6b57' opacity='0.8'/%3E%3Crect x='24' y='24' width='8' height='8' fill='%237a6b57' opacity='0.8'/%3E%3Crect x='0' y='40' width='16' height='12' fill='%237a6b57' opacity='0.8'/%3E%3Crect x='48' y='24' width='12' height='16' fill='%237a6b57' opacity='0.8'/%3E%3Crect x='32' y='40' width='8' height='8' fill='%237a6b57' opacity='0.8'/%3E%3Crect x='24' y='0' width='8' height='8' fill='%23574c3e' opacity='0.7'/%3E%3Crect x='8' y='16' width='16' height='8' fill='%23574c3e' opacity='0.7'/%3E%3Crect x='32' y='8' width='8' height='8' fill='%23574c3e' opacity='0.7'/%3E%3Crect x='16' y='32' width='12' height='8' fill='%23574c3e' opacity='0.7'/%3E%3Crect x='40' y='48' width='8' height='16' fill='%23574c3e' opacity='0.7'/%3E%3Crect x='0' y='56' width='16' height='8' fill='%23574c3e' opacity='0.7'/%3E%3C/svg%3E");
  background-size: 64px 64px;
}

.widget-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 16px;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 8px;
  color: var(--hud-accent);
  letter-spacing: 0.1em;
}

/* Table of Contents */
.toc-list {
  list-style: none;
}

.toc-item {
  margin-bottom: 8px;
}

.toc-link {
  font-size: 13px;
  color: var(--text-muted);
  display: block;
  transition: all var(--transition-fast);
}

.toc-link::before {
  content: '[ ] ';
  color: var(--text-muted);
  opacity: 0.5;
}

.toc-link:hover {
  color: var(--hud-accent);
  padding-left: 4px;
}

.toc-link.active {
  color: var(--hud-accent);
  font-weight: 600;
  padding-left: 4px;
  text-shadow: 0 0 6px var(--hud-accent-glow);
}

.toc-link.active::before {
  content: '[✓] ';
  color: var(--hud-accent);
  opacity: 1;
}

/* Team Widget (Double instructors) */
.team-operators {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.operator-profile {
  display: flex;
  gap: 16px;
  border-bottom: 1px dashed var(--border-color);
  padding-bottom: 16px;
}

.operator-profile:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.operator-avatar {
  width: 58px;
  height: 58px;
  border: 1px solid var(--border-color);
  object-fit: cover;
}

.operator-name {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.operator-callsign {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--hud-accent);
  margin-bottom: 6px;
  text-transform: uppercase;
}

.operator-bio {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ==========================================
   TACTICAL NEWSLETTER BLOCK
   ========================================== */
.newsletter-section {
  padding: 60px 0;
  border-top: 2px solid var(--border-color);
  border-bottom: 2px solid var(--border-color);
  background: var(--bg-secondary);
}

.newsletter-box {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
  padding: 40px;
  background: var(--bg-primary);
}

.newsletter-title {
  font-size: 26px;
  margin-bottom: 8px;
}

.newsletter-subtitle {
  color: var(--text-secondary);
  font-size: 13px;
  margin-bottom: 28px;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.newsletter-form {
  display: flex;
  gap: 10px;
  max-width: 500px;
  margin: 0 auto;
}

.newsletter-input {
  flex-grow: 1;
  background: var(--bg-tertiary);
  border: 2px solid var(--border-color);
  padding: 12px 16px;
  color: var(--hud-accent);
  font-family: var(--font-mono);
}

.newsletter-input::placeholder {
  color: rgba(var(--hud-accent-rgb), 0.4);
}

.newsletter-input:focus {
  border-color: var(--hud-accent);
  box-shadow: 0 0 10px var(--hud-accent-glow);
  background: var(--bg-secondary);
}

.btn-submit {
  background: var(--hud-accent);
  color: var(--bg-primary);
  font-weight: 700;
  padding: 12px 24px;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  transition: all var(--transition-fast);
  box-shadow: 0 0 10px var(--hud-accent-glow);
  white-space: nowrap;
}

.btn-submit:hover {
  background: var(--hud-accent-hover);
  box-shadow: 0 0 18px var(--hud-accent-glow);
}

/* ==========================================
   FOOTER (Terminal Matrix)
   ========================================== */
.footer {
  background: var(--bg-secondary);
  color: var(--text-muted);
  padding: 50px 0 24px 0;
  font-size: 12px;
  border-top: 2px solid var(--border-color);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.8fr repeat(3, 1fr);
  gap: 40px;
  margin-bottom: 30px;
}

.footer-brand .logo {
  margin-bottom: 12px;
  font-size: 22px;
}

.footer-brand p {
  color: var(--text-secondary);
  max-width: 300px;
  font-size: 13px;
  line-height: 1.5;
}

.footer-col h4 {
  color: var(--hud-accent);
  font-size: 14px;
  font-family: var(--font-mono);
  margin-bottom: 16px;
  letter-spacing: 0.05em;
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: 8px;
}

.footer-links a:hover {
  color: var(--hud-accent);
  text-shadow: 0 0 4px var(--hud-accent-glow);
}

.footer-bottom {
  border-top: 2px dashed var(--border-color);
  padding-top: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ==========================================
   RESPONSIVE DESIGN BREAKPOINTS
   ========================================== */
@media (max-width: 1024px) {
  .featured-card {
    grid-template-columns: 1fr;
  }
  .featured-img-wrapper {
    min-height: 280px;
    border-right: none;
    border-bottom: 2px solid var(--border-color);
  }
  .post-layout-grid {
    grid-template-columns: 1fr;
  }
  .post-sidebar {
    position: static;
    margin-top: 30px;
  }
  .ops-split-panel {
    grid-template-columns: 1fr;
  }
  .ops-left-vitals {
    border-right: none;
    border-bottom: 2px solid var(--border-color);
  }
}

@media (max-width: 768px) {
  .navbar {
    height: 64px;
  }
  
  .navbar.scrolled {
    height: 64px;
  }

  .logo {
    font-size: 20px;
  }

  .nav-menu {
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border-bottom: 2px solid var(--border-color);
    flex-direction: column;
    padding: 24px;
    gap: 16px;
    transform: translateY(-120%);
    opacity: 0;
    pointer-events: none;
    transition: transform var(--transition-smooth), opacity var(--transition-smooth);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.9);
  }

  .nav-menu.active {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .menu-toggle {
    display: flex;
  }

  .menu-toggle.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }
  .menu-toggle.active span:nth-child(2) {
    opacity: 0;
  }
  .menu-toggle.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  .search-container {
    display: none;
  }

  .tactical-dashboard-section {
    padding-top: 84px;
  }

  .hero-section {
    padding-top: 10px;
    padding-bottom: 30px;
  }

  .featured-content {
    padding: 24px;
  }

  .featured-title {
    font-size: 24px;
  }

  .post-large-title {
    font-size: 26px;
    padding: 0 12px;
  }

  .post-hero-image img {
    height: 250px;
  }

  .newsletter-form {
    flex-direction: column;
  }

  .btn-submit {
    width: 100%;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }
}
