/* ============================================================
   Deep Feed AI — style.css
   Color palette:
     --bg-dark:    #0d1117  (deep navy/charcoal)
     --bg-card:    #161b22  (card surface)
     --accent:     #4F8EF7  (electric blue)
     --accent-dim: #2d5fbe  (hover shade)
     --text:       #e6edf3  (near-white)
     --muted:      #8b949e  (subdued text)
     --border:     #21262d  (subtle border)
   ============================================================ */

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

:root {
  /* Dark theme (default) */
  --bg:        #0d1117;
  --bg-card:   #161b22;
  --bg-header: rgba(13, 17, 23, 0.92);
  --accent:    #4F8EF7;
  --accent-dim:#2d5fbe;
  --text:      #e6edf3;
  --muted:     #8b949e;
  --border:    #21262d;
  --shadow:    0 4px 24px rgba(0,0,0,0.5);
  --radius:    12px;
  --transition: 0.25s ease;
}

/* Light theme overrides */
body.light {
  --bg:        #f4f6fb;
  --bg-card:   #ffffff;
  --bg-header: rgba(244, 246, 251, 0.94);
  --text:      #1a1f2e;
  --muted:     #5a6370;
  --border:    #dde1ea;
  --shadow:    0 4px 24px rgba(0,0,0,0.1);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  transition: background var(--transition), color var(--transition);
  min-height: 100vh;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--accent-dim);
}

img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* ============================================================
   HEADER / NAV
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-header);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 1.5rem;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  transition: background var(--transition), border-color var(--transition);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 2rem;
  flex-shrink: 0;
}

/* Logo */
.logo {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.logo span.accent {
  color: var(--accent);
}

/* Nav links */
.nav-links {
  list-style: none;
  display: flex;
  gap: 1.5rem;
}

.nav-links a {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--muted);
  transition: color var(--transition);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text);
}

/* Header right controls */
.header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Search bar */
.search-wrap {
  position: relative;
}

.search-wrap svg {
  position: absolute;
  left: 0.7rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
  width: 16px;
  height: 16px;
}

#search-input {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.45rem 0.75rem 0.45rem 2.2rem;
  color: var(--text);
  font-size: 0.875rem;
  width: 220px;
  transition: border-color var(--transition), width var(--transition);
  outline: none;
}

#search-input:focus {
  border-color: var(--accent);
  width: 280px;
}

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

/* Theme toggle */
.theme-toggle {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.45rem 0.65rem;
  cursor: pointer;
  color: var(--text);
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  transition: border-color var(--transition), background var(--transition);
}

.theme-toggle:hover {
  border-color: var(--accent);
}

/* Hamburger (mobile) */
.hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.4rem;
  color: var(--text);
}

/* ============================================================
   HERO SECTION
   ============================================================ */
.hero {
  padding: 5rem 1.5rem 3.5rem;
  text-align: center;
  background: linear-gradient(160deg, var(--bg) 0%, #0e1a2e 60%, var(--bg) 100%);
  position: relative;
  overflow: hidden;
}

/* Decorative glow blob */
.hero::before {
  content: '';
  position: absolute;
  top: -80px;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 400px;
  background: radial-gradient(ellipse at center, rgba(79, 142, 247, 0.15) 0%, transparent 70%);
  pointer-events: none;
}

.hero-badge {
  display: inline-block;
  background: rgba(79, 142, 247, 0.15);
  border: 1px solid rgba(79, 142, 247, 0.35);
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.3rem 0.85rem;
  border-radius: 99px;
  margin-bottom: 1.25rem;
}

.hero h1 {
  font-size: clamp(2.25rem, 5vw, 4rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -1px;
  max-width: 800px;
  margin: 0 auto 1rem;
}

.hero h1 .accent {
  color: var(--accent);
}

.hero p {
  font-size: 1.2rem;
  color: var(--muted);
  max-width: 560px;
  margin: 0 auto 2rem;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.75rem 1.6rem;
  border-radius: 99px;
  transition: background var(--transition), transform var(--transition);
}

.hero-cta:hover {
  background: var(--accent-dim);
  color: #fff;
  transform: translateY(-2px);
}

/* ============================================================
   MAIN CONTENT WRAPPER
   ============================================================ */
.container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* ============================================================
   SECTION HEADINGS
   ============================================================ */
.section-title {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.section-sub {
  color: var(--muted);
  font-size: 1rem;
  margin-bottom: 1rem;
}

/* ============================================================
   CATEGORY FILTER
   ============================================================ */
/* Filter row: category pills + view toggles */
.filter-controls-row {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding: 0.75rem 0;
  position: sticky;
  top: 64px;
  z-index: 90;
  background: var(--bg);
}
.filter-controls-row::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: -1.5rem;
  right: -1.5rem;
  height: 1px;
  background: var(--border);
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  flex: 1;
}

.filter-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.45rem 1rem;
  border-radius: 99px;
  cursor: pointer;
  transition: all var(--transition);
}

.filter-btn:hover {
  border-color: var(--accent);
  color: var(--text);
}

.filter-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* Audio filter button — teal accent when active */
.filter-btn--audio.active {
  background: #0e9488;
  border-color: #0e9488;
  color: #fff;
}

/* Video filter button — red accent when active */
.filter-btn--video.active {
  background: #e53e3e;
  border-color: #e53e3e;
  color: #fff;
}

/* Originals filter button — orange accent when active */
.filter-btn--originals.active {
  background: #e74c3c;
  border-color: #e74c3c;
  color: #fff;
}

/* Deep Dive filter button — purple accent when active */
.filter-btn--deep-dive.active {
  background: #7c3aed;
  border-color: #7c3aed;
  color: #fff;
}

/* View toggle */
.view-toggle {
  display: flex;
  gap: 0.25rem;
  flex-shrink: 0;
  align-self: flex-start;
  margin-top: 0.1rem;
}

.view-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 0.45rem 0.6rem;
  border-radius: var(--radius, 8px);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  line-height: 1;
}

.view-btn:hover {
  border-color: var(--accent);
  color: var(--text);
}

.view-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ============================================================
   NEWS GRID
   ============================================================ */
.feed-heading {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 1rem;
  color: var(--text);
  scroll-margin-top: 140px; /* header 64px + filter bar ~76px */
}

.news-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.75rem;
  margin-bottom: 4rem;
}
@media (max-width: 1000px) { .news-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 660px)  { .news-grid { grid-template-columns: 1fr; } }

/* ---- List view ---- */
.news-grid.list-view {
  grid-template-columns: 1fr;
  gap: 0.5rem;
}

.news-grid.list-view .card {
  flex-direction: row;
  align-items: center;
}

/* Hide images in list view */
.news-grid.list-view .card-image {
  display: none;
}

.news-grid.list-view .card-body {
  flex: 1;
  padding: 0.75rem 1rem;
  gap: 0.25rem;
}

.news-grid.list-view .card-title {
  font-size: 1rem;
  -webkit-line-clamp: 1;
  min-height: auto;
}

.news-grid.list-view .card-summary {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 0.85rem;
  min-height: auto;
}

.news-grid.list-view .card-footer {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  padding: 0.75rem 1rem;
  min-width: 240px;
  border-top: none;
  border-left: 1px solid var(--border);
  text-align: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.news-grid.list-view .card-source-row {
  flex-direction: column;
  align-items: flex-end;
  gap: 0.25rem;
  text-align: right;
}

.news-grid.list-view .card-source-name {
  font-size: 0.75rem;
  white-space: normal;
  text-align: right;
}

/* Inline newsletter card stays normal in list view */
.news-grid.list-view .card.inline-newsletter {
  flex-direction: column;
}

/* No results message */
.no-results {
  display: none;
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem 1rem;
  color: var(--muted);
}

.no-results svg {
  width: 48px;
  height: 48px;
  margin: 0 auto 1rem;
  opacity: 0.4;
}

/* ============================================================
   NEWS CARD
   ============================================================ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
  /* Entrance animation */
  opacity: 0;
  transform: translateY(20px);
  animation: cardIn 0.5s ease forwards;
}

@keyframes cardIn {
  to { opacity: 1; transform: translateY(0); }
}

