/* ==================================================
   Component and theme imports — loaded before all rules so that
   per-type custom-property overrides in article-types.css take effect
   at rule level, not via !important.
   ================================================== */
@import './styles/components/swot.css';
@import './styles/components/dashboard.css';
@import './styles/components/mindmap.css';
@import './styles/themes/article-types.css';

/* ==================================================
   FONT FALLBACK METRICS — prevents CLS while web fonts load
   size-adjust/ascent-override/descent-override approximate
   each web font's metrics so that the fallback glyphs occupy
   the same space, minimising layout shift on font-swap.
   ================================================== */
@font-face {
  font-family: 'Inter Fallback';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  size-adjust: 107%;
  ascent-override: 90%;
  descent-override: 22%;
  line-gap-override: 0%;
  src: local('Arial'), local('Liberation Sans'), local('Helvetica Neue'), local('Helvetica');
}

@font-face {
  font-family: 'Orbitron Fallback';
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  size-adjust: 94%;
  ascent-override: 85%;
  descent-override: 15%;
  line-gap-override: 0%;
  src: local('Arial Black'), local('Impact'), local('Century Gothic'), local('Trebuchet MS');
}

/* ==================================================
   CROSS-BROWSER COMPATIBILITY NOTES
   ================================================== */
/* This CSS file includes vendor prefixes and fallbacks for maximum browser compatibility:
 * 
 * 1. Vendor Prefixes:
 *    - -webkit-* for Safari, Chrome, Edge (Chromium)
 *    - -moz-* for Firefox (where needed)
 *    - -ms-* for older Edge and IE11 (deprecated but included for legacy support)
 * 
 * 2. Focus-Visible Fallback:
 *    - Uses @supports to detect :focus-visible support
 *    - Falls back to :focus for Safari < 15.4
 * 
 * 3. Flexbox with Vendor Prefixes:
 *    - Includes -webkit-box (Safari 6.1+)
 *    - Includes -webkit-flex (Safari 8+)
 *    - Includes -ms-flexbox (IE 10)
 *    - Modern flex syntax for all other browsers
 * 
 * 4. Grid with Flexbox Fallback:
 *    - Flexbox layout as base (universally supported)
 *    - @supports (display: grid) for modern browsers
 *    - Ensures content is accessible even without Grid support
 * 
 * 5. Appearance Property:
 *    - -webkit-appearance for Safari/Chrome form controls
 *    - -moz-appearance for Firefox
 *    - appearance for standards-compliant browsers
 * 
 * 6. Backdrop Filter:
 *    - -webkit-backdrop-filter for Safari
 *    - backdrop-filter for other modern browsers
 * 
 * Browser Support Priority:
 * - Chrome/Edge (Chromium): 65% of users - Full support
 * - Safari (iOS/macOS): 20% of users - Full support with vendor prefixes
 * - Firefox: 5% of users - Full support
 * - Other browsers: 10% of users - Graceful degradation
 */

:root {
  /* Light Mode - Professional Cyberpunk Green */
  --primary-color: #006633;
  --primary-light: #007744;
  --primary-dark: #004422;
  --accent-color: #008838; /* WCAG 2.1 AA: 4.59:1 contrast on white (was #00C853 at 2.24:1) */
  --bg-color: #f8f9fa;
  --card-bg: #ffffff;
  --text-color: #1a1a1a;
  --text-secondary: #4a4a4a; /* WCAG 2.1 AA: 8.86:1 contrast on white (improved from #555555 at 7.46:1) */
  --header-color: #006633;
  --border-color: rgba(0, 102, 51, 0.15);
  --card-border: #dee2e6;
  --card-shadow: rgba(0, 102, 51, 0.08);
  --link-color: #007744;
  --link-hover: #006633;
  --button-bg: #007744;
  --button-text: #fff;
  --section-border: #e9ecef;
  --badge-bg: #f8f9fa;
  --confidentiality-color: #7B2CBF;
  --integrity-color: #008838; /* WCAG 2.1 AA: 4.59:1 contrast on white (was #00C853 at 2.24:1) */
  --availability-color: #007744;
  --premium-gradient-start: #006633;
  --premium-gradient-end: #007744;
  --success-color: #008838; /* WCAG 2.1 AA: 4.59:1 contrast on white (was #00C853 at 2.24:1) */
  --warning-color: #B35A00; /* WCAG 2.1 AA: 4.80:1 contrast on white (was #FF9800 at 2.16:1) */
  --danger-color: #DC3545; /* WCAG 2.1 AA: 4.53:1 contrast on white ✅ */
  --info-color: #117a8b; /* WCAG 2.1 AA: 5.02:1 contrast on white (was #17A2B8 at 3.04:1) */
  --transparency-color: #0066CC;
  
  /* WCAG 2.1 AA Accessible Colors (white text on colored backgrounds, exceeding 4.5:1 minimum) */
  --accessible-action-primary: #D84315; /* White on #D84315: 4.60:1 - WCAG AA compliant */
  --accessible-youtube-red: #CC0000; /* White on #CC0000: 5.10:1 - WCAG AA compliant */
  --accessible-aws-orange: #CC7A00; /* White on #CC7A00: 4.54:1 - WCAG AA compliant */
  
  --font-main: "Inter", "Inter Fallback", -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, sans-serif;
  --font-accent: "Inter", "Inter Fallback", system-ui, -apple-system, sans-serif;
  --font-mono: "Share Tech Mono", monospace;
  --border-radius: 8px;
  --border-radius-sm: 4px;
  --border-radius-lg: 12px;
  
  /* Typography Scale (mixed ratios for visual balance) */
  --font-size-base: 1rem; /* 16px */
  --font-size-xs: 0.75rem; /* 12px */
  --font-size-sm: 0.875rem; /* 14px */
  --font-size-lg: 1.125rem; /* 18px */
  --font-size-xl: 1.25rem; /* 20px */
  --font-size-2xl: 1.5rem; /* 24px */
  --font-size-3xl: 1.875rem; /* 30px */
  --font-size-4xl: 2.25rem; /* 36px */
  --font-size-5xl: 3rem; /* 48px */
  
  /* Heading Sizes (approximately 1.25 ratio, optimized for readability) */
  --h1-size: 2.5rem; /* 40px */
  --h2-size: 2rem; /* 32px */
  --h3-size: 1.625rem; /* 26px */
  --h4-size: 1.25rem; /* 20px */
  --h5-size: 1.125rem; /* 18px */
  --h6-size: 1rem; /* 16px */
  
  /* Line Heights */
  --line-height-tight: 1.25;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.75;
  --line-height-loose: 2;
  
  /* Spacing Scale (consistent rhythm) */
  --spacing-0: 0;
  --spacing-xs: 0.25rem; /* 4px */
  --spacing-sm: 0.5rem; /* 8px */
  --spacing-md: 1rem; /* 16px */
  --spacing-lg: 1.5rem; /* 24px */
  --spacing-xl: 2rem; /* 32px */
  --spacing-2xl: 3rem; /* 48px */
  --spacing-3xl: 4rem; /* 64px */
  --spacing-4xl: 6rem; /* 96px */

  /* ── Design Tokens: Spacing Scale (T-shirt → numeric alias) ──────────── */
  /* 4 · 8 · 12 · 16 · 24 · 32 · 48 · 64 · 96 px */
  --space-1: 0.25rem;   /* 4px  */
  --space-2: 0.5rem;    /* 8px  */
  --space-3: 0.75rem;   /* 12px */
  --space-4: 1rem;      /* 16px */
  --space-5: 1.5rem;    /* 24px */
  --space-6: 2rem;      /* 32px */
  --space-7: 3rem;      /* 48px */
  --space-8: 4rem;      /* 64px */
  --space-9: 6rem;      /* 96px */

  /* ── Modular Type Scale – Perfect Fourth (× 1.333) with fluid clamp() ── */
  --fluid-xs:   clamp(0.694rem, 0.65rem  + 0.2vw,  0.8rem);
  --fluid-sm:   clamp(0.833rem, 0.78rem  + 0.25vw, 0.938rem);
  --fluid-base: clamp(1rem,     0.95rem  + 0.3vw,  1.125rem);
  --fluid-md:   clamp(1.125rem, 1.05rem  + 0.4vw,  1.333rem);
  --fluid-lg:   clamp(1.333rem, 1.25rem  + 0.5vw,  1.777rem);
  --fluid-xl:   clamp(1.777rem, 1.6rem   + 0.7vw,  2.369rem);
  --fluid-2xl:  clamp(2.369rem, 2.1rem   + 1.0vw,  3.157rem);
  --fluid-3xl:  clamp(3.157rem, 2.8rem   + 1.4vw,  4.209rem);

  /* ── Focus Color Token ───────────────────────────────────────────────── */
  --focus-color: #007744;     /* light-mode focus ring (≥ 3:1 on white bg)  */
  --focus-ring: 3px solid var(--focus-color);
  --focus-offset: 2px;
  --focus-bg:   rgba(0, 119, 68, 0.08);  /* tinted bg for link focus highlight */
  --focus-glow: rgba(0, 119, 68, 0.18);  /* outer glow for button/input focus  */

  /* ── Card elevation tokens ────────────────────────────────────────────── */
  --card-shadow-resting:  0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --card-shadow-hover:    0 4px 12px rgba(0,0,0,0.12), 0 2px 6px rgba(0,0,0,0.08);
  --card-shadow-focus:    0 0 0 3px var(--focus-color);
  --card-transition:      transform 0.18s ease, box-shadow 0.18s ease;

  /* ── Skeleton / shimmer tokens ────────────────────────────────────────── */
  --skeleton-base:    rgba(0, 102, 51, 0.06);
  --skeleton-shine:   rgba(0, 102, 51, 0.13);
}

/* Dark Mode - Ingress Inspired Theme */
@media (prefers-color-scheme: dark) {
  :root {
    --primary-color: #00cc66;
    --primary-light: #00ff88;
    --primary-dark: #00bb77;
    --accent-color: #33eeff;
    --bg-color: #001a1a;
    --card-bg: #001c25;
    --text-color: #f0f0f0;
    --text-secondary: #aaaaaa;
    --header-color: #58a6ff;
    --border-color: rgba(0, 204, 102, 0.3);
    --card-border: rgba(0, 204, 102, 0.3);
    --card-shadow: rgba(0, 204, 102, 0.2);
    --link-color: #58a6ff;
    --link-hover: #79b8ff;
    --button-bg: #1a6fd9; /* WCAG 2.1 AA: Darkened for better contrast with white text (4.86:1) */
    --button-text: #ffffff; /* WCAG 2.1 AA: Changed from #e0e0e0 for better contrast (4.86:1 on #1a6fd9) */
    --section-border: #444;
    --badge-bg: #333;
    --confidentiality-color: #bd93f9;
    --integrity-color: #50fa7b;
    --availability-color: #8be9fd;
    --font-accent: "Orbitron", "Orbitron Fallback", sans-serif;

    /* Dark-mode focus token (high contrast on dark backgrounds) */
    --focus-color: #00d9ff;  /* primary-cyan – 7.8:1 on #001a1a  */
    --focus-ring: 3px solid var(--focus-color);
    --focus-bg:   rgba(0, 217, 255, 0.08);
    --focus-glow: rgba(0, 217, 255, 0.18);

    /* Dark-mode card elevation */
    --card-shadow-resting: 0 1px 4px rgba(0,0,0,0.5), 0 1px 3px rgba(0,0,0,0.4);
    --card-shadow-hover:   0 6px 18px rgba(0,0,0,0.6), 0 3px 8px rgba(0,0,0,0.4);
    --card-shadow-focus:   0 0 0 3px var(--focus-color);

    /* Dark-mode skeleton */
    --skeleton-base:  rgba(0, 204, 102, 0.06);
    --skeleton-shine: rgba(0, 204, 102, 0.14);
  }
}

/* Responsive Typography (scale down on mobile) */
@media (max-width: 767px) {
  :root {
    --h1-size: 2rem; /* 32px on mobile */
    --h2-size: 1.625rem; /* 26px on mobile */
    --h3-size: 1.375rem; /* 22px on mobile */
    --h4-size: 1.125rem; /* 18px on mobile */
    --h5-size: 1rem; /* 16px on mobile */
    --spacing-xl: 1.5rem; /* 24px on mobile */
    --spacing-2xl: 2rem; /* 32px on mobile */
    --spacing-3xl: 2.5rem; /* 40px on mobile */
    --spacing-4xl: 3rem; /* 48px on mobile */
  }
}

/* ==================================================
   LANGUAGE-SPECIFIC FONT SUPPORT
   ================================================== */
/* CJK (Chinese, Japanese, Korean) and RTL (Arabic, Hebrew) Language Support */
:lang(ja) {
  font-family: 'Noto Sans JP', 'Inter', 'Inter Fallback', -apple-system, BlinkMacSystemFont, sans-serif;
}

:lang(ko) {
  font-family: 'Noto Sans KR', 'Inter', 'Inter Fallback', -apple-system, BlinkMacSystemFont, sans-serif;
}

:lang(zh) {
  font-family: 'Noto Sans SC', 'Inter', 'Inter Fallback', -apple-system, BlinkMacSystemFont, sans-serif;
}

:lang(ar) {
  font-family: 'Noto Sans Arabic', 'Inter', 'Inter Fallback', -apple-system, BlinkMacSystemFont, sans-serif;
}

:lang(he) {
  font-family: 'Noto Sans Hebrew', 'Inter', 'Inter Fallback', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ==================================================
   BLACK TRIGRAM THEME (Martial Arts Red)
   ================================================== */
.theme-black-trigram {
  --primary-color: #c0392b;
  --primary-light: #e74c3c;
  --primary-dark: #a93226;
  --accent-color: #ffd700;
  --header-color: #c0392b;
  --border-color: rgba(192, 57, 43, 0.2);
  --card-border: rgba(192, 57, 43, 0.2);
  --korean-font: "Noto Sans KR", "Malgun Gothic", sans-serif;
  
  /* Archetype Colors */
  --musa-color: #8e44ad;
  --amsalja-color: #27ae60;
  --hacker-color: #2980b9;
  --jeongbo-color: #e74c3c;
  --jojik-color: #f39c12;
}

@media (prefers-color-scheme: dark) {
  .theme-black-trigram {
    --primary-color: #ff6b6b;
    --primary-light: #ff8e8e;
    --primary-dark: #ff4757;
    --accent-color: #ffd700;
    --bg-color: #1a1a1a;
    --card-bg: #2c2c2c;
    --text-color: #f0f0f0;
    --text-secondary: #aaaaaa;
    --header-color: #ff6b6b;
    --border-color: rgba(255, 107, 107, 0.3);
    --card-border: rgba(255, 107, 107, 0.3);
    --card-shadow: rgba(255, 107, 107, 0.2);
    --link-color: #ff8e8e;
    --link-hover: #ff6b6b;
    --button-bg: #ff6b6b;
    --button-text: #1a1a1a;
    
    /* Dark mode archetype colors */
    --musa-color: #bd93f9;
    --amsalja-color: #50fa7b;
    --hacker-color: #8be9fd;
    --jeongbo-color: #ff79c6;
    --jojik-color: #f1fa8c;
  }
  
  /* Black Trigram scan line effect override */
  .theme-black-trigram::after {
    background: repeating-linear-gradient(
      45deg,
      transparent 0px,
      rgba(255, 107, 107, 0.02) 1px,
      transparent 2px
    );
  }

  /* Black Trigram pattern - circular instead of hex */
  .theme-black-trigram::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60' viewBox='0 0 60 60'%3E%3Cg fill-rule='evenodd'%3E%3Cg fill='%23ff6b6b' fill-opacity='0.02'%3E%3Cpath d='M30 30m-30 0a30 30 0 1 1 60 0a30 30 0 1 1 -60 0'/%3E%3C/g%3E%3C/svg%3E");
  }
  
  /* Override buttons for Black Trigram */
  .theme-black-trigram .app-link a {
    background: linear-gradient(
      to bottom,
      rgba(255, 107, 107, 0.2),
      rgba(255, 75, 87, 0.4)
    );
  }
  
  .theme-black-trigram .app-link a::before {
    background: linear-gradient(
      to right,
      transparent 0%,
      rgba(255, 107, 107, 0.2) 50%,
      transparent 100%
    );
  }
  
  .theme-black-trigram .btn {
    background: rgba(255, 107, 107, 0.2);
    border: 1px solid rgba(255, 107, 107, 0.3);
  }
  
  .theme-black-trigram .btn:hover {
    background: rgba(255, 107, 107, 0.3);
  }
  
  /* Scanner effect for Black Trigram */
  .theme-black-trigram .scanner-effect {
    background: linear-gradient(
      45deg,
      rgba(255, 107, 107, 0) 85%,
      rgba(255, 107, 107, 0.2) 90%,
      rgba(255, 107, 107, 0) 95%
    );
  }
  
  /* Card borders for Black Trigram */
  .theme-black-trigram .card {
    background: linear-gradient(
      135deg,
      rgba(42, 42, 42, 0.95) 0%,
      rgba(26, 26, 26, 0.98) 100%
    );
  }
}

/* Korean font support */
.theme-black-trigram .korean-text,
.theme-black-trigram h1,
.theme-black-trigram h2,
.theme-black-trigram h3 {
  font-family: var(--korean-font);
}

/* Black Trigram specific card */
.black-trigram-card {
  border: 2px solid #ff6b35;
  background: linear-gradient(135deg, rgba(255, 107, 53, 0.1), rgba(255, 107, 53, 0.05));
}

/* ==================================================
   BLACK TRIGRAM ARCHETYPE CARDS
   ================================================== */
.musa-card {
  border-left: 4px solid var(--musa-color);
}

.amsalja-card {
  border-left: 4px solid var(--amsalja-color);
}

.hacker-card {
  border-left: 4px solid var(--hacker-color);
}

.jeongbo-card {
  border-left: 4px solid var(--jeongbo-color);
}

.jojik-card {
  border-left: 4px solid var(--jojik-color);
}

/* ==================================================
   BLACK TRIGRAM TABLES
   ================================================== */
.archetype-table,
.trigram-table,
.control-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
}

.archetype-table th,
.archetype-table td,
.trigram-table th,
.trigram-table td,
.control-table th,
.control-table td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--card-border);
}

.archetype-table th,
.trigram-table th,
.control-table th {
  background-color: var(--primary-color);
  color: white;
  font-weight: 600;
}

@media (max-width: 768px) {
  .archetype-table,
  .trigram-table,
  .control-table {
    font-size: 0.8rem;
  }
}

/* Korean Impact Matrix (Black Trigram specific) */
.korean-impact-matrix {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.9rem;
  font-family: 'Noto Sans KR', sans-serif;
}

.korean-impact-matrix th,
.korean-impact-matrix td {
  padding: 0.75rem;
  text-align: left;
  border: 1px solid #ddd;
  vertical-align: middle;
}

.korean-impact-matrix th {
  background-color: #ff6b35;
  color: white;
  font-weight: 600;
  text-align: center;
}

.korean-impact-matrix td img {
  max-width: 100%;
  height: auto;
}

@media (max-width: 768px) {
  .korean-impact-matrix {
    font-size: 0.8rem;
  }
  
  .korean-impact-matrix th,
  .korean-impact-matrix td {
    padding: 0.5rem;
  }
}

/* ==================================================
   CODE AND INSTALLATION BLOCKS
   ================================================== */
.code-block {
  background: #f6f8fa;
  border: 1px solid #d0d7de;
  border-radius: 6px;
  padding: 1rem;
  margin: 1rem 0;
  font-family: 'Courier New', monospace;
  overflow-x: auto;
}

@media (prefers-color-scheme: dark) {
  .code-block {
    background: rgba(0, 0, 0, 0.3);
    border-color: var(--border-color);
    color: var(--text-color);
  }
}

.installation-step {
  background: #f0f9ff;
  border-left: 4px solid #0369a1;
  padding: 1rem;
  margin: 1rem 0;
}

@media (prefers-color-scheme: dark) {
  .installation-step {
    background: rgba(3, 105, 161, 0.1);
    border-left-color: var(--primary-color);
  }
}

/* Badge groups */
.badge-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  justify-content: flex-start;
}

.badge-group img {
  height: auto;
  max-width: 100%;
}

.porters-forces {
  flex-direction: column;
  align-items: stretch;
}

.porters-forces img {
  width: 100%;
  max-width: 250px;
}

/* Korean emphasis and martial arts terms */
.korean-emphasis {
  font-weight: 700;
  color: #ff6b35;
}

.martial-arts-term {
  font-weight: 600;
  border-bottom: 1px dotted #666;
  cursor: help;
}

@media (prefers-color-scheme: dark) {
  .korean-emphasis {
    color: #ff8e8e;
  }
  
  .martial-arts-term {
    border-bottom-color: #aaa;
  }
}

/* Base styles - Premium Design */
* {
  transition-property: color, background-color, border-color, box-shadow;
  transition-duration: 200ms;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

html {
  height: 100%;
  width: 100%;
  scroll-behavior: smooth;
}

/* Smooth theme transitions when toggling light/dark mode */
@media (prefers-reduced-motion: no-preference) {
  html.theme-transition[data-theme] .card,
  html.theme-transition[data-theme] .breadcrumb,
  html.theme-transition[data-theme] .btn {
    transition-property: background-color, background, color, border-color, box-shadow;
    transition-duration: 0.3s;
    transition-timing-function: ease;
  }
}

body {
  font-family: var(--font-main);
  line-height: 1.75; /* Improved from 1.7 for optimal readability */
  color: var(--text-color);
  background-color: var(--bg-color);
  max-width: 100%;
  margin: 0;
  padding: var(--spacing-md) var(--spacing-xl);
  position: relative;
  overflow-x: hidden;
  font-size: 16px;
  font-weight: 400; /* Explicit regular weight for body text */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Scan line effect for dark mode */
@media (prefers-color-scheme: dark) {
  body::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: repeating-linear-gradient(
      transparent 0px,
      rgba(0, 0, 0, 0.05) 1px,
      transparent 2px
    );
    pointer-events: none;
    z-index: 9999;
    opacity: 0.3;
  }

  body::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='https://www.w3.org/2000/svg' width='28' height='49' viewBox='0 0 28 49'%3E%3Cg fill='%2300cc66' fill-opacity='0.03'%3E%3Cpath d='M13.99 9.25l13 7.5v15l-13 7.5L1 31.75v-15l12.99-7.5zM3 17.9v12.7l10.99 6.34 11-6.35V17.9l-11-6.34L3 17.9zM0 15l12.98-7.5V0h-2v6.35L0 12.69v2.3zm0 18.5L12.98 41v8h-2v-6.85L0 35.81v-2.3zM15 0v7.5L27.99 15H28v-2.31h-.01L17 6.35V0h-2zm0 49v-8l12.99-7.5H28v2.31h-.01L17 42.15V49h-2z'/%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.2;
    z-index: -1;
    pointer-events: none;
  }
}

/* ==================================================
   IMAGE OPTIMIZATION & LAZY LOADING
   Comprehensive image handling for performance and CLS prevention
   ================================================== */

/* Base image styles - Responsive and CLS prevention */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Picture element support */
picture {
  display: block;
}

picture img {
  max-width: 100%;
  height: auto;
}

/* Typography - Premium Hierarchy */
h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--header-color);
  font-family: var(--font-accent);
  line-height: var(--line-height-tight);
}

@media (prefers-color-scheme: dark) {
  h1,
  h2,
  h3 {
    font-family: "Orbitron", "Orbitron Fallback", sans-serif;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 0 0 5px rgba(0, 204, 102, 0.5);
  }
}

h1 {
  font-size: var(--h1-size);
  font-weight: 600; /* Semi-bold for primary headings */
  margin-top: 0;
  margin-bottom: var(--spacing-xl);
  letter-spacing: -0.02em; /* Tighter tracking for large text */
  max-width: 40ch; /* Optimal line length for headings */
}

h2 {
  font-size: var(--h2-size);
  font-weight: 600; /* Semi-bold for secondary headings */
  margin-bottom: var(--spacing-md);
  margin-top: var(--spacing-lg);
  padding-bottom: var(--spacing-sm);
  border-bottom: 2px solid var(--section-border);
  letter-spacing: -0.02em; /* Tighter tracking for large text */
  max-width: 40ch; /* Optimal line length for headings */
}

h3 {
  font-size: var(--h3-size);
  font-weight: 500; /* Medium weight for tertiary headings */
  margin-bottom: var(--spacing-sm);
  margin-top: var(--spacing-lg);
  max-width: 40ch; /* Optimal line length for headings */
}

h4 {
  font-size: var(--h4-size);
  font-weight: 500; /* Medium weight for quaternary headings */
  color: var(--text-color);
  margin-bottom: var(--spacing-sm);
  margin-top: var(--spacing-md);
  max-width: 40ch; /* Optimal line length for headings */
}

h5 {
  font-size: var(--h5-size);
  font-weight: 400;
  color: var(--text-color);
  margin-bottom: var(--spacing-sm);
  margin-top: var(--spacing-lg);
}

h6 {
  font-size: var(--h6-size);
  font-weight: 400;
  color: var(--text-color);
  margin-bottom: var(--spacing-sm);
  margin-top: var(--spacing-lg);
}

/* Body Text with Optimal Readability */
p {
  margin-bottom: var(--spacing-lg); /* Enhanced paragraph spacing (was var(--spacing-md) = 1rem) */
  max-width: 70ch; /* Optimal line length for body text readability */
  line-height: 1.75; /* Optimal readability for body text */
}

/* Strong emphasis with enhanced font weight */
strong, b {
  font-weight: 600; /* Semi-bold for subtle emphasis (lighter than default 700) */
}

a {
  color: var(--link-color);
  text-decoration: none;
  transition: color 0.2s ease, text-shadow 0.2s ease;
}

a:hover {
  color: var(--link-hover);
  text-decoration: underline;
}

@media (prefers-color-scheme: dark) {
  a:hover {
    text-shadow: 0 0 8px rgba(0, 204, 102, 0.5);
  }
}

/* ==================================================
   KEYBOARD NAVIGATION & FOCUS INDICATORS (WCAG 2.1 AA)
   Cross-browser compatibility with focus-visible fallback
   ================================================== */

/* Skip to Main Content Link - visible only when focused */
.skip-link,
.skip-to-content {
  position: absolute;
  top: -100px;
  left: 0;
  background-color: var(--primary-color);
  color: white;
  padding: var(--spacing-md) var(--spacing-lg);
  text-decoration: none;
  font-weight: 600;
  z-index: 10000;
  border-radius: 0 0 var(--border-radius) 0;
  transition: top 0.2s ease;
}

/* Focus-visible with progressive enhancement for Safari < 15.4 */
@supports selector(:focus-visible) {
  /* Modern browsers with :focus-visible support */
  .skip-link:focus-visible,
  .skip-to-content:focus-visible {
    top: 0;
    outline: 3px solid var(--accent-color);
    outline-offset: 2px;
  }
  
  /* Universal Focus Indicator - WCAG 2.1 AA compliant (3:1 contrast ratio) */
  *:focus-visible {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
  }
  
  /* Enhanced link focus with background highlight */
  a:focus-visible {
    outline: 3px solid var(--primary-color);
    outline-offset: 4px;
    background-color: rgba(0, 102, 51, 0.1);
    border-radius: var(--border-radius-sm);
  }
  
  /* Button focus with enhanced visibility and shadow */
  button:focus-visible,
  .btn:focus-visible,
  .btn-primary-large:focus-visible,
  .btn-secondary:focus-visible {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(0, 102, 51, 0.2);
  }
  
  /* Form control focus indicators */
  input:focus-visible,
  textarea:focus-visible,
  select:focus-visible {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(0, 102, 51, 0.1);
  }
  
  /* Checkbox and radio button focus */
  input[type="checkbox"]:focus-visible,
  input[type="radio"]:focus-visible {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(0, 102, 51, 0.2);
  }
}

@supports not selector(:focus-visible) {
  /* Fallback for Safari < 15.4 and older browsers - use :focus */
  .skip-link:focus,
  .skip-to-content:focus {
    top: 0;
    outline: 3px solid var(--accent-color);
    outline-offset: 2px;
  }
  
  /* Universal Focus Indicator fallback */
  *:focus {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
  }
  
  /* Enhanced link focus fallback */
  a:focus {
    outline: 3px solid var(--primary-color);
    outline-offset: 4px;
    background-color: rgba(0, 102, 51, 0.1);
    border-radius: var(--border-radius-sm);
  }
  
  /* Button focus fallback */
  button:focus,
  .btn:focus,
  .btn-primary-large:focus,
  .btn-secondary:focus {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(0, 102, 51, 0.2);
  }
  
  /* Form control focus fallback */
  input:focus,
  textarea:focus,
  select:focus {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(0, 102, 51, 0.1);
  }
  
  /* Checkbox and radio button focus fallback */
  input[type="checkbox"]:focus,
  input[type="radio"]:focus {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(0, 102, 51, 0.2);
  }
}

/* Dark mode focus indicators */
@media (prefers-color-scheme: dark) {
  .skip-link,
  .skip-to-content {
    color: var(--bg-color);
  }
  
  .skip-link:focus-visible,
  .skip-to-content:focus-visible {
    outline-color: var(--accent-color);
    box-shadow: 0 0 10px rgba(0, 204, 102, 0.5);
  }
  
  *:focus-visible {
    outline-color: var(--primary-color);
  }
  
  a:focus-visible {
    background-color: rgba(0, 204, 102, 0.15);
    outline-color: var(--primary-color);
  }
  
  button:focus-visible,
  .btn:focus-visible {
    outline-color: var(--primary-light);
    box-shadow: 0 0 0 4px rgba(0, 204, 102, 0.3);
  }
  
  input:focus-visible,
  textarea:focus-visible,
  select:focus-visible {
    outline-color: var(--primary-color);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(0, 204, 102, 0.2);
  }
}

/* ==================================================
   STICKY NAVIGATION
   Cross-browser compatibility with vendor prefixes
   ================================================== */

/* Sticky Navigation Bar */
.sticky-nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--bg-color);
  border-bottom: 2px solid var(--primary-color);
  box-shadow: 0 2px 10px var(--card-shadow);
  /* Backdrop filter with vendor prefixes for Safari */
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

@media (prefers-color-scheme: dark) {
  .sticky-nav {
    background: rgba(0, 26, 26, 0.95);
    border-bottom: 2px solid var(--primary-color);
    box-shadow: 0 2px 10px rgba(0, 204, 102, 0.2);
  }
}

.nav-container {
  max-width: 100%;
  margin: 0 auto;
  padding: 0.75rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-color);
  text-decoration: none;
  transition: color 0.3s ease;
}

.nav-logo:hover {
  color: var(--primary-light);
}

.nav-logo:focus-visible {
  outline: 3px solid var(--primary-color);
  outline-offset: 4px;
  border-radius: var(--border-radius-sm);
}

.nav-menu {
  display: -webkit-box; /* Old Safari */
  display: -webkit-flex; /* Safari 8 */
  display: -ms-flexbox; /* IE 10 */
  display: flex;
  gap: 2rem;
  list-style: none;
  margin: 0;
  padding: 0;
  -webkit-box-align: center;
  -webkit-align-items: center;
  -ms-flex-align: center;
  align-items: center;
}

.nav-menu li {
  margin: 0;
}

.nav-menu a {
  color: var(--text-color);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  transition: color 0.3s ease;
  padding: 0.5rem 0;
  display: block;
}

.nav-menu a:hover {
  color: var(--primary-color);
}

.nav-menu a:focus-visible {
  outline: 3px solid var(--primary-color);
  outline-offset: 4px;
  border-radius: var(--border-radius-sm);
  background-color: rgba(0, 102, 51, 0.1);
}

.nav-menu .btn-nav {
  background: var(--primary-color);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: var(--border-radius);
  font-weight: 600;
  transition: background-color 0.3s ease, transform 0.2s ease;
}

.nav-menu .btn-nav:hover {
  background: var(--primary-light);
  color: white;
  transform: translateY(-2px);
}

.nav-menu .btn-nav:focus-visible {
  outline: 3px solid var(--primary-light);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(0, 119, 68, 0.2);
}

/* Mobile Menu Toggle Button - WCAG 2.1 AA compliant (44x44px minimum touch target) */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: transparent;
  border: 2px solid var(--primary-color);
  cursor: pointer;
  /* WCAG 2.1 AA: Minimum 44x44px touch target */
  width: 44px;
  height: 44px;
  padding: 0;
  align-items: center;
  justify-content: center;
  border-radius: var(--border-radius-sm);
  z-index: 1001;
  transition: border-color 0.3s ease, background-color 0.3s ease;
}

.nav-toggle:hover {
  background: rgba(0, 102, 51, 0.05);
  border-color: var(--primary-light);
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--primary-color);
  transition: all 0.3s ease;
  border-radius: 2px;
}

.nav-toggle:hover span {
  background: var(--primary-light);
}

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

