/* ==========================================================================
 * Hills Desk — editorial blog direction (docs/DESIGN_EDITORIAL.md)
 * Accent choice: CLAY / terracotta (#c45c3e) — hills clay feel (not hills green).
 * Warm paper + near-black ink + serif/display H1 + magazine Pulse lead.
 * ========================================================================== */

:root {
  --paper: #f7f3ec;
  --paper-raised: #fffdf8;
  --paper-muted: #efe8dc;
  --ink: #1a1612;
  --ink-subtle: #6b635a;
  --accent: #c45c3e; /* clay / terracotta — single system accent */
  --accent-soft: rgba(196, 92, 62, 0.12);
  --pill: #ebe4d8;
  --line: #e0d6c8;
  --radius: 10px;
  --max: 750px; /* article measure locked 2026-09-17 */
  --max-wide: 960px; /* home / indexes / wide shells — do not shrink */
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-display: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Times New Roman", serif;
  --shadow: 0 1px 2px rgba(26, 22, 18, 0.04);
}

* { box-sizing: border-box; }
html { color-scheme: light; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--paper);
  color: var(--ink);
  font-size: 1.0625rem;
  line-height: 1.65;
  letter-spacing: -0.011em;
}
a { color: var(--ink); text-underline-offset: 0.12em; }
a:hover { color: var(--accent); }
a:focus-visible,
button:focus-visible,
.nav-toggle-label:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.skip {
  position: absolute;
  left: -999px;
  top: 8px;
  background: var(--ink);
  color: #fff;
  padding: 8px 12px;
  border-radius: 8px;
  z-index: 100;
}
.skip:focus { left: 12px; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 28px 20px 72px; }
.wrap.wide { max-width: var(--max-wide); }

header.site {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(247, 243, 236, 0.92);
  backdrop-filter: saturate(1.2) blur(10px);
  -webkit-backdrop-filter: saturate(1.2) blur(10px);
  border-bottom: 1px solid var(--line);
}
header.site .inner {
  max-width: var(--max-wide);
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}
.brand {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.02em;
  text-decoration: none;
  font-size: 1.15rem;
  color: var(--ink);
}
.brand:hover { color: var(--accent); }
.nav-toggle { position: absolute; opacity: 0; pointer-events: none; }
.nav-toggle-label {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: var(--pill);
}
.nav-toggle-label span,
.nav-toggle-label span::before,
.nav-toggle-label span::after {
  display: block;
  width: 16px;
  height: 2px;
  background: var(--ink);
  position: relative;
  border-radius: 1px;
}
.nav-toggle-label span::before,
.nav-toggle-label span::after {
  content: "";
  position: absolute;
  left: 0;
}
.nav-toggle-label span::before { top: -5px; }
.nav-toggle-label span::after { top: 5px; }
nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 2px;
}
nav a {
  margin-left: 4px;
  text-decoration: none;
  color: var(--ink-subtle);
  font-size: 0.9rem;
  padding: 6px 10px;
  border-radius: 6px;
}
nav a:hover,
nav a[aria-current="page"] {
  color: var(--ink);
  background: var(--pill);
}

.hero { margin-bottom: 28px; }
.hero h1 { margin-bottom: 10px; }
.pills { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }

/* Soft editorial surfaces — less SaaS lift */
.card {
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 24px;
  box-shadow: var(--shadow);
  max-width: 100%;
  min-width: 0;
}
.content-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-decoration: none;
  color: inherit;
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 18px;
  box-shadow: none;
  min-height: 100%;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.content-card:hover {
  border-color: var(--accent);
  background: #fff;
  text-decoration: none;
  transform: none;
  box-shadow: none;
}
.content-card h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  margin: 0;
  font-weight: 600;
}
.content-card p {
  margin: 0;
  color: var(--ink-subtle);
  font-size: 0.95rem;
}
.content-card .more {
  margin-top: auto;
  padding-top: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
}