/* Stagger delay for each card */
.card:nth-child(1)  { animation-delay: 0.05s; }
.card:nth-child(2)  { animation-delay: 0.10s; }
.card:nth-child(3)  { animation-delay: 0.15s; }
.card:nth-child(4)  { animation-delay: 0.20s; }
.card:nth-child(5)  { animation-delay: 0.25s; }
.card:nth-child(6)  { animation-delay: 0.30s; }
.card:nth-child(7)  { animation-delay: 0.35s; }
.card:nth-child(8)  { animation-delay: 0.40s; }
.card:nth-child(9)  { animation-delay: 0.45s; }
.card:nth-child(10) { animation-delay: 0.50s; }
.card:nth-child(11) { animation-delay: 0.55s; }
.card:nth-child(12) { animation-delay: 0.60s; }

.card:hover {
  transform: translateY(-5px);
  border-color: var(--accent);
  box-shadow: 0 8px 32px rgba(79, 142, 247, 0.2);
}

/* Image area */
.card-image {
  width: 100%;
  height: 200px;
  overflow: hidden;
  position: relative;
  background: #0d1117;
}

.card-image img {
  transition: transform 0.4s ease;
}

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

/* Featured badge on card */
.card-image .featured-badge {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  background: var(--accent);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
}

/* Card body */
.card-body {
  padding: 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex: 1;
}

/* Category tag on card */
.card-tag {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--accent);
}

