/* Town and ranking pages (scripts/build_towns.py): plain, scrolling documents in the
   app's look. Separate from app.css, which locks the page to the screen for the map. */
:root {
  color-scheme: light;
  --bg: #f4f3f0;
  --surface: #fcfcfb;
  --surface-2: #f1f0ed;
  --border: #e3e2de;
  --text: #0b0b0b;
  --text-2: #52514e;
  --text-3: #7a7974;
  --accent: #2a78d6;
  --sun: #eda100;
  --possible: #b9b7b0;
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-size: 16px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; max-width: 820px; margin: 0 auto; padding: 16px 20px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; color: var(--text-2); }

main { max-width: 820px; margin: 0 auto 24px; padding: 28px 32px 32px; background: var(--surface); border-radius: 20px; box-shadow: 0 1px 2px rgb(0 0 0 / 0.06), 0 8px 28px rgb(0 0 0 / 0.07); }
.crumbs { font-size: 14px; color: var(--text-3); margin-bottom: 6px; }
h1 { font-size: 36px; line-height: 1.15; letter-spacing: -0.025em; margin: 0 0 12px; }
h2 { font-size: 21px; letter-spacing: -0.01em; margin: 34px 0 8px; }
.lede { font-size: 18px; color: var(--text-2); margin: 0 0 20px; }
.lede strong { color: var(--text); }
.cta { display: inline-block; background: var(--sun); color: #1a1405; font-weight: 600; padding: 11px 18px; border-radius: 999px; margin: 2px 0 8px; }
.cta:hover { text-decoration: none; filter: brightness(1.05); }

.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin: 22px 0 6px; }
.facts div { background: var(--surface-2); border-radius: 12px; padding: 12px 14px; }
.facts b { display: block; font-size: 22px; font-variant-numeric: tabular-nums; }
.facts span { font-size: 14px; color: var(--text-2); }

.chart { width: 100%; height: auto; margin: 6px 0 4px; font-size: 11px; }
.chart .grid line { stroke: var(--border); }
.chart text { fill: var(--text-3); }
.chart .bars rect { fill: var(--sun); }
.chart .possible { fill: none; stroke: var(--possible); stroke-width: 2; stroke-dasharray: 5 4; }

table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; margin-top: 10px; }
th, td { padding: 7px 8px; text-align: right; border-bottom: 1px solid var(--border); }
th:first-child, .rank th { text-align: left; }
thead th { font-size: 13px; font-weight: 600; color: var(--text-2); }
tbody th { font-weight: 500; }
.months { max-width: 420px; }
.rank td:first-child { text-align: left; color: var(--text-3); width: 2.5em; }
.rank th span { color: var(--text-3); font-size: 13px; font-weight: 400; }

.links { display: grid; grid-template-columns: 1fr 1fr; gap: 0 28px; }
.links ul { list-style: none; padding: 0; margin: 0; }
.links li { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px solid var(--border); }
.links li span { color: var(--text-3); font-variant-numeric: tabular-nums; }
.more { margin: 26px 0 0; }

footer { max-width: 820px; margin: 0 auto 40px; padding: 0 20px; font-size: 13px; color: var(--text-3); }

@media (max-width: 640px) {
  main { border-radius: 0; padding: 20px 16px 24px; }
  h1 { font-size: 28px; }
  .lede { font-size: 16px; }
  .links { grid-template-columns: 1fr; }
  .rank th:nth-child(5), .rank td:nth-child(5), .rank th:nth-child(6), .rank td:nth-child(6) { display: none; }
}
