/* Civic Data, Explained — editorial design system
   Reference DNA: Spotlight PA (kickers, deks, section blocks) × Flip.to (hero, clean nav, accent) */

:root {
  --ink: #1b1b1f;
  --paper: #faf8f4;
  --panel: #ffffff;
  --rule: #e5dfd4;
  --blue: #0a5da0;
  --blue-soft: #e8f1f9;
  --amber: #b45309;
  --amber-soft: #fbf1e3;
  --muted: #6b665c;
  --serif: Georgia, "Iowan Old Style", "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- utility bar ---------- */
.utility-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.4rem 1.25rem;
  background: var(--ink);
  color: var(--paper);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.utility-link { color: #ffd9a0; font-weight: 600; }
.utility-link:hover { color: #fff; text-decoration: none; }

/* ---------- header ---------- */
.site-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1.5rem;
  padding: 1.1rem 1.25rem;
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
  position: sticky;
  top: 0;
  z-index: 10;
}
.wordmark {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.45rem;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.wordmark em { font-style: italic; color: var(--blue); }
.wordmark:hover { text-decoration: none; }
.main-nav { display: flex; gap: 1.5rem; }
.main-nav a {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
}
.main-nav a:hover { color: var(--blue); text-decoration: none; }

main { max-width: 64rem; margin: 0 auto; padding: 0 1.25rem 3rem; }

/* ---------- hero (Flip.to energy: full-bleed photo + motion) ---------- */
.hero {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  min-height: 440px;
  display: flex;
  align-items: flex-end;
  margin: 2rem 0 1.25rem;
  background: linear-gradient(115deg, #10131a 0%, #0a2c4a 100%);
}
.hero-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  animation: kenburns 24s ease-in-out infinite alternate;
  transform-origin: 60% 40%;
}
@keyframes kenburns {
  from { transform: scale(1) translate(0, 0); }
  to   { transform: scale(1.1) translate(-1.5%, -1%); }
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, rgba(16, 19, 26, 0.72) 10%, rgba(16, 19, 26, 0.3) 50%, rgba(10, 93, 160, 0.15) 100%);
}
.hero-content {
  position: relative;
  padding: 3rem 2.25rem 2.5rem;
  max-width: 52rem;
}
.hero-kicker {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #ffd9a0;
  margin: 0 0 1rem;
}
.hero h1 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(2.2rem, 5.5vw, 3.6rem);
  line-height: 1.08;
  letter-spacing: -0.015em;
  margin: 0 0 1.25rem;
  color: #fff;
}
.hero-accent {
  color: #9cc9f0;
  font-style: italic;
  font-weight: 600;
  border-bottom: 3px solid var(--amber);
}
.hero-dek {
  font-size: 1.15rem;
  color: rgba(255, 255, 255, 0.85);
  max-width: 44rem;
  margin: 0 0 1.75rem;
}
.cta {
  display: inline-block;
  background: var(--blue);
  color: #fff;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.7rem 1.4rem;
  border-radius: 6px;
}
.cta:hover { background: #08497e; text-decoration: none; }

/* ---------- ticker strip (news-banner motion) ---------- */
.ticker {
  overflow: hidden;
  background: var(--blue);
  color: #fff;
  border-radius: 6px;
  margin-bottom: 1.25rem;
  font-size: 0.85rem;
}
.ticker-track {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  width: max-content;
  padding: 0.55rem 0;
  white-space: nowrap;
  animation: marquee 30s linear infinite;
}
.ticker:hover .ticker-track { animation-play-state: paused; }
@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
.ticker-label {
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.72rem;
  color: #ffe3b3;
  margin-left: 1.25rem;
}
.ticker-item { color: #fff; }
.ticker-item:not(:last-child)::after { content: "·"; margin-left: 1.25rem; color: #9cc4e4; }

/* ---------- lead story (Spotlight PA) ---------- */
.lead { margin-bottom: 3rem; }
.lead-card {
  border-left: 4px solid var(--amber);
  padding: 0.25rem 0 0.25rem 1.5rem;
}
.lead-tags { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.5rem; }
.lead-card h2 {
  font-family: var(--serif);
  font-size: clamp(1.6rem, 3.5vw, 2.3rem);
  line-height: 1.15;
  margin: 0 0 0.5rem;
}
.lead-card h2 a { color: var(--ink); }
.lead-card h2 a:hover { color: var(--blue); text-decoration: none; }
.dek { font-size: 1.02rem; color: var(--muted); margin: 0 0 0.6rem; max-width: 44rem; }

/* ---------- kickers / tags ---------- */
.kicker {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--blue);
}
.category-tag {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--amber-soft);
  color: var(--amber);
  border-radius: 999px;
  padding: 0.15rem 0.7rem;
}
.meta {
  font-size: 0.8rem;
  color: var(--muted);
  letter-spacing: 0.02em;
  margin: 0.5rem 0 0;
}

/* ---------- topic blocks ---------- */
.topic-block { margin: 0 0 2.75rem; }
.block-photo {
  display: block;
  width: 100%;
  height: 96px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 0.9rem;
}
.block-title {
  font-family: var(--serif);
  font-size: 1.5rem;
  border-bottom: 2px solid var(--ink);
  padding-bottom: 0.4rem;
  margin: 0 0 1.25rem;
}
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(235px, 1fr));
  gap: 1.1rem;
}
.card {
  display: block;
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 0.8rem 1.15rem 1.2rem;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
  overflow: hidden;
}
.card-cover {
  display: block;
  width: calc(100% + 2.3rem);
  height: 110px;
  object-fit: cover;
  margin: -0.8rem -1.15rem 0.9rem;
  border-bottom: 1px solid var(--rule);
  background: var(--blue-soft);
}
.card:hover {
  box-shadow: 0 6px 18px rgba(27, 27, 31, 0.08);
  transform: translateY(-2px);
  text-decoration: none;
}
.card .kicker { display: block; margin-bottom: 0.45rem; }
.card h3 {
  font-family: var(--serif);
  font-size: 1.12rem;
  line-height: 1.3;
  margin: 0 0 0.45rem;
  color: var(--ink);
}
.card:hover h3 { color: var(--blue); }
.card p {
  font-size: 0.88rem;
  color: var(--muted);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---------- full catalog list ---------- */
.full-list { margin-top: 0.5rem; }
.catalog-list {
  columns: 2;
  column-gap: 2.5rem;
  padding-left: 1.4rem;
  font-size: 0.95rem;
}
.catalog-list li { margin-bottom: 0.45rem; break-inside: avoid; }
.catalog-list a { color: var(--ink); font-weight: 500; }
.catalog-list a:hover { color: var(--blue); }
.catalog-list .meta { margin-left: 0.5rem; font-size: 0.75rem; }

/* ---------- page head (list pages) ---------- */
.page-head { padding: 2.5rem 0 1.5rem; max-width: 48rem; }
.page-head h1 {
  font-family: var(--serif);
  font-size: clamp(2rem, 4vw, 2.8rem);
  margin: 0.3rem 0 0.6rem;
}

/* ---------- article page ---------- */
.article { max-width: 44rem; margin: 0 auto; padding-top: 2.25rem; }
.article-header { margin-bottom: 2rem; }
.article-tags { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.8rem; }
.article-header h1 {
  font-family: var(--serif);
  font-size: clamp(2rem, 4.5vw, 2.9rem);
  line-height: 1.12;
  letter-spacing: -0.012em;
  margin: 0 0 0.9rem;
}
.article-header .dek { font-size: 1.15rem; }

.article-cover {
  width: 100%;
  border-radius: 10px;
  margin-bottom: 1.75rem;
  box-shadow: 0 4px 16px rgba(27, 27, 31, 0.12);
}

.live-map { margin: 2.5rem 0; }
.live-map h2 {
  font-family: var(--serif);
  font-size: 1.45rem;
  margin: 0 0 0.7rem;
  padding-top: 0.4rem;
}
.dataset-map {
  width: 100%;
  height: 380px;
  border-radius: 10px;
  border: 1px solid var(--rule);
  box-shadow: 0 4px 16px rgba(27, 27, 31, 0.08);
}
.dataset-map .mapboxgl-popup-content {
  font-family: var(--sans);
  font-size: 0.85rem;
  color: var(--ink);
}

.sample-data { margin: 2.5rem 0; }
.sample-data h2 {
  font-family: var(--serif);
  font-size: 1.45rem;
  margin: 0 0 0.7rem;
  padding-top: 0.4rem;
}
.table-scroll { overflow-x: auto; }
.sample-data table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: 8px;
  overflow: hidden;
}
.sample-data th {
  text-align: left;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--blue-soft);
  padding: 0.55rem 0.8rem;
  border-bottom: 1px solid var(--rule);
}
.sample-data td {
  padding: 0.5rem 0.8rem;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}