.card-title {
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.4;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-summary {
  font-size: 0.95rem;
  color: var(--muted);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Card footer */
.card-footer {
  padding: 0 1.4rem 1.4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.875rem;
  color: var(--muted);
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card-source {
  font-weight: 600;
  color: var(--text);
}

.card-read-more {
  color: var(--accent);
  font-weight: 600;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  transition: gap var(--transition);
}

.card-read-more:hover {
  gap: 0.55rem;
}

/* Source row — writer avatar + name + source/time stacked */
.card-source-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}
.card-source-row .writer-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.card-source-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.card-source-name {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
a.card-source-name:hover {
  color: var(--accent);
}
.card-source-detail {
  font-size: 0.75rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: auto;
}

/* Hidden card (filtered out) */
.card.hidden {
  display: none;
}

/* ============================================================
   FEATURED ROW (up to 3 featured articles)
   #1 = full-width hero row; #2 & #3 = side-by-side half-width
   ============================================================ */
/* ============================================================
   FEATURED SECTION — Hero + Editor's Picks
   ============================================================ */
.featured-section { margin-bottom: 2rem; }

/* Hero card — full-width, image left + content right */
.hero-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: box-shadow var(--transition);
}
.hero-card:hover { box-shadow: var(--shadow); }
.hero-image {
  width: 100%;
  height: 100%;
  min-height: 280px;
  object-fit: cover;
  display: block;
}
.hero-body {
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.hero-badge {
  display: inline-block;
  width: fit-content;
  background: var(--accent);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  margin-bottom: 0.5rem;
}
.hero-category {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  margin-left: 0.5rem;
}
.hero-title {
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.25;
  color: var(--text);
  margin: 0.5rem 0 0.75rem;
}
.hero-summary {
  font-size: 1rem;
  color: var(--muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.hero-meta {
  margin-top: auto;
  padding-top: 1rem;
  font-size: 0.8rem;
  color: var(--muted);
}
.hero-writer {
  color: var(--text);
  font-weight: 600;
}

/* Editor's Picks row */
.featured-picks-heading {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 1.5rem 0 0.75rem;
  color: var(--text);
}
.featured-picks {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
}

/* Picks cards (reused carousel-card class) */
.carousel-card {
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition);
}
.carousel-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.carousel-image {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
}
.carousel-body { padding: 1rem; }
.carousel-category {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  margin-bottom: 0.4rem;
}
.carousel-title {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
}
.carousel-meta {
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: var(--muted);
}
.carousel-writer {
  color: var(--text);
  font-weight: 600;
}

/* List view: featured section collapses */
body.list-active .hero-card {
  display: flex;
  flex-direction: row;
  align-items: center;
}
body.list-active .hero-image { display: none; }
body.list-active .hero-body { padding: 0.75rem 1rem; }
body.list-active .hero-badge { display: none; }
body.list-active .hero-category { margin-left: 0; }
body.list-active .hero-title { font-size: 1rem; margin: 0.25rem 0; }
body.list-active .hero-summary { display: none; }
body.list-active .hero-meta { display: none; }
body.list-active .featured-picks { grid-template-columns: 1fr; gap: 0.5rem; }
body.list-active .carousel-card { display: flex; flex-direction: row; align-items: center; }
body.list-active .carousel-image { display: none; }
body.list-active .carousel-body { padding: 0.5rem 1rem; }
body.list-active .carousel-title { font-size: 1rem; -webkit-line-clamp: 1; }
body.list-active .carousel-meta { display: none; }
body.list-active .carousel-category { display: none; }


/* ============================================================
   NEWSLETTER SECTION
   ============================================================ */

/* ── Inline feed newsletter card ── */
.card.inline-newsletter {
  grid-column: 1 / -1;
  background: linear-gradient(135deg, #0a1628 0%, var(--bg-card) 100%);
  border: 1px solid var(--accent);
  border-radius: 16px;
  padding: 0;
  cursor: default;
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.15), 0 4px 24px rgba(56, 189, 248, 0.08);
}

body.light .card.inline-newsletter {
  background: linear-gradient(135deg, #dce8ff 0%, var(--bg-card) 100%);
}

.card.inline-newsletter:hover {
  transform: none;
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.25), 0 4px 32px rgba(56, 189, 248, 0.12);
}

.inline-newsletter-inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1.75rem 2rem;
}

.inline-newsletter-icon {
  font-size: 2.5rem;
  flex-shrink: 0;
  line-height: 1;
}

.inline-newsletter-content {
  flex: 1;
}

.inline-newsletter-content h3 {
  font-size: 1.2rem;
  font-weight: 800;
  margin: 0 0 0.35rem;
  color: var(--text);
}

.inline-newsletter-content p {
  color: var(--muted);
  font-size: 0.875rem;
  margin: 0 0 1rem;
  max-width: 520px;
}

.inline-newsletter-form {
  display: flex;
  gap: 0.6rem;
  max-width: 480px;
}

.inline-newsletter-form input {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.65rem 1rem;
  color: var(--text);
  font-size: 0.875rem;
  outline: none;
  transition: border-color var(--transition);
}

.inline-newsletter-form input:focus {
  border-color: var(--accent);
}

.inline-newsletter-form input::placeholder {
  color: var(--muted);
}

.inline-newsletter-form button {
  background: var(--accent);
  border: none;
  border-radius: 8px;
  padding: 0.65rem 1.25rem;
  color: #fff;
  font-weight: 700;
  font-size: 0.875rem;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--transition), transform var(--transition);
}

.inline-newsletter-form button:hover {
  background: var(--accent-dim);
  transform: translateY(-1px);
}

.inline-newsletter-success {
  color: #4ade80;
  font-weight: 600;
  font-size: 0.9rem;
}

@media (max-width: 600px) {
  .inline-newsletter-inner {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
    padding: 1.5rem;
  }
  .inline-newsletter-form {
    flex-direction: column;
    max-width: 100%;
  }
  .inline-newsletter-content p {
    max-width: 100%;
  }
}

.newsletter {
  background: linear-gradient(135deg, #0e1a2e 0%, var(--bg-card) 100%);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 3rem 2rem;
  text-align: center;
  margin-bottom: 5rem;
}

body.light .newsletter {
  background: linear-gradient(135deg, #dce8ff 0%, var(--bg-card) 100%);
}

.newsletter h2 {
  font-size: 1.75rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.newsletter p {
  color: var(--muted);
  max-width: 480px;
  margin: 0 auto 1.75rem;
}

.newsletter-form {
  display: flex;
  gap: 0.75rem;
  max-width: 480px;
  margin: 0 auto;
}

.newsletter-form input {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  color: var(--text);
  font-size: 0.9rem;
  outline: none;
  transition: border-color var(--transition);
}

.newsletter-form input:focus {
  border-color: var(--accent);
}

.newsletter-form input::placeholder {
  color: var(--muted);
}

.newsletter-form button {
  background: var(--accent);
  border: none;
  border-radius: 8px;
  padding: 0.75rem 1.5rem;
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
  white-space: nowrap;
}

.newsletter-form button:hover {
  background: var(--accent-dim);
  transform: translateY(-1px);
}

.newsletter-success {
  display: none;
  color: #4ade80;
  font-weight: 600;
  margin-top: 0.75rem;
  font-size: 0.9rem;
}

/* ============================================================
   SCROLL TO TOP BUTTON
   ============================================================ */
.scroll-top-btn {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  font-size: 1.2rem;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.3s, visibility 0.3s, transform 0.3s, background 0.2s, border-color 0.2s;
  z-index: 999;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
.scroll-top-btn.visible {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
  transform: translateY(0);
}
.scroll-top-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
@media (max-width: 600px) {
  .scroll-top-btn { bottom: 1.25rem; right: 1.25rem; width: 40px; height: 40px; font-size: 1rem; }
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 3rem 1.5rem;
}

.footer-inner {
  max-width: 1440px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2.5rem;
}

.footer-brand-header {
  margin-bottom: 0.25rem;
}
.footer-brand-header .logo {
  font-size: 1.4rem;
  font-weight: 700;
}
.footer-brand-header .logo img {
  max-height: 36px;
}
.footer-brand p {
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 0.5rem;
  max-width: 300px;
  line-height: 1.6;
}

.footer-col h4 {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 1rem;
}

.footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.footer-col ul li a {
  color: var(--muted);
  font-size: 0.875rem;
  transition: color var(--transition);
}

.footer-col ul li a:hover {
  color: var(--text);
}

.footer-bottom {
  max-width: 1440px;
  margin: 2rem auto 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--muted);
}

/* ============================================================
   ARTICLE PAGE
   ============================================================ */
.article-hero {
  padding: 3rem 2rem 2rem;
  max-width: 920px;
  margin: 0 auto;
}

.article-hero .back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--muted);
  font-size: 0.875rem;
  margin-bottom: 1.5rem;
  transition: color var(--transition);
}

.article-hero .back-link:hover { color: var(--text); }

.article-tag {
  display: inline-block;
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

.article-hero h1 {
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 1rem;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.95rem;
  color: var(--muted);
  flex-wrap: wrap;
}

.article-meta .source { color: var(--text); font-weight: 600; }
.article-read-time { color: var(--muted); font-size: 0.9rem; }

.article-cover {
  width: 100%;
  max-width: 920px;
  margin: 2rem auto;
  border-radius: var(--radius);
  overflow: hidden;
  height: 380px;
}

.article-cover img { height: 100%; }

.article-content {
  max-width: 840px;
  margin: 0 auto;
  padding: 0 2rem 5rem;
  font-size: 1.125rem;
  line-height: 1.85;
  color: var(--text);
}

.article-content p { margin-bottom: 1.5rem; }
.article-content h2 { font-size: 1.6rem; font-weight: 700; margin: 2.5rem 0 1rem; }
.article-content h3 { font-size: 1.3rem; font-weight: 700; margin: 2rem 0 0.75rem; }
.article-content blockquote {
  border-left: 3px solid var(--accent);
  padding: 0.5rem 1.25rem;
  margin: 1.5rem 0;
  color: var(--muted);
  font-style: italic;
}

/* ============================================================
   ABOUT PAGE
   ============================================================ */
.about-page {
  max-width: 800px;
  margin: 0 auto;
  padding: 4rem 1.5rem 6rem;
}

.about-page h1 { font-size: 2.5rem; font-weight: 800; margin-bottom: 0.5rem; }
.about-page .lead {
  font-size: 1.15rem;
  color: var(--muted);
  margin-bottom: 2.5rem;
  line-height: 1.7;
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin: 2.5rem 0;
}

.about-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.about-card h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.about-card p {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.6;
}

.about-icon {
  font-size: 1.75rem;
  margin-bottom: 0.75rem;
}

/* ============================================================
   RESPONSIVE — Large Tablet (≤ 1100px)
   ============================================================ */
@media (max-width: 1100px) {
  .container { max-width: 100%; padding: 0 1.5rem; }
  .nav-links { gap: 1.25rem; }
  #search-input { width: 180px; }
  #search-input:focus { width: 220px; }
  .footer-inner { max-width: 100%; }
  .footer-bottom { max-width: 100%; }
}

/* ============================================================
   RESPONSIVE — Tablet (≤ 900px)
   ============================================================ */
@media (max-width: 900px) {
  .hero-card { grid-template-columns: 1fr; }
  .hero-image { min-height: 200px; }
  .hero-body { padding: 1.25rem; }
  .hero-title { font-size: 1.25rem; }
  .featured-picks { grid-template-columns: repeat(2, 1fr); }

  .footer-inner {
    grid-template-columns: 1fr 1fr;
  }

  .about-grid { grid-template-columns: 1fr; }

  .site-header { padding: 0 1.25rem; }
  .header-left { gap: 1.25rem; }
  .nav-links { gap: 1rem; }
  .nav-links a { font-size: 0.875rem; }
  #search-input { width: 160px; }
  #search-input:focus { width: 200px; }

  .card-title { font-size: 1.05rem; }
  .card-summary { font-size: 0.9rem; }
}

/* ============================================================
   RESPONSIVE — Mobile (≤ 600px)
   ============================================================ */
@media (max-width: 600px) {
  .site-header { padding: 0 0.75rem; height: 56px; }
  .header-left { gap: 0.75rem; }
  .logo { font-size: 1.2rem; }

  .nav-links { display: none; }

  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 56px;
    left: 0;
    right: 0;
    background: var(--bg-header);
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    gap: 0.5rem;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  }

  .nav-links.open a {
    font-size: 0.95rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
  }

  .nav-links.open li:last-child a {
    border-bottom: none;
  }

  .hamburger { display: flex; }

  .header-right { gap: 0.5rem; }
  .search-wrap { display: none; }
  .dfa-user-trigger span:not(.dfa-nav-avatar):not(.dfa-nav-avatar-initial) { display: none; }
  .theme-toggle { padding: 0.35rem 0.5rem; font-size: 0.95rem; }

  .container { padding: 0 1rem; }
  .news-grid { grid-template-columns: 1fr; gap: 1rem; }

  .card-image { height: 170px; }
  .card-body { padding: 1.1rem; gap: 0.5rem; }
  .card-footer { padding: 0 1.1rem 1.1rem; font-size: 0.8rem; }
  .card-title { font-size: 1rem; }
  .card-summary { font-size: 0.875rem; }
  .card-source-name { font-size: 0.8rem; }
  .card-source-detail { font-size: 0.7rem; }
  .card-read-more { font-size: 0.8rem; }
  .card-tag { font-size: 0.72rem; }
  .section-title { font-size: 1.4rem; }
  .section-sub { font-size: 0.9rem; }
  .filter-btn { font-size: 0.82rem; }

  .card-source-row .writer-avatar { width: 28px; height: 28px; }


  .hero-image { min-height: 180px; }
  .hero-title { font-size: 1.1rem; }
  .hero-summary { -webkit-line-clamp: 2; font-size: 0.9rem; }
  .featured-picks { grid-template-columns: 1fr; }
  .carousel-image { height: 150px; }

  /* List view mobile: stacked compact layout */
  .news-grid.list-view .card {
    flex-direction: column;
    align-items: stretch;
  }
  .news-grid.list-view .card-body {
    padding: 10px 12px 8px;
    gap: 4px;
  }
  .news-grid.list-view .card-title {
    font-size: 0.875rem;
    line-height: 1.35;
    -webkit-line-clamp: 2;
  }
  .news-grid.list-view .card-summary {
    font-size: 0.75rem;
    line-height: 1.4;
    -webkit-line-clamp: 1;
  }
  .news-grid.list-view .card-source-detail {
    font-size: 0.7rem;
  }
  .news-grid.list-view .card-footer {
    min-width: auto;
    width: 100%;
    border-left: none;
    border-top: 1px solid var(--border);
    padding: 6px 12px 8px;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
  .news-grid.list-view .card-source-row {
    flex-direction: row;
    align-items: center;
    gap: 6px;
    text-align: left;
  }
  .news-grid.list-view .writer-avatar {
    width: 20px;
    height: 20px;
  }
  .news-grid.list-view .card-source-name {
    font-size: 0.7rem;
    max-width: 90px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: left;
  }

  .filter-controls-row {
    flex-wrap: nowrap;
    top: 56px;
  }
  /* Horizontal scroll for filter pills on mobile */
  .filter-bar {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    min-width: 0;
    -webkit-mask-image: linear-gradient(to right, black 90%, transparent 100%);
    mask-image: linear-gradient(to right, black 90%, transparent 100%);
    padding-right: 1rem;
  }
  .filter-bar::-webkit-scrollbar {
    display: none;
  }
  .filter-btn {
    flex-shrink: 0;
    padding: 0.4rem 0.75rem;
  }
  .feed-heading { scroll-margin-top: 120px; }

  .carousel-image { height: 140px; }

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

  .footer-inner {
    grid-template-columns: 1fr;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
  }

  .hero { padding: 3rem 1rem 2rem; }
  .hero h1 { font-size: clamp(1.75rem, 5vw, 2.5rem); }
  .hero p { font-size: 1rem; }
}

/* ============================================================
   LEGAL PAGES (privacy.html, terms.html)
   ============================================================ */
.legal-page {
  max-width: 740px;
  margin: 0 auto;
  padding: 3rem 1.5rem 5rem;
}

.legal-page h1 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 800;
  margin: 1rem 0 0.25rem;
  line-height: 1.2;
}

.legal-date {
  color: var(--muted);
  font-size: 0.875rem;
  margin-bottom: 2rem;
}

.legal-page h2 {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 2.25rem 0 0.6rem;
  color: var(--text);
}

.legal-page h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 1.25rem 0 0.4rem;
  color: var(--text);
}

.legal-page p {
  color: var(--muted);
  line-height: 1.75;
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

.legal-page ul {
  list-style: disc;
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

.legal-page ul li {
  color: var(--muted);
  line-height: 1.7;
  font-size: 0.95rem;
  margin-bottom: 0.4rem;
}

.legal-page a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.legal-page code {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.1em 0.4em;
  font-size: 0.875em;
  color: var(--accent);
}

/* ============================================================
   ARTICLE PAGE — DYNAMIC
   ============================================================ */

/* Make cards fully clickable */
.card {
  cursor: pointer;
}

/* Back link */
.article-back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--muted);
  font-size: 0.875rem;
  margin-bottom: 1.25rem;
  transition: color var(--transition);
}
.article-back-link:hover { color: var(--text); }

/* Hero image — full width, capped height */
.article-hero-image {
  width: 100%;
  max-height: 450px;
  object-fit: cover;
  border-radius: var(--radius);
  display: block;
  margin: 0 auto 2rem;
}

/* Article page header block */
.article-page-header {
  max-width: 840px;
  margin: 0 auto 1.5rem;
  padding: 0 2rem;
}

.article-page-title {
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 800;
  line-height: 1.2;
  margin: 0.6rem 0 0.85rem;
}

/* Meta row — source · date */
.article-meta {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.95rem;
  color: var(--muted);
  flex-wrap: wrap;
}
.article-meta .source { color: var(--text); font-weight: 600; }

/* Summary section */
.article-summary {
  max-width: 840px;
  margin: 0 auto 1.5rem;
  padding: 0 2rem;
  font-size: 1.125rem;
  line-height: 1.85;
  color: var(--text);
}
.article-summary p { margin-bottom: 1.25rem; }
.article-summary-note {
  color: var(--muted);
  font-size: 0.9rem;
  font-style: italic;
}

/* CTA button — prominent electric blue */
.article-cta {
  display: inline-block;
  background: var(--accent);
  color: #fff !important;
  font-weight: 700;
  font-size: 1rem;
  padding: 0.9rem 2.2rem;
  border-radius: 99px;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
  box-shadow: 0 4px 20px rgba(79, 142, 247, 0.35);
}
.article-cta:hover {
  background: var(--accent-dim);
  transform: translateY(-2px);
  box-shadow: 0 6px 28px rgba(79, 142, 247, 0.5);
}

/* ---- Related articles grid ---- */
.related-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  margin-top: 1.5rem;
}

@media (max-width: 900px) {
  .related-grid { grid-template-columns: repeat(2, 1fr); }
  .article-hero { max-width: 100%; padding: 2.5rem 1.5rem 1.5rem; }
  .article-cover { max-width: 100%; }
  .article-page-header,
  .article-summary,
  .article-content,
  .article-share,
  .article-tldr,
  .audio-player-card,
  .article-full-content,
  .article-source-credits { max-width: 100%; padding-left: 1.5rem; padding-right: 1.5rem; }
  .article-content { font-size: 1.05rem; }
  .article-summary { font-size: 1.05rem; }
  .article-full-content { font-size: 1.05rem; }
  .article-content h2 { font-size: 1.4rem; }
  .article-content h3 { font-size: 1.2rem; }
}

@media (max-width: 600px) {
  .related-grid { grid-template-columns: 1fr; }
  .article-hero { padding: 2rem 1rem 1.25rem; }
  .article-hero h1,
  .article-page-title { font-size: clamp(1.5rem, 5vw, 2rem); }
  .article-page-header,
  .article-summary,
  .article-content,
  .article-share,
  .article-tldr,
  .audio-player-card,
  .article-full-content,
  .article-source-credits { padding-left: 1rem; padding-right: 1rem; }
  .article-content { font-size: 1rem; line-height: 1.75; }
  .article-summary { font-size: 1rem; line-height: 1.75; }
  .article-full-content { font-size: 1rem; line-height: 1.75; }
  .article-content h2 { font-size: 1.25rem; }
  .article-content h3 { font-size: 1.1rem; }
  .article-meta { font-size: 0.85rem; }
  .article-cover { height: 260px; }

  /* Action bar: stack reactions above share buttons on mobile */
  .article-action-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .article-action-divider {
    display: none;
  }
  .article-action-right {
    justify-content: flex-start;
    gap: 8px;
  }
  .share-btn {
    width: 34px;
    height: 34px;
  }
  .share-btn svg {
    width: 14px;
    height: 14px;
  }
  .share-copy {
    padding: 0 0.7rem;
    font-size: 0.72rem;
  }
  .share-label {
    font-size: 0.72rem;
  }
}

/* Related card — slimmer version of .card */
.related-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}
.related-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 6px 24px rgba(79, 142, 247, 0.18);
}

