/* ── NEWS PAGE-SPECIFIC CSS ──────────────────────────────── */

/* ── LAYOUT ──────────────────────────────────────────────── */
#appBody {
  display: flex;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}

/* ── SIDEBAR ─────────────────────────────────────────────── */
#sidebar {
  width: 220px;
  min-width: 220px;
  background: #fff;
  border-right: 1px solid #e5e5e5;
  padding: 24px 16px;
  overflow-y: auto;
}

.sidebar-title {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #aaa;
  margin-bottom: 12px;
}

.source-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  background: none;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: #444;
  cursor: pointer;
  text-align: left;
  transition: background 0.12s;
}
.source-btn:hover { background: #f5f5f5; }
.source-btn.active { background: var(--neutral); color: var(--primary); font-weight: 700; }
.source-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── MAIN CONTENT ────────────────────────────────────────── */
#main {
  flex: 1;
  overflow-y: auto;
  padding: 0;
  min-height: 0;
  background: #fff;
}

/* Centered content wrapper — offsets for 220px sidebar so center aligns with nav */
#newsContent {
  max-width: 1200px;
  width: 100%;
  margin-left: max(0px, calc(50% - 600px - 110px));
}

/* ── NYT LAYOUT ──────────────────────────────────────────── */
#articleGrid { padding: 0 36px 40px; }

/* Section dividers */
.news-section {
  padding: 20px 0 0;
  border-top: 1px solid #e2e2e2;
  margin-top: 0;
}
.news-section + .news-section {
  margin-top: 20px;
}

/* Hero image */
.hero-img-wrap {
  margin: 12px 0 16px;
}
.hero-img {
  width: 100%;
  height: 260px;
  object-fit: cover;
  display: block;
}

/* Hero: 2/3 + 1/3 */
.section-hero {
  display: grid;
  grid-template-columns: 1fr 1px 340px;
  gap: 0;
}
.section-hero .col-divider {
  background: #e2e2e2;
  margin: 0;
}
.section-hero > div:first-child {
  padding-right: 28px;
}
.hero-stack {
  padding-left: 28px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}
.hero-stack .article-item + .article-item {
  border-top: 1px solid #e2e2e2;
  padding-top: 32px;
}

/* 3-col section */
.section-3col {
  display: grid;
  grid-template-columns: 1fr 1px 1fr 1px 1fr;
  gap: 0;
}
.section-3col .col-divider {
  background: #e2e2e2;
  margin: 0;
}
.section-3col > *:not(.col-divider) { padding: 0 32px; }
.section-3col > *:nth-child(1) { padding-left: 0; }
.section-3col > *:nth-child(5) { padding-right: 0; }

/* 4-col section */
.section-4col {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
}
.section-4col .article-item {
  border-right: 1px solid #e2e2e2;
  padding: 0 32px;
}
.section-4col .article-item:first-child { padding-left: 0; }
.section-4col .article-item:last-child {
  border-right: none;
  padding-right: 0;
}

/* List section */
.section-list {
  display: flex;
  flex-direction: column;
}
.section-list .article-item {
  display: flex;
  gap: 24px;
  padding: 14px 0;
  border-bottom: 1px solid #e2e2e2;
  align-items: baseline;
}
.section-list .article-item .article-topic-row { flex-shrink: 0; width: 160px; }
.section-list .article-item .article-title { font-size: 14px; margin: 0; flex: 1; }
.section-list .article-item .article-date-inline { flex-shrink: 0; font-size: 11px; color: #bbb; white-space: nowrap; }

/* Article atoms */
.article-item {
  display: block;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}
.article-item:hover .article-title { text-decoration: underline; text-decoration-color: #ccc; }

.article-topic-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}
.article-topic-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.article-topic-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: #888; }
.article-date { font-size: 10px; color: #bbb; margin-left: auto; }

/* Size variants */
.article-title {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 700;
  line-height: 1.3;
  color: #1a1a1a;
  margin-bottom: 8px;
}
.article-title-xl  { font-size: 26px; }
.article-title-lg  { font-size: 19px; }
.article-title-md  { font-size: 16px; }
.article-title-sm  { font-size: 13px; margin-bottom: 0; }

.article-desc {
  font-size: 13px;
  color: #444;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.article-desc-short {
  -webkit-line-clamp: 2;
}
.article-desc-none { display: none; }

/* States */
.state-msg {
  text-align: center;
  padding: 60px 20px;
  color: #aaa;
  font-size: 14px;
}

/* ── SPINNER OVERRIDE ────────────────────────────────────── */
/* News uses a larger spinner with top-color: #1a1a1a and auto margin */
.spinner {
  width: 28px;
  height: 28px;
  border-width: 3px;
  border-top-color: #1a1a1a;
  margin: 0 auto 12px;
}
