/* ════════════════════════════════════════════════════════════════════
   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:       #f0f4f8;
  --bg-surface:    #e8edf5;
  --bg-elevated:   #dce4ee;
  --bg-card:       #ffffff;
  --bg-card-hover: #f8faff;
  --bg-glass:      rgba(240, 244, 248, 0.8);
  --text-primary:  #0f172a;
  --text-secondary:#475569;
  --text-muted:    #94a3b8;
  --border-subtle: rgba(0, 0, 0, 0.06);
  --border-medium: rgba(0, 0, 0, 0.1);
  --shadow-card:   0 4px 24px rgba(0, 0, 0, 0.08);
  --shadow-card-hover: 0 12px 40px rgba(0, 0, 0, 0.15), 0 0 0 1px var(--border-medium);
}

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

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;
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  box-shadow: 0 4px 16px rgba(79, 142, 247, 0.35);
}

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

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

.logo-tagline {
  font-size: 0.65rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  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 {
  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-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.allsides-badge:hover {
  border-color: var(--border-accent);
  color: var(--text-accent);
}

.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: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0 24px;
}

.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;
}

/* ─── 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: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
}

/* ─── Article Card ───────────────────────────────────────────── */
.article-card {
  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: space-between;
  gap: 8px;
}

.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);
}

.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);
}

/* ─── 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 {
  grid-column: 1 / -1;
  flex-direction: row;
  max-height: 280px;
}

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

.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); }
}