.related-card-image {
  width: 100%;
  height: 130px;
  overflow: hidden;
  background: var(--bg);
}
.related-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.related-card:hover .related-card-image img { transform: scale(1.05); }

.related-card-body {
  padding: 0.85rem 1rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  flex: 1;
}

.related-card-title {
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.related-card-summary {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ============================================================
   AD UNITS
   ============================================================ */
.ad-unit {
  width: 100%;
  overflow: hidden;
  text-align: center;
}

.ad-leaderboard {
  margin: 0;
  min-height: 0;
}

.ad-banner {
  margin: 2.5rem 0;
  min-height: 90px;
}

/* Prevent layout shift while ads load — only reserve height when ad slot is active */
.ad-unit ins {
  display: block;
  min-height: 0;
}

/* ============================================================
   AI THUMBNAIL SHIMMER
   Shows an animated shimmer while Imagen generates the image.
   Once loaded, the image fades in smoothly.
   ============================================================ */

.card-image.thumb-loading {
  position: relative;
  background: var(--surface);
  overflow: hidden;
}

.card-image.thumb-loading::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(79, 142, 247, 0.12) 40%,
    rgba(79, 142, 247, 0.25) 50%,
    rgba(79, 142, 247, 0.12) 60%,
    transparent 100%
  );
  background-size: 200% 100%;
  animation: thumb-shimmer 1.6s ease-in-out infinite;
}