h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4.2vw, 2.85rem);
  letter-spacing: -0.03em;
  line-height: 1.12;
  margin: 0 0 12px;
  font-weight: 600;
}
h2 {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 2.2vw, 1.5rem);
  margin: 0 0 12px;
  letter-spacing: -0.02em;
  font-weight: 600;
}
h3 {
  font-size: 1.05rem;
  margin: 1.5em 0 0.4em;
  letter-spacing: -0.02em;
  font-weight: 650;
}
.lede {
  color: var(--ink-subtle);
  font-size: 1.15rem;
  line-height: 1.55;
  margin: 0 0 20px;
  max-width: 65ch;
}
.section {
  margin: 36px 0 8px;
}
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.section-head a {
  font-size: 0.9rem;
  color: var(--ink-subtle);
  text-decoration: none;
}
.section-head a:hover { color: var(--accent); }
.section-note {
  margin: -4px 0 1.1em;
  font-size: 0.98rem;
  color: var(--ink-subtle);
  max-width: 42rem;
  line-height: 1.5;
}

.pill {
  display: inline-block;
  background: var(--pill);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  color: var(--ink-subtle);
  font-weight: 500;
}
.pill.accent {
  background: var(--accent-soft);
  color: var(--accent);
}
.btn {
  display: inline-block;
  background: var(--ink);
  color: #fff !important;
  text-decoration: none;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.btn:hover { background: var(--accent); opacity: 1; }
.btn.secondary {
  background: var(--pill);
  color: var(--ink) !important;
}
.btn.secondary:hover {
  background: var(--accent-soft);
  color: var(--accent) !important;
}
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0 8px; }
.meta { font-size: 13px; color: var(--ink-subtle); margin-bottom: 18px; }

/* Article meta row: date / ZIP / source — not slogan pills */
.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: center;
  margin: 0 0 16px;
  font-size: 13px;
  color: var(--ink-subtle);
}
.meta-row .meta-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.meta-row .meta-item::after {
  content: "·";
  margin-left: 14px;
  color: var(--line);
  font-weight: 400;
}
.meta-row .meta-item:last-child::after { content: none; margin: 0; }
.meta-row a { color: var(--ink-subtle); }
.meta-row a:hover { color: var(--accent); }

.prose { max-width: 750px; }
.prose p { margin: 0 0 1em; max-width: 750px; }
.prose ul, .prose ol { margin: 0 0 1.1em; padding-left: 1.2em; max-width: 750px; }
.prose li { margin: 0.25em 0; }
.prose h2 { margin: 1.7em 0 0.55em; }
.prose h3 { margin: 1.25em 0 0.35em; }
.cite {
  font-size: 0.88rem;
  color: var(--ink-subtle);
}
.note {
  background: var(--paper-muted);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  font-size: 0.95rem;
  color: var(--ink-subtle);
  margin: 0 0 1.2em;
  max-width: 65ch;
}

.stat-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr;
  margin: 0 0 1.4em;
}
.stat-box {
  background: var(--paper-muted);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 16px 14px;
}
.stat-box .num {
  font-size: 1.28rem;
  font-weight: 650;
  letter-spacing: -0.03em;
  display: block;
}
.stat-box .lbl {
  font-size: 12px;
  color: var(--ink-subtle);
  display: block;
  margin-top: 4px;
}
.stat-box .src {
  font-size: 11px;
  color: var(--ink-subtle);
  display: block;
  margin-top: 8px;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 0 1.3em;
}
.table-wrap table { min-width: 480px; }
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; margin: 0; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--ink-subtle); font-weight: 600; font-size: 0.8rem; text-transform: none; }
td em { color: var(--ink-subtle); font-style: italic; }

.grid { display: grid; gap: 14px; }
.grid.cards { grid-template-columns: 1fr; }

footer.site {
  max-width: var(--max-wide);
  margin: 0 auto;
  padding: 8px 20px 48px;
  color: var(--ink-subtle);
  font-size: 13px;
  line-height: 1.55;
}
footer.site p { margin: 0 0 8px; }
footer.site a { color: var(--ink-subtle); }
footer.site a:hover { color: var(--accent); }