/* Mobile Menu Toggle Animation - Transform to X when open */
.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -6px);
}

/* Back to Top Button */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--primary-color);
  color: white;
  border: none;
  cursor: pointer;
  font-size: 1.5rem;
  z-index: 999;
  transition: opacity 0.3s ease, background-color 0.3s ease, transform 0.2s ease;
  box-shadow: 0 4px 12px var(--card-shadow);
  display: none;
  opacity: 0;
}

.back-to-top.visible {
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
}

.back-to-top:hover {
  background: var(--primary-light);
  transform: translateY(-4px);
  box-shadow: 0 6px 16px var(--card-shadow);
}

.back-to-top:focus-visible {
  outline: 3px solid var(--primary-light);
  outline-offset: 4px;
  box-shadow: 0 0 0 4px rgba(0, 119, 68, 0.3);
}

@media (prefers-color-scheme: dark) {
  .back-to-top {
    background: var(--primary-color);
    box-shadow: 0 4px 12px rgba(0, 204, 102, 0.3);
  }
  
  .back-to-top:hover {
    background: var(--primary-light);
    box-shadow: 0 6px 16px rgba(0, 204, 102, 0.4);
  }
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
  .nav-container {
    padding: 0.75rem 1rem;
  }
  
  .nav-toggle {
    display: flex;
  }
  
  /* Mobile navigation menu - slides in from right */
  .nav-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 80%;
    max-width: 300px;
    height: 100vh;
    background: var(--card-bg);
    box-shadow: -2px 0 12px var(--card-shadow);
    padding: var(--spacing-2xl) var(--spacing-lg);
    transition: right 0.3s ease;
    z-index: 1002; /* Above sticky-nav (1000) and nav-toggle (1001) */
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0;
  }
  
  /* Show menu when open */
  .nav-menu.open {
    right: 0;
  }
  
  /* Backdrop overlay when menu is open */
  .nav-menu::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
  }
  
  .nav-menu.open::before {
    opacity: 1;
    pointer-events: auto;
  }
  
  .nav-menu li {
    width: 100%;
    margin-bottom: var(--spacing-md);
  }
  
  /* WCAG 2.1 AA: Minimum 44x44px touch targets for all links */
  .nav-menu a {
    display: flex;
    align-items: center;
    padding: var(--spacing-md);
    font-size: 1.125rem;
    /* Ensure minimum 44px height for touch targets */
    min-height: 44px;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s ease, color 0.2s ease;
  }
  
  .nav-menu a:hover {
    background-color: rgba(0, 102, 51, 0.05);
  }
  
  .nav-menu a:focus-visible {
    outline: 3px solid var(--primary-color);
    outline-offset: -3px;
  }
  
  .nav-menu li:last-child {
    margin-bottom: 0;
  }
  
  .nav-menu li:last-child a {
    border-bottom: none;
  }
  
  .nav-menu .btn-nav {
    margin-top: var(--spacing-md);
    text-align: center;
    justify-content: center;
    border-bottom: none;
    /* Ensure proper touch target */
    min-height: 48px;
  }
  
  .back-to-top {
    bottom: 1rem;
    right: 1rem;
    /* Ensure WCAG 2.1 AA touch target (44x44px minimum) */
    width: 48px;
    height: 48px;
    font-size: 1.25rem;
  }
}

/* Dark mode styles for mobile menu */
@media (max-width: 768px) and (prefers-color-scheme: dark) {
  .nav-menu {
    background: rgba(0, 26, 26, 0.98);
    box-shadow: -2px 0 12px rgba(0, 204, 102, 0.2);
  }
  
  .nav-toggle {
    border-color: var(--primary-color);
  }
  
  .nav-toggle:hover {
    background: rgba(0, 204, 102, 0.1);
  }
}

@media (max-width: 480px) {
  .nav-container {
    padding: 0.75rem 0.75rem;
  }
  
  .nav-logo {
    font-size: 1.25rem;
  }
  
  .back-to-top {
    bottom: 0.75rem;
    right: 0.75rem;
    width: 40px;
    height: 40px;
    font-size: 1.1rem;
  }
}

/* Header and navigation - Premium Design */
header {
  position: relative;
  text-align: center;
  margin-bottom: var(--spacing-md);
  padding: 0 0 var(--spacing-md) 0;
  border-bottom: 2px solid var(--section-border);
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--card-bg);
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  width: 100%;
}

/* Hero Banner - Full-width branding display */
.hero-banner {
  position: relative;
  width: 100%;
  /* Single smooth clamp avoids layout jumps at breakpoints */
  height: clamp(100px, 22vw, 280px);
  overflow: hidden;
}

.hero-banner-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
}

/* Title and tagline below banner */
.hero-header-text {
  padding: var(--spacing-md) var(--spacing-lg) 0;
  text-align: center;
}

.hero-header-text h1 {
  margin: 0;
  font-size: clamp(1.5rem, 4vw, 2.4rem);
  line-height: 1.2;
}

.hero-header-text .h1-subtitle {
  font-size: clamp(0.85rem, 2vw, 1.1rem);
}

.hero-header-text .tagline {
  margin: var(--spacing-xs) auto 0;
  max-width: 56ch;
  font-size: clamp(0.8rem, 1.8vw, 1rem);
  color: var(--text-secondary);
}

@media (max-width: 768px) {
  .hero-header-text {
    padding: var(--spacing-sm) var(--spacing-sm) 0;
  }
}

@media (max-width: 480px) {
  .hero-header-text h1 {
    font-size: clamp(1.2rem, 5vw, 1.6rem);
  }
  .hero-header-text .tagline {
    font-size: clamp(0.7rem, 2.5vw, 0.85rem);
  }
}

@media (prefers-color-scheme: dark) {
  header {
    border-bottom: 1px solid rgba(0, 204, 102, 0.3);
  }
}

.logo-container {
  margin-bottom: var(--spacing-lg);
}

.logo {
  width: 56px;
  height: 56px;
  border-radius: var(--border-radius-lg);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(0, 71, 171, 0.15);
}

.logo:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 16px rgba(0, 71, 171, 0.25);
}

@media (prefers-color-scheme: dark) {
  .logo {
    box-shadow: 0 0 20px rgba(0, 204, 102, 0.5);
  }

  .logo:hover {
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(0, 204, 102, 0.7);
  }
}

/* Site Logo in Header */
.site-logo {
  display: block;
  max-width: clamp(56px, 8vw, 80px);
  max-height: 80px;
  width: auto;
  height: auto;
  margin: 0 auto;
  border-radius: var(--border-radius-lg);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              filter 0.3s ease;
  filter: drop-shadow(0 4px 16px rgba(0, 0, 0, 0.3));
}

.site-logo:hover {
  transform: scale(1.03);
  filter: drop-shadow(0 6px 20px rgba(0, 71, 171, 0.3));
}

html[data-theme="dark"] .site-logo {
  filter: drop-shadow(0 0 20px rgba(0, 204, 102, 0.4));
}

html[data-theme="dark"] .site-logo:hover {
  filter: drop-shadow(0 0 30px rgba(0, 204, 102, 0.6));
}

@media (prefers-color-scheme: dark) {
  .site-logo {
    filter: drop-shadow(0 0 20px rgba(0, 204, 102, 0.4));
  }
  .site-logo:hover {
    filter: drop-shadow(0 0 30px rgba(0, 204, 102, 0.6));
  }
}

/* Responsive site logo sizing */
@media (max-width: 768px) {
  .site-logo {
    max-height: 64px;
  }
}

@media (max-width: 480px) {
  .site-logo {
    max-height: 48px;
    max-width: clamp(36px, 10vw, 48px);
  }
}

/* Footer Logo */
.footer-logo {
  display: block;
  max-width: 80px;
  height: auto;
  margin: 0 auto var(--spacing-sm);
  opacity: 0.85;
  transition: opacity 0.3s ease;
}

.footer-logo:hover {
  opacity: 1;
}

/* News Article Site Logo */
.article-site-logo {
  display: block;
  max-width: clamp(40px, 8vw, 64px);
  height: auto;
  margin: 0 auto var(--spacing-sm);
  border-radius: var(--border-radius-md);
  filter: drop-shadow(0 2px 8px rgba(0, 71, 171, 0.15));
}

html[data-theme="dark"] .article-site-logo {
  filter: drop-shadow(0 0 12px rgba(0, 204, 102, 0.3));
}

@media (prefers-color-scheme: dark) {
  .article-site-logo {
    filter: drop-shadow(0 0 12px rgba(0, 204, 102, 0.3));
  }
}

.badges {
  display: -webkit-box; /* Old Safari */
  display: -webkit-flex; /* Safari 8 */
  display: -ms-flexbox; /* IE 10 */
  display: flex;
  -webkit-flex-wrap: wrap;
  -ms-flex-wrap: wrap;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1.5rem 0;
  -webkit-box-pack: center;
  -webkit-justify-content: center;
  -ms-flex-pack: center;
  justify-content: center;
}

.badges a {
  text-decoration: none;
}

.badges img {
  height: 20px;
  vertical-align: middle;
}

.app-link {
  display: -webkit-box; /* Old Safari */
  display: -webkit-flex; /* Safari 8 */
  display: -ms-flexbox; /* IE 10 */
  display: flex;
  gap: var(--spacing-md);
  -webkit-flex-wrap: wrap;
  -ms-flex-wrap: wrap;
  flex-wrap: wrap;
  -webkit-box-pack: center;
  -webkit-justify-content: center;
  -ms-flex-pack: center;
  justify-content: center;
  margin-top: var(--spacing-xl);
}

.app-link a {
  display: inline-block;
  padding: 0.75rem 1.75rem;
  background: var(--button-bg);
  color: var(--button-text);
  border-radius: var(--border-radius);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  transition: background 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              border-color 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 4px rgba(0, 71, 171, 0.2);
  border: 1px solid transparent;
}

.app-link a:hover {
  background: var(--link-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 71, 171, 0.25);
  text-decoration: none;
  border-color: rgba(0, 71, 171, 0.3);
}

@media (prefers-color-scheme: dark) {
  .app-link a {
    background: linear-gradient(
      to bottom,
      rgba(0, 204, 102, 0.2),
      rgba(0, 136, 68, 0.4)
    );
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
    color: var(--primary-light);
  }

  .app-link a:hover {
    box-shadow: 0 0 15px rgba(0, 204, 102, 0.3);
    border-color: var(--primary-light);
  }

  .app-link a::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
      to right,
      transparent 0%,
      rgba(0, 204, 102, 0.2) 50%,
      transparent 100%
    );
    transition: all 0.5s ease;
  }

  .app-link a:hover::before {
    left: 100%;
  }
}

/* Cards - Premium Design with Grid fallback for older browsers */
.subsection-title {
  font-size: 1.5rem;
  color: var(--text-secondary);
  margin-top: var(--spacing-3xl); /* Increased from 2xl for better section separation */
  margin-bottom: var(--spacing-xl); /* Increased from lg for better breathing room */
  font-weight: 600;
  padding-bottom: var(--spacing-sm);
  border-bottom: 2px solid var(--border-color); /* Add subtle separator line */
}

/* Flexbox fallback for browsers without Grid support */
.cards {
  display: -webkit-box; /* Old Safari */
  display: -webkit-flex; /* Safari 8 */
  display: -ms-flexbox; /* IE 10 */
  display: flex;
  -webkit-flex-wrap: wrap;
  -ms-flex-wrap: wrap;
  flex-wrap: wrap;
  gap: var(--spacing-xl); /* Increased from lg for better card separation */
  margin-bottom: var(--spacing-3xl); /* Increased from 2xl for better section breathing room */
  -webkit-box-align: stretch;
  -webkit-align-items: stretch;
  -ms-flex-align: stretch;
  align-items: stretch;
  -webkit-box-pack: center;
  -webkit-justify-content: center;
  -ms-flex-pack: center;
  justify-content: center;
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
}

.cards > * {
  -webkit-box-flex: 1;
  -webkit-flex: 1 1 280px;
  -ms-flex: 1 1 280px;
  flex: 1 1 280px;
  max-width: 450px;
  min-width: 280px;
}

/* Grid layout for modern browsers */
@supports (display: grid) {
  .cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 480px));
    justify-content: center;
  }
  
  .cards > * {
    /* Reset flex properties for grid */
    -webkit-box-flex: 0;
    -webkit-flex: none;
    -ms-flex: none;
    flex: none;
    max-width: none;
    min-width: 0;
  }
}

.card {
  border: 1px solid var(--card-border);
  border-radius: var(--border-radius-lg);
  padding: var(--spacing-2xl); /* Increased from xl for more generous internal spacing */
  background: var(--card-bg);
  box-shadow: 0 2px 8px var(--card-shadow), 0 1px 3px rgba(0, 0, 0, 0.06);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              border-color 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  min-height: 180px; /* Ensure consistent minimum card height */
}

.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--premium-gradient-start), var(--premium-gradient-end));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover::before {
  transform: scaleX(1);
}

.card h3 {
  margin-top: 0;
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--header-color);
  margin-bottom: var(--spacing-md);
  line-height: 1.3;
}

.card p {
  margin-bottom: var(--spacing-md);
  color: var(--text-secondary);
  line-height: 1.6;
}

.card img,
.card picture img {
  border-radius: 10px;
  margin-bottom: 1rem;
  max-width: 100%;
  height: auto;
}

.card picture {
  display: block;
}

.card a {
  display: inline-block;
  margin-top: var(--spacing-sm);
  padding: 0.5rem 0.75rem;
  min-height: 48px;
  font-weight: 500;
  transition: color 0.2s ease;
  line-height: 1.5;
}

.card a:focus-visible {
  outline: 3px solid var(--primary-color);
  outline-offset: 2px;
  border-radius: 4px;
  background-color: rgba(0, 102, 51, 0.1);
}

.card ul {
  margin-top: 1rem;
}

.card-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.btn-action-primary {
  /* WCAG 2.1 AA compliant (4.5:1 minimum): White text on #D84315 = 4.60:1 contrast ratio */
  background: var(--accessible-action-primary);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  text-decoration: none;
  font-weight: bold;
  transition: all 0.3s ease;
}

.btn-action-primary:hover {
  background: #BF360C;
  transform: translateY(-2px);
  text-decoration: none;
}

.btn-action-secondary {
  background: #0366d6;
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  text-decoration: none;
  font-weight: bold;
  transition: all 0.3s ease;
}

.btn-action-secondary:hover {
  background: #0256c2;
  transform: translateY(-2px);
  text-decoration: none;
}

/* Card color variants */
.card-red {
  border-left: 4px solid #ff6b35;
}

.card-purple {
  border-left: 4px solid #7B2CBF;
}

.card-green {
  border-left: 4px solid #00C853;
}

/* Profile image */
.profile-image {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  margin: 0 auto 15px;
  display: block;
}

/* Certification badges */
.cert-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0;
}

.cert-badge {
  color: white;
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
}

.cert-badge-cissp {
  background: #0056B3;
}

.cert-badge-cism {
  background: #006400;
}

.cert-badge-aws {
  /* WCAG 2.1 AA compliant (4.5:1 minimum): White text on #CC7A00 = 4.54:1 contrast ratio */
  background: var(--accessible-aws-orange);
  color: white; /* Explicit declaration for higher CSS specificity */
}

/* YouTube/Podcast action buttons */
.btn-youtube {
  /* WCAG 2.1 AA compliant (4.5:1 minimum): White text on #CC0000 = 5.10:1 contrast ratio */
  background: var(--accessible-youtube-red);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  text-decoration: none;
  font-weight: bold;
  transition: all 0.3s ease;
}

.btn-youtube:hover {
  background: #990000;
  transform: translateY(-2px);
  text-decoration: none;
}

.btn-podcast {
  background: #9146FF;
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  text-decoration: none;
  font-weight: bold;
  transition: all 0.3s ease;
}

.btn-podcast:hover {
  background: #7a38d6;
  transform: translateY(-2px);
  text-decoration: none;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0, 71, 171, 0.12), 0 4px 8px rgba(0, 0, 0, 0.08);
  border-color: rgba(0, 71, 171, 0.25);
}

.card:focus-within {
  border-color: rgba(0, 71, 171, 0.4);
  box-shadow: 0 4px 12px rgba(0, 71, 171, 0.15);
}

@media (prefers-color-scheme: dark) {
  .card {
    background: linear-gradient(
      135deg,
      rgba(0, 26, 37, 0.95) 0%,
      rgba(0, 20, 26, 0.98) 100%
    );
    border: 1px solid var(--border-color);
    box-shadow: 0 0 10px rgba(0, 204, 102, 0.2);
  }

  .card:hover {
    box-shadow: 0 0 20px rgba(0, 204, 102, 0.4);
  }

  /* Cyberpunk corner elements on cards */
  .card::before,
  .card::after {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid var(--primary-color);
    opacity: 0.6;
    z-index: 1;
    transition: all 0.3s ease;
  }

  .card::before {
    top: -2px;
    left: -2px;
    border-right: none;
    border-bottom: none;
  }

  .card::after {
    bottom: -2px;
    right: -2px;
    border-left: none;
    border-top: none;
  }

  .card:hover::before,
  .card:hover::after {
    width: 30px;
    height: 30px;
    opacity: 0.8;
  }

  /* Scanner animation effect for active cards */
  /* Scanner animation with vendor prefix for Safari */
  @-webkit-keyframes scanner {
    0%,
    100% {
      background-position: 0% 0%;
    }
    50% {
      background-position: 100% 100%;
    }
  }
  
  @keyframes scanner {
    0%,
    100% {
      background-position: 0% 0%;
    }
    50% {
      background-position: 100% 100%;
    }
  }

  .card:hover .scanner-effect {
    opacity: 1;
  }

  .scanner-effect {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
      45deg,
      rgba(0, 204, 102, 0) 85%,
      rgba(0, 204, 102, 0.2) 90%,
      rgba(0, 204, 102, 0) 95%
    );
    pointer-events: none;
    background-size: 300% 300%;
    -webkit-animation: scanner 3s ease infinite;
    animation: scanner 3s ease infinite;
    z-index: 1;
    border-radius: inherit;
    opacity: 0;
    transition: opacity 0.3s ease;
  }

  .card h3 {
    text-shadow: 0 0 6px rgba(0, 204, 102, 0.5);
  }
}

/* CIA Themed Cards */
.confidentiality-card {
  border-left: 4px solid var(--confidentiality-color);
}

.integrity-card {
  border-left: 4px solid var(--integrity-color);
}

.availability-card {
  border-left: 4px solid var(--availability-color);
}

@media (prefers-color-scheme: dark) {
  .confidentiality-card {
    box-shadow: -2px 0 8px rgba(155, 89, 182, 0.3);
  }

  .integrity-card {
    box-shadow: -2px 0 8px rgba(46, 204, 113, 0.3);
  }

  .availability-card {
    box-shadow: -2px 0 8px rgba(52, 152, 219, 0.3);
  }
}

/* Links section - Premium Design */
ul {
  list-style-type: none;
  padding: 0;
  margin-left: 0;
}

ul li {
  margin-bottom: var(--spacing-lg); /* Enhanced spacing (was var(--spacing-md) = 1rem) */
  position: relative;
  padding-left: var(--spacing-lg);
  line-height: 1.75; /* Improved from 1.7 for optimal readability */
  max-width: 70ch; /* Optimal line length for body text readability */
}

ul li::before {
  content: "▸";
  position: absolute;
  left: 0;
  color: var(--primary-color);
  font-weight: 700;
  font-size: 1.1rem;
}

@media (prefers-color-scheme: dark) {
  ul li::before {
    content: "▶";
    font-size: 0.7rem;
    left: 0;
    top: 0.3rem;
    color: var(--primary-color);
  }
}

ul li a {
  display: inline-block;
  padding: var(--spacing-xs) 0;
  transition: color 0.2s ease;
}

/* Disabled link styling for unavailable translations */
.disabled-link {
  color: var(--text-muted);
  cursor: not-allowed;
  text-decoration: none;
  opacity: 0.6;
}

.disabled-link:hover {
  color: var(--text-muted);
  text-decoration: none;
}

/* Section Styling - Premium with Enhanced Spacing & Visual Grouping */
section {
  padding: var(--spacing-lg) var(--spacing-xl);
  background: rgba(255, 255, 255, 0.5);
  border-radius: var(--border-radius-lg);
  border: 1px solid transparent;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

/* Add subtle visual separation for sections */
section:not(:first-of-type) {
  border-top: 1px solid var(--section-border);
  padding-top: var(--spacing-xl);
  margin-top: var(--spacing-xl);
}

section:hover {
  background: rgba(255, 255, 255, 0.8);
  border-color: rgba(0, 71, 171, 0.1);
}

@media (prefers-color-scheme: dark) {
  section {
    background: rgba(0, 28, 37, 0.3);
  }
  
  section:hover {
    background: rgba(0, 28, 37, 0.5);
    border-color: rgba(0, 204, 102, 0.2);
  }
  
  section:not(:first-of-type) {
    border-top-color: rgba(0, 204, 102, 0.2);
  }
}

/* Presentation Tables */
table[role="presentation"] {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
}

table[role="presentation"] td {
  width: 50%;
  text-align: center;
  padding: 1rem;
  vertical-align: top;
}

table[role="presentation"] p {
  max-width: 320px;
  margin: 0 auto;
}

/* Centered content container */
.centered-cta {
  text-align: center;
  margin: 2rem 0;
}

.centered-cta.margin-top {
  margin-top: 2rem;
}

/* FAQ intro */
.faq-intro {
  margin-bottom: var(--spacing-xl);
  color: var(--text-secondary);
}

/* Header Introduction Styles */
.header-intro {
  max-width: 100%;
  margin: 0 auto var(--spacing-xl);
}

.intro-tagline {
  font-size: 1.15rem;
  line-height: 1.7;
  color: var(--text-color);
  margin-bottom: var(--spacing-lg);
  font-weight: 500;
}

.intro-overview {
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: var(--spacing-md);
}

.business-lines {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 400px));
  gap: var(--spacing-lg);
  margin: var(--spacing-lg) auto;
  padding: var(--spacing-lg);
  background: linear-gradient(135deg, rgba(0, 71, 171, 0.03), rgba(0, 102, 204, 0.01));
  border-radius: var(--border-radius-lg);
  border: 1px solid rgba(0, 71, 171, 0.1);
  max-width: 100%;
}

.business-line {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
  padding: var(--spacing-md);
  background: var(--card-bg);
  border-radius: var(--border-radius);
  border-left: 3px solid var(--primary-light);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              border-left-color 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.business-line:hover {
  transform: translateX(4px);
  border-left-color: var(--primary-color);
  box-shadow: 0 2px 8px rgba(0, 71, 171, 0.12);
}

.business-line strong {
  color: var(--primary-color);
  font-size: 1rem;
  font-weight: 600;
}

.business-line span {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.6;
}

.intro-leadership {
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-top: var(--spacing-lg);
  text-align: center;
}

/* Value Proposition Section Styles */
.value-prop-intro {
  font-size: 1.05rem;
  line-height: 1.7;
  max-width: 100%;
  margin: 0 auto var(--spacing-xl);
  color: var(--text-secondary);
}

.header-subtitle {
  display: block;
  font-size: 1.2rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-top: var(--spacing-sm);
}

/* Value Proposition Card Variants */
.card-transparency {
  background: linear-gradient(135deg, rgba(0, 102, 204, 0.05), rgba(0, 102, 204, 0.02));
  border-left: 4px solid var(--transparency-color);
}

.card-expertise {
  background: linear-gradient(135deg, rgba(0, 200, 83, 0.05), rgba(0, 200, 83, 0.02));
  border-left: 4px solid var(--success-color);
}

.card-innovation {
  background: linear-gradient(135deg, rgba(123, 44, 191, 0.05), rgba(123, 44, 191, 0.02));
  border-left: 4px solid var(--confidentiality-color);
}

.card-practical {
  background: linear-gradient(135deg, rgba(255, 152, 0, 0.05), rgba(255, 152, 0, 0.02));
  border-left: 4px solid var(--warning-color);
}

.card-measurable {
  background: linear-gradient(135deg, rgba(23, 162, 184, 0.05), rgba(23, 162, 184, 0.02));
  border-left: 4px solid var(--info-color);
}

.card-nordic {
  background: linear-gradient(135deg, rgba(220, 53, 69, 0.05), rgba(220, 53, 69, 0.02));
  border-left: 4px solid var(--danger-color);
}

/* List styles for value proposition cards */
.value-list {
  margin: 0;
  padding-left: var(--spacing-lg);
}

/* Button */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  min-height: 48px;
  min-width: 48px;
  border-radius: 4px;
  background: var(--button-bg);
  color: var(--button-text);
  text-decoration: none;
  transition: background 0.3s ease,
              transform 0.3s ease,
              box-shadow 0.3s ease;
  line-height: 1.5;
}

.btn:hover {
  background: var(--link-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  text-decoration: none;
}

.btn:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

@media (prefers-color-scheme: dark) {
  .btn {
    background: rgba(0, 204, 102, 0.2);
    color: var(--primary-light);
    border: 1px solid rgba(0, 204, 102, 0.3);
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
  }

  .btn:hover {
    background: rgba(0, 204, 102, 0.3);
    box-shadow: 0 0 12px rgba(0, 204, 102, 0.4);
  }
}

/* Footer - Enhanced Structure with Navigation */
footer {
  background-color: var(--card-bg);
  border-top: 2px solid var(--primary-color);
  padding: var(--spacing-xl) var(--spacing-xl) var(--spacing-lg);
  margin-top: var(--spacing-xl);
  color: var(--text-secondary);
}

.footer-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--spacing-2xl);
  max-width: 100%;
  margin: 0 auto var(--spacing-2xl);
}

/* Ensure 5-column layout on larger screens */
@media (min-width: 1024px) {
  .footer-container {
    grid-template-columns: repeat(5, 1fr);
  }
}

.footer-column h2,
.footer-column h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: var(--spacing-md);
  color: var(--primary-color);
  line-height: 1.4;
}

.footer-column h2 {
  font-size: 1.25rem;
}

.footer-column p {
  margin: var(--spacing-sm) 0;
  line-height: 1.6;
  font-size: 0.9rem;
}

.footer-column ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-column li {
  margin-bottom: var(--spacing-sm);
}

.footer-column a {
  color: var(--text-color);
  text-decoration: none;
  transition: color 0.3s ease, transform 0.2s ease;
  display: inline-block;
  font-size: 0.9rem;
  line-height: 1.6;
}

.footer-column a:hover {
  color: var(--primary-color);
  transform: translateX(3px);
}

.footer-column a:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
  border-radius: var(--border-radius-sm);
}

.footer-bottom {
  border-top: 1px solid var(--border-color);
  margin-top: var(--spacing-2xl);
  padding-top: var(--spacing-lg);
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.footer-bottom p {
  margin: var(--spacing-sm) 0;
  line-height: 1.6;
}

.footer-bottom a {
  color: var(--link-color);
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-bottom a:hover {
  color: var(--link-hover);
  text-decoration: underline;
}

.footer-bottom a:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
  border-radius: var(--border-radius-sm);
}

/* Dark mode footer adjustments */
@media (prefers-color-scheme: dark) {
  .footer-column h2,
  .footer-column h3 {
    color: var(--primary-light);
  }
  
  .footer-column a:hover {
    color: var(--primary-light);
  }
  
  .footer-bottom {
    border-top: 1px solid rgba(0, 204, 102, 0.3);
  }
}

/* Responsive footer adjustments */
@media (max-width: 767px) {
  footer {
    padding: var(--spacing-xl) var(--spacing-md);
  }
  
  .footer-container {
    grid-template-columns: 1fr;
    gap: var(--spacing-xl);
  }
  
  .footer-column h2,
  .footer-column h3 {
    font-size: 1rem;
  }
  
  .footer-bottom {
    font-size: 0.8rem;
  }
}

/* Responsive adjustments */
/* Note: Mobile responsive styles consolidated in comprehensive section at end of file */

/* Animation keyframes with vendor prefixes for Safari */
@-webkit-keyframes pulse {
  0% {
    box-shadow: 0 0 5px rgba(0, 204, 102, 0.5);
  }
  50% {
    box-shadow: 0 0 20px rgba(0, 204, 102, 0.8);
  }
  100% {
    box-shadow: 0 0 5px rgba(0, 204, 102, 0.5);
  }
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 5px rgba(0, 204, 102, 0.5);
  }
  50% {
    box-shadow: 0 0 20px rgba(0, 204, 102, 0.8);
  }
  100% {
    box-shadow: 0 0 5px rgba(0, 204, 102, 0.5);
  }
}

@-webkit-keyframes flicker {
  0% {
    opacity: 0.99;
  }
  5% {
    opacity: 0.96;
  }
  10% {
    opacity: 0.97;
  }
  15% {
    opacity: 0.99;
  }
  20% {
    opacity: 0.94;
  }
  25% {
    opacity: 0.98;
  }
  30% {
    opacity: 0.97;
  }
  35% {
    opacity: 0.99;
  }
  40% {
    opacity: 0.98;
  }
  45% {
    opacity: 0.97;
  }
  50% {
    opacity: 0.99;
  }
  55% {
    opacity: 0.98;
  }
  60% {
    opacity: 0.97;
  }
  65% {
    opacity: 0.99;
  }
  70% {
    opacity: 0.96;
  }
  75% {
    opacity: 0.99;
  }
  80% {
    opacity: 0.98;
  }
  85% {
    opacity: 0.99;
  }
  90% {
    opacity: 0.96;
  }
  95% {
    opacity: 0.99;
  }
  100% {
    opacity: 1;
  }
}

@keyframes flicker {
  0% {
    opacity: 0.99;
  }
  5% {
    opacity: 0.96;
  }
  10% {
    opacity: 0.97;
  }
  15% {
    opacity: 0.99;
  }
  20% {
    opacity: 0.94;
  }
  25% {
    opacity: 0.98;
  }
  30% {
    opacity: 0.97;
  }
  35% {
    opacity: 0.99;
  }
  40% {
    opacity: 0.98;
  }
  45% {
    opacity: 0.97;
  }
  50% {
    opacity: 0.99;
  }
  55% {
    opacity: 0.98;
  }
  60% {
    opacity: 0.97;
  }
  65% {
    opacity: 0.99;
  }
  70% {
    opacity: 0.96;
  }
  75% {
    opacity: 0.99;
  }
  80% {
    opacity: 0.98;
  }
  85% {
    opacity: 0.99;
  }
  90% {
    opacity: 0.96;
  }
  95% {
    opacity: 0.99;
  }
  100% {
    opacity: 1;
  }
}

@media (prefers-color-scheme: dark) {
  .logo {
    -webkit-animation: pulse 4s infinite;
    animation: pulse 4s infinite;
  }

  main {
    -webkit-animation: flicker 10s infinite;
    animation: flicker 10s infinite;
  }
}

/* Additional compatibility with existing pages */
.header {
  background-color: var(--primary-color);
  color: #FFF;
  padding: 2rem;
  text-align: center;
  border-radius: 6px;
}

.panel-caption {
  background-color: var(--primary-light);
  color: #FFF;
  padding: var(--spacing-xl) var(--spacing-lg); /* Enhanced padding for better prominence */
  text-align: center;
  border-radius: var(--border-radius-lg); /* Use consistent border radius */
  margin: var(--spacing-3xl) 0 var(--spacing-xl) 0; /* More space above, balanced below */
  font-size: var(--h2-size); /* Larger font for better hierarchy */
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(0, 102, 51, 0.15); /* Subtle shadow for depth */
}

.overview-panel-level {
  background-color: var(--card-bg);
  border-radius: 3px;
  color: var(--text-color);
  padding: 2rem;
  box-shadow: 0 2px 6px var(--card-shadow);
}

/* Container styles */
.container {
  max-width: 100%;
  margin: 0 auto;
  padding: 2rem;
}

/* ==================================================
   DOCUMENTATION-SPECIFIC STYLES
   ================================================== */

/* Documentation tables */
.documentation-map,
.data-sources-table,
.runtime-table,
.pricing-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  overflow: hidden;
}

.documentation-map th,
.documentation-map td,
.data-sources-table th,
.data-sources-table td,
.runtime-table th,
.runtime-table td,
.pricing-table th,
.pricing-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--section-border);
}

.documentation-map th,
.data-sources-table th,
.runtime-table th,
.pricing-table th {
  background: var(--primary-color);
  color: white;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.9rem;
  letter-spacing: 0.5px;
}

.documentation-map tbody tr:last-child td,
.data-sources-table tbody tr:last-child td,
.runtime-table tbody tr:last-child td,
.pricing-table tbody tr:last-child td {
  border-bottom: none;
}

.documentation-map tbody tr:hover,
.data-sources-table tbody tr:hover,
.runtime-table tbody tr:hover,
.pricing-table tbody tr:hover {
  background: var(--bg-color);
}