/* Keep the existing image visible while AI thumb generates */
.card-image.thumb-loading img {
  opacity: 0.35;
  transition: opacity 0.5s ease;
}

/* Fade in when thumb-loading class is removed */
.card-image:not(.thumb-loading) img {
  opacity: 1;
  transition: opacity 0.5s ease;
}

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

/* ✨ AI badge on generated thumbnails */
.card-image.ai-generated::before {
  content: '✨ AI';
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  padding: 2px 7px;
  border-radius: 20px;
  backdrop-filter: blur(4px);
  z-index: 2;
  pointer-events: none;
}

/* ============================================================
   SHARE BUTTONS
   ============================================================ */

.article-share {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  max-width: 840px;
  margin: 1rem auto 1.75rem;
  padding: 0 2rem;
}

.share-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-right: 0.25rem;
}

/* Icon-only buttons with tooltip on hover */
.share-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  border: none;
  transition: transform 0.15s ease, opacity 0.15s ease, background 0.15s ease;
  line-height: 1;
  flex-shrink: 0;
}

.share-btn:hover { transform: translateY(-2px); opacity: 0.9; }
.share-btn:active { transform: scale(0.95); }

/* Tooltip */
.share-btn::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.8);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 500;
  white-space: nowrap;
  padding: 4px 8px;
  border-radius: 6px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
}
.share-btn:hover::after { opacity: 1; }

/* Copy button shows label text */
.share-copy {
  width: auto;
  border-radius: 999px;
  padding: 0 0.85rem;
  gap: 0.4rem;
}

/* Platform colors */
.share-x         { background: #000; color: #fff; }
.share-facebook  { background: #1877F2; color: #fff; }
.share-linkedin  { background: #0A66C2; color: #fff; }
.share-reddit    { background: #FF4500; color: #fff; }
.share-bluesky   { background: #0085FF; color: #fff; }

.share-copy      { background: var(--surface); color: var(--text); border: 1px solid rgba(255,255,255,0.1); }

[data-theme="light"] .share-x        { background: #111; }
[data-theme="light"] .share-copy     { border-color: rgba(0,0,0,0.12); }

.share-copy.copied { background: #22c55e !important; color: #fff; border-color: transparent; }

/* ============================================================
   AI TLDR SUMMARY
   ============================================================ */

.article-tldr {
  max-width: 840px;
  margin: 0 auto 1.75rem;
  background: linear-gradient(135deg, rgba(79,142,247,0.08) 0%, rgba(139,92,246,0.08) 100%);
  border: 1px solid rgba(79,142,247,0.2);
  border-radius: 14px;
  padding: 1.25rem 2rem;
  padding: 0 2rem;
}

.tldr-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  padding-top: 1.25rem;
}

.tldr-badge {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(79,142,247,0.12);
  padding: 3px 10px;
  border-radius: 999px;
}

.tldr-text {
  font-size: 1rem;
  line-height: 1.75;
  color: var(--text);
  margin: 0;
  padding-bottom: 1.25rem;
}

/* Structured summary */
.tldr-section-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.tldr-overview {
  font-size: 1rem;
  line-height: 1.75;
  color: var(--text);
  margin: 0 0 1.25rem;
  padding-left: 0.85rem;
  border-left: 3px solid rgba(79,142,247,0.5);
}

.tldr-overview-label {
  color: rgba(79,142,247,0.85);
}

.tldr-points-wrap {
  margin-bottom: 1.25rem;
}

.tldr-points-label {
  color: rgba(99,215,152,0.85);
}

.tldr-points {
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: .45rem;
  list-style: none;
}

.tldr-points li {
  font-size: .95rem;
  line-height: 1.65;
  color: var(--text);
  padding-left: 1.1rem;
  position: relative;
}

.tldr-points li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(99,215,152,0.7);
}

.tldr-matters {
  font-size: .95rem;
  line-height: 1.65;
  color: var(--muted);
  margin: 0;
  padding: .75rem 0 0 0.85rem;
  border-top: 1px solid var(--border);
  border-left: 3px solid rgba(251,191,36,0.5);
  margin-top: .75rem;
}

.tldr-matters-label {
  color: rgba(251,191,36,0.85);
}

.tldr-matters strong {
  color: rgba(251,191,36,0.9);
  font-weight: 700;
}

/* Shimmer loading state */
.tldr-loading {
  padding-bottom: 1.25rem;
}

.tldr-shimmer {
  height: 14px;
  border-radius: 6px;
  background: linear-gradient(
    90deg,
    rgba(79,142,247,0.08) 0%,
    rgba(79,142,247,0.2) 50%,
    rgba(79,142,247,0.08) 100%
  );
  background-size: 200% 100%;
  animation: tldr-shimmer 1.6s ease-in-out infinite;
  margin-bottom: 0.6rem;
}

.tldr-shimmer-md { width: 88%; }
.tldr-shimmer-sm { width: 65%; margin-bottom: 0; }

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

/* ── Audio Player Bar ───────────────────────────────────────────── */
/* ── Audio Podcast Card ─────────────────────────────────────────── */
/* Mirrors .article-tldr.container — border sits at the same 840px edge */
.audio-player-card {
  max-width: 840px;
  margin: 1.75rem auto 2.5rem;
  background: rgba(0,217,255,0.05);
  border: 1px solid rgba(0,217,255,0.18);
  border-radius: 14px;
  padding: 1rem 1.25rem;        /* overrides .container's padding */
  box-shadow: 0 2px 16px rgba(0,0,0,0.18);
}

.video-embed-card {
  margin: 24px auto;
  padding: 16px;
  background: var(--bg-card);
  border-radius: 12px;
  border: 1px solid var(--border);
}
.video-embed-header {
  margin-bottom: 12px;
}
.video-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  color: #e53e3e;
}
.video-embed-wrapper {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: 8px;
}
.video-embed-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Header row */
.audio-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}
.audio-card-title {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.audio-card-icon { flex-shrink: 0; fill: var(--accent); }
.audio-card-brand {
  font-size: 0.7rem;
  color: var(--muted);
  font-weight: 500;
  letter-spacing: 0.03em;
}
.audio-card-divider {
  height: 1px;
  background: rgba(0,217,255,0.12);
  margin: 0 0 0.85rem;
}

/* Controls row */
.audio-controls {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.audio-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  background: rgba(0,217,255,0.14);
  border: 1px solid rgba(0,217,255,0.3);
  border-radius: 50%;
  color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s, transform 0.1s;
  padding: 0;
}
.audio-btn:hover   { background: rgba(0,217,255,0.25); transform: scale(1.05); }
.audio-btn:active  { transform: scale(0.95); }
.audio-btn svg     { pointer-events: none; }
.audio-speed {
  border-radius: 6px;
  width: auto;
  padding: 0 0.55rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  height: 28px;
}

/* Progress bar */
.audio-progress-wrap {
  flex: 1;
  cursor: pointer;
  padding: 8px 0;
  position: relative;
}
.audio-progress-track {
  height: 4px;
  background: rgba(255,255,255,0.1);
  border-radius: 2px;
  position: relative;
  overflow: visible;
}
.audio-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, rgba(0,217,255,0.7), var(--accent));
  border-radius: 2px;
  transition: width 0.1s linear;
  position: relative;
}
.audio-progress-thumb {
  position: absolute;
  top: 50%;
  left: 0%;
  transform: translate(-50%, -50%);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 6px rgba(0,217,255,0.6);
  transition: left 0.1s linear;
  pointer-events: none;
}
.audio-progress-wrap:hover .audio-progress-thumb {
  width: 14px;
  height: 14px;
  box-shadow: 0 0 10px rgba(0,217,255,0.8);
}
.audio-time {
  font-size: 0.7rem;
  color: var(--muted);
  white-space: nowrap;
  min-width: 72px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Captions / karaoke */
.audio-captions {
  margin-top: 0.85rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(0,217,255,0.1);
  max-height: 5.5rem;
  overflow-y: auto;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  line-height: 1.7;
  font-size: 0.88rem;
  color: var(--muted);
  transition: color 0.2s;
}
.audio-captions::-webkit-scrollbar { display: none; }
.audio-captions.captions-playing   { color: var(--text); }
.caption-body { padding-bottom: 1.5rem; }

.caption-word {
  display: inline;
  border-radius: 3px;
  padding: 0 1px;
  transition: color 0.08s, background 0.08s;
}
.caption-word.caption-active {
  color: var(--accent);
  background: rgba(0,217,255,0.1);
}

/* Toggle button */
.audio-caption-toggle {
  display: block;
  margin: 0.5rem 0 0 auto;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 0.7rem;
  cursor: pointer;
  padding: 0;
  transition: color 0.15s;
  letter-spacing: 0.02em;
}
.audio-caption-toggle:hover { color: var(--accent); }

/* ── Section divider (after audio player) ───────────────────────── */
.section-divider {
  max-width: 720px;
  border: none;
  border-top: 1px solid rgba(255,255,255,0.07);
  margin: 0 auto 2rem;
}

/* ── Audio badge on article cards ───────────────────────────────── */
/* ── Category overlay on card image ────────────────────────────── */
.card-category-overlay {
  position: absolute;
  bottom: 0.55rem;
  left: 0.55rem;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: var(--accent);
  font-size: 0.67rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 0.2rem 0.55rem;
  border-radius: 5px;
  pointer-events: none;
  user-select: none;
}

/* ── Reading time in card meta ──────────────────────────────────── */
.card-read-time {
  color: var(--muted);
  font-size: 0.78rem;
  white-space: nowrap;
}

.card-source {
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
}

.meta-dot {
  color: var(--muted);
  opacity: 0.5;
}

.card-tags-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
  min-height: 1.4rem; /* keep row height stable when empty */
}
/* move existing card-tag margin to the row instead */
.card-tags-row .card-tag { margin-bottom: 0; }

.original-badge {
  display: inline-flex;
  align-items: center;
  background: #e74c3c;
  color: #fff;
  font-size: 0.6rem;
  font-weight: 800;
  font-variant: small-caps;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  white-space: nowrap;
}

/* Deep Dive badge on feed cards */
.deep-dive-badge {
  display: inline-flex;
  align-items: center;
  background: linear-gradient(135deg, #7c3aed, #0ea5e9);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  white-space: nowrap;
}

/* Deep Dive card in feed — full-width */
.deep-dive-card {
  grid-column: 1 / -1;
  border: 1px solid var(--accent);
  background: linear-gradient(135deg, var(--bg-card) 0%, rgba(124, 58, 237, 0.05) 100%);
}

/* Deep Dive context banner on article page */
.deep-dive-context {
  max-width: 840px;
  margin: 0 auto 1.5rem;
  padding: 1rem 1.25rem;
  background: linear-gradient(135deg, rgba(124,58,237,0.1), rgba(14,165,233,0.1));
  border-left: 4px solid var(--accent);
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.deep-dive-label {
  font-weight: 800;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  white-space: nowrap;
}
.deep-dive-meta {
  font-size: 0.85rem;
  color: var(--muted);
}

/* Table of contents */
.deep-dive-toc {
  max-width: 840px;
  margin: 0 auto 2rem;
  padding: 1rem 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.deep-dive-toc h3 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin: 0 0 0.75rem;
}
.deep-dive-toc ol {
  margin: 0;
  padding-left: 1.25rem;
}
.deep-dive-toc li {
  margin-bottom: 0.5rem;
}
.deep-dive-toc a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}
.deep-dive-toc a:hover {
  text-decoration: underline;
}

/* Section headers in deep dive article */
.deep-dive-section {
  margin-bottom: 2rem;
}
.deep-dive-section-header {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text);
  margin: 2rem 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--accent);
}

/* Deep dive content area */
.deep-dive-content {
  max-width: 840px;
  margin: 0 auto;
  font-size: 1.125rem;
  line-height: 1.85;
}
.deep-dive-content p {
  margin-bottom: 1.25rem;
}
.deep-dive-intro {
  margin-bottom: 1.5rem;
}

.card-audio-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: rgba(0,217,255,0.1);
  border: 1px solid rgba(0,217,255,0.25);
  color: var(--accent);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.2rem 0.55rem;
  border-radius: 20px;
  white-space: nowrap;
}