/* —— Magazine lead (home) —— */
.hero-home .site-mast {
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 1.6vw, 1.2rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 0 0 18px;
}
.magazine-lead {
  display: grid;
  gap: 20px;
  margin-bottom: 4px;
  align-items: stretch;
  width: 100%;
  min-width: 0;
}
.magazine-lead .lead-story {
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 26px 24px;
  box-shadow: var(--shadow);
  color: inherit;
  display: flex;
  flex-direction: column;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  /* Natural content height — defines .magazine-lead row */
}
.magazine-lead .lead-kicker {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 10px;
}
.magazine-lead .lead-story h1 {
  font-size: clamp(1.55rem, 3vw, 2.05rem);
  margin: 0 0 12px;
  line-height: 1.15;
}
.magazine-lead .lead-title-link {
  text-decoration: none;
  color: inherit;
}
.magazine-lead .lead-title-link:hover {
  color: var(--accent);
}
.magazine-lead .lead-dek {
  color: var(--ink-subtle);
  font-size: 1.05rem;
  line-height: 1.55;
  margin: 0 0 18px;
  max-width: 58ch;
}
.lead-sparks {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 0 0 18px;
  width: 100%;
  min-width: 0;
}
.spark-card.compact {
  padding: 10px 12px;
  margin: 0;
  background: var(--paper-muted);
  border: 1px solid var(--line);
  border-radius: 8px;
  min-width: 0;
  overflow: hidden;
}
.spark-card.compact [data-spark],
.spark-card.compact svg {
  max-width: 100%;
  display: block;
}
.spark-card.compact .spark-label {
  font-size: 11px;
  margin-bottom: 4px;
}
.lead-footer {
  margin-top: auto;
  padding-top: 4px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.magazine-lead .lead-meta {
  font-size: 12px;
  color: var(--ink-subtle);
  margin: 0;
  line-height: 1.4;
}
.lead-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
}
.latest-rail {
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 20px 8px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  /*
   * Match Pulse lead height without growing the hero:
   * height:0 → rail content does not size the grid row;
   * min-height:100% → stretch to the row height set by .lead-story.
   */
  height: 0;
  min-height: 100%;
}
.latest-heading {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  margin: 0 0 4px;
  letter-spacing: -0.02em;
}
.rail-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
  /* Fill Pulse-matched card; scroll when items exceed that height */
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.rail-list li {
  border-bottom: 1px solid var(--line);
  padding: 16px 0;
}
.rail-list li:last-child {
  border-bottom: none;
}
.rail-list a {
  text-decoration: none;
  color: inherit;
  display: block;
}
.rail-list a:hover .rail-title { color: var(--accent); }
.rail-kicker {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--ink-subtle);
  margin: 0 0 6px;
}
.rail-title {
  font-family: var(--font-display);
  font-size: 1.02rem;
  font-weight: 600;
  margin: 0;
  letter-spacing: -0.02em;
  line-height: 1.3;
}
.rail-dek {
  font-size: 0.9rem;
  color: var(--ink-subtle);
  margin: 0;
}

@media (min-width: 800px) {
  .magazine-lead {
    grid-template-columns: 1.55fr 1fr;
    gap: 22px;
    align-items: stretch;
  }
  .magazine-lead .lead-story,
  .magazine-lead .latest-rail {
    grid-row: 1;
  }
  .magazine-lead .lead-story { padding: 32px 30px 26px; }
}

/* Schematic map */
.schematic-map {
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 16px 14px;
  margin: 0 0 1.4em;
  max-width: 520px;
}
.schematic-map svg {
  display: block;
  width: 100%;
  height: auto;
  max-width: 480px;
}
.schematic-map .map-caption {
  margin: 10px 0 0;
  font-size: 12px;
  color: var(--ink-subtle);
  line-height: 1.45;
}

