/* 50 Plus Hub — News Components */

/* ── News Brief Badge ── */
.news-badge {
  display: inline-block;
  background: #E53935;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 4px 10px;
  border-radius: 4px;
  margin-right: 8px;
  vertical-align: middle;
}

/* ── News Hero (hub page) ── */
.news-hero {
  background: var(--nav-bg);
  color: #fff;
  padding: 60px 0 48px;
  text-align: center;
}
.news-hero h1 {
  font-size: 2.4rem;
  color: #fff;
  margin-bottom: 12px;
}
.news-hero p {
  font-size: 1.1rem;
  color: rgba(255,255,255,0.75);
  max-width: 600px;
  margin: 0 auto;
}

/* ── Category Filter Pills ── */
.news-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin: 32px 0;
}
.filter-btn {
  display: inline-block;
  padding: 8px 20px;
  border: 2px solid var(--border);
  border-radius: 24px;
  background: var(--white);
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  min-height: 44px;
}
.filter-btn:hover,
.filter-btn.active {
  background: var(--link);
  color: #fff;
  border-color: var(--link);
}

/* ── Homepage News Section ── */
.news-section {
  padding: 48px 0 32px;
  border-bottom: 2px solid var(--border);
  margin-bottom: 16px;
}
.news-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}
.news-header h2 {
  font-size: 1.7rem;
  margin: 0;
}
.news-header .news-timestamp {
  font-size: 0.85rem;
  color: var(--text-muted);
}
.news-header .view-all {
  font-weight: 700;
  font-size: 0.95rem;
}

/* ── News Grid ── */
.news-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

/* Lead card — spans full width */
.digest-card.news-lead {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}
.digest-card.news-lead .card-body {
  padding: 28px 32px;
}
.digest-card.news-lead .card-body h3 {
  font-size: 1.5rem;
}
.digest-card.news-lead .news-lead-img {
  border-radius: var(--radius) 0 0 var(--radius);
  overflow: hidden;
}
.digest-card.news-lead .news-lead-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ── "How Does This Affect 50+" Section ── */
.affect-section {
  background: var(--bg-warm);
  border-left: 5px solid var(--link);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 24px 28px;
  margin: 2em 0;
}
.affect-section h2 {
  font-size: 1.3rem;
  margin: 0 0 16px;
  color: var(--link);
}
.affect-section p {
  margin-bottom: 1em;
}
.affect-section p:last-child {
  margin-bottom: 0;
}

/* ── News Image with Credit ── */
.news-image {
  margin: 1.5em 0;
}
.news-image img {
  width: 100%;
  border-radius: var(--radius);
}
.news-image figcaption {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: right;
  margin-top: 6px;
}
.news-image figcaption a {
  color: var(--text-muted);
  text-decoration: underline;
}

/* ── Chart Wrapper ── */
.news-chart {
  margin: 2em 0;
  max-width: 600px;
}
.news-chart canvas {
  width: 100% !important;
  height: auto !important;
}

/* ── Responsive ── */
@media (max-width: 1024px) {
  .news-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .digest-card.news-lead {
    grid-template-columns: 1fr;
  }
  .digest-card.news-lead .news-lead-img {
    border-radius: var(--radius) var(--radius) 0 0;
    max-height: 240px;
  }
}

@media (max-width: 768px) {
  .news-grid {
    grid-template-columns: 1fr;
  }
  .news-hero h1 {
    font-size: 1.8rem;
  }
  .digest-card.news-lead .card-body {
    padding: 20px;
  }
  .digest-card.news-lead .card-body h3 {
    font-size: 1.2rem;
  }
}

/* ── Dark mode adjustments ── */
[data-theme="dark"] .news-badge {
  background: #EF5350;
}
[data-theme="dark"] .news-hero {
  background: #0D1117;
}