.card-video-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: rgba(229, 62, 62, 0.10);
  border: 1px solid rgba(229, 62, 62, 0.25);
  color: #e53e3e;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.2rem 0.55rem;
  border-radius: 20px;
  white-space: nowrap;
}

.card-comment-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: rgba(160,160,255,0.08);
  border: 1px solid rgba(160,160,255,0.2);
  color: var(--muted);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 0.2rem 0.55rem;
  border-radius: 20px;
  white-space: nowrap;
}

.card-reactions-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: rgba(231,76,60,0.08);
  border: 1px solid rgba(231,76,60,0.2);
  color: var(--muted);
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 20px;
  white-space: nowrap;
}

@media (max-width: 500px) {
  .audio-player-card { padding: 0.75rem 1rem; }
  .audio-card-brand  { display: none; }
}

/* ================================================================
   AUTH — Sign-in modal, user menu, toasts
   ================================================================ */

/* ── Sign-in nav button ─────────────────────────────────────────── */
.dfa-signin-btn {
  background: var(--accent);
  color: #0f172a;
  border: none;
  border-radius: 6px;
  padding: 0.45rem 1rem;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.2s;
  white-space: nowrap;
}
.dfa-signin-btn:hover { opacity: 0.85; }

/* ── User menu ──────────────────────────────────────────────────── */
.dfa-user-menu { position: relative; }

.dfa-user-trigger {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.35rem 0.6rem 0.35rem 0.4rem;
  cursor: pointer;
  color: var(--text);
  font-size: 0.85rem;
  transition: border-color 0.2s;
}
.dfa-user-trigger:hover { border-color: var(--accent); }

.dfa-nav-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.dfa-nav-avatar-initial {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: #0f172a;
  font-weight: 700;
  font-size: 0.8rem;
}

.dfa-user-name {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dfa-user-caret { font-size: 0.65rem; opacity: 0.6; }

.dfa-user-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 200px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.5rem 0;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  z-index: 1000;
}
.dfa-user-dropdown.open { display: block; }

.dfa-dropdown-header {
  padding: 0.6rem 1rem 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.dfa-dropdown-name  { font-weight: 600; font-size: 0.9rem; color: var(--text); }
.dfa-dropdown-email { font-size: 0.75rem; color: var(--muted); }
.dfa-dropdown-divider { border: none; border-top: 1px solid var(--border); margin: 0.25rem 0; }

.dfa-dropdown-item {
  display: block;
  width: 100%;
  padding: 0.5rem 1rem;
  background: none;
  border: none;
  text-align: left;
  font-size: 0.875rem;
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s;
}
.dfa-dropdown-item:hover { background: rgba(255,255,255,0.05); }
.dfa-signout-btn { color: #f87171; }
.dfa-signout-btn:hover { background: rgba(248,113,113,0.08); }

/* ── Auth modal ─────────────────────────────────────────────────── */
#dfa-auth-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9000;
  align-items: center;
  justify-content: center;
}
.dfa-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
}
.dfa-modal-box {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem;
  width: 90%;
  max-width: 400px;
  text-align: center;
  box-shadow: 0 24px 64px rgba(0,0,0,0.6);
  animation: dfa-modal-in 0.2s ease-out;
}
@keyframes dfa-modal-in {
  from { opacity: 0; transform: translateY(-16px) scale(0.97); }
  to   { opacity: 1; transform: none; }
}
.dfa-modal-close {
  position: absolute;
  top: 0.75rem; right: 0.75rem;
  background: none; border: none;
  color: var(--muted);
  font-size: 1rem;
  cursor: pointer;
  padding: 0.25rem;
  line-height: 1;
  border-radius: 4px;
  transition: color 0.2s;
}
.dfa-modal-close:hover { color: var(--text); }

.dfa-modal-logo { font-size: 2rem; margin-bottom: 0.75rem; }
.dfa-modal-box h2 { font-size: 1.2rem; font-weight: 700; color: var(--text); margin-bottom: 0.4rem; }
.dfa-modal-box > p { font-size: 0.875rem; color: var(--muted); margin-bottom: 1.5rem; }

