:root {
  --ink: #12131a;
  --paper: #f6f4ee;
  --paper-dim: #eae7dd;
  --navy: #1c2541;
  --left: #3b6ea5;
  --center: #8a8578;
  --right: #b5482f;
  --line: rgba(18, 19, 26, 0.12);
  --font-display: "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --font-body: "Charter", "Georgia", serif;
  --font-mono: "IBM Plex Mono", "SFMono-Regular", Menlo, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.5;
}

.site-header {
  padding: 2.5rem 1.5rem 1.5rem;
  text-align: center;
  border-bottom: 1px solid var(--line);
}

.header-actions {
  display: flex;
  gap: 0.6rem;
  justify-content: center;
  margin-top: 1rem;
}

.inline-link-btn {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: var(--navy);
  text-decoration: underline;
  cursor: pointer;
}

.sources-btn {
  background: none;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--navy);
  padding: 0.45rem 0.9rem;
  cursor: pointer;
}

.sources-btn:hover {
  background: var(--paper-dim);
  border-color: rgba(18, 19, 26, 0.28);
}

.sources-view {
  max-width: 760px;
  margin: 0 auto;
  padding: 1.5rem;
}

.sources-view.hidden { display: none; }

.sources-title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  margin: 0;
}

.sources-intro {
  font-size: 0.95rem;
  line-height: 1.6;
  color: #3a3a34;
  margin: 0 0 1.5rem;
}

.criteria-box {
  background: var(--paper-dim);
  border-radius: 10px;
  padding: 1.2rem 1.4rem;
  margin-bottom: 2rem;
}

.criteria-box h3 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  margin: 0 0 0.6rem;
}

.criteria-box p {
  font-size: 0.9rem;
  line-height: 1.6;
  color: #3a3a34;
  margin: 0;
}

.sources-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--line);
}

.source-row {
  background: var(--paper);
  padding: 1rem 1.2rem;
}

.source-row-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
}

.source-name {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
}

.bucket-pill {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  white-space: nowrap;
}

.bucket-pill.left { background: rgba(59, 110, 165, 0.15); color: var(--left); }
.bucket-pill.center { background: rgba(138, 133, 120, 0.18); color: #6b6650; }
.bucket-pill.right { background: rgba(181, 72, 47, 0.15); color: var(--right); }

.source-row-meta {
  display: flex;
  gap: 1.2rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: #6b6a63;
  margin-top: 0.3rem;
}

.current-alignment {
  margin: 0.6rem 0 0;
  padding: 0.7rem 0.9rem;
  border: 1px dashed rgba(186, 117, 23, 0.4);
  border-radius: 6px;
  background: rgba(186, 117, 23, 0.06);
}

.current-alignment-tag {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #8a5a1a;
  margin-bottom: 0.35rem;
}

.current-alignment p {
  font-size: 0.85rem;
  color: #3a3a34;
  margin: 0 0 0.4rem;
}

.current-alignment a {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--navy);
  text-decoration: none;
}

.current-alignment a:hover { text-decoration: underline; }

.last-verified {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: #a5a297;
  margin: 0.6rem 0 0;
}

.more-info-link {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--navy);
  text-decoration: none;
  margin-top: 0.5rem;
}

.more-info-link:hover { text-decoration: underline; }

.source-funding {
  font-size: 0.85rem;
  color: #3a3a34;
  margin: 0.5rem 0 0;
}

.source-context {
  font-size: 0.85rem;
  color: #5f5d54;
  font-style: italic;
  margin: 0.5rem 0 0;
  padding-left: 0.6rem;
  border-left: 2px solid var(--line);
}

.wordmark {
  font-family: var(--font-display);
  font-size: 2.1rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: none;
  border: none;
  color: var(--ink);
  cursor: pointer;
  padding: 0;
}

.tagline {
  margin: 0.5rem 0 0;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.4;
  letter-spacing: 0;
  color: #4a4942;
}

.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem 1rem;
  color: #6b6a63;
  font-family: var(--font-mono);
  font-size: 0.9rem;
}

.freshness-badge {
  max-width: 1080px;
  margin: 0.5rem auto 0;
  padding: 0 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: #6b6a63;
}

.freshness-badge.hidden { display: none; }

.freshness-badge.is-live::before {
  content: "● ";
  color: #3b8a5a;
}

.category-tabs {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0.5rem 1.5rem 0;
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--line);
}

.category-tabs.hidden { display: none; }

.tab {
  background: none;
  border: none;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #55534b;
  padding: 0.6rem 0.2rem;
  margin-right: 1rem;
  cursor: pointer;
  border-bottom: 2px solid transparent;
}

.tab:hover { color: var(--ink); }

.tab.active {
  color: var(--navy);
  border-bottom-color: var(--navy);
  font-weight: 600;
}

.story-list {
  max-width: 1080px;
  margin: 0 auto;
  padding: 1.5rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.1rem;
}

.story-list.hidden { display: none; }

.story-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1.4rem 1.5rem;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.story-card:hover {
  background: var(--paper-dim);
  border-color: rgba(18, 19, 26, 0.28);
}

.story-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.7rem;
}

.category-badge {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--navy);
  background: rgba(28, 37, 65, 0.08);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}

.story-date {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: #6b6a63;
}

.story-card h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  line-height: 1.3;
  margin: 0 0 0.7rem;
  font-weight: 600;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.mini-spectrum {
  display: flex;
  height: 6px;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 0.4rem;
}

.mini-spectrum span { display: block; height: 100%; }
.mini-spectrum .l { background: var(--left); }
.mini-spectrum .c { background: var(--center); }
.mini-spectrum .r { background: var(--right); }

.story-meta {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: #6b6a63;
  letter-spacing: 0.02em;
}

.story-detail {
  max-width: 980px;
  margin: 0 auto;
  padding: 1.5rem;
}

.story-detail.hidden { display: none; }

.view-header {
  display: flex;
  align-items: baseline;
  gap: 1.2rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.back-btn {
  background: none;
  border: none;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--navy);
  cursor: pointer;
  padding: 0.4rem 0;
  white-space: nowrap;
}

#detail-headline {
  font-family: var(--font-display);
  font-size: 1.7rem;
  max-width: 640px;
  margin: 0;
}

.spectrum-bar {
  display: flex;
  height: 10px;
  border-radius: 5px;
  overflow: hidden;
  margin-bottom: 2rem;
}
.spectrum-bar span { height: 100%; }

.columns {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
}

.column {
  background: var(--paper);
  padding: 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.column-title {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--ink);
}

.column-title.left { border-color: var(--left); color: var(--left); }
.column-title.center { border-color: var(--center); color: var(--center); }
.column-title.right { border-color: var(--right); color: var(--right); }

.article-card {
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--line);
}
.article-card:last-child { border-bottom: none; }

.article-source {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: #55534b;
  letter-spacing: 0.01em;
}

.article-headline {
  display: block;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  margin: 0.25rem 0 0.35rem;
}

.article-headline:hover {
  color: var(--navy);
  text-decoration: underline;
}

.article-time {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: #6b6a63;
  margin: 0 0 0.4rem;
}

.article-summary {
  font-size: 0.88rem;
  color: #3a3a34;
  margin: 0;
}

.article-context {
  font-size: 0.8rem;
  color: #5f5d54;
  font-style: italic;
  margin: 0.4rem 0 0;
  padding-left: 0.6rem;
  border-left: 2px solid var(--line);
}

.site-footer {
  max-width: 760px;
  margin: 2rem auto 3rem;
  padding: 0 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.5;
  color: #6b6a63;
  text-align: center;
}

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