@media (min-width: 640px) {
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .grid.two, .grid.cards { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 900px) {
  .grid.cards.three { grid-template-columns: 1fr 1fr 1fr; }
}

@media (max-width: 719px) {
  .nav-toggle-label { display: flex; }
  nav {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    padding: 4px 0 10px;
  }
  nav a {
    margin: 0;
    padding: 10px 12px;
    border-radius: 8px;
  }
  .nav-toggle:checked ~ nav { display: flex; }
  header.site .inner { flex-wrap: wrap; }
  .card { padding: 22px 18px; }

  /* Centered mobile measure — prevent right-bleed from hero grids */
  .wrap,
  .wrap.wide {
    padding-left: 16px;
    padding-right: 16px;
    max-width: 100%;
    overflow-x: clip;
  }
  header.site .inner {
    padding-left: 16px;
    padding-right: 16px;
  }
  .magazine-lead .lead-story,
  .latest-rail {
    padding-left: 18px;
    padding-right: 18px;
  }
  .lead-sparks {
    grid-template-columns: 1fr;
  }
  .lead-actions .btn {
    flex: 1 1 auto;
  }
  .section-head {
    gap: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .content-card { transition: none; }
}

/* ZIP Pulse stat chips */
.stat-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 1.5em;
}
.stat-chip {
  flex: 1 1 140px;
  min-width: 132px;
  background: var(--paper-muted);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 14px 12px;
}
.stat-chip .num {
  font-size: 1.2rem;
  font-weight: 650;
  letter-spacing: -0.03em;
  display: block;
  line-height: 1.2;
}
.stat-chip .lbl {
  font-size: 12px;
  color: var(--ink-subtle);
  display: block;
  margin-top: 4px;
}
.stat-chip .src {
  font-size: 11px;
  color: var(--ink-subtle);
  display: block;
  margin-top: 8px;
}
.trend-list {
  margin: 0;
  padding-left: 1.2em;
}
.trend-list li { margin: 0.4em 0; }
.redirect-banner {
  background: var(--paper-muted);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin: 0 0 1.2em;
}

/* Compact takeaways (Pulse UX) */
.takeaways {
  display: grid;
  gap: 12px;
  margin: 0 0 1.4em;
}
.takeaways .takeaway {
  background: var(--paper-muted);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 12px 14px;
  font-size: 0.95rem;
  max-width: 65ch;
}
.takeaways .takeaway strong {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--accent);
  margin-bottom: 4px;
}
.takeaways ul {
  margin: 0;
  padding-left: 1.15em;
}
.takeaways li { margin: 0.2em 0; }

/* Trend charts (SVG, no SaaS) */
.trend-charts {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin: 0 0 1.4em;
  width: 100%;
}
.trend-chart {
  background: var(--paper-muted);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 14px 12px;
  width: 100%;
}
.trend-chart svg {
  max-width: 100%;
  height: auto;
}
.chart-title {
  margin: 0 0 4px;
  font-size: 1rem;
  letter-spacing: -0.02em;
  font-weight: 650;
}
.chart-sub {
  margin: 0 0 10px;
  font-size: 12px;
  color: var(--ink-subtle);
}
.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin: 0 0 8px;
  font-size: 12px;
  color: var(--ink-subtle);
}
.chart-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.chart-legend-item .swatch {
  width: 14px;
  height: 3px;
  border-radius: 2px;
  background: var(--ink);
  display: inline-block;
}
.chart-caption {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--ink-subtle);
  line-height: 1.45;
}
.chart-fallback {
  margin-top: 8px;
  font-size: 12px;
  color: var(--ink-subtle);
}
.chart-fallback summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--ink-subtle);
}
.chart-fallback table {
  font-size: 11px;
  margin: 8px 0 0;
  max-height: 220px;
  display: block;
  overflow: auto;
  min-width: 0;
}
.spark-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 12px 0 0;
}
.spark-card {
  flex: 1 1 200px;
  background: var(--paper-muted);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.spark-card .spark-label {
  font-size: 12px;
  color: var(--ink-subtle);
  font-weight: 600;
}
.spark-card .spark-meta {
  font-size: 11px;
  color: var(--ink-subtle);
}
.spark-card [data-spark] {
  line-height: 0;
}

/* 375px mobile hard check */
@media (max-width: 400px) {
  body { font-size: 1rem; }
  .wrap { padding: 20px 14px 56px; }
  .stat-chip { min-width: 120px; flex: 1 1 120px; }
  h1 { font-size: 1.75rem; }
}