.dfa-modal-buttons { display: flex; flex-direction: column; gap: 0.75rem; margin-bottom: 1rem; }

.dfa-oauth-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.7rem 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
  border: none;
  width: 100%;
}
.dfa-oauth-btn:hover { opacity: 0.88; }
.dfa-oauth-btn:active { transform: scale(0.98); }

.dfa-google-btn { background: #fff; color: #1f2937; }
.dfa-github-btn { background: #24292e; color: #fff; }

.dfa-modal-terms { font-size: 0.72rem; color: var(--muted); line-height: 1.5; }
.dfa-modal-terms a { color: var(--accent); text-decoration: none; }
.dfa-modal-terms a:hover { text-decoration: underline; }

/* ── Toast notifications ─────────────────────────────────────────── */
.dfa-toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.7rem 1.2rem;
  font-size: 0.875rem;
  color: var(--text);
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
  z-index: 9999;
  white-space: nowrap;
}
.dfa-toast.dfa-toast-show { opacity: 1; transform: translateX(-50%) translateY(0); }
.dfa-toast.dfa-toast-error { border-color: #f87171; color: #f87171; }

/* ── #dfa-auth-nav container in header ─────────────────────────── */
#dfa-auth-nav { display: flex; align-items: center; }

/* ================================================================
   COMMENTS
   ================================================================ */

.comments-section {
  margin-top: 3rem;
  margin-bottom: 4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.comments-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 1.5rem;
}

.comments-count {
  color: var(--muted);
  font-weight: 400;
  font-size: 0.95rem;
}

/* ── Signin prompt ───────────────────────────────────────────────── */
.comments-signin-prompt {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--bg-card);
  border: 1px dashed var(--border);
  border-radius: 10px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
}
.comments-signin-prompt p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  flex: 1;
}

/* ── Compose box ─────────────────────────────────────────────────── */
.comment-compose {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 2rem;
  align-items: flex-start;
}
.compose-avatar { flex-shrink: 0; }
.compose-right  { flex: 1; }

.compose-textarea {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  resize: vertical;
  transition: border-color 0.2s;
  box-sizing: border-box;
}
.compose-textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.compose-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.5rem;
}
.compose-counter {
  font-size: 0.75rem;
  color: var(--muted);
}
.compose-actions { display: flex; gap: 0.5rem; }

.compose-submit-btn {
  background: var(--accent);
  color: #0f172a;
  border: none;
  border-radius: 6px;
  padding: 0.4rem 1rem;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.2s;
}
.compose-submit-btn:hover { opacity: 0.85; }
.compose-submit-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.compose-cancel-btn {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.4rem 0.75rem;
  font-size: 0.85rem;
  cursor: pointer;
  transition: color 0.2s;
}
.compose-cancel-btn:hover { color: var(--text); }

/* ── Comment avatar ──────────────────────────────────────────────── */
.comment-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  object-fit: cover;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  vertical-align: middle;
}
.comment-avatar-initial {
  background: var(--accent);
  color: #0f172a;
  font-weight: 700;
}

/* ── Comment list ────────────────────────────────────────────────── */
.comments-list { display: flex; flex-direction: column; gap: 1.25rem; }

.comments-loading,
.comments-empty {
  color: var(--muted);
  font-size: 0.9rem;
  padding: 1rem 0;
}

/* ── Individual comment ──────────────────────────────────────────── */
.comment-item {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.comment-item.highlight {
  animation: comment-flash 2s ease;
}
@keyframes comment-flash {
  0%, 30% { background: rgba(0, 217, 255, 0.08); }
  100%    { background: transparent; }
}
.comment-reply {
  margin-left: 2.75rem;
  padding-left: 1rem;
  border-left: 2px solid var(--border);
}

.comment-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.4rem;
}
.comment-meta {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.comment-author {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text);
}
.comment-time {
  font-size: 0.75rem;
  color: var(--muted);
}
.comment-edited {
  font-size: 0.72rem;
  color: var(--muted);
  font-style: italic;
}

.comment-body {
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.6;
  margin-left: calc(32px + 0.6rem);
  white-space: pre-wrap;
  word-break: break-word;
}

.comment-deleted {
  font-size: 0.85rem;
  color: var(--muted);
  font-style: italic;
  margin: 0;
}

.comment-actions {
  display: flex;
  gap: 0.5rem;
  margin-left: calc(32px + 0.6rem);
  margin-top: 0.4rem;
}
.comment-action-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 0.78rem;
  cursor: pointer;
  padding: 0.15rem 0.3rem;
  border-radius: 4px;
  transition: color 0.15s;
}
.comment-action-btn:hover { color: var(--accent); }
.comment-delete-btn:hover { color: #f87171; }
.comment-report-btn:hover { color: #fbbf24; }

.comment-reply-compose { margin-top: 0.75rem; }
.comment-replies { margin-top: 0.75rem; display: flex; flex-direction: column; gap: 1rem; }

@media (max-width: 600px) {
  .comment-reply { margin-left: 1.25rem; }
  .comments-signin-prompt { flex-direction: column; align-items: flex-start; }
}

/* ── Top Commenters Leaderboard ──────────────────────────────────── */
.leaderboard-section {
  max-width: 900px;
  margin: 0 auto 4rem;
  padding: 0 1.5rem;
}

.leaderboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.lb-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--card-bg, rgba(255,255,255,0.04));
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  border-radius: 12px;
  padding: 0.85rem 1rem;
  transition: border-color 0.2s, transform 0.15s;
}
.lb-card:hover {
  border-color: rgba(0,217,255,0.3);
  transform: translateY(-1px);
}

.lb-rank {
  font-size: 1.25rem;
  min-width: 28px;
  text-align: center;
  line-height: 1;
}

.lb-avatar-wrap {
  position: relative;
  flex-shrink: 0;
}
.lb-avatar,
.lb-avatar-fallback {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border, rgba(255,255,255,0.1));
}
.lb-avatar-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,217,255,0.1);
  color: var(--accent, #00d9ff);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}
.lb-provider {
  position: absolute;
  bottom: -2px;
  right: -4px;
  font-size: 0.65rem;
  line-height: 1;
}

.lb-info {
  min-width: 0;
}
.lb-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text, #f0f0f0);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lb-count {
  font-size: 0.75rem;
  color: var(--muted, #94a3b8);
  margin-top: 0.15rem;
}

@media (max-width: 600px) {
  .leaderboard-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* ── Comment Reactions ───────────────────────────────────────────── */
.comment-reactions {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin: 0.4rem 0 0.2rem;
}

.rx-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  border-radius: 20px;
  padding: 0.18rem 0.6rem;
  font-size: 0.85rem;
  cursor: pointer;
  color: var(--muted, #94a3b8);
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
  line-height: 1.4;
}
.rx-btn:not([disabled]):hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.2);
  transform: scale(1.08);
}
.rx-btn.rx-active {
  background: rgba(0,217,255,0.1);
  border-color: rgba(0,217,255,0.35);
  color: var(--accent, #00d9ff);
}
.rx-btn[disabled] {
  cursor: default;
  opacity: 0.6;
}
.rx-count {
  font-size: 0.72rem;
  font-weight: 600;
  color: inherit;
  min-width: 10px;
}

/* ── Hot Posts ───────────────────────────────────────────────────── */
.filter-btn--hot {
  background: rgba(251,146,60,0.08);
  border-color: rgba(251,146,60,0.25);
  color: #fb923c;
}
.filter-btn--hot.active,
.filter-btn--hot:hover {
  background: rgba(251,146,60,0.18);
  border-color: rgba(251,146,60,0.5);
  color: #fb923c;
}

.hot-rank-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(251,146,60,0.92);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 0.18rem 0.5rem;
  border-radius: 20px;
  z-index: 2;
  backdrop-filter: blur(4px);
}

