/* ════════════════════════════════════════════════════════════════════
   OptiVoic News — Premium Design System
   Dark mode first. Glassmorphism. Smooth micro-animations. Inter font.
   ════════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Playfair+Display:wght@700;800&display=swap');

/* ─── CSS Design Tokens ─────────────────────────────────────── */
:root {
  /* Background layers */
  --bg-base:       #080c18;
  --bg-surface:    #0d1428;
  --bg-elevated:   #131a30;
  --bg-card:       #161d35;
  --bg-card-hover: #1c2540;
  --bg-glass:      rgba(13, 20, 40, 0.6);

  /* Accent colors */
  --accent-primary:   #4f8ef7;
  --accent-glow:      rgba(79, 142, 247, 0.2);
  --accent-secondary: #7c6af7;

  /* Bias badge colors */
  --bias-center-left:    #60a5fa;
  --bias-center-left-bg: rgba(96, 165, 250, 0.12);
  --bias-center-left-glow: rgba(96, 165, 250, 0.3);
  --bias-center:       #10b981;
  --bias-center-bg:    rgba(16, 185, 129, 0.12);
  --bias-center-glow:  rgba(16, 185, 129, 0.3);
  --bias-center-right:    #f59e0b;
  --bias-center-right-bg: rgba(245, 158, 11, 0.12);
  --bias-center-right-glow: rgba(245, 158, 11, 0.3);

  /* Text hierarchy */
  --text-primary:   #f0f4ff;
  --text-secondary: #94a3b8;
  --text-muted:     #4a5568;
  --text-accent:    #4f8ef7;

  /* Borders */
  --border-subtle:  rgba(255, 255, 255, 0.06);
  --border-medium:  rgba(255, 255, 255, 0.1);
  --border-accent:  rgba(79, 142, 247, 0.3);

  /* Shadows */
  --shadow-card:    0 4px 24px rgba(0, 0, 0, 0.4);
  --shadow-card-hover: 0 12px 40px rgba(0, 0, 0, 0.6), 0 0 0 1px var(--border-medium);
  --shadow-glow:    0 0 30px var(--accent-glow);

  /* Spacing */
  --radius-sm:  6px;
  --radius-md:  12px;
  --radius-lg:  16px;
  --radius-xl:  24px;

  /* Transitions */
  --transition-fast:   0.15s ease;
  --transition-normal: 0.25s ease;
  --transition-slow:   0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Light mode overrides */
[data-theme="light"] {
  --bg-base:       #f1f5f9;
  --bg-surface:    #e2e8f0;
  --bg-elevated:   #cbd5e1;
  --bg-card:       #ffffff;
  --bg-card-hover: #f8fafc;
  --bg-glass:      rgba(241, 245, 249, 0.9);
  --text-primary:  #0f172a;
  --text-secondary:#334155;
  --text-muted:    #64748b;
  --border-subtle: rgba(15, 23, 42, 0.12);
  --border-medium: rgba(15, 23, 42, 0.22);
  --shadow-card:   0 4px 20px rgba(0, 0, 0, 0.08);
  --shadow-card-hover: 0 12px 36px rgba(0, 0, 0, 0.14), 0 0 0 1px var(--border-medium);
}

/* ─── Reset & Base ───────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ─── Accessibility: Focus Visible & Skip Link ───────────────── */
:focus-visible {
  outline: 2px solid var(--accent-primary) !important;
  outline-offset: 3px !important;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  top: -60px;
  left: 20px;
  background: var(--accent-primary);
  color: #ffffff !important;
  padding: 10px 18px;
  font-size: 0.9rem;
  font-weight: 700;
  border-radius: 0 0 8px 8px;
  z-index: 9999;
  transition: top 0.2s ease;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
  text-decoration: none;
}

.skip-link:focus {
  top: 0;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  transition: background var(--transition-slow), color var(--transition-slow);
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

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

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
}

/* ─── Background Gradient Orbs ───────────────────────────────── */
body::before {
  content: '';
  position: fixed;
  top: -20%;
  left: -10%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(79, 142, 247, 0.06) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

body::after {
  content: '';
  position: fixed;
  bottom: -20%;
  right: -10%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(124, 106, 247, 0.05) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* ─── Header ─────────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  background: var(--bg-glass);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0 24px;
}

.header-inner {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
  gap: 16px;
}

/* Logo */
.site-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.brand-logo-img {
  height: 42px;
  width: auto;
  object-fit: contain;
  border-radius: 8px;
  transition: transform var(--transition-fast);
}

.site-logo:hover .brand-logo-img {
  transform: scale(1.04);
}

.footer-logo-img {
  height: 36px;
  width: auto;
  object-fit: contain;
  border-radius: 6px;
}

.logo-text,
.header-text-group {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.logo-name,
.header-text-group h1 {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.logo-tagline,
.header-text-group span {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* Header search */
.header-search {
  flex: 1;
  max-width: 420px;
  position: relative;
}

.search-input {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 9px 16px 9px 40px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.875rem;
  transition: all var(--transition-fast);
  outline: none;
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-input:focus {
  border-color: var(--border-accent);
  background: var(--bg-card);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 16px;
  pointer-events: none;
}

/* Header actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.allsides-badge,
.allsides-info-btn,
.bias-guide-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-primary, #e5e7eb);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-family: inherit;
}

.shortcuts-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  color: var(--text-primary, #e5e7eb);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.allsides-badge:hover,
.allsides-info-btn:hover,
.bias-guide-btn:hover,
.shortcuts-toggle:hover {
  border-color: var(--border-accent);
  background: var(--bg-card-hover);
  color: #ffffff;
}

/* Dark Mode explicit contrast overrides */
[data-theme="dark"] .bias-guide-btn,
[data-theme="dark"] .allsides-info-btn,
body.dark-mode .bias-guide-btn,
.dark .bias-guide-btn {
  color: #e5e7eb;
  opacity: 0.95;
}

[data-theme="dark"] .bias-guide-btn:hover,
[data-theme="dark"] .allsides-info-btn:hover,
body.dark-mode .bias-guide-btn:hover,
.dark .bias-guide-btn:hover {
  color: #ffffff;
  opacity: 1;
}

/* Segmented Perspective Filter Control */
.perspective-segmented-control {
  display: flex;
  justify-content: center;
  margin: 16px 0 24px 0;
  width: 100%;
}

.perspective-segmented-inner {
  display: inline-flex;
  background-color: #1e293b;
  padding: 4px;
  border-radius: 9999px;
  align-items: center;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.06));
  flex-wrap: wrap;
  max-width: 100%;
}

/* Default state for the segmented toggle buttons */
.bias-toggle-btn { 
  background: transparent; 
  color: #cbd5e1; 
  padding: 6px 18px;
  border-radius: 9999px;
  border: none;
  cursor: pointer;
  font-size: 0.875rem;
  transition: all 0.2s ease;
  font-weight: 500;
  font-family: inherit;
}

/* Hover effect for inactive buttons */
.bias-toggle-btn:not(.active):hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

/* Active states for the segmented control */
.bias-toggle-btn.active[data-bias="all"] { 
  background: #4b5563; 
  color: #ffffff; 
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3); 
}
.bias-toggle-btn.active[data-bias="Center-Left"] { 
  background: #1d4ed8; 
  color: #ffffff; 
  box-shadow: 0 2px 6px rgba(29, 78, 216, 0.4); 
}
.bias-toggle-btn.active[data-bias="Center"] { 
  background: #15803d; 
  color: #ffffff; 
  box-shadow: 0 2px 6px rgba(21, 128, 61, 0.4); 
}
.bias-toggle-btn.active[data-bias="Center-Right"] { 
  background: #c2410c; 
  color: #ffffff; 
  box-shadow: 0 2px 6px rgba(194, 65, 12, 0.4); 
}

.allsides-badge .badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: conic-gradient(var(--bias-center) 0deg 120deg, var(--bias-lean-left) 120deg 240deg, #f59e0b 240deg 360deg);
  animation: spin 8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.theme-toggle {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: all var(--transition-fast);
  color: var(--text-secondary);
}

.theme-toggle:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-medium);
  color: var(--text-primary);
}

.refresh-btn {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: all var(--transition-fast);
  color: var(--text-secondary);
}

.refresh-btn:hover {
  background: var(--bg-card-hover);
  color: var(--accent-primary);
}

.refresh-btn.spinning svg,
.refresh-btn.spinning {
  animation: rotate 1s linear infinite;
}

@keyframes rotate {
  to { transform: rotate(360deg); }
}

/* ─── Hero Bar ───────────────────────────────────────────────── */
.hero-bar {
  background: linear-gradient(180deg, rgba(8, 12, 24, 0.75) 0%, rgba(13, 20, 40, 0.92) 100%), url('hero-bg.jpg?v=2') center/cover no-repeat;
  border-bottom: 1px solid var(--border-subtle);
  padding: 0 24px;
  position: relative;
  overflow: hidden;
}

[data-theme="light"] .hero-bar {
  background: linear-gradient(180deg, rgba(241, 245, 249, 0.92) 0%, rgba(226, 232, 240, 0.96) 100%), url('hero-bg.jpg?v=2') center/cover no-repeat;
}

.hero-bar::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 85% 25%, rgba(79, 142, 247, 0.18) 0%, rgba(8, 12, 24, 0) 65%);
  pointer-events: none;
}