.sample-data tbody tr:last-child td { border-bottom: none; }
.sample-data tbody tr:nth-child(even) { background: #fbf9f4; }

.article-body {
  font-size: 1.05rem;
  line-height: 1.75;
}
.article-body h2 {
  font-family: var(--serif);
  font-size: 1.45rem;
  margin: 2.2rem 0 0.7rem;
  padding-top: 0.4rem;
}
.article-body h3 { font-size: 1.1rem; margin: 1.5rem 0 0.5rem; }
.article-body p { margin: 0 0 1rem; }
.article-body ul, .article-body ol { margin: 0 0 1rem 1.3rem; padding: 0; }
.article-body li { margin-bottom: 0.35rem; }
.article-body strong { font-weight: 700; }
.article-body code {
  background: #efece4;
  border-radius: 4px;
  padding: 0.08rem 0.35rem;
  font-size: 0.9em;
}
.article-body blockquote {
  margin: 1.2rem 0;
  padding: 0.9rem 1.2rem;
  background: var(--blue-soft);
  border-left: 4px solid var(--blue);
  border-radius: 0 6px 6px 0;
}
.article-body blockquote p { margin: 0; }

.callout {
  background: var(--amber-soft);
  border-left: 4px solid var(--amber);
  border-radius: 0 8px 8px 0;
  padding: 1rem 1.25rem;
  margin: 1.4rem 0;
}
.callout p { margin: 0; }

/* ---------- dictionary ---------- */
.dictionary { margin: 2.5rem 0; }
.dictionary h2 { font-family: var(--serif); font-size: 1.45rem; margin-bottom: 0.3rem; }
.dictionary-note { font-size: 0.85rem; color: var(--muted); margin: 0 0 1rem; }
.dictionary table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  background: var(--panel);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(27, 27, 31, 0.06);
}
.dictionary th, .dictionary td {
  text-align: left;
  padding: 0.6rem 0.8rem;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}