@media (prefers-color-scheme: dark) {
  .documentation-map,
  .data-sources-table,
  .runtime-table {
    border: 1px solid var(--border-color);
    box-shadow: 0 0 10px rgba(0, 204, 102, 0.1);
  }
  
  .documentation-map th,
  .data-sources-table th,
  .runtime-table th {
    background: rgba(0, 204, 102, 0.2);
    color: var(--primary-light);
    text-shadow: 0 0 5px rgba(0, 204, 102, 0.5);
  }
  
  .documentation-map tbody tr:hover,
  .data-sources-table tbody tr:hover,
  .runtime-table tbody tr:hover {
    background: rgba(0, 204, 102, 0.05);
  }
}

@media (max-width: 768px) {
  .documentation-map,
  .data-sources-table,
  .runtime-table {
    font-size: 0.85rem;
  }
  
  .documentation-map th,
  .documentation-map td,
  .data-sources-table th,
  .data-sources-table td,
  .runtime-table th,
  .runtime-table td {
    padding: 0.5rem;
  }
}

/* Status badges */
.badge-success,
.badge-warning {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-success {
  background: #28a745;
  color: white;
}

.badge-warning {
  background: #ffc107;
  color: #333;
}

@media (prefers-color-scheme: dark) {
  .badge-success {
    background: rgba(40, 167, 69, 0.3);
    color: #50fa7b;
    border: 1px solid #50fa7b;
    box-shadow: 0 0 8px rgba(80, 250, 123, 0.3);
  }
  
  .badge-warning {
    background: rgba(255, 193, 7, 0.3);
    color: #f1fa8c;
    border: 1px solid #f1fa8c;
    box-shadow: 0 0 8px rgba(241, 250, 140, 0.3);
  }
}

/* Specialized card types for documentation */
.architecture-card {
  border-left: 4px solid #0366d6;
}

.security-card {
  border-left: 4px solid #8e44ad;
}

.data-card {
  border-left: 4px solid #27ae60;
}

.concept-card {
  border-left: 4px solid #2980b9;
}

.process-card {
  border-left: 4px solid #e74c3c;
}

.devops-card {
  border-left: 4px solid #f39c12;
}

.business-card {
  border-left: 4px solid #16a085;
}

@media (prefers-color-scheme: dark) {
  .architecture-card {
    box-shadow: -2px 0 8px rgba(3, 102, 214, 0.3);
  }
  
  .security-card {
    box-shadow: -2px 0 8px rgba(142, 68, 173, 0.3);
  }
  
  .data-card {
    box-shadow: -2px 0 8px rgba(39, 174, 96, 0.3);
  }
  
  .concept-card {
    box-shadow: -2px 0 8px rgba(41, 128, 185, 0.3);
  }
  
  .process-card {
    box-shadow: -2px 0 8px rgba(231, 76, 60, 0.3);
  }
  
  .devops-card {
    box-shadow: -2px 0 8px rgba(243, 156, 18, 0.3);
  }
  
  .business-card {
    box-shadow: -2px 0 8px rgba(22, 160, 133, 0.3);
  }
}

/* ==================================================
   SCREENSHOT CONTAINER STYLES
   ================================================== */
.screenshot-container {
  margin: 2rem 0;
  text-align: center;
  position: relative;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: 1rem;
  background: var(--card-bg);
  box-shadow: 0 2px 8px var(--card-shadow);
  transition: all 0.3s ease;
}

.screenshot-container:hover {
  box-shadow: 0 4px 16px var(--card-shadow);
  transform: translateY(-2px);
}

.screenshot-container img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: block;
  margin: 0 auto;
}

.screenshot-container img:hover {
  transform: scale(1.02);
}

.screenshot-container figcaption {
  margin-top: 1rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-style: italic;
  line-height: 1.5;
}

.expand-hint {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  font-size: 0.85rem;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  z-index: 10;
}

.screenshot-container:hover .expand-hint {
  opacity: 1;
}

@media (prefers-color-scheme: dark) {
  .screenshot-container {
    border-color: var(--border-color);
    box-shadow: 0 0 10px rgba(0, 204, 102, 0.2);
  }
  
  .screenshot-container:hover {
    box-shadow: 0 0 20px rgba(0, 204, 102, 0.4);
  }
  
  .expand-hint {
    background: rgba(0, 204, 102, 0.3);
    border: 1px solid var(--border-color);
    text-shadow: 0 0 5px rgba(0, 204, 102, 0.5);
  }
}

/* Fullscreen overlay for screenshots */
.fullscreen-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.95);
  z-index: 10000;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 2rem;
  cursor: pointer;
}

.fullscreen-overlay img {
  max-width: 90%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.8);
}

.fullscreen-caption {
  color: white;
  margin-top: 1.5rem;
  max-width: 100%;
  text-align: center;
  font-size: 1rem;
  line-height: 1.6;
}

@media (prefers-color-scheme: dark) {
  .fullscreen-overlay {
    background: rgba(0, 26, 26, 0.98);
  }
  
  .fullscreen-overlay img {
    box-shadow: 0 0 40px rgba(0, 204, 102, 0.3);
  }
  
  .fullscreen-caption {
    color: var(--text-color);
    text-shadow: 0 0 10px rgba(0, 204, 102, 0.3);
  }
}

@media (max-width: 768px) {
  .screenshot-container {
    padding: 0.75rem;
    margin: 1.5rem 0;
  }
  
  .expand-hint {
    font-size: 0.75rem;
    padding: 0.4rem 0.8rem;
    top: 1rem;
    right: 1rem;
  }
  
  .fullscreen-overlay {
    padding: 1rem;
  }
  
  .fullscreen-overlay img {
    max-width: 95%;
    max-height: 75vh;
  }
  
  .fullscreen-caption {
    font-size: 0.9rem;
    margin-top: 1rem;
  }
}

/* Removed duplicate :root declaration that was forcing dark theme - use @media (prefers-color-scheme: dark) instead */

/* ==================================================
   DISCORDIAN BLOG STYLING
   ================================================== */

/* ROI Badge Styles */
.badge {
  display: inline-block;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0.25rem;
}

.badge-exceptional {
  background: linear-gradient(135deg, #ffd700, #ffed4e);
  color: #000;
  box-shadow: 0 2px 8px rgba(255, 215, 0, 0.4);
}

.badge-high {
  background: linear-gradient(135deg, #ff6b6b, #ff8e8e);
  color: #fff;
  box-shadow: 0 2px 8px rgba(255, 107, 107, 0.4);
}

.badge-moderate {
  background: linear-gradient(135deg, #4ecdc4, #44a8a0);
  color: #fff;
  box-shadow: 0 2px 8px rgba(78, 205, 196, 0.4);
}

.badge-basic {
  background: linear-gradient(135deg, #95afc0, #778ca3);
  color: #fff;
  box-shadow: 0 2px 8px rgba(149, 175, 192, 0.4);
}

.badge-minimal {
  background: linear-gradient(135deg, #b7b7b7, #999999);
  color: #fff;
  box-shadow: 0 2px 8px rgba(183, 183, 183, 0.4);
}

@media (prefers-color-scheme: dark) {
  .badge-exceptional {
    background: rgba(255, 215, 0, 0.3);
    color: #ffd700;
    border: 1px solid #ffd700;
    box-shadow: 0 0 12px rgba(255, 215, 0, 0.5);
  }
  
  .badge-high {
    background: rgba(255, 107, 107, 0.3);
    color: #ff8e8e;
    border: 1px solid #ff6b6b;
    box-shadow: 0 0 12px rgba(255, 107, 107, 0.5);
  }
  
  .badge-moderate {
    background: rgba(78, 205, 196, 0.3);
    color: #4ecdc4;
    border: 1px solid #4ecdc4;
    box-shadow: 0 0 12px rgba(78, 205, 196, 0.5);
  }
  
  .badge-basic {
    background: rgba(149, 175, 192, 0.3);
    color: #95afc0;
    border: 1px solid #95afc0;
    box-shadow: 0 0 12px rgba(149, 175, 192, 0.5);
  }
  
  .badge-minimal {
    background: rgba(183, 183, 183, 0.3);
    color: #b7b7b7;
    border: 1px solid #b7b7b7;
    box-shadow: 0 0 12px rgba(183, 183, 183, 0.5);
  }
}

/* Data Table Styles */
.data-table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  background: var(--card-bg);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 12px var(--card-shadow);
}

.data-table thead {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
  color: #fff;
}

.data-table th {
  padding: 1rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.data-table td {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-color);
}

.data-table tbody tr:hover {
  background: rgba(0, 102, 51, 0.05);
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.data-table .total-row {
  font-weight: 700;
  background: rgba(0, 102, 51, 0.1);
  border-top: 2px solid var(--primary-color);
}

.data-table strong {
  font-weight: 700;
  color: var(--primary-color);
}

@media (prefers-color-scheme: dark) {
  .data-table thead {
    background: linear-gradient(135deg, rgba(0, 204, 102, 0.3), rgba(0, 255, 136, 0.2));
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
  }
  
  .data-table tbody tr:hover {
    background: rgba(0, 204, 102, 0.1);
  }
  
  .data-table .total-row {
    background: rgba(0, 204, 102, 0.2);
    border-top: 2px solid var(--primary-color);
  }
  
  .data-table strong {
    color: var(--primary-light);
  }
}

/* ROI Table Row Styling */
.roi-exceptional {
  background: rgba(255, 215, 0, 0.05);
}

.roi-high {
  background: rgba(255, 107, 107, 0.05);
}

.roi-moderate {
  background: rgba(78, 205, 196, 0.05);
}

.roi-basic {
  background: rgba(149, 175, 192, 0.05);
}

.roi-minimal {
  background: rgba(183, 183, 183, 0.05);
}

@media (prefers-color-scheme: dark) {
  .roi-exceptional {
    background: rgba(255, 215, 0, 0.1);
  }
  
  .roi-high {
    background: rgba(255, 107, 107, 0.1);
  }
  
  .roi-moderate {
    background: rgba(78, 205, 196, 0.1);
  }
  
  .roi-basic {
    background: rgba(149, 175, 192, 0.1);
  }
  
  .roi-minimal {
    background: rgba(183, 183, 183, 0.1);
  }
}

/* Value Metrics Display */
.value-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 420px));
  gap: var(--spacing-lg);
  margin: 2rem auto;
  justify-content: center;
  max-width: 100%;
}

.value-metric {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 4px 12px var(--card-shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.value-metric:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 24px var(--card-shadow);
}

.value-metric h3 {
  margin: 0 0 0.5rem 0;
  color: var(--primary-color);
  font-size: 1.1rem;
}

.metric-value {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--header-color);
  margin: 0.5rem 0;
  font-family: var(--font-mono);
}

.metric-description {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.5;
  margin: 0.5rem 0 0 0;
}

@media (prefers-color-scheme: dark) {
  .value-metric {
    background: linear-gradient(135deg, rgba(0, 28, 37, 0.95), rgba(0, 26, 26, 0.98));
    border: 1px solid rgba(0, 204, 102, 0.3);
    box-shadow: 0 4px 12px rgba(0, 204, 102, 0.2);
  }
  
  .value-metric:hover {
    box-shadow: 0 8px 24px rgba(0, 204, 102, 0.4);
  }
  
  .metric-value {
    color: var(--primary-color);
    text-shadow: 0 0 10px rgba(0, 204, 102, 0.5);
  }
}

/* Signature styling for blog posts */
.signature {
  font-style: italic;
  text-align: right;
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
  color: var(--text-secondary);
}

/* Hidden wisdom styling - Discordian Easter eggs */
.hidden-wisdom {
  font-style: italic;
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  background: rgba(0, 102, 51, 0.05);
  border-left: 3px solid var(--primary-color);
  border-radius: 4px;
}

@media (prefers-color-scheme: dark) {
  .hidden-wisdom {
    background: rgba(0, 204, 102, 0.1);
    border-left-color: var(--primary-color);
    color: var(--primary-light);
  }
}

/* Responsive tables for mobile */
@media (max-width: 768px) {
  .data-table {
    font-size: 0.85rem;
  }
  
  .data-table th,
  .data-table td {
    padding: 0.5rem;
  }
  
  .value-metrics {
    grid-template-columns: 1fr;
  }
  
  .metric-value {
    font-size: 2rem;
  }
}

/* Discordian blog footer styles */
.discordian-authors {
  margin-top: 0.5rem;
  font-style: italic;
  font-size: 0.9rem;
}

.discordian-implementation {
  margin-top: 0.3rem;
  font-style: italic;
  font-size: 0.85rem;
  color: #888;
}

/* ==================================================
   BREADCRUMB NAVIGATION COMPONENT (WCAG 2.1 AA)
   ================================================== */

/* Breadcrumb container */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.25rem;
  margin-bottom: var(--spacing-md);
  background: rgba(0, 102, 51, 0.04);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  font-size: 0.875rem;
  list-style: none;
}

@media (prefers-color-scheme: dark) {
  .breadcrumb {
    background: rgba(0, 204, 102, 0.08);
    border-color: rgba(0, 204, 102, 0.2);
  }
}

/* Black Trigram theme override */
.theme-black-trigram .breadcrumb {
  background: rgba(192, 57, 43, 0.05);
  border-color: rgba(192, 57, 43, 0.2);
}

@media (prefers-color-scheme: dark) {
  .theme-black-trigram .breadcrumb {
    background: rgba(255, 107, 107, 0.08);
    border-color: rgba(255, 107, 107, 0.2);
  }
}

/* Breadcrumb list items */
.breadcrumb-item {
  display: flex;
  align-items: center;
  color: var(--text-secondary);
}

/* Breadcrumb links */
.breadcrumb-item a {
  color: var(--link-color);
  text-decoration: none;
  padding: 0.25rem 0.5rem;
  border-radius: var(--border-radius-sm);
  transition: color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.breadcrumb-item a:hover {
  color: var(--link-hover);
  background-color: rgba(0, 102, 51, 0.1);
  text-decoration: none;
}

@media (prefers-color-scheme: dark) {
  .breadcrumb-item a:hover {
    background-color: rgba(0, 204, 102, 0.15);
    box-shadow: 0 0 8px rgba(0, 204, 102, 0.3);
  }
}

/* Black Trigram theme link hover */
.theme-black-trigram .breadcrumb-item a:hover {
  background-color: rgba(192, 57, 43, 0.1);
}

@media (prefers-color-scheme: dark) {
  .theme-black-trigram .breadcrumb-item a:hover {
    background-color: rgba(255, 107, 107, 0.15);
    box-shadow: 0 0 8px rgba(255, 107, 107, 0.3);
  }
}

/* Focus state for keyboard navigation (WCAG 2.1 AA) */
.breadcrumb-item a:focus-visible {
  outline: 3px solid var(--primary-color);
  outline-offset: 2px;
  background-color: rgba(0, 102, 51, 0.1);
  border-radius: var(--border-radius-sm);
}

@media (prefers-color-scheme: dark) {
  .breadcrumb-item a:focus-visible {
    outline-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(0, 204, 102, 0.2);
  }
}

.theme-black-trigram .breadcrumb-item a:focus-visible {
  outline-color: var(--primary-color);
  background-color: rgba(192, 57, 43, 0.1);
}

/* Current page styling (not a link) */
.breadcrumb-item[aria-current="page"] {
  color: var(--text-color);
  font-weight: 600;
  padding: 0.25rem 0.5rem;
}

/* Breadcrumb separator */
.breadcrumb-item + .breadcrumb-item::before {
  content: "›";
  color: var(--text-secondary);
  margin: 0 0.5rem;
  font-size: 1.1em;
  opacity: 0.6;
  user-select: none;
}

@media (prefers-color-scheme: dark) {
  .breadcrumb-item + .breadcrumb-item::before {
    opacity: 0.5;
    text-shadow: 0 0 4px rgba(0, 204, 102, 0.3);
  }
}


/* ==================================================
   DASHBOARD CTA BANNER
   Prominent call-to-action for Intelligence Dashboard
   ================================================== */

.dashboard-cta {
  background: linear-gradient(135deg, rgba(0, 102, 51, 0.06) 0%, rgba(0, 119, 68, 0.04) 100%);
  border: 2px solid var(--primary-color);
  border-radius: var(--border-radius);
  padding: var(--spacing-md) var(--spacing-lg);
  margin: 0 var(--spacing-md) var(--spacing-md) var(--spacing-md);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.dashboard-cta::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 200%;
  height: 2px;
  background: linear-gradient(90deg, transparent, #00d9ff, #ff006e, transparent);
  transform: translateX(-100%);
  will-change: transform;
  animation: dashboard-cta-shimmer 4s linear infinite;
}

@keyframes dashboard-cta-shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(0%);
  }
}

/* Disable dashboard CTA shimmer animation for users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  .dashboard-cta::before {
    animation: none;
  }
}

.dashboard-cta-heading {
  font-family: var(--font-accent);
  font-size: clamp(1.1rem, 2.5vw, 1.4rem);
  color: var(--header-color);
  margin: 0 0 0.5rem 0;
  letter-spacing: 0.02em;
}

.dashboard-cta-description {
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
  line-height: 1.5;
  margin: 0 0 0.75rem 0;
  max-width: 72ch;
  margin-inline: auto;
}

.dashboard-cta-features {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: 0.75rem;
  list-style: none;
  padding: 0;
}

.dashboard-cta-features li {
  background: rgba(0, 102, 51, 0.08);
  border: 1px solid var(--border-color);
  border-radius: 2rem;
  padding: 0.25rem 0.75rem;
  font-size: var(--font-size-sm, 0.875rem);
  color: var(--text-color);
  white-space: nowrap;
}

.dashboard-cta-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--button-text);
  background: var(--button-bg);
  text-decoration: none;
  font-weight: 700;
  font-size: var(--font-size-base);
  padding: 0.6rem 1.5rem;
  border-radius: var(--border-radius);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 102, 51, 0.2);
}

.dashboard-cta-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 102, 51, 0.3);
  background: var(--primary-dark);
}

.dashboard-cta-link:focus-visible {
  outline: 3px solid var(--primary-color);
  outline-offset: 4px;
  border-radius: var(--border-radius-sm, 4px);
}

.dashboard-cta-link-icon {
  font-size: 1.3rem;
}

@media (max-width: 768px) {
  .dashboard-cta {
    padding: var(--spacing-md);
    margin: 0 var(--spacing-sm) var(--spacing-md) var(--spacing-sm);
  }

  .dashboard-cta-features li {
    font-size: 0.8rem;
    padding: 0.25rem 0.7rem;
  }

  .dashboard-cta-link {
    font-size: 1rem;
    padding: 0.65rem 1.5rem;
  }
}

@media (prefers-color-scheme: dark) {
  .dashboard-cta {
    background: linear-gradient(135deg, rgba(0, 217, 255, 0.15) 0%, rgba(255, 0, 110, 0.1) 100%);
    border-color: rgba(0, 217, 255, 0.5);
  }
}

/* ==================================================
   NEWS NAVIGATION
   Cyberpunk magenta-themed callout for News section
   ================================================== */

.news-navigation {
  background: linear-gradient(135deg, rgba(0, 102, 51, 0.04) 0%, rgba(0, 119, 68, 0.06) 100%);
  border: 2px solid var(--primary-light);
  border-radius: var(--border-radius);
  padding: var(--spacing-md) var(--spacing-lg);
  margin: 0 var(--spacing-md) var(--spacing-md) var(--spacing-md);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.news-navigation::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 200%;
  height: 2px;
  background: linear-gradient(90deg, transparent, #ff006e, #ffbe0b, transparent);
  animation: news-cta-shimmer 4s linear infinite;
}

@keyframes news-cta-shimmer {
  0% { left: -100%; }
  100% { left: 100%; }
}

/* Disable news navigation shimmer animation for users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  .news-navigation::before {
    animation: none;
  }
}

.news-navigation-heading {
  font-family: var(--font-accent);
  font-size: clamp(1.1rem, 2.5vw, 1.4rem);
  color: var(--header-color);
  margin: 0 0 0.5rem 0;
  letter-spacing: 0.02em;
}

.news-navigation-description {
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
  line-height: 1.5;
  margin: 0 0 0.75rem 0;
  max-width: 72ch;
  margin-inline: auto;
}

.news-navigation-features {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: 0.75rem;
  list-style: none;
  padding: 0;
}

.news-navigation-features li {
  background: rgba(0, 102, 51, 0.08);
  border: 1px solid var(--border-color);
  border-radius: 2rem;
  padding: 0.25rem 0.75rem;
  font-size: var(--font-size-sm);
  color: var(--text-color);
  white-space: nowrap;
}

.news-navigation-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--button-text);
  background: var(--button-bg);
  text-decoration: none;
  font-weight: 700;
  font-size: var(--font-size-base);
  padding: 0.6rem 1.5rem;
  border-radius: var(--border-radius);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 102, 51, 0.2);
}

.news-navigation-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 102, 51, 0.3);
  background: var(--primary-dark);
}

.news-navigation-link:focus-visible {
  outline: 3px solid var(--primary-color);
  outline-offset: 4px;
  border-radius: var(--border-radius-sm, 4px);
}

.news-navigation-link-icon {
  font-size: 1.3rem;
}

/* Legacy single-line support */
.news-navigation > a:not(.news-navigation-link) {
  color: var(--link-color);
  text-decoration: none;
  font-size: var(--font-size-lg);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: color 0.3s ease, transform 0.2s ease;
}

.news-navigation-icon {
  font-size: 1.3rem;
}

@media (max-width: 768px) {
  .news-navigation {
    padding: var(--spacing-md);
    margin: 0 var(--spacing-sm) var(--spacing-md) var(--spacing-sm);
  }

  .news-navigation-features li {
    font-size: 0.8rem;
    padding: 0.25rem 0.7rem;
  }

  .news-navigation-link {
    font-size: 1rem;
    padding: 0.65rem 1.5rem;
  }
}

@media (prefers-color-scheme: dark) {
  .news-navigation {
    background: linear-gradient(135deg, rgba(255, 0, 110, 0.12) 0%, rgba(255, 190, 11, 0.08) 100%);
    border-color: rgba(255, 0, 110, 0.45);
  }
}
/* Mobile responsive adjustments */
@media (max-width: 768px) {
  .breadcrumb {
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    gap: 0.25rem;
  }
  
  .breadcrumb-item + .breadcrumb-item::before {
    margin: 0 0.35rem;
  }
  
  .breadcrumb-item a,
  .breadcrumb-item[aria-current="page"] {
    padding: 0.2rem 0.4rem;
  }
}

/* Very small screens - compact layout */
@media (max-width: 480px) {
  .breadcrumb {
    font-size: 0.8rem;
    padding: 0.4rem 0.6rem;
  }
  
  .breadcrumb-item + .breadcrumb-item::before {
    margin: 0 0.25rem;
    font-size: 1em;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .breadcrumb {
    border-width: 2px;
  }
  
  .breadcrumb-item a:focus-visible {
    outline-width: 3px;
  }
  
  .breadcrumb-item + .breadcrumb-item::before {
    opacity: 1;
    font-weight: bold;
  }
}

/* ==================================================
   FAQ ACCORDION STYLES - WCAG 2.1 AA Compliant
   ================================================== */

/* FAQ Section Container */
#faq {
  margin: var(--spacing-2xl) 0;
}

/* FAQ Controls - Expand/Collapse All Buttons */
.faq-controls {
  display: flex;
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-xl);
  flex-wrap: wrap;
}

.faq-control-btn {
  padding: var(--spacing-sm) var(--spacing-lg);
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: var(--border-radius-sm);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  transition: background-color 0.2s ease, transform 0.1s ease;
}

.faq-control-btn:hover {
  background: var(--primary-light);
  transform: translateY(-1px);
}

.faq-control-btn:active {
  transform: translateY(0);
}

.faq-control-btn:focus-visible {
  outline: 3px solid var(--primary-color);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(0, 102, 51, 0.2);
}

/* FAQ Item - Native Details/Summary */
.faq-item {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--border-radius);
  margin-bottom: var(--spacing-md);
  overflow: hidden;
  transition: box-shadow 0.3s ease;
}

.faq-item:hover {
  box-shadow: 0 4px 12px var(--card-shadow);
}

/* FAQ Question Button - Native Summary Element */
.faq-item summary {
  cursor: pointer;
  padding: var(--spacing-lg);
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background-color 0.2s ease;
  position: relative;
}

.faq-item summary:hover {
  background: rgba(0, 102, 51, 0.05);
}

/* Focus indicator for keyboard navigation - WCAG 2.1 AA */
.faq-item summary:focus-visible {
  outline: 3px solid var(--primary-color);
  outline-offset: -3px;
  background: rgba(0, 102, 51, 0.08);
}

/* Remove default marker on all browsers */
.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::marker {
  display: none;
}

/* FAQ Question Heading */
.faq-item summary h3 {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-color);
  flex: 1;
  transition: color 0.2s ease;
}

.faq-item summary:hover h3 {
  color: var(--primary-color);
}

/* Expand/Collapse Indicator */
.faq-item summary::after {
  content: '+';
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--primary-color);
  transition: transform 0.3s ease;
  flex-shrink: 0;
  margin-left: var(--spacing-md);
  line-height: 1;
}

.faq-item[open] summary::after {
  content: '−';
}

/* FAQ Answer Content */
.faq-answer {
  padding: 0 var(--spacing-lg) var(--spacing-lg);
}

@-webkit-keyframes fadeIn {
  from {
    opacity: 0;
    -webkit-transform: translateY(-10px);
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    -webkit-transform: translateY(0);
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    -webkit-transform: translateY(-10px);
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    -webkit-transform: translateY(0);
    transform: translateY(0);
  }
}

.faq-answer p {
  margin: 0 0 var(--spacing-md) 0;
  color: var(--text-secondary);
  line-height: 1.7;
}

.faq-answer p:last-child {
  margin-bottom: 0;
}

/* FAQ Section Heading */
#faq h2 {
  text-align: center;
  margin-bottom: var(--spacing-xl);
}

/* FAQ Content Container */
.faq-content {
  max-width: 100%;
  margin: 0 auto;
}

/* FAQ Answer Lists */
.faq-answer ul,
.faq-answer ol {
  margin: var(--spacing-md) 0;
  padding-left: var(--spacing-xl);
  color: var(--text-secondary);
  line-height: 1.7;
}

.faq-answer li {
  margin-bottom: var(--spacing-sm);
}

.faq-answer ul ul,
.faq-answer ol ul,
.faq-answer ul ol,
.faq-answer ol ol {
  margin-top: var(--spacing-sm);
  padding-left: var(--spacing-lg);
}

.faq-answer strong {
  color: var(--text-color);
  font-weight: 600;
}

.faq-answer a {
  color: var(--link-color);
  text-decoration: underline;
  transition: color 0.2s ease;
}

.faq-answer a:hover {
  color: var(--link-hover);
}

.faq-answer a:focus-visible {
  outline: 3px solid var(--primary-color);
  outline-offset: 2px;
  border-radius: var(--border-radius-sm);
  background-color: rgba(0, 102, 51, 0.1);
}

/* Reduced Motion Support - Accessibility */
@media (prefers-reduced-motion: reduce) {
  .faq-control-btn:hover,
  .faq-control-btn:active {
    transform: none;
  }
  
  .faq-item summary::after {
    transition: none;
  }
  
  .faq-answer {
    animation: none;
  }
}

/* Respect user motion preferences for fade-in animation */
@media (prefers-reduced-motion: no-preference) {
  .faq-answer {
    -webkit-animation: fadeIn 0.3s ease-in;
    animation: fadeIn 0.3s ease-in;
  }
}

/* Dark Mode Adjustments */
@media (prefers-color-scheme: dark) {
  .faq-item summary:hover {
    background: rgba(0, 204, 102, 0.1);
  }
  
  .faq-item summary:focus-visible {
    background: rgba(0, 204, 102, 0.15);
  }
  
  .faq-control-btn {
    background: var(--primary-color);
  }
  
  .faq-control-btn:hover {
    background: var(--primary-light);
  }
}

/* Responsive Design - Mobile */
@media (max-width: 768px) {
  .faq-item summary {
    padding: var(--spacing-md);
  }
  
  .faq-item summary h3 {
    font-size: 1rem;
  }
  
  .faq-item summary::after {
    font-size: 1.25rem;
  }
  
  .faq-answer {
    padding: 0 var(--spacing-md) var(--spacing-md);
  }
  
  .faq-controls {
    gap: var(--spacing-sm);
  }
  
  .faq-control-btn {
    flex: 1;
    min-width: 120px;
  }
}

/* Print Styles - Show all FAQ answers */
@media print {
  .faq-controls {
    display: none;
  }
  
  .faq-item summary::after {
    display: none;
  }
  
  .faq-answer {
    display: block !important;
    padding: 0 var(--spacing-lg) var(--spacing-lg) !important;
  }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
  .faq-item {
    border-width: 2px;
  }
  
  .faq-item summary:focus-visible {
    outline-width: 4px;
  }
  
  .faq-item summary::after {
    font-weight: 700;
  }
  
  .faq-control-btn {
    border: 2px solid var(--text-color);
  }
}

/* ==================================================
   SWEDISH ELECTION 2026 STYLES
   ================================================== */

/* Election Countdown */
.election-countdown {
  margin: var(--spacing-md) 0;
  padding: var(--spacing-md);
  background: var(--card-bg);
  border: 2px solid var(--primary-color);
  border-radius: var(--border-radius-lg);
  text-align: center;
}

.election-countdown h2 {
  font-size: 1.5rem;
  color: var(--primary-color);
  margin-bottom: var(--spacing-xs);
}

.election-countdown #countdown {
  color: var(--accent-color);
  font-weight: 700;
  font-family: var(--font-mono);
}

/* Hero Stats Grid */
.hero-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: var(--spacing-md);
  margin: var(--spacing-md) 0;
  width: 100%;
  padding: 0 var(--spacing-lg);
  box-sizing: border-box;
}

.hero-stats .stat {
  text-align: center;
  padding: var(--spacing-md);
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
}

.hero-stats .stat .number {
  display: block;
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary-color);
  font-family: var(--font-mono);
  line-height: 1;
  margin-bottom: var(--spacing-xs);
}

.hero-stats .stat .label {
  display: block;
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* Coalition Stability */
.coalition-stability {
  margin-top: var(--spacing-2xl);
  padding: var(--spacing-lg);
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
}

.coalition-stability h3 {
  color: var(--header-color);
  margin-bottom: var(--spacing-md);
}

.stability-info {
  margin-top: var(--spacing-md);
}

.stability-info p {
  margin-bottom: var(--spacing-sm);
  padding: var(--spacing-sm) var(--spacing-md);
  background: var(--bg-color);
  border-left: 3px solid var(--warning-color);
  border-radius: var(--border-radius-sm);
}

.stability-info p strong {
  color: var(--primary-color);
}

/* Risk Rules Breakdown */
.risk-rules-breakdown {
  margin-top: var(--spacing-2xl);
  padding: var(--spacing-lg);
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
}

.risk-rules-breakdown h3 {
  color: var(--header-color);
  margin-top: var(--spacing-xl);
  margin-bottom: var(--spacing-md);
}

.risk-rules-breakdown h3:first-child {
  margin-top: 0;
}

.risk-rules-breakdown ul {
  list-style: none;
  padding: 0;
}

.risk-rules-breakdown li {
  padding: var(--spacing-sm) 0;
  border-bottom: 1px solid var(--section-border);
}

.risk-rules-breakdown li:last-child {
  border-bottom: none;
}

.risk-rules-breakdown li strong {
  color: var(--primary-color);
}

/* Election Timeline Phases */
.timeline-phases {
  display: grid;
  gap: var(--spacing-xl);
  margin-top: var(--spacing-lg);
}

.timeline-phases .phase {
  padding: var(--spacing-lg);
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--primary-color);
  border-radius: var(--border-radius);
}

.timeline-phases .phase h3 {
  color: var(--primary-color);
  margin-bottom: var(--spacing-md);
}

.timeline-phases .phase ul {
  list-style: none;
  padding: 0;
}

.timeline-phases .phase li {
  padding: var(--spacing-sm) 0;
  padding-left: var(--spacing-lg);
  position: relative;
}

.timeline-phases .phase li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: var(--primary-color);
  font-weight: 700;
}

/* Coalition Scenarios */
.scenarios {
  display: grid;
  gap: var(--spacing-xl);
  margin-top: var(--spacing-lg);
}

.scenarios .scenario {
  padding: var(--spacing-lg);
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
}

.scenarios .scenario h3 {
  color: var(--primary-color);
  margin-bottom: var(--spacing-md);
}

.scenarios .scenario-summary {
  font-style: italic;
  color: var(--text-secondary);
  margin-bottom: var(--spacing-md);
  padding: var(--spacing-md);
  background: var(--bg-color);
  border-left: 3px solid var(--info-color);
  border-radius: var(--border-radius-sm);
}

.scenarios .scenario ul {
  list-style: none;
  padding: 0;
}

.scenarios .scenario li {
  padding: var(--spacing-sm) 0;
  border-bottom: 1px solid var(--section-border);
}