[data-theme="light"] .hero-bar::before {
  background: radial-gradient(circle at 85% 25%, rgba(59, 130, 246, 0.12) 0%, rgba(241, 245, 249, 0) 65%);
}

.hero-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 28px 0 20px;
}

.hero-eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 6px #10b981;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.6; transform: scale(0.8); }
}

.live-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #10b981;
}

.hero-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 4px;
}

.hero-subtitle {
  font-size: 0.9rem;
  color: var(--text-secondary);
  max-width: 540px;
}

.hero-subtitle a {
  color: var(--accent-primary);
  font-weight: 500;
}

.hero-subtitle a:hover {
  text-decoration: underline;
}

.hero-stats {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.stat-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.stat-pill .stat-value {
  font-weight: 700;
  color: var(--text-primary);
}

/* ─── Time-of-Day Edition Bar ───────────────────────────────── */
.edition-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}

.edition-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  text-align: left;
  cursor: pointer;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.edition-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-medium);
  transform: translateY(-1px);
}

.edition-btn.active {
  background: linear-gradient(135deg, rgba(79, 142, 247, 0.15) 0%, rgba(124, 106, 247, 0.1) 100%);
  border-color: var(--accent-primary);
  box-shadow: 0 4px 20px rgba(79, 142, 247, 0.2);
}