.dictionary th {
  background: var(--ink);
  color: var(--paper);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.dictionary tr:last-child td { border-bottom: none; }
.dictionary td code { white-space: nowrap; }

/* ---------- lookup box ---------- */
.lookup {
  margin: 2.5rem 0;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--panel);
  padding: 1.25rem 1.4rem;
}
.lookup h2 { font-family: var(--serif); font-size: 1.3rem; margin: 0 0 0.4rem; }
.lookup p { font-size: 0.92rem; color: var(--muted); margin: 0 0 0.8rem; }
.lookup ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 1.5rem; flex-wrap: wrap; }
.lookup a { font-weight: 600; }

.disclaimer {
  font-size: 0.82rem;
  color: var(--muted);
  border-top: 1px solid var(--rule);
  padding-top: 1rem;
  margin-top: 2.5rem;
}

/* ---------- footer ---------- */
.site-footer {
  background: var(--ink);
  color: #c9c4b8;
  padding: 2.5rem 1.25rem 1.75rem;
  margin-top: 2rem;
}
.footer-cols {
  max-width: 64rem;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 2rem;
}
.footer-col { display: flex; flex-direction: column; gap: 0.45rem; }
.footer-col strong {
  color: #fff;
  font-family: var(--serif);
  font-size: 1.1rem;
  margin-bottom: 0.3rem;
}
.footer-col em { font-style: italic; color: #7fb4e0; }
.footer-col p { font-size: 0.88rem; margin: 0; color: #a9a497; }
.photo-credit { font-size: 0.75rem !important; color: #8b867a !important; }
.photo-credit code { background: rgba(255, 255, 255, 0.08); border-radius: 3px; padding: 0.05rem 0.3rem; }
.footer-col a { color: #c9c4b8; font-size: 0.92rem; }
.footer-col a:hover { color: #fff; }
.footer-col .count { color: var(--amber); font-size: 0.8rem; }
.footer-disclaimer {
  max-width: 64rem;
  margin: 2rem auto 0;
  border-top: 1px solid #3a3a42;
  padding-top: 1.1rem;
  font-size: 0.78rem;
  color: #8b867a;
}

@media (max-width: 640px) {
  .footer-cols { grid-template-columns: 1fr; gap: 1.5rem; }
  .catalog-list { columns: 1; }
  .site-header { flex-direction: column; align-items: flex-start; }
}