.scenarios .scenario li:last-child {
  border-bottom: none;
}

.scenarios .scenario li strong {
  color: var(--primary-color);
}

/* Pilot Program Application */
.pilot-application {
  margin-top: var(--spacing-2xl);
  padding: var(--spacing-lg);
  background: var(--card-bg);
  border: 2px solid var(--primary-color);
  border-radius: var(--border-radius-lg);
}

.pilot-application h3 {
  color: var(--primary-color);
  margin-bottom: var(--spacing-md);
}

.pilot-application ol {
  padding-left: var(--spacing-xl);
}

.pilot-application li {
  margin-bottom: var(--spacing-sm);
}

.pilot-application p {
  margin-top: var(--spacing-md);
}

.pilot-application p strong {
  color: var(--primary-color);
}

/* Pilot Program Pricing Cards */
.card .price {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-color);
  margin: var(--spacing-md) 0;
}

.card .duration {
  color: var(--text-secondary);
  margin-bottom: var(--spacing-md);
}

.card .target {
  margin-top: var(--spacing-lg);
  padding-top: var(--spacing-md);
  border-top: 1px solid var(--section-border);
  color: var(--text-secondary);
}

.card .slots {
  font-weight: 600;
  color: var(--accent-color);
}

/* Technical Specifications */
.tech-specs {
  display: grid;
  gap: var(--spacing-xl);
  margin-top: var(--spacing-lg);
}

.tech-specs .spec-category {
  padding: var(--spacing-lg);
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
}

.tech-specs .spec-category h3 {
  color: var(--primary-color);
  margin-bottom: var(--spacing-md);
}

.tech-specs .spec-category ul {
  list-style: none;
  padding: 0;
}

.tech-specs .spec-category li {
  padding: var(--spacing-sm) 0;
  border-bottom: 1px solid var(--section-border);
}

.tech-specs .spec-category li:last-child {
  border-bottom: none;
}

.tech-specs .spec-category li strong {
  color: var(--primary-color);
  display: inline-block;
  min-width: 150px;
}

/* Resources List */
.resources {
  margin-top: var(--spacing-2xl);
  padding: var(--spacing-lg);
  background: var(--bg-color);
  border-radius: var(--border-radius);
}

.resources h3 {
  color: var(--primary-color);
  margin-bottom: var(--spacing-md);
}

.resources ul {
  list-style: none;
  padding: 0;
  display: grid;
  gap: var(--spacing-sm);
}

.resources li {
  padding: var(--spacing-sm) var(--spacing-md);
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
}

.resources a {
  display: block;
  text-decoration: none;
  color: var(--link-color);
  transition: color 0.3s ease;
}

.resources a:hover {
  color: var(--link-hover);
}

.resources a::before {
  content: "📄 ";
  margin-right: var(--spacing-xs);
}

/* Responsive Design for Election Pages */
@media (max-width: 768px) {
  .hero-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-md);
  }
  
  .hero-stats .stat .number {
    font-size: 2rem;
  }
  
  .election-countdown h2 {
    font-size: 1.4rem;
  }
  
  .tech-specs .spec-category li strong {
    display: block;
    margin-bottom: var(--spacing-xs);
  }
}

@media (max-width: 480px) {
  .hero-stats {
    grid-template-columns: 1fr;
  }
}

/* ==================================================
   COMPARISON TABLE (Why Hack23 Page)
   ================================================== */
.comparison-table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  box-shadow: 0 2px 8px var(--card-shadow);
  border-radius: var(--border-radius);
  overflow: hidden;
}

.comparison-table thead {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
}

.comparison-table th {
  padding: 1rem;
  text-align: left;
  color: white;
  font-weight: 600;
  font-size: 1.1rem;
  border-bottom: 2px solid var(--primary-dark);
}

.comparison-table th:first-child {
  width: 25%;
}

.comparison-table th:nth-child(2),
.comparison-table th:nth-child(3) {
  width: 37.5%;
}

.comparison-table tbody tr {
  border-bottom: 1px solid var(--card-border);
  transition: background-color 0.2s ease;
}

.comparison-table tbody tr:hover {
  background-color: var(--badge-bg);
}

.comparison-table tbody tr:last-child {
  border-bottom: none;
}

.comparison-table td {
  padding: 1rem;
  vertical-align: top;
}

.comparison-table td:first-child,
.comparison-table th[scope="row"] {
  font-weight: 600;
  color: var(--header-color);
  background-color: var(--badge-bg);
}

.comparison-table td.positive {
  color: var(--success-color);
  font-weight: 500;
}

.comparison-table td.negative {
  color: var(--text-secondary);
  font-weight: 500;
}

.comparison-table td.warning {
  color: var(--warning-color);
  font-weight: 500;
}

.comparison-table td.neutral {
  color: var(--info-color);
  font-weight: 500;
}

.table-container {
  overflow-x: auto;
  margin: 2rem 0;
}

/* Responsive comparison table */
@media (max-width: 768px) {
  .comparison-table {
    font-size: 0.85rem;
  }
  
  .comparison-table th,
  .comparison-table td {
    padding: 0.75rem 0.5rem;
  }
  
  .comparison-table th {
    font-size: 0.95rem;
  }
}

@media (max-width: 480px) {
  .comparison-table {
    font-size: 0.75rem;
  }
  
  .comparison-table th,
  .comparison-table td {
    padding: 0.5rem 0.25rem;
  }
  
  .comparison-table th {
    font-size: 0.85rem;
  }
}

/* CTA buttons styling */
.cta-buttons {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
  margin: 2rem 0;
}

.cta-buttons .btn {
  flex: 0 1 auto;
  min-width: 200px;
}

.cta-text {
  text-align: center;
  font-size: 1.1rem;
  margin: 2rem 0;
  padding: 1rem;
  background-color: var(--badge-bg);
  border-radius: var(--border-radius);
}

@media (max-width: 480px) {
  .cta-buttons {
    flex-direction: column;
  }
  
  .cta-buttons .btn {
    width: 100%;
  }
}

/* ==================================================
   LEAD MAGNET STYLES
   ================================================== */

/* Lead Magnet Hero Section */
.lead-magnet-hero {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
  color: white;
  padding: 3rem 2rem;
  margin: 0 0 3rem 0;
  border-radius: var(--border-radius-lg);
}

.lead-magnet-content h2 {
  color: white;
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  text-align: center;
}

.lead-subtitle {
  text-align: center;
  font-size: 1.3rem;
  margin-bottom: 2rem;
  color: rgba(255, 255, 255, 0.95);
}

.checklist-benefits {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.benefit-card {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  padding: 1.5rem;
  border-radius: var(--border-radius);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.benefit-card h3 {
  color: white;
  font-size: 1.3rem;
  margin-bottom: 1rem;
}

.benefit-card ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.benefit-card li {
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.benefit-card li:last-child {
  border-bottom: none;
}

/* Lead Magnet Form Section */
.lead-magnet-form-section {
  background: var(--card-bg);
  padding: 3rem 2rem;
  margin: 3rem 0;
  border-radius: var(--border-radius-lg);
  box-shadow: 0 4px 6px var(--card-shadow);
}

.form-container {
  max-width: 600px;
  margin: 0 auto;
}

.form-container h2 {
  text-align: center;
  color: var(--primary-color);
  margin-bottom: 1rem;
}

.form-intro {
  text-align: center;
  font-size: 1.1rem;
  margin-bottom: 2rem;
  color: var(--text-secondary);
}

.lead-capture-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group label {
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-color);
}

.required {
  color: var(--danger-color);
  font-weight: bold;
}

.form-group input[type="email"],
.form-group input[type="text"],
.form-group select {
  padding: 0.75rem;
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius);
  font-size: 1rem;
  font-family: var(--font-main);
  transition: border-color 0.3s ease;
  /* Remove default browser styling for consistent cross-browser appearance
   * Necessary for Safari/WebKit (rounded corners, shadows on iOS) and
   * Firefox (dropdown arrows, focus rings). Improves visual consistency
   * while maintaining accessibility through explicit border/focus styles. */
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

.form-group input[type="email"]:focus-visible,
.form-group input[type="text"]:focus-visible,
.form-group select:focus-visible {
  outline: 3px solid var(--primary-color);
  outline-offset: 2px;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 4px rgba(0, 102, 51, 0.15);
}

.checkbox-group {
  flex-direction: row;
}

.checkbox-group label {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-weight: 400;
  cursor: pointer;
}

.checkbox-group input[type="checkbox"] {
  margin-top: 0.25rem;
  width: 1.2rem;
  height: 1.2rem;
  cursor: pointer;
}

.cta-button {
  background: var(--primary-color);
  color: white;
  padding: 1rem 2rem;
  font-size: 1.2rem;
  font-weight: 600;
  border: none;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.cta-button:hover {
  background: var(--primary-light);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 102, 51, 0.3);
}

.cta-button:active {
  transform: translateY(0);
}

.button-icon {
  font-size: 1.5rem;
}

/* CTA Container with Generous Whitespace */
.cta-container {
  margin: var(--spacing-3xl) 0;
  padding: var(--spacing-2xl);
  text-align: center;
  background-color: var(--card-bg);
  border-radius: var(--border-radius-lg);
  border: 2px solid var(--primary-color);
  box-shadow: 0 2px 8px var(--card-shadow);
}

.cta-container h2,
.cta-container h3 {
  margin-top: 0;
  margin-bottom: var(--spacing-lg);
}

.cta-container p {
  margin-bottom: var(--spacing-xl);
  font-size: var(--font-size-lg);
}

@media (prefers-color-scheme: dark) {
  .cta-container {
    border-color: var(--primary-light);
    background: rgba(0, 28, 37, 0.5);
    box-shadow: 0 0 20px rgba(0, 204, 102, 0.2);
  }
}

.privacy-notice {
  margin-top: 2rem;
  padding: 1.5rem;
  background: var(--badge-bg);
  border-radius: var(--border-radius);
  border-left: 4px solid var(--success-color);
}

.privacy-notice p {
  margin: 0.5rem 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.privacy-notice strong {
  color: var(--text-color);
}

.privacy-notice a {
  color: var(--link-color);
  text-decoration: underline;
}

.gdpr-notice {
  font-size: 0.85rem !important;
  font-style: italic;
  text-align: center;
  color: var(--success-color) !important;
}

/* Checklist Preview Section */
.checklist-preview {
  padding: 3rem 2rem;
}

.checklist-preview h2 {
  text-align: center;
  color: var(--primary-color);
  margin-bottom: 2rem;
}

.preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  max-width: 100%;
  margin: 0 auto;
}

.preview-item {
  background: var(--card-bg);
  padding: 1.5rem;
  border-radius: var(--border-radius);
  border: 2px solid var(--border-color);
  transition: all 0.3s ease;
}

.preview-item:hover {
  border-color: var(--primary-color);
  box-shadow: 0 4px 12px var(--card-shadow);
  transform: translateY(-4px);
}

.preview-item h3 {
  color: var(--primary-color);
  margin-bottom: 0.75rem;
  font-size: 1.2rem;
}

.preview-item p {
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Social Proof Section */
.social-proof {
  background: var(--bg-color);
  padding: 3rem 2rem;
  margin: 3rem 0;
  border-radius: var(--border-radius-lg);
}

.social-proof h2 {
  text-align: center;
  color: var(--primary-color);
  margin-bottom: 2rem;
}

.credentials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  max-width: 100%;
  margin: 0 auto;
}

.credential-card {
  background: var(--card-bg);
  padding: 1.5rem;
  border-radius: var(--border-radius);
  border-left: 4px solid var(--primary-color);
}

.credential-card h3 {
  color: var(--primary-color);
  margin-bottom: 1rem;
}

.credential-card ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.credential-card li {
  padding: 0.5rem 0;
  color: var(--text-secondary);
  position: relative;
  padding-left: 1.5rem;
}

.credential-card li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--success-color);
  font-weight: bold;
}

/* CTA Section */
.cta-section {
  text-align: center;
  padding: 3rem 2rem;
  background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
  color: white;
  border-radius: var(--border-radius-lg);
  margin: 3rem 0;
}

.cta-section h2 {
  color: white;
  margin-bottom: 1rem;
}

.cta-section p {
  font-size: 1.2rem;
  margin-bottom: 2rem;
  color: rgba(255, 255, 255, 0.95);
}

.cta-button-large {
  display: inline-block;
  background: white;
  color: var(--primary-color);
  padding: 1.25rem 3rem;
  font-size: 1.3rem;
  font-weight: 700;
  border-radius: var(--border-radius);
  text-decoration: none;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.cta-button-large:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
  background: rgba(255, 255, 255, 0.95);
}

/* Primary colored CTA button variant */
.cta-button-large-primary {
  display: inline-block;
  background: var(--primary-color);
  color: white;
  padding: 1rem 2rem;
  font-size: 1.1rem;
  font-weight: 600;
  border-radius: var(--border-radius);
  text-decoration: none;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 119, 68, 0.3);
}

.cta-button-large-primary:hover {
  background: var(--primary-light);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 119, 68, 0.4);
  text-decoration: none;
}

/* Blog Post CTA Section - Compact version for blog content */
.blog-cta {
  text-align: center;
  padding: 2rem;
  background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
  color: white;
  border-radius: var(--border-radius-lg);
  margin: 2rem 0;
}

.blog-cta h2 {
  color: white;
  margin-bottom: 1rem;
  font-size: 1.5rem;
}

.blog-cta p {
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
  color: rgba(255, 255, 255, 0.95);
}

.blog-cta strong {
  display: block;
  margin-bottom: 1.5rem;
}

.blog-cta-button {
  display: inline-block;
  background: white;
  color: var(--primary-color);
  padding: 1rem 2rem;
  font-size: 1.1rem;
  font-weight: 700;
  border-radius: var(--border-radius);
  text-decoration: none;
  transition: all 0.3s ease;
}

.blog-cta-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  background: rgba(255, 255, 255, 0.95);
}

/* Additional Resources Section */
.additional-resources {
  padding: 3rem 2rem;
}

.additional-resources h2 {
  text-align: center;
  color: var(--primary-color);
  margin-bottom: 2rem;
}

.resource-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  max-width: 100%;
  margin: 0 auto;
}

.resource-card {
  background: var(--card-bg);
  padding: 1.5rem;
  border-radius: var(--border-radius);
  border: 2px solid var(--border-color);
  transition: all 0.3s ease;
}

.resource-card:hover {
  border-color: var(--primary-color);
  box-shadow: 0 4px 12px var(--card-shadow);
}

.resource-card h3 {
  margin-bottom: 0.75rem;
}

.resource-card h3 a {
  color: var(--primary-color);
  text-decoration: none;
}

.resource-card h3 a:hover {
  text-decoration: underline;
}

.resource-card p {
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Responsive adjustments for lead magnet */
@media (max-width: 768px) {
  .lead-magnet-content h2 {
    font-size: 2rem;
  }
  
  .lead-subtitle {
    font-size: 1.1rem;
  }
  
  .checklist-benefits {
    grid-template-columns: 1fr;
  }
  
  .cta-section p {
    font-size: 1rem;
  }
  
  .cta-button-large {
    padding: 1rem 2rem;
    font-size: 1.1rem;
  }
}

@media (max-width: 480px) {
  .lead-magnet-hero {
    padding: 2rem 1rem;
  }
  
  .lead-magnet-form-section {
    padding: 2rem 1rem;
  }
  
  .form-container {
    padding: 0;
  }
}

/* Dark mode adjustments for lead magnet */
@media (prefers-color-scheme: dark) {
  .benefit-card {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.15);
  }
  
  .privacy-notice {
    background: rgba(255, 255, 255, 0.05);
  }
  
  .form-group input[type="email"],
  .form-group input[type="text"],
  .form-group select {
    background: var(--card-bg);
    color: var(--text-color);
    border-color: var(--border-color);
  }
}

/* ==================================================
   HERO SECTION OPTIMIZATIONS
   ================================================== */

/* Details/Summary for collapsible content */
.header-intro-details,
.badge-section {
  margin-top: 2rem;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.header-intro-details summary,
.badge-section summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--primary-color);
  padding: 0.75rem 1rem;
  border: 1px solid var(--primary-color);
  border-radius: var(--border-radius);
  display: inline-block;
  transition: all 0.3s ease;
  user-select: none;
  background: transparent;
  min-width: 48px;
  min-height: 48px;
}

.header-intro-details summary:hover,
.badge-section summary:hover {
  background: var(--primary-color);
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 102, 51, 0.2);
}

.header-intro-details summary:focus-visible,
.badge-section summary:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

.header-intro-details[open] summary,
.badge-section[open] summary {
  margin-bottom: 1rem;
}

@media (prefers-color-scheme: dark) {
  .header-intro-details summary,
  .badge-section summary {
    color: var(--primary-light);
    border-color: var(--primary-light);
  }
  
  .header-intro-details summary:hover,
  .badge-section summary:hover {
    background: rgba(0, 204, 102, 0.2);
    color: var(--primary-light);
    box-shadow: 0 0 12px rgba(0, 204, 102, 0.3);
  }
}

/* Hero CTA buttons 
 * Note: These styles are intentionally duplicated inline in index*.html files
 * and in this external CSS for critical rendering path optimization (FCP < 1.5s).
 * Both the inline and external CSS now provide fully synchronized button base styles,
 * including min-height, min-width, and line-height for WCAG 2.1 AA compliance (48×48px
 * touch targets) and consistent spacing during the entire page load cycle.
 */
.hero-tagline {
  font-size: 1.25rem;
  line-height: 1.6;
  color: var(--text-color);
  margin: var(--spacing-lg) auto;
  max-width: 800px;
  font-weight: 500;
}

.hero-subtitle {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-secondary);
  margin: var(--spacing-md) auto var(--spacing-xl);
  max-width: 700px;
}

.hero-cta {
  display: -webkit-box; /* Old Safari */
  display: -webkit-flex; /* Safari 8 */
  display: -ms-flexbox; /* IE 10 */
  display: flex;
  gap: var(--spacing-md);
  -webkit-flex-wrap: wrap;
  -ms-flex-wrap: wrap;
  flex-wrap: wrap;
  -webkit-box-pack: center;
  -webkit-justify-content: center;
  -ms-flex-pack: center;
  justify-content: center;
  margin: var(--spacing-xl) 0;
  /* Reserve space for CTA buttons to reduce Cumulative Layout Shift (CLS) */
  min-height: 56px;
}

.btn-primary-large,
.btn-secondary {
  display: inline-block;
  padding: 1rem 2rem;
  border-radius: var(--border-radius);
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  min-height: 48px;
  min-width: 48px;
  line-height: 1.5;
}

.btn-primary-large {
  background: var(--button-bg);
  color: var(--button-text);
  box-shadow: 0 4px 12px rgba(0, 119, 68, 0.3);
  border: 1px solid transparent;
}

.btn-primary-large:hover {
  background: var(--primary-color);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 119, 68, 0.4);
  text-decoration: none;
}

.btn-primary-large:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

.btn-secondary {
  background: transparent;
  color: var(--primary-color);
  border: 2px solid var(--primary-color);
}

.btn-secondary:hover {
  background: var(--primary-color);
  color: white;
  transform: translateY(-2px);
  text-decoration: none;
}

.btn-secondary:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

@media (prefers-color-scheme: dark) {
  .btn-primary-large {
    background: linear-gradient(135deg, rgba(0, 204, 102, 0.3), rgba(0, 136, 68, 0.5));
    border: 1px solid var(--primary-light);
    color: var(--primary-light);
  }
  
  .btn-primary-large:hover {
    background: linear-gradient(135deg, rgba(0, 204, 102, 0.5), rgba(0, 136, 68, 0.7));
    box-shadow: 0 0 20px rgba(0, 204, 102, 0.4);
  }
  
  .btn-secondary {
    border-color: var(--primary-light);
    color: var(--primary-light);
  }
  
  .btn-secondary:hover {
    background: rgba(0, 204, 102, 0.2);
    color: var(--primary-light);
  }
}

/* Mobile optimizations */
@media (max-width: 768px) {
  .hero-tagline {
    font-size: 1.1rem;
  }
  
  .hero-subtitle {
    font-size: 1rem;
  }
  
  .btn-primary-large,
  .btn-secondary {
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
    width: 100%;
    max-width: 300px;
  }
  
  .hero-cta {
    flex-direction: column;
    align-items: center;
  }
}

/* Badge Showcase Collapsible Grid Pattern */
.badge-showcase {
  margin: 2rem 0;
  padding: 1.5rem;
  border: 2px solid var(--primary-color);
  border-radius: var(--border-radius);
  background: var(--card-bg);
  box-shadow: 0 2px 8px var(--card-shadow);
}

.badge-showcase summary {
  cursor: pointer;
  list-style: none;
  padding: 0.5rem;
  user-select: none;
  min-height: 48px;
  min-width: 48px;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.5rem 1rem;
  position: relative;
  padding-right: 2.5rem;
}

.badge-showcase summary::-webkit-details-marker {
  display: none;
}

.badge-showcase summary h2,
.badge-showcase summary h3,
.badge-showcase summary h4 {
  flex: 0 0 100%;
  margin: 0;
  color: var(--primary-color);
}

.badge-showcase summary h2 {
  font-size: 1.25rem;
}

.badge-showcase summary h3 {
  font-size: 1.25rem;
}

.badge-showcase summary h4 {
  font-size: 1.1rem;
}

.badge-showcase summary .summary-description {
  display: block;
  flex: 0 0 100%;
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.badge-showcase summary::after {
  content: '▼';
  font-size: 0.8rem;
  transition: transform 0.3s ease;
  color: var(--primary-color);
  position: absolute;
  right: 0.5rem;
  top: 0.5rem;
}

.badge-showcase[open] summary::after {
  transform: rotate(180deg);
}

.badge-showcase summary:hover {
  background: rgba(0, 102, 51, 0.05);
  border-radius: var(--border-radius-sm);
}

.badge-showcase summary:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
  border-radius: var(--border-radius-sm);
}

.badge-grid {
  /* Flexbox fallback for older browsers */
  display: -webkit-box;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  -webkit-flex-wrap: wrap;
  -ms-flex-wrap: wrap;
  flex-wrap: wrap;
  gap: 2rem;
  margin-top: 1.5rem;
}

.badge-grid > * {
  -webkit-box-flex: 1;
  -webkit-flex: 1 1 280px;
  -ms-flex: 1 1 280px;
  flex: 1 1 280px;
  min-width: 280px;
}

/* Grid layout for modern browsers */
@supports (display: grid) {
  .badge-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  }
  
  .badge-grid > * {
    -webkit-box-flex: 0;
    -webkit-flex: none;
    -ms-flex: none;
    flex: none;
    min-width: 0;
  }
}

.badge-grid--compact {
  gap: 1rem;
  margin-top: 1rem;
}

@supports (display: grid) {
  .badge-grid--compact {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }
  
  .badge-grid--compact > * {
    min-width: 200px;
  }
}

.badge-category {
  padding: 1rem;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  background: var(--bg-color);
}

.badge-category h4,
.badge-category h5 {
  margin-top: 0;
  margin-bottom: 0.75rem;
  color: var(--primary-color);
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 0.5rem;
  font-size: 1rem;
}

.badge-category .badges {
  display: -webkit-box;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
  -webkit-flex-direction: column;
  -ms-flex-direction: column;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1rem;
  -webkit-box-pack: start;
  -webkit-justify-content: flex-start;
  -ms-flex-pack: start;
  justify-content: flex-start;
}

.badge-category .badges a {
  align-self: flex-start;
}

.badge-category .badges img {
  align-self: flex-start;
  max-width: 100%;
  height: auto;
}

/* Key badges - visible above the fold */
.key-badges {
  display: -webkit-box;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  -webkit-flex-wrap: wrap;
  -ms-flex-wrap: wrap;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1.5rem 0;
  -webkit-box-pack: center;
  -webkit-justify-content: center;
  -ms-flex-pack: center;
  justify-content: center;
  -webkit-box-align: center;
  -webkit-align-items: center;
  -ms-flex-align: center;
  align-items: center;
}

.key-badges--start {
  -webkit-box-pack: start;
  -webkit-justify-content: flex-start;
  -ms-flex-pack: start;
  justify-content: flex-start;
  margin: 1rem 0;
}

.key-badges img {
  height: auto;
  max-width: 100%;
}

.badge-showcase--nested {
  margin-top: 0.5rem;
}