.edition-btn.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  background: var(--accent-primary);
}

.edition-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
}

.edition-text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.edition-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
}

.edition-btn.active .edition-title {
  color: var(--accent-primary);
}

.edition-subtitle {
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--text-muted);
}

/* ─── Filter Bar ─────────────────────────────────────────────── */
.filter-bar {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0 24px;
  position: sticky;
  top: 68px;
  z-index: 90;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.filter-inner {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.filter-inner::-webkit-scrollbar {
  display: none;
}

/* Category chips */
.category-chips {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  white-space: nowrap;
  user-select: none;
}

.chip:hover {
  border-color: var(--border-medium);
  color: var(--text-primary);
  background: var(--bg-card-hover);
}

.chip.active {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(79, 142, 247, 0.35);
}

.chip-icon {
  font-size: 0.85em;
}

/* Source filter */
.source-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.source-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.source-select {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 6px 28px 6px 10px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-primary);
  font-family: inherit;
  cursor: pointer;
  outline: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  transition: all var(--transition-fast);
}

.source-select:focus {
  border-color: var(--border-accent);
}

/* Bias filter toggles */
.bias-filters {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.bias-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  color: var(--text-muted);
  transition: all var(--transition-fast);
  user-select: none;
}

.bias-toggle[data-bias="center-left"].active {
  background: var(--bias-center-left-bg);
  border-color: var(--bias-center-left);
  color: var(--bias-center-left);
}

.bias-toggle[data-bias="center"].active {
  background: var(--bias-center-bg);
  border-color: var(--bias-center);
  color: var(--bias-center);
}

.bias-toggle[data-bias="center-right"].active {
  background: var(--bias-center-right-bg);
  border-color: var(--bias-center-right);
  color: var(--bias-center-right);
}

.bias-toggle .bias-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

/* ─── Segmented Perspective Control ─────────────────────────── */
.perspective-segmented-control {
  display: flex;
  justify-content: flex-start;
  padding: 6px 24px 12px 24px;
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
}

.perspective-segmented-inner {
  display: inline-flex;
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  padding: 4px;
  border-radius: 9999px;
  align-items: center;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.08);
  flex-wrap: wrap;
  max-width: 100%;
}

.bias-toggle-btn {
  padding: 6px 18px;
  border-radius: 9999px;
  border: none;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: transparent;
  transition: all 0.2s ease;
}

.bias-toggle-btn:hover {
  color: var(--text-primary);
}

.bias-toggle-btn.active {
  background: var(--bg-card);
  color: var(--text-primary);
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12), 0 0 0 1px var(--border-subtle);
}

[data-theme="dark"] .perspective-segmented-inner {
  background: #1e293b;
  border-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .bias-toggle-btn {
  color: #94a3b8;
}

[data-theme="dark"] .bias-toggle-btn:hover {
  color: #f8fafc;
}

[data-theme="dark"] .bias-toggle-btn.active {
  background: #334155;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

/* ─── Factual Score Badges ─────────────────────────────────── */
.factual-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 700;
  white-space: nowrap;
  letter-spacing: 0.02em;
  line-height: 1.2;
}

.factual-badge.factual-very-high {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.factual-badge.factual-high {
  background: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
  border: 1px solid rgba(59, 130, 246, 0.35);
}

.factual-badge.factual-mixed {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.factual-badge.factual-low {
  background: rgba(249, 115, 22, 0.15);
  color: #f97316;
  border: 1px solid rgba(249, 115, 22, 0.35);
}

.factual-badge.factual-very-low {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

/* ─── Main Content ───────────────────────────────────────────── */
.main-content {
  max-width: 1440px;
  margin: 0 auto;
  padding: 28px 24px 60px;
  position: relative;
  z-index: 1;
}

/* Section header */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.section-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

.section-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  min-width: 28px;
}

.last-updated {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* ─── News Grid ──────────────────────────────────────────────── */
.news-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  width: 100%;
}

/* ─── Article Card ───────────────────────────────────────────── */
.article-card {
  flex: 1 1 310px;
  max-width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all var(--transition-normal);
  cursor: pointer;
  position: relative;
}

.article-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-medium);
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-2px);
}