/* ── Notification preference toggle ─────────────────────────────── */
.notify-toggle-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.8rem;
  color: var(--muted, #94a3b8);
  user-select: none;
  transition: color 0.15s;
}
.notify-toggle-label:hover { color: var(--text, #f0f0f0); }
.notify-toggle-label input[type="checkbox"] {
  accent-color: var(--accent, #00d9ff);
  width: 14px;
  height: 14px;
  cursor: pointer;
}

/* ── Announcement Bar ────────────────────────────────────────────── */
.announce-bar {
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  background: linear-gradient(90deg, #0ea5e9, #00d9ff, #a78bfa);
  color: #0f1117;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.6rem 1.25rem;
  text-align: center;
}
.announce-text { flex: 1; text-align: center; }
.announce-link {
  background: none;
  border: none;
  border-bottom: 1px solid rgba(0,0,0,0.4);
  color: inherit;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
  font-size: inherit;
}
.announce-link:hover { opacity: 0.75; }
.announce-close {
  background: none;
  border: none;
  color: inherit;
  font-size: 1rem;
  cursor: pointer;
  opacity: 0.7;
  padding: 0 0.25rem;
  line-height: 1;
  flex-shrink: 0;
}
.announce-close:hover { opacity: 1; }

/* ── What's New Modal ────────────────────────────────────────────── */
.wnew-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(6px);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  animation: fadeIn 0.2s ease;
}

.wnew-modal {
  position: relative;
  background: #1a1d27;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 20px;
  max-width: 480px;
  width: 100%;
  padding: 2rem;
  box-shadow: 0 24px 80px rgba(0,0,0,0.6);
  animation: slideUp 0.25s ease;
}

.wnew-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--muted);
  border-radius: 50%;
  width: 28px;
  height: 28px;
  cursor: pointer;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.wnew-close:hover { background: rgba(255,255,255,0.12); color: var(--text); }

.wnew-header { margin-bottom: 1.5rem; }
.wnew-badge {
  display: inline-block;
  background: rgba(0,217,255,0.1);
  border: 1px solid rgba(0,217,255,0.3);
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.25rem 0.7rem;
  border-radius: 20px;
  margin-bottom: 0.75rem;
}
.wnew-title {
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.3;
  margin: 0 0 0.5rem;
  color: var(--text);
}
.wnew-sub {
  font-size: 0.875rem;
  color: var(--muted);
  margin: 0;
}

.wnew-features {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.75rem;
}
.wnew-feature {
  display: flex;
  align-items: flex-start;
  gap: 0.875rem;
  padding: 0.75rem 1rem;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
  transition: border-color 0.15s;
}
.wnew-feature:hover { border-color: rgba(0,217,255,0.2); }
.wnew-icon {
  font-size: 1.35rem;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 0.1rem;
}
.wnew-copy {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.wnew-copy strong {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text);
}
.wnew-copy span {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.5;
}

.wnew-footer {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  align-items: stretch;
}
.wnew-signin-btn {
  background: linear-gradient(135deg, #00d9ff, #a78bfa);
  color: #0f1117;
  border: none;
  border-radius: 10px;
  padding: 0.85rem 1.5rem;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
}
.wnew-signin-btn:hover { opacity: 0.9; transform: translateY(-1px); }
.wnew-dismiss {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 0.8rem;
  cursor: pointer;
  padding: 0.4rem;
  transition: color 0.15s;
  text-align: center;
}
.wnew-dismiss:hover { color: var(--text); }

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

@media (max-width: 480px) {
  .wnew-modal { padding: 1.5rem; border-radius: 16px; }
  .wnew-title { font-size: 1.15rem; }
}

/* ── About page — community feature list ────────────────────────── */
.about-community-grid {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
  margin-bottom: 2.5rem;
}
.about-community-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 12px;
  transition: border-color 0.15s;
}
.about-community-item:hover { border-color: rgba(0,217,255,0.25); }
.about-community-icon {
  font-size: 1.4rem;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 0.15rem;
}
.about-community-item > div {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.about-community-item strong {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
}
.about-community-item span {
  font-size: 0.83rem;
  color: var(--muted);
  line-height: 1.55;
}

/* ---------- Writer Byline (article cards) ---------- */
.writer-byline {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.5rem;
  font-size: 0.8rem;
}
.writer-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
}
.writer-name {
  color: var(--muted);
  font-weight: 500;
  text-decoration: none;
}
a.writer-name:hover {
  color: var(--accent);
}
.writer-beat {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.1rem 0.45rem;
  border-radius: 4px;
  background: var(--accent);
  color: #000;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-left: 0.25rem;
}

/* ---------- Writer Byline (article detail page) ---------- */
.article-writer-byline {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.writer-avatar-lg {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
}
.article-writer-byline .writer-detail {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.article-writer-byline .writer-name-lg {
  font-weight: 700;
  font-size: 1.05rem;
}
.writer-beat-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.12rem 0.5rem;
  border-radius: 4px;
  background: var(--accent);
  color: #000;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* ---------- Writer attribution label (TLDR section) ---------- */
.tldr-writer-label {
  display: inline-block;
  font-size: 0.78rem;
  color: var(--muted);
  margin-left: 0.75rem;
  font-weight: 500;
}

/* ---------- Writer filter banner (homepage feed) ---------- */
.writer-filter-banner {
  padding: 0.65rem 1rem;
  margin-bottom: 1rem;
  border-radius: 8px;
  background: var(--surface, #1a1a2e);
  border: 1px solid var(--border);
  font-size: 0.88rem;
  color: var(--text-secondary, var(--muted));
}
.writer-filter-banner a {
  color: var(--accent);
  text-decoration: none;
  margin-left: 0.25rem;
}
.writer-filter-banner a:hover {
  text-decoration: underline;
}

/* ---------- Original article full content ---------- */
.article-full-content {
  margin: 2rem auto;
  max-width: 840px;
  padding: 0 2rem;
  line-height: 1.85;
  font-size: 1.125rem;
  color: var(--text);
}

.article-full-content p {
  margin-bottom: 1.25rem;
}

.full-content-header {
  font-size: 1.35rem;
  font-weight: 800;
  margin-bottom: 1.5rem;
  color: var(--text);
  border-bottom: 2px solid var(--accent);
  padding-bottom: 0.5rem;
  display: inline-block;
}

/* ---------- Source credits for original articles ---------- */
.article-source-credits {
  margin: 2.5rem auto 2rem;
  max-width: 840px;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.source-credits-header {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.article-source-credits p {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.5;
}

.source-ref-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.source-ref-item {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.5;
}

.source-ref-item a {
  color: var(--accent);
  text-decoration: none;
}

.source-ref-item a:hover {
  text-decoration: underline;
}

.source-ref-origin {
  color: var(--muted);
  font-style: italic;
}
.source-ref-num {
  color: var(--accent);
  font-weight: 600;
  font-size: 0.85em;
}

/* Synthesis context banner */
.synthesis-context {
  max-width: 840px;
  margin: 0 auto 1rem;
  padding: 0.75rem 1rem;
  background: var(--card-bg);
  border-left: 3px solid var(--accent);
  border-radius: 4px;
  font-size: 0.85rem;
  color: var(--muted);
}

/* Inline citations */
.inline-cite {
  font-size: 0.7em;
  vertical-align: super;
  line-height: 0;
}
.inline-cite a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}
.inline-cite a:hover {
  text-decoration: underline;
}

/* ---------- Inline AI Images (originals & deep dives) ---------- */
.inline-image {
  margin: 2rem auto;
  max-width: 840px;
  border-radius: 12px;
  overflow: hidden;
}
.inline-image img {
  width: 100%;
  height: auto;
  display: block;
  aspect-ratio: 16/9;
  object-fit: cover;
}
.inline-image-caption {
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--muted);
  background: var(--bg-card);
}
.inline-image-attr {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.75rem;
  opacity: 0.7;
}


/* ---------- Infinite Scroll ---------- */
.feed-sentinel { height: 1px; }
.feed-loading {
  display: none;
  text-align: center;
  padding: 2rem;
  color: var(--muted);
}
.feed-loading-spinner {
  display: inline-block;
  width: 28px;
  height: 28px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: feed-spin 0.7s linear infinite;
}
@keyframes feed-spin {
  to { transform: rotate(360deg); }
}