/* Mobile responsive */
@media (max-width: 768px) {
  .badge-grid {
    grid-template-columns: 1fr;
  }
  
  .badge-showcase {
    padding: 1rem;
  }
  
  .badge-showcase summary h2,
  .badge-showcase summary h3 {
    font-size: 1.1rem;
  }
  
  .key-badges {
    flex-direction: column;
    align-items: center;
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  .badge-showcase {
    border-color: var(--primary-light);
    background: var(--card-bg);
  }
  
  .badge-showcase summary h2,
  .badge-showcase summary h3,
  .badge-showcase summary h4 {
    color: var(--primary-light);
  }
  
  .badge-showcase summary .summary-description {
    color: var(--text-secondary);
  }
  
  .badge-showcase summary::after {
    color: var(--primary-light);
  }
  
  .badge-showcase summary:hover {
    background: rgba(0, 204, 102, 0.1);
  }
  
  .badge-category {
    background: var(--bg-color);
    border-color: var(--border-color);
  }
  
  .badge-category h4,
  .badge-category h5 {
    color: var(--primary-light);
  }
}

/* ==================================================
   COMPREHENSIVE MOBILE RESPONSIVENESS OPTIMIZATIONS
   Optimized for touch targets, typography, and layout
   Target: WCAG 2.1 AAA (44×44px touch targets)
   ================================================== */

/* Mobile Base Styles (320px-768px) */
@media (max-width: 768px) {
  /* Ensure body prevents horizontal scroll */
  body {
    overflow-x: hidden;
    padding: var(--spacing-sm) var(--spacing-sm);
  }
  
  /* Header and main horizontal padding for mobile */
  header,
  main {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }
  
  /* Ensure media elements respect container width */
  img,
  video,
  iframe,
  table {
    max-width: 100%;
  }
  
  /* Typography - Optimized for mobile readability */
  h1 {
    font-size: 2rem; /* Down from 2.5rem */
    line-height: 1.2;
    margin-bottom: var(--spacing-md);
  }
  
  h2 {
    font-size: 1.5rem; /* Down from 2rem */
    line-height: 1.3;
    margin-top: var(--spacing-xl);
    margin-bottom: var(--spacing-md);
  }
  
  h3 {
    font-size: 1.25rem; /* Down from 1.5rem */
    line-height: 1.4;
    margin-bottom: var(--spacing-sm);
  }
  
  h4 {
    font-size: 1.1rem;
    margin-bottom: var(--spacing-sm);
  }
  
  p {
    font-size: 1rem; /* 16px minimum - prevents zoom on iOS */
    margin-bottom: 1.25rem;
    line-height: 1.6;
  }
  
  /* Touch Targets - Minimum 44×44px (WCAG 2.1 AAA) */
  /* Apply to specific interactive elements to avoid disrupting inline text links */
  .btn a,
  .card a,
  .app-link a,
  .hero-cta a,
  nav a:not(.nav-logo):not(.breadcrumb-item a) {
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  
  button {
    min-height: 44px;
    min-width: 44px;
    padding: 12px 16px;
  }
  
  /* Enhanced button spacing for touch */
  .btn,
  .cta-button {
    font-size: 1rem; /* Never below 16px */
    padding: 14px 24px; /* Larger touch target */
    margin: 8px 0; /* Prevent accidental taps */
    min-height: 48px;
    min-width: 48px;
  }
  
  /* Card optimizations */
  .card {
    padding: 1.5rem;
    margin-bottom: var(--spacing-md);
  }

  .card a {
    padding: 0.75rem 1rem;
    min-height: 48px;
    margin-top: var(--spacing-md);
  }
  
  /* Cards grid - single column */
  .cards {
    grid-template-columns: 1fr;
  }

  /* Business lines - single column */
  .business-lines {
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
    padding-left: var(--spacing-md);
    padding-right: var(--spacing-md);
  }

  .business-line {
    padding: var(--spacing-md);
  }
  
  /* App version display */
  .app-version {
    display: block;
    margin-top: 0.5rem;
  }
  
  /* Section padding reduction for mobile */
  section {
    padding: 2rem 1rem; /* Reduced from larger desktop padding */
  }
  
  header {
    padding: var(--spacing-xl) var(--spacing-md);
  }
  
  /* Images - Prevent overflow */
  img {
    height: auto;
    max-width: 100%;
    display: block;
  }
  
  /* Badge responsive stacking */
  .badges {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
  
  .badges img {
    max-width: 100%;
    height: auto;
  }
  
  /* FAQ Mobile - Enhanced touch targets */
  .faq-item summary,
  details summary {
    font-size: 1rem;
    padding: 1rem;
    min-height: 44px;
  }
  
  /* Table Responsive - Horizontal scroll */
  table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* App links - Better touch spacing */
  .app-link {
    gap: var(--spacing-md);
  }
  
  .app-link a {
    padding: 1rem 1.5rem;
    min-height: 48px;
  }
  
  /* Hero section optimizations */
  .hero-tagline {
    font-size: 1.1rem;
    padding: 0 var(--spacing-sm);
  }
  
  .hero-subtitle {
    font-size: 1rem;
    padding: 0 var(--spacing-sm);
  }
  
  /* Breadcrumb touch targets */
  .breadcrumb-item a {
    padding: 0.5rem 0.75rem;
    min-height: 44px;
  }
  
  /* Navigation toggle - Ensure proper size */
  .nav-toggle {
    min-height: 44px;
    min-width: 44px;
    padding: 12px;
  }
  
  /* Details/summary elements - Enhanced touch */
  details {
    margin-bottom: var(--spacing-md);
  }
  
  details summary {
    padding: 1rem;
    min-height: 48px;
  }
  
  /* Lists - Better spacing */
  ul,
  ol {
    padding-left: 1.5rem;
  }
  
  li {
    margin-bottom: 0.5rem;
  }
}

/* Small Mobile Devices (320px-480px) */
@media (max-width: 480px) {
  /* Further typography reduction */
  h1 {
    font-size: 1.75rem;
    line-height: 1.2;
  }
  
  h2 {
    font-size: 1.35rem;
    line-height: 1.3;
  }
  
  h3 {
    font-size: 1.15rem;
  }
  
  .hero-tagline {
    font-size: 1.05rem;
  }
  
  .hero-subtitle {
    font-size: 1rem;
  }
  
  /* Reduce spacing further on very small screens */
  section {
    padding: 1.5rem 0.75rem;
  }
  
  header {
    padding: var(--spacing-lg) var(--spacing-sm);
  }
  
  main {
    padding-left: var(--spacing-sm);
    padding-right: var(--spacing-sm);
  }
  
  .card {
    padding: 1.25rem;
  }
  
  /* Buttons remain touch-friendly but can be full width */
  .btn,
  .btn-primary-large,
  .btn-secondary {
    width: 100%;
    text-align: center;
    justify-content: center;
  }
  
  /* Stack everything on very small screens */
  .hero-cta {
    width: 100%;
  }
  
  /* Logo size reduction */
  .logo {
    width: 64px;
    height: 64px;
  }
  
  /* Center badges on very small screens for better visual balance */
  .badges {
    align-items: center; /* Override flex-start from 768px for centered appearance */
  }
  
  /* App links full width */
  .app-link {
    flex-direction: column;
    align-items: center;
  }

  .app-link a {
    width: 100%;
    text-align: center;
  }
}

/* Tablet Landscape Optimization (768px-1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
  /* Optimize for tablet landscape */
  .cards {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-lg);
  }
  
  .badge-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Ensure touch targets on mobile touch devices only (combined with viewport width) */
@media (max-width: 768px) and (hover: none) and (pointer: coarse) {
  /* This targets mobile touch devices specifically, avoiding large touch screens */
  button,
  summary,
  .btn {
    min-height: 48px;
    min-width: 48px;
    padding: 12px 16px;
  }
  
  /* Add spacing between interactive elements */
  button + button {
    margin-left: 8px;
  }
}

/* ==================================================
   SITEMAP PAGE STYLES
   ================================================== */

/* Sitemap Grid Layout - with Flexbox fallback */
.sitemap-grid {
  /* Flexbox fallback for older browsers */
  display: -webkit-box;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  -webkit-flex-wrap: wrap;
  -ms-flex-wrap: wrap;
  flex-wrap: wrap;
  gap: 2rem;
  margin: 2rem 0;
}

.sitemap-grid > * {
  -webkit-box-flex: 1;
  -webkit-flex: 1 1 280px;
  -ms-flex: 1 1 280px;
  flex: 1 1 280px;
  min-width: 280px;
}

/* Grid layout for modern browsers */
@supports (display: grid) {
  .sitemap-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  }
  
  .sitemap-grid > * {
    -webkit-box-flex: 0;
    -webkit-flex: none;
    -ms-flex: none;
    flex: none;
    min-width: 0;
  }
}

/* Sitemap Section Cards */
.sitemap-section {
  padding: 1.5rem;
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  box-shadow: 0 2px 4px var(--card-shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.sitemap-section:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px var(--card-shadow);
}

/* Sitemap Section Headers */
.sitemap-section h2 {
  margin-top: 0;
  margin-bottom: 1rem;
  color: var(--primary-color);
  font-size: 1.25rem;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 0.5rem;
}

/* Section Descriptions - Provides context about sitemap content categories */
.sitemap-section .section-description {
  margin: 0 0 1rem 0;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.6;
  font-style: italic;
}

/* Sitemap Lists */
.sitemap-section ul {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

/* Nested Lists */
.sitemap-section ul ul {
  padding-left: 1.5rem;
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
  border-left: 2px solid var(--border-color);
}

/* List Items */
.sitemap-section li {
  margin: 0.5rem 0;
  line-height: 1.6;
}

/* Link Descriptions */
.sitemap-section .link-description {
  display: block;
  color: var(--text-secondary);
  font-size: 0.875rem;
  line-height: 1.5;
  margin-top: 0.25rem;
  margin-left: 0;
  padding-left: 0;
}

/* Strong Tags for Section Titles */
.sitemap-section strong {
  color: var(--text-color);
  font-weight: 600;
}

/* Links */
.sitemap-section a {
  color: var(--link-color);
  text-decoration: none;
  transition: color 0.2s ease, text-decoration 0.2s ease;
  display: inline-block;
}

.sitemap-section a:hover {
  text-decoration: underline;
  color: var(--link-hover);
}

.sitemap-section a:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Responsive Sitemap Grid */
@media (max-width: 768px) {
  .sitemap-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .sitemap-section {
    padding: 1.25rem;
  }
  
  .sitemap-section ul ul {
    padding-left: 1rem;
  }
}

@media (min-width: 1200px) {
  .sitemap-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Site Statistics Section */
.site-statistics {
  margin-top: 2rem;
  padding: 1.5rem;
  background-color: var(--card-bg);
  border-radius: var(--border-radius-lg);
  border: 1px solid var(--border-color);
}

.site-statistics h2 {
  margin-top: 0;
  color: var(--primary-color);
}

.site-statistics ul {
  list-style: none;
  padding-left: 0;
}

.site-statistics li {
  margin: 0.5rem 0;
}

/* ==================================================
   CONTACT FORM STYLES
   ================================================== */

/* Contact Section */
.contact-section {
  margin: var(--spacing-4xl) 0;
  padding: var(--spacing-2xl);
  background-color: var(--card-bg);
  border-radius: var(--border-radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: 0 2px 4px var(--card-shadow);
}

.contact-section h2 {
  color: var(--primary-color);
  margin-top: 0;
  margin-bottom: var(--spacing-md);
  font-size: var(--h2-size);
}

.contact-section > p {
  color: var(--text-secondary);
  margin-bottom: var(--spacing-xl);
  max-width: 700px;
}

/* Contact Form */
.contact-form {
  max-width: 700px;
  margin: 0 auto;
}

/* Form Group */
.form-group {
  margin-bottom: var(--spacing-lg);
}

/* Form Labels */
.contact-form label {
  display: block;
  font-weight: 600;
  margin-bottom: var(--spacing-sm);
  color: var(--text-color);
  font-size: var(--font-size-base);
}

/* Required and Optional Indicators */
.required-indicator {
  color: var(--danger-color);
  font-weight: 700;
  margin-left: 0.125rem;
}

.optional-indicator {
  color: var(--text-secondary);
  font-weight: 400;
  font-size: var(--font-size-sm);
  margin-left: 0.25rem;
}

/* Form Inputs - Cross-browser compatibility with vendor prefixes */
.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form input[type="tel"],
.contact-form textarea {
  width: 100%;
  min-height: 44px; /* WCAG 2.1 AA touch target size */
  padding: var(--spacing-md);
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius);
  font-size: var(--font-size-base);
  font-family: var(--font-main);
  color: var(--text-color);
  background-color: var(--card-bg);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  line-height: var(--line-height-normal);
  /* Remove default browser styling for consistent cross-browser appearance
   * Necessary for Safari/WebKit (rounded corners, shadows on iOS) and
   * Firefox (dropdown arrows, focus rings). Improves visual consistency
   * while maintaining accessibility through explicit border/focus styles. */
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

.contact-form textarea {
  resize: vertical;
  min-height: 150px;
}

/* Input Placeholder */
.contact-form input::placeholder,
.contact-form textarea::placeholder {
  color: var(--text-secondary);
  opacity: 0.7;
}

/* Input Focus State - Visible Focus Indicator */
.contact-form input:focus,
.contact-form textarea:focus {
  outline: 3px solid var(--primary-color);
  outline-offset: 2px;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(0, 102, 51, 0.1);
}

/* Input Hover State */
.contact-form input:hover:not(:focus),
.contact-form textarea:hover:not(:focus) {
  border-color: var(--primary-light);
}

/* Input Invalid State (only show when user has interacted) */
.contact-form input:invalid:not(:placeholder-shown):not(:focus),
.contact-form textarea:invalid:not(:placeholder-shown):not(:focus) {
  border-color: var(--danger-color);
  background-color: rgba(220, 53, 69, 0.05);
}

/* Error Message */
.error-message {
  display: none;
  color: var(--danger-color);
  font-size: var(--font-size-sm);
  margin-top: var(--spacing-sm);
  font-weight: 500;
}

.error-message:not(:empty) {
  display: block;
}

/* Field Help Text */
.field-help {
  display: block;
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
  margin-top: var(--spacing-sm);
  font-style: italic;
}

/* Form Actions */
.form-actions {
  margin-top: var(--spacing-xl);
  text-align: center;
}

.form-actions .btn-primary-large {
  min-width: 200px;
  padding: var(--spacing-md) var(--spacing-xl);
}

.form-privacy-note {
  margin-top: var(--spacing-md);
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

.form-privacy-note a {
  color: var(--link-color);
  text-decoration: underline;
}

.form-privacy-note a:hover {
  color: var(--link-hover);
}

/* Success Message */
.success-message {
  margin-top: var(--spacing-lg);
  padding: var(--spacing-lg);
  background-color: rgba(0, 136, 56, 0.1);
  border: 2px solid var(--success-color);
  border-radius: var(--border-radius);
  color: var(--text-color);
  text-align: center;
}

.success-message strong {
  color: var(--success-color);
  display: block;
  margin-bottom: var(--spacing-sm);
  font-size: var(--font-size-lg);
}

.success-message p {
  margin: 0;
  color: var(--text-secondary);
}

/* Error Message Box */
.error-message-box {
  margin-top: var(--spacing-lg);
  padding: var(--spacing-lg);
  background-color: rgba(220, 53, 69, 0.1);
  border: 2px solid var(--danger-color);
  border-radius: var(--border-radius);
  color: var(--text-color);
  text-align: center;
}

.error-message-box strong {
  color: var(--danger-color);
  display: block;
  margin-bottom: var(--spacing-sm);
  font-size: var(--font-size-lg);
}

.error-message-box p {
  margin: 0;
  color: var(--text-secondary);
}

.error-message-box a {
  color: var(--link-color);
  text-decoration: underline;
}

.error-message-box a:hover {
  color: var(--link-hover);
}

/* Alternative Contact Methods */
.contact-alternatives {
  margin-top: var(--spacing-3xl);
  padding-top: var(--spacing-2xl);
  border-top: 1px solid var(--section-border);
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

.contact-alternatives h3 {
  color: var(--primary-color);
  margin-bottom: var(--spacing-lg);
  font-size: var(--h3-size);
}

.contact-alternatives ul {
  list-style: none;
  padding-left: 0;
}

.contact-alternatives li {
  margin-bottom: var(--spacing-md);
  font-size: var(--font-size-base);
}

.contact-alternatives strong {
  color: var(--text-color);
  display: inline-block;
  min-width: 100px;
}

.contact-alternatives a {
  color: var(--link-color);
  text-decoration: none;
  transition: color 0.3s ease;
}

.contact-alternatives a:hover {
  color: var(--link-hover);
  text-decoration: underline;
}

.contact-alternatives a:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Responsive Design */
@media (max-width: 768px) {
  .contact-section {
    padding: var(--spacing-lg);
    margin: var(--spacing-2xl) 0;
  }
  
  .form-group {
    margin-bottom: var(--spacing-md);
  }
  
  .contact-form input[type="text"],
  .contact-form input[type="email"],
  .contact-form input[type="tel"],
  .contact-form textarea {
    font-size: 16px; /* Prevent zoom on iOS */
  }
  
  .form-actions .btn-primary-large {
    width: 100%;
  }
  
  .contact-alternatives strong {
    display: block;
    margin-bottom: var(--spacing-xs);
  }
}

/* Dark Mode Adjustments */
@media (prefers-color-scheme: dark) {
  .contact-form input:invalid:not(:placeholder-shown):not(:focus),
  .contact-form textarea:invalid:not(:placeholder-shown):not(:focus) {
    background-color: rgba(220, 53, 69, 0.1);
  }
  
  .success-message {
    background-color: rgba(80, 250, 123, 0.1);
  }
}

/* ========================================================================
   UTILITY CLASSES - Extracted from Inline Styles
   ======================================================================== */

/* Margin Utilities */
.mb-0 {
  margin-bottom: 0;
}

.mb-05 {
  margin-bottom: 0.5rem;
}

.mb-1 {
  margin-bottom: 1rem;
}

.mb-15 {
  margin-bottom: 1.5rem;
}

.mt-0 {
  margin-top: 0;
}

.mt-05 {
  margin-top: 0.5rem;
}

.mt-1 {
  margin-top: 1rem;
}

.mt-15 {
  margin-top: 1.5rem;
}

.m-0 {
  margin: 0;
}

.my-1 {
  margin-top: 1rem;
  margin-bottom: 1rem;
}

/* Padding Utilities */
.p-1 {
  padding: 1rem;
}

.p-15 {
  padding: 1.5rem;
}

.p-2 {
  padding: 2rem;
}

.pl-15 {
  padding-left: 1.5rem;
}

/* Display Utilities */
.d-flex {
  display: flex;
}

.d-inline-block {
  display: inline-block;
}

.d-grid {
  display: grid;
}

/* Flexbox Utilities */
.flex-wrap {
  flex-wrap: wrap;
}

.flex-gap-05 {
  gap: 0.5rem;
}

.flex-gap-1 {
  gap: 1rem;
}

.align-items-center {
  align-items: center;
}

/* Grid Utilities */
.grid-auto-fit-250 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
}

/* Text Utilities */
.text-center {
  text-align: center;
}

.text-left {
  text-align: left;
}

.text-primary {
  color: var(--primary-color);
}

.text-link {
  color: var(--link-color);
}

.text-secondary-color {
  color: var(--text-secondary);
}

/* Background Utilities */
.bg-primary-light {
  background: rgba(0, 102, 51, 0.1);
}

.bg-primary-lighter {
  background: rgba(0, 102, 51, 0.05);
}

/* Border Utilities */
.border-radius {
  border-radius: var(--border-radius);
}

.border-radius-lg {
  border-radius: var(--border-radius-lg);
}

/* Image Utilities */
.img-responsive {
  max-width: 100%;
  height: auto;
}

.img-badge {
  height: 20px;
  vertical-align: middle;
}

/* List Utilities */
.list-style-none {
  list-style: none;
  padding: 0;
}

/* Font Size Utilities */
.text-sm {
  font-size: 0.9rem;
}

.text-base {
  font-size: 0.95rem;
}

.text-md {
  font-size: 1.1rem;
}

/* Line Height Utilities */
.line-height-normal {
  line-height: 1.6;
}

.line-height-relaxed {
  line-height: 1.8;
}

/* Combined Pattern Classes */
.service-info-box {
  background: rgba(0, 102, 51, 0.1);
  padding: 1.5rem;
  border-radius: var(--border-radius);
  margin: 1.5rem 0;
}

.evidence-section {
  margin-top: 1rem;
}

.evidence-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.evidence-badges-simple {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.btn-primary-inline {
  display: inline-block;
  background: var(--primary-color);
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: var(--border-radius);
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
  border: 1px solid transparent;
}

.btn-primary-inline:hover {
  background: var(--primary-light);
  transform: translateY(-2px);
}

.btn-secondary-inline {
  display: inline-block;
  background: transparent;
  border: 2px solid var(--primary-color);
  color: var(--primary-color);
  padding: 0.75rem 1.5rem;
  border-radius: var(--border-radius);
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
}

.btn-secondary-inline:hover {
  background: var(--primary-color);
  color: white;
}

.cta-section {
  text-align: center;
  margin: 3rem 0;
  padding: 2rem;
  background: linear-gradient(135deg, rgba(0, 102, 51, 0.05) 0%, rgba(0, 136, 56, 0.05) 100%);
  border-radius: var(--border-radius-lg);
}

.cta-buttons {
  margin-top: 1.5rem;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}

.stats-highlight {
  background: rgba(0, 102, 51, 0.05);
  padding: 2rem;
  border-radius: var(--border-radius);
  margin: 2rem 0;
}

.footer-note {
  margin-top: 1.5rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* Project-specific utility classes */
.project-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.project-logo {
  border-radius: 10px;
}

.project-logo-rounded {
  border-radius: var(--border-radius);
}

.project-title {
  margin: 0;
}

.project-subtitle {
  margin: 0.5rem 0 0;
  font-size: 0.9rem;
}

.project-features-list {
  columns: 2;
  column-gap: 1.5rem;
  font-size: 0.95rem;
}

.project-badges {
  margin: 1rem 0;
  gap: 0.3rem;
}

.project-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}

.btn-trigram {
  background: #ff6b35;
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: var(--border-radius);
  text-decoration: none;
  font-weight: bold;
  transition: all 0.3s ease;
}

.btn-trigram:hover {
  background: #e05a28;
  transform: translateY(-2px);
}

.btn-compliance {
  background: #0366d6;
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: var(--border-radius);
  text-decoration: none;
  font-weight: bold;
  transition: all 0.3s ease;
}

.btn-compliance:hover {
  background: #0256b8;
  transform: translateY(-2px);
}

/* Table utilities */
.table-wrapper {
  overflow-x: auto;
}

.comparison-table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
}

.comparison-table thead tr {
  background: var(--card-bg);
  border-bottom: 2px solid var(--border-color);
}

.comparison-table th {
  padding: 1rem;
  text-align: left;
}

.comparison-table th.text-center {
  text-align: center;
}

.comparison-table tbody tr {
  border-bottom: 1px solid var(--border-color);
}

.comparison-table tbody tr:last-child {
  border-bottom: none;
}

.comparison-table td {
  padding: 1rem;
}

.comparison-table td.text-center {
  text-align: center;
}

/* Korean/Swedish index table styles */
.index-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
}

.index-table-cell {
  width: 50%;
  text-align: center;
  padding: 1rem;
  vertical-align: top;
}

.index-section-img {
  max-width: 320px;
  margin: 0 auto;
}

/* Card border colors */
.card-trigram {
  border: 2px solid #ff6b35;
}

/* Additional flex utilities */
.flex-gap-075 {
  gap: 0.75rem;
}

/* Margin utilities additions */
.my-2 {
  margin-top: 2rem;
  margin-bottom: 2rem;
}

.mt-2 {
  margin-top: 2rem;
}

.mx-0 {
  margin-left: 0;
  margin-right: 0;
}

/* Code block styling */
.code-block {
  background: #1e1e1e;
  color: #d4d4d4;
  padding: 15px;
  border-radius: var(--border-radius);
  overflow-x: auto;
  font-family: var(--font-mono);
}

/* White card variants */
.white-card {
  background: white;
  padding: 2rem;
  border-radius: var(--border-radius-lg);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.white-card-sm {
  background: white;
  padding: 1.5rem;
  border-radius: var(--border-radius);
  margin-bottom: 1rem;
}

/* Text size variants */
.text-base-lg {
  font-size: 1rem;
}

.text-lg-125 {
  font-size: 1.125rem;
}

.text-xl-125 {
  font-size: 1.25rem;
}

/* List utilities */
.list-unstyled {
  list-style: none;
  padding-left: 0;
}

/* Badge utilities */
.badge-error {
  background: #FF0000;
  color: white;
  padding: 0.5rem 1rem;
  border-radius: var(--border-radius); /* Defined in :root at line 83-85 */
  font-weight: bold;
  display: inline-block;
}

.badge-warning-sm {
  background: #FF9900;
  color: white;
  padding: 0.3rem 0.6rem;
  border-radius: var(--border-radius-sm); /* Defined in :root at line 84 */
  font-weight: bold;
  display: inline-block;
  font-size: 0.85rem;
}

/* Spacing variants */
.mb-xl {
  margin-bottom: var(--spacing-xl); /* Defined in :root at line 117 */
}

/* Grid variants */
.grid-auto-fit-300 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

/* Flex variants */
.flex-center {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}

.flex-center-my-2 {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
  margin: 2rem 0;
}

/* Typography variants */
.text-italic {
  font-style: italic;
}

.text-note {
  margin-top: 0.5rem;
  font-style: italic;
  font-size: 0.9rem;
}

/* Generic margin helpers */
.my-0 {
  margin-top: 0;
  margin-bottom: 0;
}

/* ==================================================
   BLOG PAGE SPECIFIC IMPROVEMENTS
   ================================================== */

/* Enhanced spacing for blog sections */
article > section {
  margin-bottom: var(--spacing-4xl); /* Large spacing between major sections */
}

/* Improved introduction section spacing */
#introduction {
  margin-top: var(--spacing-2xl);
  margin-bottom: var(--spacing-3xl);
}

/* Better paragraph spacing within blog content */
article section p {
  margin-bottom: var(--spacing-xl); /* More breathing room between paragraphs */
}

/* Signature and hidden wisdom styling */
.signature {
  font-style: italic;
  color: var(--text-secondary);
  margin-top: var(--spacing-2xl);
  padding-top: var(--spacing-lg);
  border-top: 1px solid var(--border-color);
  font-size: var(--font-size-sm);
}

.hidden-wisdom {
  background: linear-gradient(135deg, rgba(0, 102, 51, 0.05), rgba(0, 102, 51, 0.02));
  border-left: 4px solid var(--primary-color);
  padding: var(--spacing-lg) var(--spacing-xl);
  margin: var(--spacing-2xl) 0;
  border-radius: var(--border-radius);
  font-style: italic;
}

/* Discordian authors footer section */
.discordian-authors,
.discordian-implementation {
  margin-top: var(--spacing-lg);
  padding-top: var(--spacing-md);
  border-top: 1px solid var(--border-color);
  font-size: var(--font-size-sm);
  line-height: 1.6;
}

.discordian-authors strong,
.discordian-implementation strong {
  color: var(--primary-color);
  font-weight: 600;
}

/* Responsive spacing adjustments for mobile */
@media (max-width: 768px) {
  article > section {
    margin-bottom: var(--spacing-2xl);
  }
  
  .panel-caption {
    font-size: var(--h3-size);
    padding: var(--spacing-lg) var(--spacing-md);
  }
  
  .hidden-wisdom {
    padding: var(--spacing-md) var(--spacing-lg);
    margin: var(--spacing-lg) 0;
  }
}

/* Performance optimization: Reduce motion for scanner effects */
@media (prefers-reduced-motion: reduce) {
  .scanner-effect {
    animation: none !important;
    opacity: 0 !important;
  }
  
  .card:hover .scanner-effect {
    opacity: 0 !important;
  }
}

/* Discordian Agents Footer Section (Blog-specific) */
.footer-discordian {
  background: linear-gradient(135deg, rgba(0, 102, 51, 0.05), rgba(0, 102, 51, 0.02));
  border-top: 2px solid var(--border-color);
  border-bottom: 2px solid var(--border-color);
  padding: var(--spacing-xl) var(--spacing-lg);
  margin: var(--spacing-xl) 0;
  text-align: center;
}

.footer-discordian .discordian-authors,
.footer-discordian .discordian-implementation {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
  margin-bottom: var(--spacing-md);
}

.footer-discordian .discordian-implementation {
  margin-bottom: 0;
}

.footer-discordian a {
  color: var(--link-color);
  font-weight: 500;
  transition: color 0.2s ease;
}

.footer-discordian a:hover {
  color: var(--link-hover);
  text-decoration: underline;
}

@media (prefers-color-scheme: dark) {
  .footer-discordian {
    background: linear-gradient(135deg, rgba(0, 204, 102, 0.08), rgba(0, 204, 102, 0.03));
    border-color: rgba(0, 204, 102, 0.2);
  }
}

@media (max-width: 768px) {
  .footer-discordian {
    padding: var(--spacing-lg) var(--spacing-md);
    text-align: left;
  }
}

/* ========================================
   RTL (Right-to-Left) Language Support
   For Arabic and Hebrew languages
   ======================================== */

/* Base RTL Direction */
html[lang="ar"],
html[lang="he"] {
  direction: rtl;
  text-align: right;
}

/* Arabic Font Family */
html[lang="ar"] {
  font-family: 'Noto Sans Arabic', 'Tahoma', 'Arial', sans-serif;
}

/* Hebrew Font Family */
html[lang="he"] {
  font-family: 'Noto Sans Hebrew', 'Arial Hebrew', 'David', 'Arial', sans-serif;
}

/* ========================================
   CJK (Chinese, Japanese, Korean) Font Support
   ======================================== */

/* Japanese Font Family */
html[lang="ja"] {
  font-family: 'Noto Sans JP', 'Hiragino Sans', 'Yu Gothic', 'Meiryo', sans-serif;
}

/* Korean Font Family */
html[lang="ko"] {
  font-family: 'Noto Sans KR', 'Malgun Gothic', 'Apple SD Gothic Neo', sans-serif;
}

/* Chinese (Simplified) Font Family */
html[lang="zh"] {
  font-family: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', 'SimHei', sans-serif;
}

/* RTL Body Adjustments */
[lang="ar"] body,
[lang="he"] body {
  text-align: right;
}

/* RTL Navigation - Reverse flex direction */
[lang="ar"] nav ul,
[lang="he"] nav ul,
[lang="ar"] .nav-menu,
[lang="he"] .nav-menu,
[lang="ar"] .sticky-nav ul,
[lang="he"] .sticky-nav ul {
  flex-direction: row-reverse;
}

/* RTL Navigation Items */
[lang="ar"] nav li,
[lang="he"] nav li {
  text-align: right;
}

/* RTL Footer Alignment */
[lang="ar"] footer,
[lang="he"] footer {
  text-align: right;
  direction: rtl;
}

[lang="ar"] footer p,
[lang="he"] footer p {
  direction: rtl;
  text-align: right;
}

/* RTL Breadcrumb Navigation */
[lang="ar"] .breadcrumb,
[lang="he"] .breadcrumb {
  flex-direction: row-reverse;
}

[lang="ar"] .breadcrumb li::after,
[lang="he"] .breadcrumb li::after {
  content: "←";
  margin: 0 0.5rem 0 0.5rem;
}

[lang="ar"] .breadcrumb li:last-child::after,
[lang="he"] .breadcrumb li:last-child::after {
  content: "";
}

/* RTL Button Groups and CTA */
[lang="ar"] .hero-cta,
[lang="he"] .hero-cta,
[lang="ar"] .app-link,
[lang="he"] .app-link {
  flex-direction: row-reverse;
}

/* RTL Cards and Grid Layouts */
[lang="ar"] .cards,
[lang="he"] .cards {
  direction: rtl;
}

[lang="ar"] .card,
[lang="he"] .card {
  text-align: right;
}

/* RTL Lists */
[lang="ar"] ul,
[lang="he"] ul,
[lang="ar"] ol,
[lang="he"] ol {
  padding-right: 1.5rem;
  padding-left: 0;
}

/* RTL FAQ Items */
[lang="ar"] .faq-item,
[lang="he"] .faq-item {
  text-align: right;
}

/* RTL Tables */
[lang="ar"] table,
[lang="he"] table {
  direction: rtl;
}

[lang="ar"] th,
[lang="he"] th,
[lang="ar"] td,
[lang="he"] td {
  text-align: right;
}

/* RTL Icon Adjustments - Mirror directional icons */
[lang="ar"] .icon-arrow-right::before,
[lang="he"] .icon-arrow-right::before {
  content: "←";
}

[lang="ar"] .icon-arrow-left::before,
[lang="he"] .icon-arrow-left::before {
  content: "→";
}

/* RTL Forms */
[lang="ar"] input,
[lang="he"] input,
[lang="ar"] textarea,
[lang="he"] textarea,
[lang="ar"] select,
[lang="he"] select {
  text-align: right;
  direction: rtl;
}

/* RTL Checkbox and Radio Labels */
[lang="ar"] input[type="checkbox"] + label,
[lang="he"] input[type="checkbox"] + label,
[lang="ar"] input[type="radio"] + label,
[lang="he"] input[type="radio"] + label {
  padding-right: 1.5rem;
  padding-left: 0;
}

/* Preserve LTR for Code and Technical Content */
[lang="ar"] code,
[lang="he"] code,
[lang="ar"] pre,
[lang="he"] pre,
[lang="ar"] .code-block,
[lang="he"] .code-block {
  direction: ltr;
  text-align: left;
  unicode-bidi: embed;
}

/* Preserve LTR for URLs and Email Addresses */
[lang="ar"] a[href^="http"],
[lang="he"] a[href^="http"],
[lang="ar"] a[href^="mailto"],
[lang="he"] a[href^="mailto"] {
  direction: ltr;
  unicode-bidi: embed;
}

/* RTL Mobile Responsive Adjustments */
@media (max-width: 768px) {
  [lang="ar"] .nav-menu,
  [lang="he"] .nav-menu {
    text-align: right;
  }
  
  /* Note: nav-toggle positioning is intentionally not changed for RTL
     as it should remain on the right side in the base layout */
  
  [lang="ar"] .footer-discordian,
  [lang="he"] .footer-discordian {
    text-align: right;
  }
}

/* Code Example Styling for Documentation Pages */
.code-example {
  background: #f6f8fa;
  padding: 1rem;
  border-radius: 8px;
  overflow-x: auto;
  direction: ltr;
  text-align: left;
}

/* Dark mode support for code examples */
@media (prefers-color-scheme: dark) {
  .code-example {
    background: #1a1a1a;
    border: 1px solid #333;
  }
}

/* ==================================================
   RISK ASSESSMENT & ANOMALY DETECTION DASHBOARD
   ================================================== */

/* Dashboard Container */
.dashboard-container {
  position: relative;
  margin: var(--spacing-2xl) 0;
  padding: var(--spacing-xl);
  background: var(--card-bg);
  border-radius: var(--border-radius-lg);
  border: 1px solid var(--card-border);
  box-shadow: 0 4px 6px var(--card-shadow);
}

/* Dashboard Section (alternative wrapper) */
.dashboard-section {
  margin: var(--spacing-2xl) 0;
  padding: var(--spacing-xl);
  background: var(--card-bg);
  border-radius: var(--border-radius-lg);
  border: 1px solid var(--card-border);
  box-shadow: 0 4px 6px var(--card-shadow);
}

/* Status Cards Grid (Pre-Election Dashboard) */
.status-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--spacing-lg);
  margin: var(--spacing-xl) 0;
}

.status-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--border-radius);
  padding: var(--spacing-lg);
  text-align: center;
  box-shadow: 0 2px 4px var(--card-shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.status-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--card-shadow);
}

.status-card h3 {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  margin-bottom: var(--spacing-sm);
  font-weight: 600;
}

.status-card .current-value {
  font-size: var(--font-size-3xl);
  font-weight: 700;
  color: var(--primary-color);
  margin: var(--spacing-sm) 0;
  line-height: var(--line-height-tight);
}

.status-card .baseline-comparison {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  margin: var(--spacing-xs) 0;
}

.status-badge {
  display: inline-block;
  padding: 0.25em 0.75em;
  border-radius: 999px;
  font-size: var(--font-size-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.status-badge.normal {
  background: rgba(0, 136, 56, 0.12);
  color: var(--success-color);
}

.status-badge.improving {
  background: rgba(0, 102, 204, 0.12);
  color: var(--transparency-color);
}

.status-badge.warning {
  background: rgba(179, 90, 0, 0.12);
  color: var(--warning-color);
}

.status-badge.critical {
  background: rgba(220, 53, 69, 0.12);
  color: var(--danger-color);
}

@media (max-width: 767px) {
  .status-cards {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-md);
  }
  
  .status-card .current-value {
    font-size: var(--font-size-2xl);
  }
  
  .dashboard-section {
    padding: var(--spacing-md);
  }
}

.dashboard-description {
  font-size: var(--font-size-lg);
  color: var(--text-secondary);
  margin-bottom: var(--spacing-lg);
  max-width: 80ch;
}

/* Dashboard Filters */
.dashboard-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  align-items: center;
  margin-bottom: 2rem;
  padding: var(--spacing-lg);
  background: var(--bg-color);
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
}

.dashboard-filters select {
  padding: 0.75rem 1rem;
  font-size: var(--font-size-base);
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  background: var(--card-bg);
  color: var(--text-color);
  font-family: var(--font-main);
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 180px;
}

.dashboard-filters select:hover {
  border-color: var(--primary-color);
}

.dashboard-filters select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(0, 102, 51, 0.1);
}

/* Alert Banner */
.alert-banner {
  padding: var(--spacing-md) var(--spacing-lg);
  margin-bottom: var(--spacing-xl);
  border-radius: var(--border-radius);
  font-weight: 600;
  border: 2px solid;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--spacing-sm);
}

.alert-banner.critical {
  background: #ffebee;
  color: #c62828;
  border-color: #ef5350;
}

.alert-banner.high {
  background: #fff3e0;
  color: #e65100;
  border-color: #ff9800;
}

.alert-banner.normal {
  background: #e8f5e9;
  color: #2e7d32;
  border-color: #66bb6a;
}

.alert-banner.moderate {
  background: rgba(251, 192, 45, 0.2);
  border-color: #fbc02d;
  color: #f9a825;
}

.alert-banner.low {
  background: rgba(56, 142, 60, 0.2);
  border-color: #388e3c;
  color: #2e7d32;
}

.alert-details {
  font-size: var(--font-size-sm);
  font-weight: 400;
  opacity: 0.9;
}

@media (prefers-color-scheme: dark) {
  .alert-banner.critical {
    background: rgba(198, 40, 40, 0.2);
    color: #ef5350;
    border-color: #ef5350;
  }
  
  .alert-banner.high {
    background: rgba(230, 81, 0, 0.2);
    color: #ff9800;
    border-color: #ff9800;
  }
  
  .alert-banner.normal {
    background: rgba(46, 125, 50, 0.2);
    color: #66bb6a;
    border-color: #66bb6a;
  }

  .alert-banner.moderate {
    background: rgba(251, 192, 45, 0.2);
    color: #fbc02d;
    border-color: #fbc02d;
  }

  .alert-banner.low {
    background: rgba(56, 142, 60, 0.2);
    color: #66bb6a;
    border-color: #388e3c;
  }
}

/* Dashboard Loader & Error States */
.dashboard-loader {
  display: none;
  text-align: center;
  padding: var(--spacing-xl);
  color: var(--text-secondary);
  font-size: var(--font-size-lg);
}

.dashboard-error {
  display: none;
  text-align: center;
  padding: var(--spacing-xl);
  color: #d32f2f;
  font-size: var(--font-size-lg);
}

/* Filter Group (used in dashboard filters) */
.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 150px;
}

.filter-group label {
  display: block;
  font-weight: 600;
  font-size: var(--font-size-sm);
  color: var(--text-color);
}

/* Dashboard Grid */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: var(--spacing-xl);
  margin-top: var(--spacing-xl);
}

/* Chart Container (consistent height for chart wrappers) */
.chart-container {
  height: 400px;
  position: relative;
}

.chart-container--scrollable {
  min-height: 400px;
  overflow-x: auto;
}

/* Chart Card */
.chart-card {
  padding: var(--spacing-lg);
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--border-radius);
  box-shadow: 0 2px 4px var(--card-shadow);
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.chart-card:hover {
  box-shadow: 0 4px 8px var(--card-shadow);
  transform: translateY(-2px);
}

.chart-card.full-width,
.chart-card.wide {
  grid-column: 1 / -1;
}

.chart-card canvas {
  max-width: 100%;
  width: 100%;
  height: 350px;
  max-height: 400px;
}

.chart-card h3 {
  margin-top: 0;
  color: var(--header-color);
  font-size: var(--h3-size);
  margin-bottom: var(--spacing-md);
  border-bottom: 2px solid var(--primary-color);
  padding-bottom: var(--spacing-sm);
}

.chart-description {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  margin-bottom: var(--spacing-md);
  font-style: italic;
}