.article-card:active {
  transform: translateY(0);
}

/* Card image */
.card-image-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--bg-elevated);
  flex-shrink: 0;
}

.card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.article-card:hover .card-image {
  transform: scale(1.04);
}

.card-image-placeholder {
  width: 100%;
  height: 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: linear-gradient(135deg, #131a30 0%, #0d1428 100%);
  color: var(--text-primary);
  padding: 16px;
}

/* Custom Editorial Branded Gradients */
.card-image-placeholder[data-source="wsj"] { background: linear-gradient(135deg, #1f242d 0%, #0d1117 100%); border-bottom: 2px solid #f59e0b; }
.card-image-placeholder[data-source="reuters"] { background: linear-gradient(135deg, #102a43 0%, #0b1d3a 100%); border-bottom: 2px solid #10b981; }
.card-image-placeholder[data-source="bbc"] { background: linear-gradient(135deg, #2d1216 0%, #12080a 100%); border-bottom: 2px solid #ef4444; }
.card-image-placeholder[data-source="thehill"] { background: linear-gradient(135deg, #2a1b12 0%, #110b07 100%); border-bottom: 2px solid #f97316; }
.card-image-placeholder[data-source="dispatch"] { background: linear-gradient(135deg, #1c1d2e 0%, #0a0b14 100%); border-bottom: 2px solid #8b5cf6; }
.card-image-placeholder[data-source="reason"] { background: linear-gradient(135deg, #2b2310 0%, #120e06 100%); border-bottom: 2px solid #eab308; }
.card-image-placeholder[data-source="examiner"] { background: linear-gradient(135deg, #192536 0%, #090e17 100%); border-bottom: 2px solid #3b82f6; }
.card-image-placeholder[data-source="guardian"] { background: linear-gradient(135deg, #0f2b48 0%, #061524 100%); border-bottom: 2px solid #60a5fa; }
.card-image-placeholder[data-source="npr"] { background: linear-gradient(135deg, #13273e 0%, #06111f 100%); border-bottom: 2px solid #60a5fa; }
.card-image-placeholder[data-source="ap"] { background: linear-gradient(135deg, #261f1a 0%, #0f0c0a 100%); border-bottom: 2px solid #f97316; }
.card-image-placeholder[data-source="csmonitor"] { background: linear-gradient(135deg, #0e2925 0%, #051311 100%); border-bottom: 2px solid #10b981; }

.placeholder-watermark {
  position: absolute;
  font-size: 7rem;
  opacity: 0.07;
  user-select: none;
  pointer-events: none;
  transform: scale(1.3) rotate(-10deg);
}

.placeholder-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  text-align: center;
}

.placeholder-logo {
  font-size: 2rem;
  line-height: 1;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.5));
}

.placeholder-name {
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--text-primary);
  text-transform: uppercase;
}

.placeholder-tagline {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.8;
}

/* Bias ribbon on image */
.card-bias-ribbon {
  position: absolute;
  top: 10px;
  right: 10px;
}

/* Card body */
.card-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 10px;
}

/* Source meta row */
.card-source-meta {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  flex-wrap: wrap;
}

.card-source {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.source-logo {
  font-size: 1rem;
  flex-shrink: 0;
}

.source-name {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Bias badge */
.bias-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all var(--transition-fast);
}

.bias-badge.center-left {
  background: var(--bias-center-left-bg);
  color: var(--bias-center-left);
  border: 1px solid rgba(96, 165, 250, 0.3);
}

.bias-badge.center {
  background: var(--bias-center-bg);
  color: var(--bias-center);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.bias-badge.center-right {
  background: var(--bias-center-right-bg);
  color: var(--bias-center-right);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.bias-badge-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.article-card:hover .bias-badge.center-left {
  box-shadow: 0 0 12px var(--bias-center-left-glow);
}

.article-card:hover .bias-badge.center {
  box-shadow: 0 0 12px var(--bias-center-glow);
}

.article-card:hover .bias-badge.center-right {
  box-shadow: 0 0 12px var(--bias-center-right-glow);
}

/* Card headline */
.card-headline {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.4;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color var(--transition-fast);
}

.card-headline-link {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-fast);
}

.card-headline-link:hover,
.article-card:hover .card-headline-link,
.compact-article-card:hover .card-headline-link {
  color: var(--accent-primary);
}

.article-card:hover .card-headline {
  color: var(--text-accent);
}

/* Card description */
.card-description {
  font-size: 0.84rem;
  color: var(--text-secondary);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Card footer */
.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid var(--border-subtle);
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
}

.meta-icon {
  font-size: 0.75em;
}

.read-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent-primary);
  padding: 5px 11px;
  border-radius: 6px;
  border: 1px solid var(--border-accent);
  background: var(--accent-glow);
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.read-link:hover {
  background: var(--accent-primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(79, 142, 247, 0.35);
}

/* ─── Bottom-of-Card Alternate Duplicate Sources Bar ─────────── */
.card-alt-sources {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.alt-sources-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 4px;
}

.alt-sources-list {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.alt-source-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 4px 10px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  min-height: 28px;
}

.alt-source-pill:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-primary);
  color: var(--text-primary);
  transform: translateY(-1px);
}

.alt-source-pill.active {
  background: var(--accent-glow);
  border-color: var(--accent-primary);
  color: var(--text-primary);
  font-weight: 700;
  box-shadow: 0 0 0 1px var(--accent-primary);
}

.alt-source-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ─── Skeleton Loaders ───────────────────────────────────────── */
.skeleton {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.skeleton-img {
  width: 100%;
  aspect-ratio: 16/9;
  background: linear-gradient(90deg, var(--bg-elevated) 25%, var(--bg-card-hover) 50%, var(--bg-elevated) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

.skeleton-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.skeleton-line {
  height: 14px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--bg-elevated) 25%, var(--bg-card-hover) 50%, var(--bg-elevated) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

.skeleton-line.w-40 { width: 40%; }
.skeleton-line.w-60 { width: 60%; }
.skeleton-line.w-80 { width: 80%; }
.skeleton-line.w-100 { width: 100%; }
.skeleton-line.h-20 { height: 20px; }

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ─── Featured / Hero Card ───────────────────────────────────── */
.article-card.featured {
  flex: 1 1 100%;
  width: 100%;
  flex-direction: row;
  min-height: 280px;
}

@media (max-width: 768px) {
  .article-card.featured {
    flex-direction: column;
    max-height: none;
  }
}

/* ─── 3-Tier News Feed Layout ─────────────────────────────────── */
.tier-section-title {
  flex: 1 1 100%;
  width: 100%;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 28px 0 14px 0;
  padding-top: 20px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 8px;
}

.compact-articles-grid {
  flex: 1 1 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  width: 100%;
}

/* Compact Article Card */
.compact-article-card {
  flex: 1 1 380px;
  max-width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md, 10px);
  padding: 12px;
  display: flex;
  gap: 14px;
  align-items: center;
  transition: all var(--transition-fast);
  cursor: pointer;
}

.compact-article-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-medium);
  transform: translateY(-1px);
}

.compact-image-wrap {
  width: 96px;
  height: 96px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--bg-elevated);
}

.compact-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.compact-article-card:hover .compact-image {
  transform: scale(1.05);
}

.compact-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  background: var(--bg-elevated);
}

.compact-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  gap: 4px;
}

.compact-header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  flex-wrap: wrap;
}

.compact-source {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.compact-bias-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.compact-headline {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 2px 0;
}

.compact-article-card:hover .compact-headline {
  color: var(--accent-primary);
}

.compact-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 4px;
}

.compact-time {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.compact-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.article-card.featured .card-image-wrap {
  width: 45%;
  aspect-ratio: auto;
  flex-shrink: 0;
}

.article-card.featured .card-body {
  padding: 20px;
}

.article-card.featured .card-headline {
  font-size: 1.25rem;
  -webkit-line-clamp: 4;
}

.article-card.featured .card-description {
  -webkit-line-clamp: 4;
}

/* ─── Load More ──────────────────────────────────────────────── */
.load-more-section {
  display: flex;
  justify-content: center;
  margin-top: 32px;
}

.load-more-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-medium);
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 600;
  font-family: inherit;
  transition: all var(--transition-normal);
}

.load-more-btn:hover:not(:disabled) {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: #fff;
  box-shadow: 0 8px 24px rgba(79, 142, 247, 0.35);
  transform: translateY(-1px);
}

.load-more-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.load-more-btn.loading {
  pointer-events: none;
}

.load-more-btn.loading::before {
  content: '';
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: rotate 0.7s linear infinite;
}

/* ─── Empty State ────────────────────────────────────────────── */
.empty-state {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  text-align: center;
  gap: 16px;
  color: var(--text-muted);
}

.empty-icon {
  font-size: 3rem;
  opacity: 0.5;
}

.empty-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.empty-text {
  font-size: 0.875rem;
  max-width: 320px;
  line-height: 1.6;
}

/* ─── Error State ────────────────────────────────────────────── */
.error-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: #1e1024;
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
  padding: 12px 20px;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 500;
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  max-width: 90vw;
}

.error-toast.visible {
  transform: translateX(-50%) translateY(0);
}

/* ─── AllSides Info Modal ────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
}

.modal-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  background: var(--bg-elevated);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-xl);
  padding: 32px;
  max-width: 520px;
  width: 100%;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.5);
  transform: scale(0.95) translateY(10px);
  transition: transform var(--transition-normal);
}

.modal-overlay.visible .modal {
  transform: scale(1) translateY(0);
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
}

.modal-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.modal-close:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.modal-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal-body p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.modal-body a {
  color: var(--accent-primary);
}

.bias-legend {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.82rem;
}

.legend-badge {
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}

.legend-badge.center {
  background: var(--bias-center-bg);
  color: var(--bias-center);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.legend-badge.lean-left {
  background: var(--bias-lean-left-bg);
  color: var(--bias-lean-left);
  border: 1px solid rgba(96, 165, 250, 0.3);
}

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

/* ─── Responsive ─────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .news-grid {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  }
}

@media (max-width: 768px) {
  .site-header { padding: 0 16px; }
  .hero-bar { padding: 0 16px; }
  .filter-bar { padding: 0 16px; }
  .main-content { padding: 20px 16px 48px; }

  .header-search { display: none; }
  .allsides-badge span:not(.badge-dot) { display: none; }

  .news-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .hero-stats { gap: 10px; }
}

@media (max-width: 480px) {
  .logo-tagline { display: none; }
  .bias-filters { display: none; }
  .category-chips { gap: 4px; }
  .chip { padding: 5px 10px; font-size: 0.75rem; }
}

/* ─── Scrollbar ──────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-medium); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ─── Utility ────────────────────────────────────────────────── */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
}

.fade-in {
  animation: fadeIn 0.4s ease both;
}

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

/* ─── Footer ─────────────────────────────────────────────────── */
.site-footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border-subtle);
  padding: 48px 24px 32px;
  margin-top: 60px;
}

.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}

@media (max-width: 768px) {
  .footer-inner {
    grid-template-columns: 1fr;
    gap: 32px;
  }
}

.footer-brand {
  max-width: 480px;
}

.footer-brand .brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.footer-brand .brand-name {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.footer-tagline {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.6;
  margin-top: 10px;
}

.footer-links {
  display: flex;
  gap: 60px;
}

@media (max-width: 480px) {
  .footer-links {
    flex-direction: column;
    gap: 24px;
  }
}

.footer-heading {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-primary);
  margin-bottom: 14px;
}

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

.footer-col li {
  margin-bottom: 10px;
}

.footer-col a, .footer-link-btn {
  color: var(--text-secondary);
  font-size: 0.9rem;
  text-decoration: none;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
  transition: color var(--transition-fast);
}

.footer-col a:hover, .footer-link-btn:hover {
  color: var(--accent-blue);
}

.footer-bottom {
  max-width: 1280px;
  margin: 36px auto 0;
  padding-top: 24px;
  border-top: 1px solid var(--border-subtle);
  text-align: center;
}

.footer-bottom p {
  color: var(--text-muted);
  font-size: 0.82rem;
  line-height: 1.5;
}

/* ─── Perspective Balance Meter ─────────────────────────────── */
.balance-meter-wrapper {
  margin-top: 18px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  box-shadow: var(--shadow-sm);
}

.balance-meter-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 0.82rem;
}

.meter-title {
  font-weight: 600;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.balance-meter-text {
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 500;
}

.balance-meter-bar {
  display: flex;
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  background: var(--bg-elevated);
}

.meter-segment {
  height: 100%;
  transition: width 0.4s ease;
}

.seg-left { background: #60a5fa; }
.seg-center { background: #10b981; }
.seg-right { background: #f59e0b; }

/* ─── Keyboard Shortcuts Modal & Buttons ─────────────────────── */
.shortcuts-toggle {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  cursor: pointer;
  font-size: 1rem;
  transition: all var(--transition-fast);
}

.shortcuts-toggle:hover {
  background: var(--bg-hover);
  border-color: var(--border-medium);
}

.shortcuts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 8px;
}

.shortcut-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
  color: var(--text-secondary);
}

kbd {
  background: var(--bg-elevated);
  border: 1px solid var(--border-medium);
  border-radius: 4px;
  box-shadow: 0 2px 0 var(--border-subtle);
  color: var(--accent-blue);
  display: inline-block;
  font-family: monospace;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 3px 7px;
  min-width: 22px;
  text-align: center;
}

/* ─── Card Actions (Bookmark & Share) ────────────────────────── */
.card-actions-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-action-btn {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  font-size: 0.82rem;
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all var(--transition-fast);
}

.card-action-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border-medium);
}

.card-action-btn.bookmarked {
  background: rgba(96, 165, 250, 0.15);
  color: var(--accent-blue);
  border-color: var(--accent-blue);
}

.count-badge-mini {
  background: var(--accent-blue);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  margin-left: 4px;
}

/* Audio Player Button */
.audio-btn {
  border-color: var(--accent-blue) !important;
}

.audio-btn.playing {
  background: rgba(16, 185, 129, 0.2) !important;
  border-color: #10b981 !important;
  animation: pulseAudio 1.5s infinite;
}

@keyframes pulseAudio {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
  70% { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* ─── Reading Progress Bar ───────────────────────────────────── */
.scroll-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, #4f8ef7 0%, #7c6af7 50%, #10b981 100%);
  z-index: 9999;
  transition: width 0.1s ease-out;
  box-shadow: 0 0 8px rgba(79, 142, 247, 0.6);
}

/* ─── Floating Audio Mini-Player ────────────────────────────── */
.floating-audio-player {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: rgba(13, 20, 40, 0.92);
  border: 1px solid var(--accent-primary);
  border-radius: 9999px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 0 15px rgba(79, 142, 247, 0.3);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: transform 0.3s ease, opacity 0.3s ease;
  max-width: calc(100vw - 48px);
}

.floating-audio-player.hidden {
  transform: translateY(100px);
  opacity: 0;
  pointer-events: none;
}

.floating-audio-play {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent-primary);
  color: #ffffff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  cursor: pointer;
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.floating-audio-play:hover {
  transform: scale(1.08);
}

.floating-audio-info {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.floating-audio-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

.floating-audio-status {
  font-size: 0.68rem;
  color: #10b981;
  font-weight: 500;
}

.floating-audio-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.9rem;
  cursor: pointer;
  padding: 4px;
  transition: color 0.2s ease;
}

.floating-audio-close:hover {
  color: var(--text-primary);
}

/* ─── Skeleton Loading Cards ─────────────────────────────────── */
/* ─── Hero Card Ambient Glow ──────────────────────────────────── */
.article-card.featured::after {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(79, 142, 247, 0.25) 0%, rgba(124, 106, 247, 0.15) 50%, rgba(16, 185, 129, 0.2) 100%);
  z-index: -1;
  filter: blur(16px);
  opacity: 0.6;
  transition: opacity 0.3s ease;
}

.article-card.featured:hover::after {
  opacity: 1;
}

/* ─── Staggered Card Entrance Animations ────────────────────── */
.stagger-card {
  animation: slideUpFade 0.45s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  opacity: 0;
  will-change: transform, opacity;
}

@keyframes slideUpFade {
  0% {
    opacity: 0;
    transform: translateY(18px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}



.skeleton-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg, 14px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 360px;
  position: relative;
}

.skeleton-card.hero-skeleton {
  flex: 1 1 100%;
  width: 100%;
  flex-direction: row;
  height: 280px;
}

@media (max-width: 768px) {
  .skeleton-card.hero-skeleton {
    flex-direction: column;
    height: auto;
  }
}

.skeleton-box {
  background: linear-gradient(90deg, var(--bg-elevated) 25%, var(--bg-card-hover) 50%, var(--bg-elevated) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 6px;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-img {
  width: 100%;
  height: 160px;
  border-radius: 0;
}

.skeleton-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.skeleton-title {
  height: 20px;
  width: 90%;
}

.skeleton-line {
  height: 14px;
  width: 100%;
}

.skeleton-line.short {
  width: 60%;
}

/* ─── "You're Caught Up" Completion Block ───────────────────── */
.caught-up-wrapper {
  flex: 1 1 100%;
  width: 100%;
  display: flex;
  justify-content: center;
  margin: 32px 0 20px 0;
}

.caught-up-card {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.12) 0%, rgba(13, 20, 40, 0.85) 100%);
  border: 1px solid rgba(16, 185, 129, 0.4);
  border-radius: 20px;
  padding: 32px 24px;
  text-align: center;
  max-width: 640px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.4), 0 0 20px rgba(16, 185, 129, 0.15);
}

.caught-up-badge {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: #10b981;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: bold;
  margin-bottom: 14px;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.4);
}

.caught-up-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: #10b981;
  margin-bottom: 8px;
}

.caught-up-text {
  font-size: 0.875rem;
  color: var(--text-secondary);
  max-width: 480px;
  margin: 0 auto;
  line-height: 1.5;
}

/* ─── Muted Topic Tag Chips ─────────────────────────────────── */
.muted-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #ef4444;
  padding: 4px 10px;
  border-radius: 14px;
  font-size: 0.78rem;
  font-weight: 600;
}

.muted-chip-remove {
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

.muted-chip-remove:hover {
  opacity: 1;
}

/* ─── Phase 3: In-App Article Reader Modal ───────────────────── */
.reader-modal-drawer {
  background: var(--bg-surface);
  border-left: 1px solid var(--border-medium);
  width: 100%;
  max-width: 820px;
  height: 100vh;
  position: fixed;
  top: 0;
  right: 0;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.6);
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.modal-overlay.visible .reader-modal-drawer {
  transform: translateX(0);
}

.reader-header {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
}

.reader-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.reader-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.reader-ext-btn {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent-primary);
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-accent);
  background: var(--accent-glow);
  text-decoration: none;
  transition: all 0.2s ease;
}

.reader-ext-btn:hover {
  background: var(--accent-primary);
  color: #ffffff;
}

.reader-body {
  flex: 1;
  overflow-y: auto;
  padding: 36px 40px 60px;
}

.reader-headline {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(1.6rem, 2.5vw, 2.2rem);
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.25;
  margin-bottom: 16px;
}

.reader-lead-img {
  width: 100%;
  max-height: 380px;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 24px;
}

.reader-paragraph {
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.75;
  margin-bottom: 18px;
  letter-spacing: -0.003em;
}

/* ─── Phase 4: Story Cluster Super Card ──────────────────────── */
.super-card {
  flex: 1 1 100%;
  width: 100%;
  background: linear-gradient(135deg, rgba(20, 28, 55, 0.9) 0%, rgba(13, 20, 40, 0.95) 100%);
  border: 1px solid rgba(79, 142, 247, 0.35);
  border-radius: var(--radius-lg, 14px);
  padding: 24px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35), 0 0 20px rgba(79, 142, 247, 0.12);
  margin: 12px 0;
}

[data-theme="light"] .super-card {
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid var(--border-medium);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .super-card .card-headline a {
  color: var(--text-primary);
}

.super-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 10px;
}

.cluster-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 20px;
  background: rgba(79, 142, 247, 0.15);
  border: 1px solid rgba(79, 142, 247, 0.4);
  color: var(--accent-primary);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.cluster-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.cluster-tab-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.cluster-tab-btn.active {
  background: var(--bg-surface);
  border-color: var(--accent-primary);
  color: var(--text-primary);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.cluster-tab-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: all 0.25s ease;
}

/* ─── Supabase Auth & Rhythm Dashboard ──────────────────────── */
.auth-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  padding: 5px 14px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.auth-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-accent);
}