/* Controls */
.controls {
  margin: var(--spacing-md) 0;
  display: flex;
  gap: var(--spacing-md);
  align-items: center;
  flex-wrap: wrap;
  padding: var(--spacing-md);
  background: var(--bg-color);
  border-radius: var(--border-radius-sm);
}

.control-label {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  font-size: var(--font-size-sm);
  cursor: pointer;
}

.control-label input[type="checkbox"] {
  width: 20px;
  height: 20px;
  cursor: pointer;
}

.control-label select {
  padding: var(--spacing-sm) var(--spacing-md);
  border: 1px solid var(--card-border);
  border-radius: var(--border-radius-sm);
  background: var(--card-bg);
  color: var(--text-color);
  font-size: var(--font-size-sm);
  cursor: pointer;
}

.btn-sm {
  padding: var(--spacing-sm) var(--spacing-md);
  font-size: var(--font-size-sm);
  background: var(--button-bg);
  color: var(--button-text);
  border: none;
  border-radius: var(--border-radius-sm);
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.2s ease;
  font-weight: 500;
}

.btn-sm:hover {
  background: var(--primary-light);
  transform: translateY(-1px);
}

.btn-sm:active {
  transform: translateY(0);
}

/* Heat Map Container */
#riskHeatMap {
  width: 100%;
  height: 600px;
  overflow: auto;
  border: 1px solid var(--card-border);
  border-radius: var(--border-radius-sm);
  background: var(--bg-color);
}

#riskHeatMap svg {
  display: block;
}

/* Heat Map Legend */
.legend {
  margin-top: var(--spacing-md);
  padding: var(--spacing-md);
  background: var(--bg-color);
  border-radius: var(--border-radius-sm);
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-md);
  align-items: center;
}

/* Canvas Charts (scoped to risk dashboard) */
#risk-dashboard canvas {
  max-width: 100%;
  height: auto;
  min-height: 300px;
}

/* Top 10 Lists */
#ethicsConcernsList,
#electoralRiskList {
  list-style-type: decimal;
  padding-left: var(--spacing-xl);
  margin: var(--spacing-md) 0;
}

#ethicsConcernsList li,
#electoralRiskList li {
  padding: var(--spacing-sm) 0;
  border-bottom: 1px solid var(--card-border);
  line-height: 1.6;
}

#ethicsConcernsList li:last-child,
#electoralRiskList li:last-child {
  border-bottom: none;
}

#ethicsConcernsList li strong,
#electoralRiskList li strong {
  color: var(--primary-color);
  font-weight: 600;
}

/* Data Attribution */
.data-attribution {
  margin-top: var(--spacing-xl);
  padding: var(--spacing-md);
  background: var(--bg-color);
  border-radius: var(--border-radius-sm);
  border-left: 4px solid var(--primary-color);
  font-size: var(--font-size-sm);
}

.data-attribution p {
  margin-bottom: var(--spacing-sm);
}

.data-attribution p:last-child {
  margin-bottom: 0;
}

/* Data Source Disclaimer Banner */
.data-source-disclaimer {
  margin: var(--spacing-sm) 0;
  padding: var(--spacing-xs) var(--spacing-md);
  border-radius: var(--border-radius-sm);
  font-size: var(--font-size-sm);
  text-align: center;
}

.data-source-live {
  color: var(--success-color);
  border: 1px solid color-mix(in srgb, var(--success-color) 40%, transparent);
  background-color: color-mix(in srgb, var(--success-color) 10%, transparent);
}

.data-source-synthetic {
  color: var(--warning-color);
  border: 1px solid color-mix(in srgb, var(--warning-color) 40%, transparent);
  background-color: color-mix(in srgb, var(--warning-color) 10%, transparent);
}

.data-source-mock {
  color: var(--primary-cyan, #00d9ff);
  border: 1px solid color-mix(in srgb, var(--primary-cyan, #00d9ff) 40%, transparent);
  background-color: color-mix(in srgb, var(--primary-cyan, #00d9ff) 10%, transparent);
}

.methodology-note {
  color: var(--text-secondary);
  font-style: italic;
}

/* Responsive Adjustments */
@media (max-width: 1024px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  
  .chart-card.wide {
    grid-column: auto;
  }
}

@media (max-width: 768px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  
  .dashboard-container {
    padding: var(--spacing-md);
  }
  
  .dashboard-filters {
    flex-direction: column;
    align-items: stretch;
  }
  
  .dashboard-filters select {
    width: 100%;
    min-width: auto;
  }
  
  .chart-card canvas {
    height: 300px;
  }
  
  #riskHeatMap {
    height: 400px;
  }
  
  .controls {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .control-label {
    width: 100%;
  }
  
  .control-label select {
    width: 100%;
  }
  
  #risk-dashboard canvas {
    min-height: 250px;
  }
}

@media (max-width: 480px) {
  .dashboard-container {
    padding: var(--spacing-sm);
  }
  
  .chart-card {
    padding: var(--spacing-md);
  }
  
  .chart-card canvas {
    height: 250px;
  }
  
  #riskHeatMap {
    height: 300px;
  }
  
  .alert-banner {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Dark Mode Specific Styles */
@media (prefers-color-scheme: dark) {
  .dashboard-container {
    background: var(--card-bg);
    border-color: var(--card-border);
    box-shadow: 0 4px 6px rgba(0, 204, 102, 0.1);
  }
  
  .chart-card {
    background: rgba(0, 28, 37, 0.8);
    border-color: rgba(0, 204, 102, 0.3);
  }
  
  .chart-card:hover {
    box-shadow: 0 4px 8px rgba(0, 204, 102, 0.2);
  }
  
  #riskHeatMap {
    background: rgba(0, 0, 0, 0.3);
    border-color: var(--card-border);
  }
  
  .controls {
    background: rgba(0, 26, 26, 0.5);
  }
  
  .data-attribution {
    background: rgba(0, 26, 26, 0.5);
    border-left-color: var(--primary-color);
  }
  
  .legend {
    background: rgba(0, 26, 26, 0.5);
  }
}

/* Accessibility: High Contrast Mode Support */
@media (prefers-contrast: high) {
  .chart-card {
    border-width: 2px;
  }
  
  .alert-banner {
    border-width: 3px;
  }
  
  .control-label input[type="checkbox"] {
    border: 2px solid currentColor;
  }
}

/* Print Styles */
@media print {
  .dashboard-container {
    page-break-inside: avoid;
  }
  
  .chart-card {
    page-break-inside: avoid;
    box-shadow: none;
    border: 1px solid #000;
  }
  
  .controls {
    display: none;
  }
  
  #riskHeatMap {
    height: auto;
    overflow: visible;
  }
}

/* ==================================================
   UI/UX ENHANCEMENTS - FEBRUARY 2026
   ================================================== */

/* Note: Skip-to-content link styles already defined earlier in this file
   at lines 666-789 (.skip-link pattern). Reusing existing implementation. */

/* Note: Global focus-visible styles already defined earlier in this file
   at lines 666-789. Avoiding duplicate universal focus rules. */

/* Remove outline for mouse clicks (only show for keyboard) */
/* Focus visible support (scoped to browsers that support it) */
@supports selector(:focus-visible) {
  *:focus:not(:focus-visible) {
    outline: none;
  }
}

/* Respect user's motion preferences */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Loading States */
.loading {
  opacity: 0.6;
  pointer-events: none;
  cursor: wait;
}

.skeleton {
  background: linear-gradient(
    90deg,
    var(--bg-color) 25%,
    var(--card-border) 50%,
    var(--bg-color) 75%
  );
  background-size: 200% 100%;
  animation: loading 1.5s ease-in-out infinite;
  border-radius: var(--border-radius);
  min-height: 20px;
}

@keyframes loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* Enhanced Card Hover Effects */
.card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  will-change: transform;
}

.card:hover {
  transform: translateY(-4px) scale(1.01);
  box-shadow: 
    0 10px 20px rgba(0, 102, 51, 0.15),
    0 6px 6px rgba(0, 102, 51, 0.1),
    0 0 20px rgba(0, 102, 51, 0.05);
}

.card:active {
  transform: translateY(-2px) scale(1.005);
}

/* Micro-interactions for Buttons */
.btn,
button:not(.back-to-top) {
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.btn:hover,
button:not(.back-to-top):hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 102, 51, 0.2);
}

.btn:active,
button:not(.back-to-top):active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(0, 102, 51, 0.2);
}

/* Button ripple effect */
.btn::after,
button:not(.back-to-top)::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn:active::after,
button:not(.back-to-top):active::after {
  width: 200px;
  height: 200px;
}

/* Note: Back-to-top button styles already defined earlier in this file
   at lines 989-1030. Avoiding duplicate .back-to-top implementation. */

/* Enhanced Footer */
footer {
  background: var(--card-bg);
  padding: 3rem 2rem 1rem;
  margin-top: 4rem;
  border-top: 3px solid var(--primary-color);
  box-shadow: 0 -4px 12px rgba(0, 102, 51, 0.05);
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  max-width: 100%;
  margin: 0 auto 2rem;
}

.footer-section {
  display: flex;
  flex-direction: column;
}

.footer-section h3 {
  color: var(--primary-color);
  margin-bottom: 1rem;
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.footer-section p {
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1rem;
}

.footer-section ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-section li {
  margin-bottom: 0.5rem;
}

.footer-section a {
  color: var(--text-color);
  text-decoration: none;
  transition: color 0.2s ease, padding-left 0.2s ease;
  display: inline-block;
}

.footer-section a:hover {
  color: var(--primary-color);
  padding-left: 4px;
}

.footer-section a:focus-visible {
  color: var(--primary-color);
  text-decoration: underline;
}

.footer-stats {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0 0;
}

.footer-stats li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-secondary);
}

.footer-stats li:last-child {
  border-bottom: none;
}

.footer-stats li strong {
  color: var(--primary-color);
  font-weight: 600;
}

/* Language Grid */
.language-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.language-grid a {
  padding: 0.5rem;
  text-decoration: none;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  text-align: center;
  transition: all 0.2s ease;
  background: var(--bg-color);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-color);
}

.language-grid a:hover {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
  transform: translateY(-2px);
  box-shadow: 0 2px 8px rgba(0, 102, 51, 0.2);
}

.language-grid a:active {
  transform: translateY(0);
}

.language-grid a:focus-visible {
  outline: 3px solid var(--accent-color);
  outline-offset: 2px;
  border-color: var(--primary-color);
}

/* Footer Bottom */
.footer-bottom {
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.footer-bottom p {
  margin: 0.5rem 0;
}

.footer-bottom a {
  color: var(--text-color);
  text-decoration: none;
  transition: color 0.2s ease;
  font-weight: 500;
}

.footer-bottom a:hover {
  color: var(--primary-color);
  text-decoration: underline;
}

.footer-bottom time {
  font-style: italic;
  color: var(--text-secondary);
}

/* Responsive Footer */
@media (max-width: 1024px) {
  .footer-content {
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
  }
}

@media (max-width: 768px) {
  .footer-content {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .back-to-top {
    bottom: 20px;
    right: 20px;
    width: 45px;
    height: 45px;
    font-size: 20px;
  }
  
  footer {
    padding: 2rem 1rem 1rem;
    margin-top: 3rem;
  }
}

@media (max-width: 480px) {
  .language-grid {
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 0.4rem;
  }
  
  .language-grid a {
    padding: 0.4rem;
    font-size: 0.75rem;
  }
  
  .footer-section h3 {
    font-size: 1rem;
  }
  
  .footer-bottom {
    font-size: 0.85rem;
  }
}

/* Minimum Touch Target Size (WCAG 2.1 AAA) */
@media (pointer: coarse) {
  a,
  button,
  input,
  select,
  textarea {
    min-height: 44px;
    min-width: 44px;
  }
  
  .language-grid a {
    min-height: 44px;
    padding: 0.6rem;
  }
}

/* High Contrast Mode Enhancements */
@media (prefers-contrast: high) {
  .skip-to-content:focus,
  *:focus-visible {
    outline-width: 4px;
  }
  
  .card:hover {
    border-width: 2px;
  }
  
  .back-to-top {
    border: 2px solid white;
  }
  
  footer {
    border-top-width: 4px;
  }
}

/* Dark Mode Support (Future Enhancement) */
@media (prefers-color-scheme: dark) {
  :root {
    /* Dark mode variables remain the same as light mode for now */
    /* The cyberpunk green theme works well in both modes */
  }
}

/* Print Styles for Footer */
@media print {
  footer {
    page-break-before: always;
    border-top: 2px solid #000;
  }
  
  .back-to-top,
  .skip-to-content {
    display: none;
  }
  
  .language-grid {
    display: none;
  }
  
  .footer-content {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Accessibility: Focus Management */
.focus-trap {
  position: relative;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Interactive Element States */
a,
button {
  cursor: pointer;
}

a:focus,
button:focus {
  outline-width: 3px;
}

/* Disabled State */
button:disabled,
a[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* External Link Indicator (Optional) */
a[target="_blank"]::after {
  content: ' ↗';
  font-size: 0.8em;
  vertical-align: super;
  margin-left: 2px;
}

.language-grid a[target="_blank"]::after,
.footer-stats a[target="_blank"]::after {
  content: none; /* Remove for language links */
}

/* Loading Spinner (for future async content) */
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(0, 102, 51, 0.3);
  border-radius: 50%;
  border-top-color: var(--primary-color);
  animation: spinner 0.6s linear infinite;
}

@keyframes spinner {
  to {
    transform: rotate(360deg);
  }
}

/* Tooltip Enhancement */
[title] {
  position: relative;
}

/* Enhance existing breadcrumb for better accessibility */
.breadcrumb {
  display: flex;
  list-style: none;
  padding: 1rem 0;
  margin: 0;
  flex-wrap: wrap;
}

.breadcrumb-item {
  display: flex;
  align-items: center;
  font-size: 0.9rem;
}

.breadcrumb-item + .breadcrumb-item::before {
  content: '/';
  padding: 0 0.5rem;
  color: var(--text-secondary);
}

.breadcrumb-item a {
  color: var(--link-color);
  text-decoration: none;
  transition: color 0.2s ease;
}

.breadcrumb-item a:hover {
  color: var(--primary-color);
  text-decoration: underline;
}

.breadcrumb-item[aria-current="page"] {
  color: var(--text-secondary);
  font-weight: 500;
}

/* Enhanced Time Elements */
time {
  font-variant-numeric: tabular-nums;
}

/* Improve Header Accessibility */
header {
  position: relative;
}

header h1 {
  scroll-margin-top: 2rem;
}

/* Smooth transitions for all interactive elements */
a,
button,
.card,
.language-grid a {
  -webkit-tap-highlight-color: rgba(0, 102, 51, 0.2);
}

/* EOF - UI/UX Enhancements */


/* ==================================================
   SEASONAL PATTERNS DASHBOARD
   ================================================== */

/* Seasonal Dashboard Container */
#seasonal-patterns-dashboard {
  max-width: 100%;
  margin: 3rem auto;
  padding: 2rem;
  background: var(--card-bg);
  border-radius: var(--border-radius-lg);
  box-shadow: 0 4px 16px var(--card-shadow);
}

#seasonal-patterns-dashboard h2 {
  font-family: var(--font-accent);
  font-size: var(--h2-size);
  color: var(--header-color);
  margin-bottom: 0.5rem;
  text-align: center;
}

#seasonal-patterns-dashboard .subtitle {
  text-align: center;
  color: var(--text-secondary);
  font-size: var(--font-size-lg);
  margin-bottom: 2rem;
}

/* Seasonal Heatmap */
#seasonal-heatmap {
  width: 100%;
  min-height: 600px;
  overflow-x: auto;
  overflow-y: hidden;
}

#seasonal-heatmap svg {
  font-family: var(--font-main);
}

#seasonal-heatmap .axis text {
  font-size: 12px;
  fill: var(--text-color);
}

#seasonal-heatmap .axis line,
#seasonal-heatmap .axis path {
  stroke: var(--border-color);
}

#seasonal-heatmap .cell {
  cursor: pointer;
  transition: all 0.2s ease;
}

#seasonal-heatmap .cell:hover {
  stroke: #000 !important;
  stroke-width: 2 !important;
}

#seasonal-heatmap .anomaly-marker {
  cursor: pointer;
  animation: pulse-anomaly 2s infinite;
}

@keyframes pulse-anomaly {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.7;
    transform: scale(1.1);
  }
}

@media (prefers-reduced-motion: reduce) {
  #seasonal-heatmap .anomaly-marker {
    animation: none;
  }
  
  #seasonal-patterns-dashboard.loading::after {
    animation: none;
    opacity: 0.9;
  }
}

/* Seasonal Loading State */
#seasonal-patterns-dashboard.loading {
  position: relative;
  min-height: 400px;
}

#seasonal-patterns-dashboard.loading::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 50px;
  height: 50px;
  border: 4px solid var(--border-color);
  border-top: 4px solid var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  z-index: 10;
}

@keyframes spin {
  0% { transform: translate(-50%, -50%) rotate(0deg); }
  100% { transform: translate(-50%, -50%) rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  #seasonal-patterns-dashboard.loading::before {
    animation: none;
    border-top-color: var(--primary-color);
    border-right-color: var(--primary-color);
  }
}

#seasonal-patterns-dashboard.loading::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.9);
  z-index: 9;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.9; }
  50% { opacity: 0.7; }
}

/* Error Message */
.error-message {
  padding: 1.5rem;
  background: rgba(211, 47, 47, 0.1);
  border: 2px solid var(--danger-color);
  border-radius: var(--border-radius);
  color: var(--text-color);
  margin: 1rem 0;
}

.error-message h3 {
  margin: 0 0 0.5rem 0;
  color: var(--danger-color);
  font-size: 1.125rem;
}

.error-message p {
  margin: 0.5rem 0;
  font-size: 0.875rem;
}

/* Seasonal Dark Mode */
@media (prefers-color-scheme: dark) {
  #seasonal-patterns-dashboard {
    background: rgba(26, 26, 26, 0.95);
  }
  
  #seasonal-patterns-dashboard.loading::after {
    background: rgba(26, 26, 26, 0.9);
  }
  
  #seasonal-heatmap .axis text {
    fill: var(--light-text, #e0e0e0);
  }
}

/* Seasonal Responsive */
@media (max-width: 768px) {
  #seasonal-patterns-dashboard {
    padding: 1rem;
    margin: 1.5rem auto;
  }
  
  #seasonal-heatmap {
    min-height: 500px;
  }
}

@media (max-width: 480px) {
  #seasonal-patterns-dashboard h2 {
    font-size: var(--h3-size);
  }
  
  #seasonal-heatmap {
    min-height: 400px;
  }
}

/* ==================================================
   ANOMALY DETECTION DASHBOARD
   ================================================== */

/* Utility Classes */
.hidden {
  display: none !important;
}

/* Anomaly Dashboard Container */
#anomaly-detection-dashboard {
  margin: 3rem 0;
  padding: 2rem;
  background: var(--card-bg);
  border-radius: var(--border-radius-lg);
  box-shadow: 0 4px 6px var(--card-shadow);
}

/* Anomaly Alert Banner Enhancements */
#anomaly-detection-dashboard .alert-banner {
  position: sticky;
  top: 0;
  z-index: 1000;
  animation: slideDown 0.3s ease-out;
}

.alert-banner .alert-icon {
  font-size: 2rem;
  line-height: 1;
}

.alert-banner p {
  flex: 1;
  margin: 0;
  font-size: 1rem;
}

.dismiss-alert {
  margin-left: auto;
  padding: 0.5rem 1rem;
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.5);
  color: #fff;
  border-radius: var(--border-radius-sm);
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.dismiss-alert:hover {
  background: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.7);
}

.dismiss-alert:focus {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* Severity Heatmap */
#severity-heatmap {
  width: 100%;
  height: auto;
  min-height: 300px;
  overflow-x: auto;
}

#severity-heatmap svg {
  font-family: var(--font-main);
}

/* Recent Anomalies Feed */
#recent-anomalies-feed {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.anomaly-feed-item {
  background: var(--bg-color);
  border-left: 4px solid var(--primary-color);
  padding: 1rem;
  border-radius: var(--border-radius-sm);
  transition: all 0.2s ease;
}

.anomaly-feed-item:hover {
  box-shadow: 0 2px 4px var(--card-shadow);
  transform: translateX(2px);
}

.anomaly-feed-item.critical {
  border-left-color: #d32f2f;
}

.anomaly-feed-item.high {
  border-left-color: #f57c00;
}

.anomaly-feed-item.moderate {
  border-left-color: #fbc02d;
}

.anomaly-feed-item.low {
  border-left-color: #388e3c;
}

.anomaly-feed-item p {
  margin: 2px 0;
  font-size: 0.875rem;
  line-height: 1.5;
}

/* Severity Badge */
.severity-badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  border-radius: var(--border-radius-sm);
  font-size: 0.75rem;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.severity-badge.critical {
  background: #d32f2f;
  color: #fff;
}

.severity-badge.high {
  background: #f57c00;
  color: #fff;
}

.severity-badge.moderate {
  background: #fbc02d;
  color: #1a1a1a;
}

.severity-badge.low {
  background: #388e3c;
  color: #fff;
}

/* Loading Indicator */
.loading-indicator {
  padding: 2rem;
  text-align: center;
  color: var(--primary-color);
  font-size: 1rem;
  font-weight: 500;
}

/* Animations */
@keyframes slideDown {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Anomaly Responsive */
@media (max-width: 767px) {
  #anomaly-detection-dashboard {
    padding: 1rem;
  }
  
  #anomaly-detection-dashboard .alert-banner {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  
  .dismiss-alert {
    margin-left: 0;
    align-self: stretch;
  }
}

/* Anomaly Dark Mode */
@media (prefers-color-scheme: dark) {
  #anomaly-detection-dashboard {
    background: #1a1e3d;
    color: #e0e0e0;
  }
}

/* ==================================================
   COALITION & VOTING PATTERN DASHBOARD
   ================================================== */

/* Coalition-specific chart card height */
#coalition-dashboard .chart-card {
  min-height: 400px;
}

/* D3.js visualization containers */
#coalitionNetwork,
#alignmentHeatMap {
  min-height: 500px;
  position: relative;
}

#coalitionNetwork svg,
#alignmentHeatMap svg {
  border: 1px solid var(--card-border);
  border-radius: var(--border-radius-sm);
  background: var(--bg-color);
}

#coalitionNetwork .nodes g:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 4px;
}

/* Dashboard attribution note */
.dashboard-attribution {
  margin-top: var(--spacing-lg);
}

/* Loading state for dashboard container */
.dashboard-container.loading::after {
  content: 'Loading dashboard data...';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  padding: var(--spacing-lg);
  border-radius: var(--border-radius);
  font-size: var(--font-size-lg);
  z-index: 1000;
}

/* Coalition network table (accessible fallback) */
#coalitionNetworkTable {
  width: 100%;
  border-collapse: collapse;
  margin-top: var(--spacing-lg);
}

#coalitionNetworkTable caption {
  font-weight: bold;
  padding: var(--spacing-sm);
  text-align: left;
  font-size: var(--font-size-lg);
}

#coalitionNetworkTable th,
#coalitionNetworkTable td {
  padding: var(--spacing-sm);
  border: 1px solid var(--card-border);
  text-align: left;
}

#coalitionNetworkTable th {
  background: var(--primary-color);
  color: #fff;
  font-weight: 600;
}

/* Coalition Responsive */
@media (max-width: 768px) {
  #coalition-dashboard .chart-card {
    min-height: 300px;
  }
  
  #coalitionNetwork,
  #alignmentHeatMap {
    min-height: 350px;
  }
}

/* Coalition Dark Mode */
@media (prefers-color-scheme: dark) {
  #coalitionNetwork svg,
  #alignmentHeatMap svg {
    background: rgba(0, 26, 26, 0.5);
    border-color: rgba(0, 204, 102, 0.3);
  }
}

/* ==================================================
   NEWS PAGE STYLES
   ================================================== */
/* Styles specific to news/index*.html pages
 * These replace inline <style> blocks for cleaner HTML
 * Maintains cyberpunk theme consistency
 */

/* News page body override for dark theme */
body.news-page {
  background: var(--bg-color, #0a0e27);
  color: var(--text-color, #e0e0e0);
  font-family: 'Inter', 'Inter Fallback', sans-serif;
  line-height: 1.6;
  padding: 0;
  margin: 0;
  max-width: none;
}

/* News header section */
.news-page .header-section {
  position: relative;
  background: var(--card-bg, rgba(26, 30, 61, 0.9));
  border-bottom: 2px solid var(--primary-cyan, #00d9ff);
  padding: 2rem 1rem;
  margin-bottom: 0;
}

.news-page .header-content {
  max-width: 100%;
  margin: 0 auto;
  position: relative;
}

.news-page h1 {
  font-family: 'Orbitron', 'Orbitron Fallback', sans-serif;
  font-size: clamp(1.75rem, 4vw, 3rem);
  margin: 0 0 0.75rem 0;
  background: linear-gradient(135deg, var(--primary-cyan, #00d9ff), var(--primary-magenta, #ff006e));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  padding-right: 60px;
}

.news-page .subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary, #b0b0b0);
  margin: 0 0 0.75rem 0;
}

.news-page .back-link {
  display: inline-block;
  color: var(--primary-cyan, #00d9ff);
  text-decoration: none;
  padding: 0.5rem 0;
  transition: transform 0.2s;
}

.news-page .back-link:hover {
  transform: translateX(-5px);
}

.news-page .container {
  max-width: 100%;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 3rem;
}

/* Language notice for fallback content */
.news-page .language-notice {
  background: rgba(255, 190, 11, 0.1);
  border-left: 4px solid var(--primary-yellow, #ffbe0b);
  padding: 1rem;
  margin-bottom: 2rem;
  border-radius: 4px;
}

.news-page .language-notice h2 {
  font-size: 1.2rem;
  color: var(--primary-yellow, #ffbe0b);
  margin: 0 0 0.5rem 0;
}

.news-page .language-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: rgba(255, 255, 255, 0.1);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.85rem;
  color: #fff;
  margin-left: 0.5rem;
}

/* Filter bar */
.news-page .filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: var(--card-bg, rgba(26, 30, 61, 0.6));
  border-radius: 8px;
  border: 1px solid var(--border-color, rgba(0, 217, 255, 0.3));
}

.news-page .filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
  min-width: 160px;
}

.news-page .filter-group label {
  font-size: 0.9rem;
  color: var(--primary-cyan, #00d9ff);
  font-weight: 600;
}

.news-page .filter-group select {
  padding: 0.5rem;
  background: var(--bg-color, rgba(10, 14, 39, 0.8));
  border: 1px solid var(--border-color, rgba(0, 217, 255, 0.5));
  border-radius: 4px;
  color: var(--text-color, #e0e0e0);
  font-family: 'Inter', 'Inter Fallback', sans-serif;
  cursor: pointer;
}

.news-page .filter-group select:hover {
  border-color: var(--primary-cyan, #00d9ff);
}

.news-page .filter-group input[type="search"] {
  padding: 0.5rem;
  background: var(--bg-color, rgba(10, 14, 39, 0.8));
  border: 1px solid var(--border-color, rgba(0, 217, 255, 0.5));
  border-radius: 4px;
  color: var(--text-color, #e0e0e0);
  font-family: 'Inter', 'Inter Fallback', sans-serif;
}

.news-page .filter-group input[type="search"]:hover {
  border-color: var(--primary-cyan, #00d9ff);
}

.news-page .filter-group input[type="search"]:focus-visible {
  border-color: var(--primary-cyan, #00d9ff);
  outline: 2px solid var(--primary-cyan, #00d9ff);
  outline-offset: 2px;
}

.news-page .pagination-controls {
  text-align: center;
  margin-top: 2rem;
  padding: 1rem 0;
}

.news-page .article-counter {
  color: #888;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.news-page .load-more-btn {
  padding: 0.75rem 2rem;
  background: rgba(0, 217, 255, 0.1);
  border: 1px solid rgba(0, 217, 255, 0.5);
  border-radius: 4px;
  color: var(--primary-cyan, #00d9ff);
  font-family: 'Inter', 'Inter Fallback', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.news-page .load-more-btn:hover {
  background: rgba(0, 217, 255, 0.2);
  border-color: var(--primary-cyan, #00d9ff);
}

.news-page .load-more-btn:focus-visible {
  outline: 2px solid var(--primary-cyan, #00d9ff);
  outline-offset: 2px;
}

/* Articles grid */
.news-page .articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

/* Article card */
.news-page .article-card {
  background: var(--card-bg, rgba(26, 30, 61, 0.8));
  border: 1px solid var(--border-color, rgba(0, 217, 255, 0.3));
  border-radius: 8px;
  padding: 1.5rem;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
}

.news-page .article-card:hover {
  border-color: var(--primary-cyan, #00d9ff);
  box-shadow: 0 4px 20px rgba(0, 217, 255, 0.2);
  transform: translateY(-2px);
}

.news-page .article-meta {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  font-size: 0.85rem;
  color: var(--text-secondary, #888);
}

.news-page .article-date {
  color: var(--primary-cyan, #00d9ff);
}

.news-page .article-type {
  padding: 0.2rem 0.6rem;
  background: var(--focus-bg, rgba(0, 217, 255, 0.1));
  border-radius: 4px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.news-page .article-title {
  font-size: 1.3rem;
  font-weight: 600;
  margin: 0 0 1rem 0;
  color: var(--text-color, #fff);
  line-height: 1.4;
}

.news-page .article-title a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s;
}

.news-page .article-title a:hover {
  color: var(--primary-cyan, #00d9ff);
}

.news-page .article-excerpt {
  color: var(--text-secondary, #b0b0b0);
  margin-bottom: 1rem;
  flex-grow: 1;
}

.news-page .article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.news-page .tag {
  padding: 0.3rem 0.7rem;
  background: rgba(255, 0, 110, 0.1);
  border: 1px solid rgba(255, 0, 110, 0.3);
  border-radius: 4px;
  font-size: 0.8rem;
  color: var(--primary-magenta, #ff006e);
}

/* News page responsive */
@media (max-width: 768px) {
  .news-page .articles-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .news-page .filter-bar {
    flex-direction: column;
    gap: 0.75rem;
    padding: 0.75rem;
  }
  
  .news-page .filter-group {
    min-width: 100%;
  }

  .news-page .container {
    padding: 1rem 0.75rem 2rem;
  }

  .news-page h1 {
    padding-right: 50px;
  }

  .news-page .header-section {
    padding: 1.5rem 0.75rem;
  }
}

/* ========================================
   Coalition Status Section Styles
   ======================================== */

#coalition-status {
  margin: 2rem 0;
}

#coalition-status .cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

#coalition-status .card {
  min-height: 200px;
}

#coalition-status .card h3 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
  color: var(--header-color);
  font-family: var(--font-heading, 'Orbitron', 'Orbitron Fallback', sans-serif);
}

#coalition-status .party-stats {
  margin: 1rem 0;
}

#coalition-status .party-stats p {
  margin: 0.5rem 0;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

#coalition-status .party-stats strong {
  color: var(--primary-color);
  font-size: 1.1rem;
  font-weight: 600;
}

#coalition-status .party-leader {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--card-border);
  font-size: 0.9rem;
  color: var(--text-tertiary);
}

#coalition-status .party-leader strong {
  color: var(--text-secondary);
  font-weight: 600;
}

#coalition-status .leader-details {
  margin-top: 0.5rem;
  padding-left: 0.5rem;
  border-left: 2px solid var(--primary-cyan, #00d9ff);
  color: var(--text-tertiary);
  font-size: 0.85rem;
  font-style: normal;
}

#coalition-status .leader-details p {
  margin: 0.25rem 0;
  line-height: 1.4;
}

#coalition-status .loading-message,
#coalition-status .error-message {
  text-align: center;
  padding: 2rem;
  color: var(--text-secondary);
  font-size: 1rem;
}

#coalition-status .error-message {
  color: var(--danger-color, #f44336);
}

/* Responsive adjustments for coalition cards */
@media (max-width: 768px) {
  #coalition-status .cards {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  #coalition-status .card {
    min-height: 160px;
  }
}

@media (min-width: 1024px) {
  #coalition-status .cards {
    grid-template-columns: repeat(4, 1fr);
  }
}
/* ============================================================================
/* =============================================
   NEWS ARTICLE STYLES
   For generated news articles (evening analysis, etc.)
   Latest news and analysis from Sweden's Riksdag.
   AI-generated political intelligence journalism based on OSINT/INTOP data covering
   parliament, government, and agencies with systematic transparency.
   ============================================= */

/* News Article Container — constrained width for readability */
.news-article {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 clamp(1rem, 3vw, 3rem);
  background: var(--bg-color, #f8f9fa);
  width: 100%;
  box-sizing: border-box;
}

/* Article Header */
.news-article .article-header {
  border-bottom: 3px solid var(--primary-color, #006633);
  padding-bottom: 1.5rem;
  margin-bottom: 2rem;
}

.news-article .article-header h1 {
  font-size: 2.25rem;
  line-height: 1.2;
  margin: 0 0 0.75rem 0;
  color: var(--header-color, #006633);
  font-weight: 700;
}

/* Intelligence-style subtitle tagline */
.news-article .article-tagline {
  font-size: 0.95rem;
  color: var(--text-secondary, #4a4a4a);
  font-style: italic;
  margin-bottom: 1rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

/* Article metadata - date, type, read time */
.news-article .article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.9rem;
  color: var(--text-secondary, #4a4a4a);
  align-items: center;
}

.news-article .article-meta time {
  font-weight: 600;
}

.news-article .article-meta .separator {
  color: var(--border-color, #ccc);
}

/* Lead Paragraph */
.news-article .lede {
  font-size: 1.2rem;
  line-height: 1.8;
  font-weight: 500;
  color: var(--text-color, #1a1a1a);
  margin-bottom: 2rem;
  padding-left: 1.25rem;
  border-left: 4px solid var(--primary-color, #006633);
}

/* Article Content */
.news-article .article-content h2 {
  font-size: 1.75rem;
  margin: 2.5rem 0 1rem 0;
  color: var(--header-color, #006633);
  font-weight: 600;
  line-height: 1.3;
}

.news-article .article-content h3 {
  font-size: 1.3rem;
  margin: 2rem 0 0.75rem 0;
  color: var(--primary-color, #006633);
  font-weight: 600;
  line-height: 1.4;
}

.news-article .article-content p {
  margin: 0 0 1.35rem 0;
  line-height: 1.8;
  max-width: 75ch;
}

/* Images inside articles — ensure fully visible */
.news-article .article-content img,
.news-article img:not(.hero-banner-bg):not(.article-site-logo) {
  max-width: 100%;
  height: auto;
  border-radius: var(--border-radius, 8px);
  display: block;
  margin: 1rem auto;
}

.news-article .article-content figure {
  margin: 1.5rem 0;
  text-align: center;
}

.news-article .article-content figcaption {
  font-size: 0.85rem;
  color: var(--text-secondary, #666);
  margin-top: 0.5rem;
  font-style: italic;
}

/* Context Box */
.news-article .context-box {
  background: var(--badge-bg, #f8f9fa);
  border-left: 4px solid var(--primary-color, #006633);
  padding: 1.5rem;
  margin: 2rem 0;
  border-radius: var(--border-radius-sm, 4px);
}

.news-article .context-box h3 {
  margin-top: 0;
  font-size: 1.2rem;
  color: var(--primary-color, #006633);
}

.news-article .context-box ul {
  margin: 0.5rem 0;
  padding-left: 1.5rem;
}

.news-article .context-box li {
  margin: 0.5rem 0;
}

/* Deep Analysis Section (5W Framework) */
.news-article .deep-analysis {
  background: var(--badge-bg, #f0f4f8);
  border: 2px solid var(--primary-color, #006633);
  border-radius: var(--border-radius-lg, 12px);
  padding: clamp(1.5rem, 3vw, 2.5rem);
  margin: 2rem 0;
  width: 100%;
  box-sizing: border-box;
}

.news-article .deep-analysis h2 {
  font-size: 1.5rem;
  margin: 0 0 1.5rem 0;
  color: var(--primary-color, #006633);
  border-bottom: 2px solid var(--primary-color, #006633);
  padding-bottom: 0.75rem;
}

.news-article .deep-analysis h3 {
  font-size: 1.15rem;
  margin: 1.5rem 0 0.75rem 0;
  color: var(--primary-dark, #004d26);
}

.news-article .deep-analysis p {
  margin: 0.5rem 0;
  line-height: 1.7;
}

[dir="rtl"] .news-article .deep-analysis {
  direction: rtl;
  text-align: right;
}

/* Sankey Section */
.news-article .sankey-section-wrapper,
.sankey-section-wrapper {
  margin: 2rem 0;
}

.news-article .sankey-section {
  background: #0a0e27;
  border: 2px solid #9d4edd;
  border-radius: 12px;
  padding: clamp(1.5rem, 3vw, 2.5rem);
  margin: 2rem 0;
  width: 100%;
  box-sizing: border-box;
}

.news-article .sankey-section h2 {
  font-size: 1.4rem;
  color: #9d4edd;
  border-bottom: 2px solid #9d4edd;
  padding-bottom: 0.75rem;
  margin: 0 0 1rem 0;
  font-family: var(--font-heading, 'Orbitron', sans-serif);
}

.news-article .sankey-summary {
  color: #a0a0a0;
  font-size: 0.95rem;
  margin: 0 0 1.5rem 0;
}

.news-article .sankey-chart-wrapper {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.news-article .sankey-chart-wrapper svg {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
  margin: 0 auto;
}

/* Accessible fallback table — hidden visually, available to screen readers */

[dir="rtl"] .news-article .sankey-section {
  direction: rtl;
  text-align: right;
}

/* CIA Overview Section */
.news-article .cia-overview-section-wrapper,
.cia-overview-section-wrapper {
  margin: 2rem 0;
}

.news-article .cia-overview-section {
  background: #0a0e27;
  border: 2px solid #00d9ff;
  border-radius: 12px;
  padding: clamp(1.5rem, 3vw, 2.5rem);
  margin: 2rem 0;
  width: 100%;
  box-sizing: border-box;
}

.news-article .cia-overview-section h2 {
  font-size: 1.4rem;
  color: #00d9ff;
  border-bottom: 2px solid #00d9ff;
  padding-bottom: 0.75rem;
  margin: 0 0 1rem 0;
  font-family: var(--font-heading, 'Orbitron', sans-serif);
}

.news-article .cia-section-summary {
  color: #a0a0a0;
  font-size: 0.95rem;
  margin: 0 0 1.5rem 0;
}

.news-article .cia-panels-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-top: 1rem;
  width: 100%;
}

/* Coalition panel */
.news-article .cia-coalition-panel,
.news-article .cia-party-panel,
.news-article .cia-voting-panel {
  background: rgba(0, 217, 255, 0.04);
  border: 2px solid rgba(0, 217, 255, 0.25);
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.news-article .cia-coalition-panel:hover,
.news-article .cia-party-panel:hover,
.news-article .cia-voting-panel:hover {
  box-shadow: 0 0 16px rgba(0, 217, 255, 0.15);
  border-color: rgba(0, 217, 255, 0.5);
}

.news-article .cia-panel-heading {
  font-size: 0.95rem;
  font-weight: 700;
  margin: 0 0 0.75rem 0;
  font-family: var(--font-heading, 'Orbitron', sans-serif);
  color: #00d9ff;
}

.news-article .cia-coalition-score-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.news-article .cia-score-number {
  font-size: 1.8rem;
  font-weight: 900;
  font-family: var(--font-heading, 'Orbitron', sans-serif);
  line-height: 1;
}

.news-article .cia-risk-badge {
  font-size: 0.7rem;
  font-weight: 700;
  font-family: var(--font-heading, 'Orbitron', sans-serif);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  letter-spacing: 0.05em;
}

.news-article .cia-stability-bar-wrapper {
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
  margin: 0.5rem 0 1rem 0;
}

.news-article .cia-stability-bar {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s ease;
}

.news-article .cia-stat-list {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.15rem 0.75rem;
  margin: 0;
  font-size: 0.85rem;
}

.news-article .cia-stat-list dt {
  color: #a0a0a0;
  font-weight: 400;
}

.news-article .cia-stat-list dd {
  margin: 0;
  font-weight: 600;
  color: #e0e0e0;
}

/* Party performance table */
.news-article .cia-table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.news-article .cia-party-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.news-article .cia-party-table th {
  background: rgba(0, 217, 255, 0.1);
  color: #00d9ff;
  font-weight: 700;
  padding: 0.35rem 0.5rem;
  text-align: left;
  font-size: 0.75rem;
  white-space: nowrap;
  border-bottom: 1px solid rgba(0, 217, 255, 0.3);
}

.news-article .cia-party-table td {
  padding: 0.3rem 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: #e0e0e0;
}

.news-article .cia-party-table tr:hover td {
  background: rgba(0, 217, 255, 0.05);
}

.news-article .cia-party-table td.cia-party-id {
  font-weight: 700;
  color: #00d9ff;
  font-family: var(--font-heading, 'Orbitron', sans-serif);
  font-size: 0.75rem;
}

.news-article .cia-stat-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.news-article .cia-trend {
  text-align: center;
  font-size: 1rem;
}

.news-article .cia-trend.rising,
.news-article .cia-trend.increasing {
  color: #83cf39;
}

.news-article .cia-trend.declining {
  color: #ff006e;
}

.news-article .cia-trend.stable {
  color: #ffbe0b;
}

/* Voting alignment bars */
.news-article .cia-alignment-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.news-article .cia-alignment-topic {
  display: block;
  font-weight: 600;
  font-size: 0.82rem;
  color: #e0e0e0;
  margin-bottom: 0.25rem;
}

.news-article .cia-alignment-bars {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.news-article .cia-bar-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
}

.news-article .cia-bar-label {
  flex: 0 0 5.5rem;
  font-size: 0.75rem;
  white-space: nowrap;
}

.news-article .cia-coalition-label { color: #00d9ff; }
.news-article .cia-opposition-label { color: #ff006e; }

.news-article .cia-bar-track {
  flex: 1;
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
}

.news-article .cia-bar-fill {
  height: 100%;
  border-radius: 4px;
}

.news-article .cia-coalition-fill { background: #00d9ff; }
.news-article .cia-opposition-fill { background: #ff006e; }

/* CIA Panel - risk level color variants (replaces inline style attributes) */
.news-article .cia-score--positive,
.news-article .cia-panel-heading.cia-score--positive,
.news-article .cia-score-number.cia-score--positive { color: #83cf39; }

.news-article .cia-risk-badge--high {
  background: rgba(255, 0, 110, 0.125);
  border: 1px solid #ff006e;
  color: #ff006e;
}

.news-article .cia-stability-bar--positive { background: #83cf39; }

.news-article .cia-stat-value--risk { color: #ff006e; }

/* CIA alignment bar width classes (replaces inline width styles) */
.news-article .cia-bar-w-0 { width: 0%; }
.news-article .cia-bar-w-1 { width: 1%; }
.news-article .cia-bar-w-2 { width: 2%; }
.news-article .cia-bar-w-3 { width: 3%; }
.news-article .cia-bar-w-4 { width: 4%; }
.news-article .cia-bar-w-5 { width: 5%; }
.news-article .cia-bar-w-6 { width: 6%; }
.news-article .cia-bar-w-7 { width: 7%; }
.news-article .cia-bar-w-8 { width: 8%; }
.news-article .cia-bar-w-9 { width: 9%; }
.news-article .cia-bar-w-10 { width: 10%; }
.news-article .cia-bar-w-11 { width: 11%; }
.news-article .cia-bar-w-12 { width: 12%; }
.news-article .cia-bar-w-13 { width: 13%; }
.news-article .cia-bar-w-14 { width: 14%; }
.news-article .cia-bar-w-15 { width: 15%; }
.news-article .cia-bar-w-16 { width: 16%; }
.news-article .cia-bar-w-17 { width: 17%; }
.news-article .cia-bar-w-18 { width: 18%; }
.news-article .cia-bar-w-19 { width: 19%; }
.news-article .cia-bar-w-20 { width: 20%; }
.news-article .cia-bar-w-21 { width: 21%; }
.news-article .cia-bar-w-22 { width: 22%; }
.news-article .cia-bar-w-23 { width: 23%; }
.news-article .cia-bar-w-24 { width: 24%; }
.news-article .cia-bar-w-25 { width: 25%; }
.news-article .cia-bar-w-26 { width: 26%; }
.news-article .cia-bar-w-27 { width: 27%; }
.news-article .cia-bar-w-28 { width: 28%; }
.news-article .cia-bar-w-29 { width: 29%; }
.news-article .cia-bar-w-30 { width: 30%; }
.news-article .cia-bar-w-31 { width: 31%; }
.news-article .cia-bar-w-32 { width: 32%; }
.news-article .cia-bar-w-33 { width: 33%; }
.news-article .cia-bar-w-34 { width: 34%; }
.news-article .cia-bar-w-35 { width: 35%; }
.news-article .cia-bar-w-36 { width: 36%; }
.news-article .cia-bar-w-37 { width: 37%; }
.news-article .cia-bar-w-38 { width: 38%; }
.news-article .cia-bar-w-39 { width: 39%; }
.news-article .cia-bar-w-40 { width: 40%; }
.news-article .cia-bar-w-41 { width: 41%; }
.news-article .cia-bar-w-42 { width: 42%; }
.news-article .cia-bar-w-43 { width: 43%; }
.news-article .cia-bar-w-44 { width: 44%; }
.news-article .cia-bar-w-45 { width: 45%; }
.news-article .cia-bar-w-46 { width: 46%; }
.news-article .cia-bar-w-47 { width: 47%; }
.news-article .cia-bar-w-48 { width: 48%; }
.news-article .cia-bar-w-49 { width: 49%; }
.news-article .cia-bar-w-50 { width: 50%; }
.news-article .cia-bar-w-51 { width: 51%; }
.news-article .cia-bar-w-52 { width: 52%; }
.news-article .cia-bar-w-53 { width: 53%; }
.news-article .cia-bar-w-54 { width: 54%; }
.news-article .cia-bar-w-55 { width: 55%; }
.news-article .cia-bar-w-56 { width: 56%; }
.news-article .cia-bar-w-57 { width: 57%; }
.news-article .cia-bar-w-58 { width: 58%; }
.news-article .cia-bar-w-59 { width: 59%; }
.news-article .cia-bar-w-60 { width: 60%; }
.news-article .cia-bar-w-61 { width: 61%; }
.news-article .cia-bar-w-62 { width: 62%; }
.news-article .cia-bar-w-63 { width: 63%; }
.news-article .cia-bar-w-64 { width: 64%; }
.news-article .cia-bar-w-65 { width: 65%; }
.news-article .cia-bar-w-66 { width: 66%; }
.news-article .cia-bar-w-67 { width: 67%; }
.news-article .cia-bar-w-68 { width: 68%; }
.news-article .cia-bar-w-69 { width: 69%; }
.news-article .cia-bar-w-70 { width: 70%; }
.news-article .cia-bar-w-71 { width: 71%; }
.news-article .cia-bar-w-72 { width: 72%; }
.news-article .cia-bar-w-73 { width: 73%; }
.news-article .cia-bar-w-74 { width: 74%; }
.news-article .cia-bar-w-75 { width: 75%; }
.news-article .cia-bar-w-76 { width: 76%; }
.news-article .cia-bar-w-77 { width: 77%; }
.news-article .cia-bar-w-78 { width: 78%; }
.news-article .cia-bar-w-79 { width: 79%; }
.news-article .cia-bar-w-80 { width: 80%; }
.news-article .cia-bar-w-81 { width: 81%; }
.news-article .cia-bar-w-82 { width: 82%; }
.news-article .cia-bar-w-83 { width: 83%; }
.news-article .cia-bar-w-84 { width: 84%; }
.news-article .cia-bar-w-85 { width: 85%; }
.news-article .cia-bar-w-86 { width: 86%; }
.news-article .cia-bar-w-87 { width: 87%; }
.news-article .cia-bar-w-88 { width: 88%; }
.news-article .cia-bar-w-89 { width: 89%; }
.news-article .cia-bar-w-90 { width: 90%; }
.news-article .cia-bar-w-91 { width: 91%; }
.news-article .cia-bar-w-92 { width: 92%; }
.news-article .cia-bar-w-93 { width: 93%; }
.news-article .cia-bar-w-94 { width: 94%; }
.news-article .cia-bar-w-95 { width: 95%; }
.news-article .cia-bar-w-96 { width: 96%; }
.news-article .cia-bar-w-97 { width: 97%; }
.news-article .cia-bar-w-98 { width: 98%; }
.news-article .cia-bar-w-99 { width: 99%; }
.news-article .cia-bar-w-100 { width: 100%; }

.news-article .cia-bar-pct {
  flex: 0 0 2.5rem;
  text-align: right;
  color: #a0a0a0;
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
}

/* Data source note */
.news-article .cia-data-source-note {
  color: #666;
  font-size: 0.75rem;
  margin: 1.5rem 0 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 0.75rem;
}

@media (min-width: 768px) {
  .news-article .cia-panels-grid {
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  }
}

@media (min-width: 1200px) {
  .news-article .cia-panels-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

[dir="rtl"] .news-article .cia-overview-section {
  direction: rtl;
  text-align: right;
}

[dir="rtl"] .news-article .cia-bar-label {
  text-align: right;
}

/* Watch Section */
.news-article .watch-section {
  background: linear-gradient(135deg, var(--primary-color, #006633) 0%, var(--primary-light, #007744) 100%);
  color: white;
  border-radius: var(--border-radius-lg, 12px);
  padding: clamp(1.5rem, 3vw, 2.5rem);
  margin: 2rem 0;
  width: 100%;
  box-sizing: border-box;
}

.news-article .watch-section h2 {
  font-size: 1.5rem;
  margin: 0 0 1.5rem 0;
  font-weight: 700;
  text-align: center;
}

.news-article .watch-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.news-article .watch-list li {
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.news-article .watch-list li:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.news-article .watch-list strong {
  display: block;
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

/* Event Calendar (for Week Ahead articles) */
.news-article .event-calendar {
  background: linear-gradient(135deg, var(--primary-color, #006633) 0%, var(--primary-light, #007744) 100%);
  color: white;
  border-radius: var(--border-radius-lg, 12px);
  padding: clamp(1.5rem, 3vw, 2.5rem);
  margin: 2rem 0;
  box-shadow: 0 4px 6px var(--card-shadow, rgba(0, 102, 51, 0.08));
  width: 100%;
  box-sizing: border-box;
}

.news-article .event-calendar h2 {
  font-size: 1.5rem;
  margin: 0 0 1.5rem 0;
  font-weight: 700;
  text-align: center;
}

.news-article .calendar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-top: 1rem;
}

.news-article .calendar-day {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: var(--border-radius, 8px);
  padding: 1.25rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: transform 0.2s ease, background 0.2s ease;
}

/* Note: calendar-day is currently a non-interactive <div> without tabindex.
   Focus states below are included for future enhancement if calendar days
   become interactive (e.g., clickable for drill-down details).
   Currently only :hover applies. */
.news-article .calendar-day:hover,
.news-article .calendar-day:focus,
.news-article .calendar-day:focus-visible {
  background: rgba(255, 255, 255, 0.25);
  transform: translateY(-2px);
  outline: 2px solid rgba(255, 255, 255, 0.9);
  outline-offset: 3px;
}

.news-article .calendar-day.today {
  background: rgba(255, 255, 255, 0.3);
  border: 2px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}

.news-article .day-header {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.9;
  margin-bottom: 0.25rem;
  font-weight: 600;
}

.news-article .day-date {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  display: block;
}

.news-article .event-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.news-article .event-item {
  margin-bottom: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.news-article .event-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.news-article .event-time {
  font-size: 0.85rem;
  opacity: 0.9;
  font-weight: 500;
}

.news-article .event-title {
  font-weight: 600;
  margin-top: 0.25rem;
}

/* Article Footer */
.news-article .article-footer {
  border-top: 2px solid var(--section-border, #e9ecef);
  margin-top: 3rem;
  padding-top: 2rem;
}

/* Article sub-lede (secondary lead paragraph) */
.news-article .article-lede {
  font-size: 1.1rem;
  line-height: 1.7;
  color: var(--text-secondary, #4a4a4a);
  margin-bottom: 1.5rem;
  font-weight: 500;
}

/* Interpellation and motion entry cards */
.news-article .interpellation-entry,
.news-article .motion-entry {
  background: var(--badge-bg, #f8f9fa);
  border-left: 4px solid var(--primary-color, #006633);
  border-radius: 0 var(--border-radius-sm, 4px) var(--border-radius-sm, 4px) 0;
  padding: 1rem 1.25rem;
  margin: 1rem 0;
}

.news-article .interpellation-entry h4,
.news-article .motion-entry h4 {
  margin: 0 0 0.5rem 0;
  font-size: 1rem;
  color: var(--header-color, #006633);
}

.news-article .interpellation-entry p,
.news-article .motion-entry p {
  margin: 0.25rem 0;
  font-size: 0.95rem;
  line-height: 1.6;
}

html[data-theme="dark"] .news-article .interpellation-entry,
html[data-theme="dark"] .news-article .motion-entry {
  background: rgba(0, 28, 37, 0.4);
  border-left-color: var(--primary-color);
}

html[data-theme="dark"] .news-article .article-lede {
  color: var(--text-secondary, #b0b0b0);
}

[dir="rtl"] .news-article .interpellation-entry,
[dir="rtl"] .news-article .motion-entry {
  border-left: none;
  border-right: 4px solid var(--primary-color, #006633);
  border-radius: var(--border-radius-sm, 4px) 0 0 var(--border-radius-sm, 4px);
}

.news-article .article-sources {
  background: var(--badge-bg, #f8f9fa);
  padding: 1.5rem;
  border-radius: var(--border-radius, 8px);
  margin-bottom: 1.5rem;
}

.news-article .article-sources h3 {
  margin-top: 0;
  color: var(--primary-color, #006633);
  font-size: 1.2rem;
}

.news-article .article-sources p {
  margin: 0.75rem 0;
  font-size: 0.95rem;
  color: var(--text-secondary, #4a4a4a);
}

.news-article .article-nav {
  text-align: center;
}

.news-article .back-to-news {
  display: inline-block;
  color: var(--link-color, #007744);
  text-decoration: none;
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  border: 2px solid var(--link-color, #007744);
  border-radius: var(--border-radius, 8px);
  transition: all 0.3s ease;
}

.news-article .back-to-news:hover,
.news-article .back-to-news:focus,
.news-article .back-to-news:focus-visible {
  background: var(--link-color, #007744);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 119, 68, 0.2);
  outline: 3px solid currentColor;
  outline-offset: 2px;
}

/* Responsive Design for News Articles */
@media (max-width: 768px) {
  .news-article {
    padding: 0 0.75rem;
  }
  
  .news-article .article-header h1 {
    font-size: 1.75rem;
  }
  
  .news-article .calendar-grid {
    grid-template-columns: 1fr;
  }
  
  .news-article .event-calendar {
    padding: 1.5rem;
  }
  
  .news-article .watch-section {
    padding: 1.5rem;
  }
}

/* Site Tagline for News Articles */
.news-article .site-tagline {
  font-size: 0.85rem;
  color: var(--text-secondary, #6c757d);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color, #e9ecef);
  font-weight: 500;
}

/* Print Styles for News Articles */
@media print {
  .news-article .event-calendar,
  .news-article .watch-section {
    background: white;
    color: black;
    border: 2px solid #006633;
  }
  
  .news-article .back-to-news {
    display: none;
  }
}

/* RTL overrides for News Articles (Arabic & Hebrew) */
[dir="rtl"] .news-article {
  text-align: right;
}

[dir="rtl"] .news-article .article-header {
  text-align: right;
}

[dir="rtl"] .news-article .article-meta {
  flex-direction: row-reverse;
  justify-content: flex-start;
}

[dir="rtl"] .news-article .lede {
  padding-left: 0;
  padding-right: 1rem;
  border-left: none;
  border-right: 4px solid var(--primary-color, #006633);
}

[dir="rtl"] .news-article .context-box {
  border-left: none;
  border-right: 4px solid var(--primary-color, #006633);
}

[dir="rtl"] .news-article .breadcrumb-nav {
  direction: rtl;
}

[dir="rtl"] .news-article .watch-list li::before {
  margin-left: 0.5rem;
  margin-right: 0;
}

[dir="rtl"] .news-article .article-content ul,
[dir="rtl"] .news-article .article-content ol {
  padding-left: 0;
  padding-right: 2rem;
}

/* ========================================================================
   Article Language Switcher
   ======================================================================== */

.language-switcher {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.25rem;
  justify-content: center;
  align-items: center;
  padding: 0.5rem 1rem;
  background: var(--card-bg, #f0f2f5);
  border-bottom: 2px solid var(--primary-color, #006633);
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.language-switcher .lang-link {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.3rem 0.5rem;
  border-radius: 4px;
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-color, #333);
  transition: background 0.2s ease, color 0.2s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.language-switcher .lang-link:hover,
.language-switcher .lang-link:focus-visible {
  background: var(--primary-color, #006633);
  color: #fff;
}

.language-switcher .lang-link:focus-visible {
  outline: 2px solid var(--primary-color, #006633);
  outline-offset: 2px;
}

.language-switcher .lang-link.active {
  background: var(--primary-color, #006633);
  color: #fff;
  font-weight: 600;
}

/* Article top navigation bar (Back to News at top) */
.article-top-nav {
  max-width: 100%;
  margin: 0.75rem auto 0;
  padding: 0 clamp(1rem, 3vw, 3rem);
}

.article-top-nav .back-to-news {
  display: inline-block;
  color: var(--link-color, #007744);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.5rem 0;
  transition: color 0.2s ease;
}

.article-top-nav .back-to-news:hover,
.article-top-nav .back-to-news:focus-visible {
  color: var(--primary-color, #006633);
  text-decoration: underline;
}

/* RTL overrides for language switcher */
[dir="rtl"] .language-switcher {
  direction: rtl;
}

[dir="rtl"] .article-top-nav {
  text-align: right;
}

[dir="rtl"] .article-top-nav .back-to-news {
  direction: rtl;
}

/* Responsive language switcher */
@media (max-width: 768px) {
  .language-switcher {
    gap: 0.15rem;
    padding: 0.4rem 0.5rem;
    justify-content: flex-start;
  }

  .language-switcher .lang-link {
    padding: 0.25rem 0.4rem;
    font-size: 0.72rem;
  }

  .article-top-nav {
    padding: 0 1rem;
  }
}

/* Language badge styles (namespaced under .news-page) */
.news-page .lang-badge-sm {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: rgba(0, 102, 51, 0.1);
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  font-size: 0.75rem;
  color: var(--primary-color, #006633);
  border: 1px solid rgba(0, 102, 51, 0.2);
  font-weight: 500;
}

/* Available Languages Section (namespaced under .news-page) */
.news-page .available-languages {
  margin: 0.5rem 0;
  font-size: 0.85rem;
  color: var(--text-secondary, #6c757d);
}

.news-page .available-languages strong {
  font-weight: 600;
  margin-right: 0.5rem;
}

/* ==================================================
   CHART STATE OVERLAYS (Loading/Empty/Error)
   ================================================== */
/* Styles for Chart.js and D3.js visualization states
 * Provides user-friendly feedback during data loading,
 * empty data scenarios, and error conditions
 * WCAG 2.1 AA compliant with proper contrast and ARIA support
 */

/* Common state container styles */
.chart-loading-state,
.chart-empty-state,
.chart-error-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  padding: 2rem;
  text-align: center;
  background: rgba(26, 30, 61, 0.5);
  border-radius: 8px;
  border: 2px dashed rgba(255, 255, 255, 0.1);
}

/* Loading state */
.chart-loading-state {
  border-color: var(--primary-cyan, #00d9ff);
}

.chart-loading-state .spinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(0, 217, 255, 0.2);
  border-top-color: var(--primary-cyan, #00d9ff);
  border-radius: 50%;
  animation: spinner-rotation 0.8s linear infinite;
  margin-bottom: 1rem;
}

@keyframes spinner-rotation {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.chart-loading-state p {
  color: var(--primary-cyan, #00d9ff);
  font-size: 1rem;
  font-weight: 500;
  margin: 0;
}

/* Empty state */
.chart-empty-state {
  border-color: var(--primary-yellow, #ffbe0b);
}

.chart-empty-state .empty-icon {
  width: 64px;
  height: 64px;
  color: var(--primary-yellow, #ffbe0b);
  margin-bottom: 1rem;
  stroke-width: 2;
}

.chart-empty-state h3 {
  color: var(--light-text, #e0e0e0);
  font-family: 'Orbitron', 'Orbitron Fallback', sans-serif;
  font-size: 1.5rem;
  margin: 0 0 0.5rem 0;
  font-weight: 600;
}

.chart-empty-state p {
  color: rgba(224, 224, 224, 0.8);
  font-size: 1rem;
  margin: 0.5rem 0;
  line-height: 1.5;
}

.chart-empty-state .help-text {
  font-size: 0.9rem;
  color: rgba(224, 224, 224, 0.6);
}

.chart-empty-state a {
  color: var(--primary-cyan, #00d9ff);
  text-decoration: underline;
}

.chart-empty-state a:hover {
  color: var(--primary-magenta, #ff006e);
}

/* Error state */
.chart-error-state {
  border-color: var(--primary-magenta, #ff006e);
}

.chart-error-state .error-icon {
  width: 64px;
  height: 64px;
  color: var(--primary-magenta, #ff006e);
  margin-bottom: 1rem;
  stroke-width: 2;
}

.chart-error-state h3 {
  color: var(--light-text, #e0e0e0);
  font-family: 'Orbitron', 'Orbitron Fallback', sans-serif;
  font-size: 1.5rem;
  margin: 0 0 0.5rem 0;
  font-weight: 600;
}

.chart-error-state p {
  color: rgba(224, 224, 224, 0.8);
  font-size: 1rem;
  margin: 0.5rem 0 1.5rem 0;
  line-height: 1.5;
}

.chart-error-state .retry-button {
  background: var(--primary-cyan, #00d9ff);
  color: var(--dark-bg, #0a0e27);
  border: none;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  font-family: 'Inter', 'Inter Fallback', sans-serif;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.chart-error-state .retry-button:hover {
  background: var(--primary-magenta, #ff006e);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(255, 0, 110, 0.3);
}

.chart-error-state .retry-button:focus {
  outline: 3px solid var(--primary-cyan, #00d9ff);
  outline-offset: 2px;
}

.chart-error-state .retry-button:active {
  transform: translateY(0);
}

/* Responsive adjustments for mobile */
@media (max-width: 768px) {
  .chart-loading-state,
  .chart-empty-state,
  .chart-error-state {
    min-height: 250px;
    padding: 1.5rem;
  }
  
  .chart-loading-state .spinner {
    width: 40px;
    height: 40px;
    border-width: 3px;
  }
  
  .chart-empty-state .empty-icon,
  .chart-error-state .error-icon {
    width: 48px;
    height: 48px;
  }
  
  .chart-empty-state h3,
  .chart-error-state h3 {
    font-size: 1.25rem;
  }
  
  .chart-empty-state p,
  .chart-error-state p {
    font-size: 0.9rem;
  }
}

/* Focus indicators for accessibility (WCAG 2.1 AA) */
canvas:focus-visible,
svg:focus-visible,
.chart-card:focus-within {
  outline: 3px solid var(--primary-cyan, #00d9ff);
  outline-offset: 2px;
}

/* Fallback for browsers without :focus-visible support */
@supports not selector(:focus-visible) {
  canvas:focus,
  svg:focus,
  .chart-card:focus-within {
    outline: 3px solid var(--primary-cyan, #00d9ff);
    outline-offset: 2px;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .chart-loading-state,
  .chart-empty-state,
  .chart-error-state {
    border-width: 3px;
    border-style: solid;
  }
  
  .chart-error-state .retry-button {
    border: 2px solid currentColor;
  }
}

/* =============================================================================
   UI/UX IMPROVEMENTS – Design Tokens, Accessibility, Visual Polish
   Added: design tokens, skeleton animation, card hover/focus, article readability,
          RTL logical properties, forced-colors, scroll-to-top, language switcher
   ============================================================================= */

/* ── 1. Skeleton Loading Animation ────────────────────────────────────────── */
@keyframes shimmer {
  0%   { background-position: -200% center; }
  100% { background-position:  200% center; }
}

.skeleton {
  background: linear-gradient(
    90deg,
    var(--skeleton-base)  25%,
    var(--skeleton-shine) 50%,
    var(--skeleton-base)  75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--border-radius-sm);
  color: transparent !important;
  pointer-events: none;
  user-select: none;
}

/* Skeleton shapes */
.skeleton-text {
  height: 1em;
  margin-block-end: var(--space-2);
  border-radius: 3px;
}

.skeleton-heading {
  height: 1.5em;
  width: 60%;
  margin-block-end: var(--space-3);
  border-radius: 3px;
}

.skeleton-avatar {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  flex-shrink: 0;
}

.skeleton-card {
  height: 160px;
  border-radius: var(--border-radius-lg);
}

/* Chart container placeholder shown while a lazy dashboard module loads */
.chart-skeleton {
  background: linear-gradient(
    90deg,
    var(--skeleton-base)  25%,
    var(--skeleton-shine) 50%,
    var(--skeleton-base)  75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--border-radius-lg, 8px);
  min-height: 300px;
  pointer-events: none;
}

/* Respect reduced-motion preference */
@media (prefers-reduced-motion: reduce) {
  .skeleton {
    animation: none;
    opacity: 0.6;
  }
  .chart-skeleton {
    animation: none;
    opacity: 0.6;
  }
}

/* ── 2. Enhanced Card Styles (hover lift + focus-within ring) ───────────────── */
.card,
.metric-card,
.prediction-card,
.scenario-card,
.ranking-item,
.committee-card {
  box-shadow: var(--card-shadow-resting);
  border-radius: var(--border-radius-lg);
  transition: var(--card-transition);
}

.card:hover,
.prediction-card:hover,
.scenario-card:hover,
.ranking-item:hover,
.committee-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--card-shadow-hover);
}

.card:focus-within,
.prediction-card:focus-within,
.scenario-card:focus-within,
.ranking-item:focus-within,
.committee-card:focus-within {
  box-shadow: var(--card-shadow-focus), var(--card-shadow-resting);
  outline: var(--focus-ring);
  outline-offset: var(--focus-offset);
}

/* ── 3. Enhanced Focus Indicators using token ───────────────────────────────── */
/* Override the hardcoded --primary-color fallbacks with the new --focus-color token */
@supports selector(:focus-visible) {
  :where(
    button,
    [href],
    input,
    select,
    textarea,
    summary,
    details,
    [role="button"],
    [role="link"],
    [tabindex]:not([tabindex="-1"])
  ):focus-visible {
    outline: var(--focus-ring);
    outline-offset: var(--focus-offset);
  }

  a:focus-visible {
    outline: var(--focus-ring);
    outline-offset: 4px;
    background-color: var(--focus-bg);
    border-radius: var(--border-radius-sm);
  }

  button:focus-visible,
  .btn:focus-visible,
  .btn-primary-large:focus-visible,
  .btn-secondary:focus-visible {
    outline: var(--focus-ring);
    outline-offset: var(--focus-offset);
    box-shadow: 0 0 0 4px var(--focus-glow);
  }

  input:focus-visible,
  textarea:focus-visible,
  select:focus-visible {
    outline: var(--focus-ring);
    outline-offset: var(--focus-offset);
    border-color: var(--focus-color);
    box-shadow: 0 0 0 3px var(--focus-glow);
  }
}

/* ── 4. Link Underline Animation ─────────────────────────────────────────────── */
/* Smooth animated underline on hover/focus – decorative but consistent */
a:not(.btn):not(.btn-primary-large):not(.btn-secondary):not(.nav-link):not([class*="badge"]) {
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: text-decoration-color 0.2s ease, color 0.2s ease;
}

a:not(.btn):not(.btn-primary-large):not(.btn-secondary):not(.nav-link):not([class*="badge"]):hover {
  text-decoration-thickness: 2px;
  text-underline-offset: 2px;
}

/* ── 5. Article Text Readability ──────────────────────────────────────── */
/* Article content — readable width within constrained container */
.article-content,
.news-article .article-content,
.news-article .lede,
.article-body,
.prose {
  max-width: 100%;
}

/* Constrained article container for readability */
.news-article {
  max-width: 1200px;
  margin-inline: auto;
}

/* ── 6. Pull-Quote Styling ────────────────────────────────────────────────── */
.pull-quote {
  font-size: var(--fluid-lg, 1.333rem);
  font-style: italic;
  line-height: var(--line-height-relaxed, 1.75);
  color: var(--primary-color);
  border-inline-start: 4px solid var(--primary-color);
  padding-inline-start: var(--space-5);
  margin-block: var(--space-7);
  margin-inline: 0;
}

@media (prefers-color-scheme: dark) {
  .pull-quote {
    color: var(--primary-light, #00ff88);
    border-inline-start-color: var(--primary-light, #00ff88);
  }
}

/* ── 7. CSS Logical Properties for RTL Support ────────────────────────────── */
/* Ensure layout components use logical rather than physical properties */
.lede,
.news-article .lede {
  padding-inline-start: var(--space-4);
  border-inline-start: 4px solid var(--primary-color, #006633);
  /* Remove physical fallbacks below (kept for older browsers with @supports) */
}

@supports (margin-inline-start: 0) {
  .container,
  .news-article,
  .cia-dashboard {
    margin-inline: auto;
  }

  /* Navigation items spacing */
  .nav-item + .nav-item {
    margin-inline-start: var(--space-4);
  }

  /* Badge spacing */
  .badge,
  .party-badge,
  .alert-badge {
    padding-inline: var(--space-2);
    padding-block: var(--space-1);
  }

  /* Section headings bottom border */
  .section-heading {
    padding-block-end: var(--space-2);
  }
}

/* RTL-specific overrides */
[dir="rtl"] .lede,
[dir="rtl"] .news-article .lede {
  padding-inline-start: var(--space-4);
  padding-inline-end: 0;
  border-inline-start: 4px solid var(--primary-color, #006633);
  border-inline-end: none;
}

[dir="rtl"] .pull-quote {
  border-inline-start: 4px solid var(--primary-color);
  border-inline-end: none;
  padding-inline-start: var(--space-5);
  padding-inline-end: 0;
}

/* ── 8. Forced-Colors (Windows High Contrast) Support ──────────────────────── */
@media (forced-colors: active) {
  /* Cards: force border so they're distinguishable without shadow */
  .card,
  .metric-card,
  .prediction-card,
  .scenario-card,
  .ranking-item,
  .committee-card,
  .chart-loading-state,
  .chart-empty-state,
  .chart-error-state {
    border: 2px solid ButtonText;
    box-shadow: none;
    background: Canvas;
    color: CanvasText;
  }

  /* Remove gradient backgrounds – forced-colors strips them anyway */
  .metric-card {
    background: ButtonFace;
    color: ButtonText;
  }

  /* Buttons */
  .btn,
  .btn-primary-large,
  .btn-secondary,
  button {
    border: 2px solid ButtonText;
    background: ButtonFace;
    color: ButtonText;
  }

  /* Focus rings remain visible */
  *:focus-visible {
    outline: 3px solid Highlight;
    outline-offset: 2px;
  }

  /* Links */
  a {
    color: LinkText;
  }

  a:visited {
    color: VisitedText;
  }

  /* Progress / skeleton: invisible in high-contrast so hide gracefully */
  .skeleton {
    border: 1px dashed GrayText;
    animation: none;
  }

  /* Back-to-top button */
  .back-to-top {
    border: 2px solid ButtonText;
    background: ButtonFace;
    color: ButtonText;
  }
}

/* ── 9. Scroll-to-Top Button Enhancement ────────────────────────────────────── */
/* Existing .back-to-top is styled elsewhere; add logical properties & token use */
@supports (inset-inline-end: 1rem) and (inset-block-end: 1rem) {
  .back-to-top {
    /* Clear physical insets so only logical properties control position */
    right: auto;
    left: auto;
    top: auto;
    bottom: auto;
    /* Use logical properties for position */
    inset-inline-end: var(--space-5);
    inset-block-end: var(--space-5);
    /* Smooth appearance */
    transition: opacity 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
  }
}

.back-to-top:hover {
  transform: translateY(-3px);
}

.back-to-top:focus-visible {
  outline: var(--focus-ring);
  outline-offset: var(--focus-offset);
}

/* ── 10. Mobile Language Switcher Improvement ──────────────────────────────── */
@media (max-width: 767px) {
  /* Language switcher: single-row horizontal scroll on mobile.
     Targets both .language-switcher (markup class) and legacy wrapper names. */
  .language-switcher,
  .lang-switcher,
  .language-menu,
  .lang-menu {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.15rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    justify-content: flex-start;
    padding: 0.4rem 0.5rem;
  }
}

/* ── 11. Responsive Dashboard Grid Enhancement ──────────────────────────────── */
/* Enhance existing grids with auto-fit/minmax for fluid column counts */
.metrics-cards,
.predictions-grid,
.scenarios-grid,
.committee-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: var(--space-5);
}

/* Chart containers responsive grid */
.charts-grid,
.chart-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr));
  gap: var(--space-5);
}

/* ── 12. Dark-Mode WCAG AA Contrast Fixes ─────────────────────────────────── */
/* Ensure --text-secondary and muted text meet 4.5:1 on dark backgrounds */
@media (prefers-color-scheme: dark) {
  /* #aaaaaa on #001a1a = 8.2:1 – already fine, but ensure secondary text is legible */
  .text-secondary,
  .data-attribution,
  .article-tagline,
  .ranking-party,
  .ranking-role,
  .score-label,
  .seats-label,
  .confidence-interval,
  .scenario-risk-level {
    color: #b8b8b8; /* 9.0:1 on #001a1a ✓ */
  }

  /* Muted placeholder / helper text */
  ::placeholder {
    color: #909090; /* 5.3:1 on #001c25 ✓ */
    opacity: 1;
  }

  /* Improve link colours in dark mode for AA compliance */
  a {
    color: var(--link-color, #58a6ff); /* 5.5:1 on #001a1a ✓ */
  }

  a:hover {
    color: var(--link-hover, #79b8ff);
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   THEME TOGGLE SYSTEM
   ─────────────────────────────────────────────────────────────────────────
   These [data-theme] selectors let the user override the OS colour scheme.
   They carry higher specificity than :root and override every
   @media (prefers-color-scheme: dark) block written above.

   Architecture:
     • html[data-theme="dark"]  → Ingress-inspired dark (mirrors media-query)
     • html[data-theme="light"] → Professional green / light (mirrors :root)

   WCAG 2.1 AA compliance notes:
     Dark  bg #001a1a / text #f0f0f0  → 18.1:1  ✅
     Light bg #f5f5f5 / text #1a1a1a  → 16.1:1  ✅
     Cyan  #0077b6 on #f5f5f5         →  5.2:1  ✅ (primary-cyan light)
     Cyan  #00d9ff on #001a1a         →  9.4:1  ✅ (primary-cyan dark)
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Dark theme: explicit user choice ─────────────────────────────────────── */
html[data-theme="dark"] {
  /* Core palette (mirrors @media prefers-color-scheme: dark) */
  --primary-color:         #00cc66;
  --primary-light:         #00ff88;
  --primary-dark:          #00bb77;
  --accent-color:          #33eeff;
  --bg-color:              #001a1a;
  --card-bg:               #001c25;
  --text-color:            #f0f0f0;
  --text-secondary:        #aaaaaa;
  --header-color:          #58a6ff;
  --border-color:          rgba(0, 204, 102, 0.3);
  --card-border:           rgba(0, 204, 102, 0.3);
  --card-shadow:           rgba(0, 204, 102, 0.2);
  --link-color:            #58a6ff;
  --link-hover:            #79b8ff;
  --button-bg:             #1a6fd9;
  --button-text:           #ffffff;
  --section-border:        #444;
  --badge-bg:              #333;
  --confidentiality-color: #bd93f9;
  --integrity-color:       #50fa7b;
  --availability-color:    #8be9fd;
  /* Focus / card-elevation (dark) */
  --focus-color:           #00d9ff;
  --focus-ring:            3px solid var(--focus-color);
  --focus-bg:              rgba(0, 217, 255, 0.08);
  --focus-glow:            rgba(0, 217, 255, 0.18);
  --card-shadow-resting:   0 1px 4px rgba(0,0,0,0.5), 0 1px 3px rgba(0,0,0,0.4);
  --card-shadow-hover:     0 6px 18px rgba(0,0,0,0.6), 0 3px 8px rgba(0,0,0,0.4);
  --card-shadow-focus:     0 0 0 3px var(--focus-color);
  --skeleton-base:         rgba(0, 204, 102, 0.06);
  --skeleton-shine:        rgba(0, 204, 102, 0.14);
  /* Cyberpunk design-system tokens */
  --dark-bg:               #001a1a;
  --mid-bg:                #001c25;
  --light-text:            #f0f0f0;
  --primary-cyan:          #00d9ff;
  /* color-scheme: informs browsers to render native UI controls (scrollbars,
     form inputs, date pickers) in dark mode, matching the custom CSS palette.
     This improves accessibility and visual consistency beyond custom styles. */
  color-scheme: dark;
}

/* Element-level dark overrides — mirrors @media (prefers-color-scheme: dark) */
html[data-theme="dark"] h1,
html[data-theme="dark"] h2,
html[data-theme="dark"] h3 {
  font-family: "Orbitron", "Orbitron Fallback", sans-serif;
  text-transform: uppercase;
  letter-spacing: 1px;
  text-shadow: 0 0 5px rgba(0, 204, 102, 0.5);
}

html[data-theme="dark"] a:hover {
  text-shadow: 0 0 8px rgba(0, 204, 102, 0.5);
}

html[data-theme="dark"] header {
  border-bottom: 1px solid rgba(0, 204, 102, 0.3);
  background: rgba(0, 26, 26, 0.95);
}

html[data-theme="dark"] .sticky-nav {
  background: rgba(0, 26, 26, 0.97);
  border-bottom: 2px solid var(--primary-color);
  box-shadow: 0 2px 10px rgba(0, 204, 102, 0.2);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

html[data-theme="dark"] .card {
  background: linear-gradient(135deg, rgba(0, 28, 37, 0.9), rgba(0, 26, 26, 0.9));
  border: 1px solid var(--border-color);
  box-shadow: 0 2px 12px rgba(0, 204, 102, 0.12);
}

html[data-theme="dark"] .card:hover {
  border-color: rgba(0, 204, 102, 0.5);
  box-shadow: 0 4px 20px rgba(0, 204, 102, 0.2);
}

html[data-theme="dark"] section {
  background: rgba(0, 28, 37, 0.3);
  border-radius: var(--border-radius);
}

html[data-theme="dark"] .btn {
  background: rgba(0, 204, 102, 0.2);
  color: var(--primary-light);
  border: 1px solid rgba(0, 204, 102, 0.3);
}

html[data-theme="dark"] .btn:hover {
  background: rgba(0, 204, 102, 0.3);
  box-shadow: 0 0 12px rgba(0, 204, 102, 0.3);
}

html[data-theme="dark"] ul li::before {
  content: "▶";
  font-size: 0.7rem;
  top: 0.3rem;
}

html[data-theme="dark"] .dashboard-cta {
  background: rgba(0, 28, 37, 0.6);
  border: 1px solid rgba(0, 204, 102, 0.3);
  box-shadow: 0 0 20px rgba(0, 204, 102, 0.1);
}

html[data-theme="dark"] .news-navigation {
  background: rgba(0, 28, 37, 0.6);
  border: 1px solid rgba(0, 204, 102, 0.3);
}

html[data-theme="dark"] footer {
  background: rgba(0, 26, 26, 0.95);
  border-top: 2px solid var(--primary-color);
}

/* Scan-line effect for dark theme.
   Note: base scan-line styles are also defined under @media (prefers-color-scheme: dark).
   The [data-theme] selector takes higher specificity and overrides the media-query rule. */
html[data-theme="dark"] body::after {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: repeating-linear-gradient(
    transparent 0px,
    rgba(0, 0, 0, 0.05) 1px,
    transparent 2px
  );
  pointer-events: none;
  z-index: 9999;
  opacity: 0.3;
}

html[data-theme="dark"] .breadcrumb {
  background: rgba(0, 26, 26, 0.4);
  border-color: var(--border-color);
}

html[data-theme="dark"] .code-block {
  background: rgba(0, 0, 0, 0.3);
  border-color: var(--border-color);
  color: var(--text-color);
}

html[data-theme="dark"] .installation-step {
  background: rgba(3, 105, 161, 0.1);
  border-left-color: var(--primary-color);
}

html[data-theme="dark"] .badge-success {
  background: rgba(40, 167, 69, 0.3);
  color: #50fa7b;
  border: 1px solid #50fa7b;
  box-shadow: 0 0 8px rgba(80, 250, 123, 0.3);
}

html[data-theme="dark"] .badge-warning {
  background: rgba(255, 193, 7, 0.3);
  color: #f1fa8c;
  border: 1px solid #f1fa8c;
  box-shadow: 0 0 8px rgba(241, 250, 140, 0.3);
}

html[data-theme="dark"] .screenshot-container {
  border-color: var(--border-color);
  box-shadow: 0 0 10px rgba(0, 204, 102, 0.2);
}

/* ── Light theme: explicit user choice ────────────────────────────────────── */
html[data-theme="light"] {
  /* Core palette (mirrors :root light defaults) */
  --primary-color:         #006633;
  --primary-light:         #007744;
  --primary-dark:          #004422;
  --accent-color:          #008838;
  --bg-color:              #f0f2f5;
  --card-bg:               #ffffff;
  --text-color:            #1a1a1a;
  --text-secondary:        #4a4a4a;
  --header-color:          #006633;
  --border-color:          rgba(0, 102, 51, 0.12);
  --card-border:           rgba(0, 0, 0, 0.08);
  --card-shadow:           rgba(0, 102, 51, 0.08);
  --link-color:            #007744;
  --link-hover:            #006633;
  --button-bg:             #007744;
  --button-text:           #fff;
  --section-border:        #e0e4e8;
  --badge-bg:              #f0f2f5;
  --confidentiality-color: #7B2CBF;
  --integrity-color:       #008838;
  --availability-color:    #007744;
  /* Focus / card-elevation (light) */
  --focus-color:           #007744;
  --focus-ring:            3px solid var(--focus-color);
  --focus-bg:              rgba(0, 119, 68, 0.08);
  --focus-glow:            rgba(0, 119, 68, 0.18);
  --card-shadow-resting:   0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --card-shadow-hover:     0 8px 24px rgba(0,0,0,0.10), 0 4px 8px rgba(0,0,0,0.06);
  --card-shadow-focus:     0 0 0 3px var(--focus-color);
  --skeleton-base:         rgba(0, 102, 51, 0.06);
  --skeleton-shine:        rgba(0, 102, 51, 0.13);
  /* Cyberpunk design-system tokens (light) — per spec */
  --dark-bg:               #f0f2f5;
  --mid-bg:                #e4e7eb;
  --light-text:            #1a1e3d;
  --primary-cyan:          #0077b6;
  /* color-scheme: informs browsers to render native UI controls (scrollbars,
     form inputs, date pickers) in light mode, matching the custom CSS palette.
     This improves accessibility and visual consistency beyond custom styles. */
  color-scheme: light;
}

/* Disable dark element-level overrides when user forces light */
html[data-theme="light"] body::after,
html[data-theme="light"] body::before {
  display: none;
}

html[data-theme="light"] h1,
html[data-theme="light"] h2,
html[data-theme="light"] h3 {
  font-family: var(--font-main);
  text-transform: none;
  letter-spacing: normal;
  text-shadow: none;
  color: var(--header-color);
}

html[data-theme="light"] a:hover {
  text-shadow: none;
}

html[data-theme="light"] header {
  border-bottom: 1px solid var(--card-border);
  background: var(--card-bg);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

html[data-theme="light"] .card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  box-shadow: var(--card-shadow-resting);
}

html[data-theme="light"] .card:hover {
  box-shadow: var(--card-shadow-hover);
  border-color: rgba(0, 102, 51, 0.2);
}

html[data-theme="light"] section {
  background: rgba(0, 102, 51, 0.02);
  border-radius: var(--border-radius);
}

html[data-theme="light"] .btn {
  background: var(--button-bg);
  color: var(--button-text);
  border: none;
  box-shadow: 0 2px 4px rgba(0, 119, 68, 0.15);
}

html[data-theme="light"] .btn:hover {
  box-shadow: 0 4px 8px rgba(0, 119, 68, 0.25);
}

html[data-theme="light"] ul li::before {
  content: "•";
  font-size: 1rem;
}

html[data-theme="light"] .sticky-nav {
  background: rgba(255, 255, 255, 0.97);
  border-bottom: 2px solid var(--primary-color);
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.06);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

html[data-theme="light"] .dashboard-cta,
html[data-theme="light"] .news-navigation {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  box-shadow: var(--card-shadow-resting);
}

html[data-theme="light"] .breadcrumb {
  background: var(--card-bg);
  border-color: var(--border-color);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

html[data-theme="light"] .code-block {
  background: #f8f9fa;
  border-color: var(--card-border);
  color: var(--text-color);
}

html[data-theme="light"] .installation-step {
  background: #f0f9ff;
  border-left-color: #0369a1;
}

html[data-theme="light"] footer {
  background: var(--card-bg);
  border-top: 2px solid var(--primary-color);
  box-shadow: 0 -1px 4px rgba(0, 0, 0, 0.04);
}

/* ─── Theme Toggle Button ─────────────────────────────────────────────────── */

.theme-toggle-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: var(--card-bg);
  border: 2px solid var(--border-color);
  border-radius: 2rem;
  padding: 0.4rem 0.8rem;
  cursor: pointer;
  font-size: 1rem;
  display: -webkit-inline-flex;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
  z-index: 100;
  color: var(--text-color);
  box-shadow: var(--card-shadow-resting);
  min-width: 44px;   /* WCAG 2.5.5 touch target */
  min-height: 44px;
  justify-content: center;
  font-family: var(--font-main);
  line-height: 1;
  -webkit-user-select: none;
  user-select: none;
}

.theme-toggle-btn:hover {
  transform: scale(1.06);
  box-shadow: var(--card-shadow-hover);
  border-color: var(--primary-color);
  background: var(--bg-color);
}

.theme-toggle-btn:focus,
.theme-toggle-btn:focus-visible {
  outline: var(--focus-ring);
  outline-offset: var(--focus-offset, 2px);
}

.theme-toggle-btn:active {
  transform: scale(0.97);
}

.theme-toggle-btn .theme-icon {
  font-size: 1.1rem;
  line-height: 1;
  display: block;
}

/* RTL: flip button to left side */
[dir="rtl"] .theme-toggle-btn {
  right: auto;
  left: 1rem;
}

/* Responsive */
@media (max-width: 768px) {
  .theme-toggle-btn {
    top: 0.5rem;
    right: 0.5rem;
    padding: 0.3rem 0.6rem;
    font-size: 0.9rem;
    min-width: 44px;
    min-height: 44px;
  }

  [dir="rtl"] .theme-toggle-btn {
    right: auto;
    left: 0.5rem;
  }
}

/* ── News Page Theme Overrides ─────────────────────────────────────────────── */
/* Light theme: news page uses professional green tones instead of cyberpunk dark */
html[data-theme="light"] body.news-page {
  background: var(--bg-color);
  color: var(--text-color);
}

html[data-theme="light"] .news-page .header-section {
  background: var(--card-bg);
  border-bottom-color: var(--primary-color);
}

html[data-theme="light"] .news-page h1 {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

html[data-theme="light"] .news-page .subtitle {
  color: var(--text-secondary);
}

html[data-theme="light"] .news-page .back-link {
  color: var(--link-color);
}

html[data-theme="light"] .news-page .filter-bar {
  background: var(--card-bg);
  border-color: var(--border-color);
}

html[data-theme="light"] .news-page .filter-group label {
  color: var(--primary-color);
}

html[data-theme="light"] .news-page .filter-group select,
html[data-theme="light"] .news-page .filter-group input[type="search"] {
  background: var(--bg-color);
  border-color: var(--border-color);
  color: var(--text-color);
}

html[data-theme="light"] .news-page .article-card {
  background: var(--card-bg);
  border-color: var(--border-color);
  box-shadow: var(--card-shadow-resting);
}

html[data-theme="light"] .news-page .article-card:hover {
  border-color: var(--primary-color);
  box-shadow: var(--card-shadow-hover);
}

html[data-theme="light"] .news-page .article-date {
  color: var(--primary-color);
}

html[data-theme="light"] .news-page .article-type {
  background: rgba(0, 102, 51, 0.08);
  color: var(--primary-color);
}

html[data-theme="light"] .news-page .article-title a:hover {
  color: var(--primary-color);
}

html[data-theme="light"] .news-page .tag {
  background: rgba(0, 102, 51, 0.06);
  border-color: rgba(0, 102, 51, 0.2);
  color: var(--primary-color);
}

html[data-theme="light"] .news-page .load-more-btn {
  background: var(--button-bg);
  border-color: var(--primary-color);
  color: #fff;
}

html[data-theme="light"] .news-page .load-more-btn:hover {
  background: var(--primary-dark);
}

html[data-theme="light"] .news-footer {
  background: var(--card-bg);
  border-top: 1px solid var(--border-color);
  color: var(--text-secondary);
}

html[data-theme="light"] .language-switcher {
  background: var(--card-bg);
  border-bottom-color: var(--primary-color);
}

/* Dark theme: news page keeps cyberpunk aesthetic */
html[data-theme="dark"] body.news-page {
  background: linear-gradient(135deg, #001a1a 0%, #001c25 100%);
  color: var(--text-color);
}

html[data-theme="dark"] .news-page .header-section {
  background: rgba(0, 28, 37, 0.9);
  border-bottom-color: var(--primary-cyan);
}

html[data-theme="dark"] .news-page .article-card {
  background: rgba(0, 28, 37, 0.8);
  border-color: rgba(0, 204, 102, 0.2);
}

html[data-theme="dark"] .news-page .article-card:hover {
  border-color: var(--primary-cyan);
  box-shadow: 0 4px 20px rgba(0, 217, 255, 0.15);
}

html[data-theme="dark"] .news-page .filter-bar {
  background: rgba(0, 28, 37, 0.6);
  border-color: rgba(0, 204, 102, 0.2);
}

html[data-theme="dark"] .news-footer {
  background: rgba(0, 28, 37, 0.8);
  border-top: 1px solid rgba(0, 204, 102, 0.2);
}

html[data-theme="dark"] .language-switcher {
  background: rgba(0, 28, 37, 0.8);
  border-bottom-color: var(--primary-cyan);
}

/* ── News Article (individual article pages) Theme Overrides ───────────────── */
/* Dark mode: news articles get cyberpunk styling */
html[data-theme="dark"] .news-article {
  background: var(--bg-color);
}

html[data-theme="dark"] .news-article .article-header {
  border-bottom-color: var(--primary-color);
}

html[data-theme="dark"] .news-article .article-header h1 {
  color: var(--primary-light);
}

html[data-theme="dark"] .news-article .context-box {
  background: rgba(0, 204, 102, 0.06);
  border-left-color: var(--primary-color);
}

html[data-theme="dark"] .news-article .deep-analysis {
  background: rgba(0, 28, 37, 0.5);
  border-color: var(--primary-color);
}

html[data-theme="dark"] .news-article .deep-analysis h2 {
  color: var(--primary-light);
  border-bottom-color: var(--primary-color);
}

html[data-theme="dark"] .news-article .deep-analysis h3 {
  color: var(--primary-color);
}

html[data-theme="dark"] .news-article .lede {
  border-left-color: var(--primary-color);
}

html[data-theme="dark"] .news-article .article-content h2 {
  color: var(--primary-light);
}

html[data-theme="dark"] .news-article .article-content h3 {
  color: var(--primary-color);
}

/* Dark mode: article content text alignment and spacing */
html[data-theme="dark"] .news-article .article-content p {
  color: var(--text-color, #e0e0e0);
}

html[data-theme="dark"] .news-article .article-sources {
  background: rgba(0, 28, 37, 0.4);
}

html[data-theme="dark"] .news-article .article-sources h3 {
  color: var(--primary-light);
}

/* Light mode: news articles get professional green tones */
html[data-theme="light"] .news-article {
  background: var(--bg-color);
}

html[data-theme="light"] .news-article .article-header h1 {
  color: var(--primary-color);
}

html[data-theme="light"] .news-article .context-box {
  background: rgba(0, 102, 51, 0.04);
}

html[data-theme="light"] .news-article .deep-analysis {
  background: rgba(0, 102, 51, 0.03);
  border-color: var(--primary-color);
}

html[data-theme="light"] .news-article .sankey-section,
html[data-theme="light"] .news-article .cia-overview-section {
  background: var(--card-bg);
  border-color: var(--primary-color);
}

html[data-theme="light"] .news-article .sankey-section h2,
html[data-theme="light"] .news-article .cia-overview-section h2 {
  color: var(--primary-color);
  border-bottom-color: var(--primary-color);
}

html[data-theme="light"] .news-article .sankey-summary,
html[data-theme="light"] .news-article .cia-section-summary {
  color: var(--text-secondary);
}

html[data-theme="light"] .news-article .cia-coalition-panel,
html[data-theme="light"] .news-article .cia-party-panel,
html[data-theme="light"] .news-article .cia-voting-panel {
  background: rgba(0, 102, 51, 0.04);
  border-color: rgba(0, 102, 51, 0.15);
}

html[data-theme="light"] .news-article .cia-panel-heading {
  color: var(--primary-color);
}

html[data-theme="light"] .news-article .cia-alignment-topic {
  color: var(--text-color);
}

html[data-theme="light"] .news-article .cia-bar-track {
  background: rgba(0, 0, 0, 0.08);
}

html[data-theme="light"] .news-article .watch-section {
  background: var(--card-bg);
  border-color: var(--primary-color);
}

html[data-theme="light"] .news-article .watch-list li {
  border-bottom-color: var(--border-color);
}

html[data-theme="light"] .news-article .event-calendar {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
}

/* ============================================================
   Fallback UI — error boundary cards and loading skeletons
   ============================================================ */

/* Error card */
.fallback-error-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-xl);
  border: 1px solid var(--danger-color);
  border-radius: var(--border-radius);
  background: rgba(220, 53, 69, 0.08);
  text-align: center;
}

.fallback-icon {
  font-size: 2rem;
  line-height: 1;
}

.fallback-message {
  margin: 0;
  color: var(--text-color);
  font-size: var(--font-size-base);
}

.fallback-retry-btn {
  margin-top: var(--spacing-sm);
  padding: 0.5rem 1.25rem;
  border: none;
  border-radius: var(--border-radius-sm);
  background: var(--primary-color);
  color: #fff;
  font-size: var(--font-size-base);
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.fallback-retry-btn:hover {
  opacity: 0.85;
}

.fallback-retry-btn:focus-visible {
  outline: var(--focus-ring);
  outline-offset: 2px;
}

/* Loading skeleton */
.fallback-loading-skeleton {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
  padding: var(--spacing-xl);
}

.skeleton-bar {
  height: 1.25rem;
  border-radius: var(--border-radius-sm);
  background: linear-gradient(
    90deg,
    var(--skeleton-base)  25%,
    var(--skeleton-shine) 50%,
    var(--skeleton-base)  75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
}

.skeleton-bar:nth-child(1) { width: 100%; }
.skeleton-bar:nth-child(2) { width: 85%; }
.skeleton-bar:nth-child(3) { width: 70%; }

/* Respect user preference for reduced motion */
@media (prefers-reduced-motion: reduce) {
  .skeleton-bar {
    animation: none;
    opacity: 0.6;
  }
}

/* Dark-mode adjustments */
@media (prefers-color-scheme: dark) {
  .fallback-error-card {
    border-color: #ef5350;
    background: rgba(239, 83, 80, 0.1);
  }
}

/* AI-Disrupted News Generation Section */
.ai-newsroom-section {
  background: linear-gradient(135deg, var(--card-bg, #1a1e3d), var(--dark-bg, #0a0e27));
  border-top: 2px solid var(--primary-color, #00d9ff);
  border-bottom: 2px solid var(--primary-color, #00d9ff);
  padding: 2rem 1.5rem;
  margin: 2rem 0 0;
  text-align: center;
}

.ai-newsroom-section .container {
  max-width: 100%;
  margin: 0 auto;
}

.ai-newsroom-section h2 {
  font-family: var(--font-heading, 'Orbitron', sans-serif);
  color: var(--primary-color, #00d9ff);
  font-size: clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem);
  margin-bottom: 1rem;
}

.ai-newsroom-section p {
  color: var(--text-secondary, #a0a0a0);
  font-size: clamp(0.875rem, 0.8rem + 0.3vw, 1rem);
  line-height: 1.7;
  margin: 0;
}

/* Footer disclaimer */
.footer-disclaimer {
  font-size: 0.85rem;
  color: var(--text-secondary, #a0a0a0);
  margin-top: 0.5rem;
}

.footer-disclaimer a {
  color: var(--primary-color, #00d9ff);
  text-decoration: underline;
}

.footer-disclaimer a:hover {
  color: var(--link-hover, #ff006e);
}

/* News index page footer */
.news-footer {
  text-align: center;
  padding: 1.5rem 1rem;
  color: var(--text-secondary, #a0a0a0);
  font-size: 0.9rem;
}

.news-footer a {
  color: var(--primary-color, #00d9ff);
  text-decoration: underline;
}

.news-footer a:hover {
  color: var(--link-hover, #ff006e);
}

/* Light mode: AI newsroom section */
html[data-theme="light"] .ai-newsroom-section {
  background: linear-gradient(135deg, var(--card-bg), var(--bg-color));
  border-top-color: var(--primary-color);
  border-bottom-color: var(--primary-color);
}

html[data-theme="light"] .ai-newsroom-section h2 {
  color: var(--primary-color);
}

html[data-theme="light"] .ai-newsroom-section p {
  color: var(--text-secondary);
}

html[data-theme="light"] .news-footer {
  color: var(--text-secondary);
}

html[data-theme="light"] .news-footer a {
  color: var(--primary-color);
}

html[data-theme="light"] .footer-disclaimer a {
  color: var(--primary-color);
}