.user-header-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--accent-primary);
}

.dashboard-drawer {
  background: var(--bg-surface);
  border-left: 1px solid var(--border-medium);
  width: 100%;
  max-width: 580px;
  height: 100vh;
  position: fixed;
  top: 0;
  right: 0;
  z-index: 2100;
  display: flex;
  flex-direction: column;
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.6);
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.modal-overlay.visible .dashboard-drawer {
  transform: translateX(0);
}

.dashboard-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
}

.dashboard-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Avatar Uploader */
.avatar-section {
  display: flex;
  align-items: center;
  gap: 18px;
  background: var(--bg-card);
  padding: 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.avatar-preview-wrap {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 2px solid var(--accent-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
}

.avatar-preview-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-upload-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-medium);
  border-radius: 8px;
  padding: 7px 14px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.avatar-upload-btn:hover {
  border-color: var(--accent-primary);
  background: var(--bg-card-hover);
}

/* Form inputs */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.form-input, .form-textarea {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 0.9rem;
  color: var(--text-primary);
  font-family: inherit;
  outline: none;
  transition: all 0.2s ease;
}

.form-input:focus, .form-textarea:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

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

/* Privacy toggles card */
.privacy-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.privacy-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.privacy-info h4 {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.privacy-info p {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.3;
}

/* Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: var(--bg-elevated);
  border: 1px solid var(--border-medium);
  transition: .3s;
  border-radius: 24px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: var(--text-secondary);
  transition: .3s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--accent-primary);
  border-color: var(--accent-primary);
}

input:checked + .slider:before {
  transform: translateX(20px);
  background-color: #ffffff;
}

/* Public Profile Card Modal */
.public-profile-card {
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  max-width: 440px;
  width: 100%;
}

.public-profile-avatar {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--accent-primary);
  background: var(--bg-elevated);
}

.public-profile-name {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text-primary);
}

.public-profile-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  background: var(--accent-glow);
  border: 1px solid var(--border-accent);
  color: var(--accent-primary);
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: 20px;
}

.public-profile-bio {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-top: 4px;
}
