/* ═══════════════════════════════════════════════════════════════
   seo.css — RoadRot server-rendered pages (province, city, guides)

   Design language: "the road itself."
   - Maple red (#d80621) — brand + actions, matches the map app
   - Asphalt (#17171b)   — dark bands, display text
   - Paint yellow        — the centre-line motif: dashed stripes on
                           the H1, the stat band, and the footer rule
   - Barlow Condensed    — display face (highway-signage lineage)
   - Geist / Geist Mono  — body + data, matches the map app

   Theme via [data-theme="dark"] on <html>.
   ═══════════════════════════════════════════════════════════════ */

:root {
  --bg:           #f4f4f5;
  --bg-alt:       #ececee;
  --bg-card:      #ffffff;
  --text:         #1a1a1e;
  --text-muted:   #6b6b76;
  --border:       #dcdce0;
  --link:         #b30015;
  --link-hover:   #d80621;
  --accent:       #d80621;
  --accent-ink:   #ffffff;
  --asphalt:      #17171b;
  --asphalt-2:    #232329;
  --paint:        #f5b90a;
  --on-asphalt:   #f0f0f2;
  --on-asphalt-2: #9b9ba6;
  --ok:           #0f7b5f;
  --warn:         #b8860b;
  --shadow:       0 1px 3px rgba(20, 20, 24, 0.08);
  --radius:       8px;
  --radius-lg:    12px;
  --font:         'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --display:      'Barlow Condensed', 'Arial Narrow', var(--font);
  --mono:         'Geist Mono', ui-monospace, 'SF Mono', Menlo, monospace;
}

[data-theme="dark"] {
  --bg:           #131316;
  --bg-alt:       #1a1a1e;
  --bg-card:      #1c1c21;
  --text:         #f0f0f2;
  --text-muted:   #9b9ba6;
  --border:       #2e2e33;
  --link:         #ff5c6e;
  --link-hover:   #ff8492;
  --accent:       #e81730;
  --asphalt:      #1c1c21;
  --asphalt-2:    #26262c;
  --ok:           #2fb28d;
  --warn:         #d9a92c;
  --shadow:       0 1px 3px rgba(0, 0, 0, 0.4);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px; line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); text-decoration: underline; }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px;
}

h1, h2, h3 { margin: 0 0 0.5em; line-height: 1.15; }

h1 {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(2.1rem, 5.5vw, 3.1rem);
  text-transform: uppercase;
  letter-spacing: 0.015em;
}

h2 {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.4rem, 3vw, 1.75rem);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin-top: 2em;
}

h3 { font-size: 1.15rem; font-weight: 600; }

p { margin: 0 0 1em; }

strong { font-weight: 600; }

/* ── Container ──────────────────────────────── */

.seo-container {
  max-width: 880px;
  margin: 0 auto;
  padding: 0 1.5rem 4rem;
}

/* ── Header ─────────────────────────────────── */

.seo-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 0; border-bottom: 1px solid var(--border); margin-bottom: 1.5rem;
}
.seo-logo {
  display: flex; align-items: center; gap: 0.55rem;
  font-family: var(--display);
  font-weight: 700; font-size: 1.45rem; letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--text);
}
.seo-logo:hover { text-decoration: none; color: var(--text); }
.seo-logo-icon {
  width: 32px; height: 32px;
  background: var(--accent); border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.seo-logo-icon svg { width: 20px; height: 20px; }

.seo-header-right { display: flex; align-items: center; gap: 1rem; }
.seo-nav { display: flex; gap: 1.25rem; }
.seo-nav a { color: var(--text-muted); font-size: 0.95rem; font-weight: 500; }
.seo-nav a:hover { color: var(--text); text-decoration: none; }

.seo-hamburger, .seo-theme-btn {
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); padding: 0.5rem;
  display: flex; align-items: center;
}
.seo-hamburger:hover, .seo-theme-btn:hover { color: var(--text); }
.seo-theme-btn svg { width: 22px; height: 22px; fill: currentColor; }
.icon-moon { display: none; }
[data-theme="dark"] .icon-sun  { display: none; }
[data-theme="dark"] .icon-moon { display: block; }

@media (max-width: 640px) {
  .seo-nav { display: none; }
}
@media (min-width: 641px) {
  .seo-hamburger { display: none; }
}

/* ── Breadcrumbs ────────────────────────────── */

.breadcrumbs {
  font-family: var(--mono);
  font-size: 0.8rem; color: var(--text-muted);
  margin: 0 0 1.75rem;
  text-transform: uppercase; letter-spacing: 0.04em;
}
.breadcrumbs a { color: var(--text-muted); }
.breadcrumbs a:hover { color: var(--text); }
.breadcrumbs-sep { margin: 0 0.5em; opacity: 0.5; }
.breadcrumbs [aria-current="page"] { color: var(--text); }

/* ── Page title — signature centre-line stripe ── */

.seo-page-title { margin-bottom: 2.25rem; }
.seo-page-title h1 { margin-bottom: 0.35rem; }
.seo-page-title h1::after {
  content: "";
  display: block;
  width: 96px; height: 0;
  margin-top: 0.45rem;
  border-top: 4px dashed var(--paint);
}
.seo-page-title .subtitle {
  color: var(--text-muted); font-size: 1rem; margin: 0.6rem 0 0;
}

/* ── Stats band — asphalt cross-section ─────── */

.stats-grid {
  position: relative;
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 0;
  margin: 2rem 0;
  background: var(--asphalt);
  border-radius: var(--radius-lg);
  padding: 1.4rem 1rem 1.25rem;
  overflow: hidden;
}
.stats-grid::before {
  /* the centre line runs behind the numbers */
  content: "";
  position: absolute; left: 1.25rem; right: 1.25rem; top: 50%;
  border-top: 3px dashed var(--paint);
  opacity: 0.28;
  pointer-events: none;
}
.stat {
  position: relative;
  background: none; border: none; box-shadow: none;
  padding: 0.4rem 0.5rem; text-align: center;
}
.stat + .stat { border-left: 1px solid rgba(255,255,255,0.08); }
.stat-num {
  font-family: var(--mono);
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 700; color: var(--paint); line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.stat-label {
  font-family: var(--mono);
  font-size: 0.72rem; color: var(--on-asphalt-2);
  margin-top: 0.45rem; text-transform: uppercase; letter-spacing: 0.08em;
}
@media (max-width: 640px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); row-gap: 1.25rem; }
  .stats-grid::before { display: none; }
  .stat + .stat { border-left: none; }
  .stat:nth-child(even) { border-left: 1px solid rgba(255,255,255,0.08); }
}

/* ── Empty state ────────────────────────────── */

.empty-state {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 2.25rem 2rem; text-align: center;
  margin: 2rem 0; box-shadow: var(--shadow);
}
.empty-state h2 { margin-top: 0; font-size: 1.4rem; }

/* ── CTA button ─────────────────────────────── */

.cta-button {
  display: inline-block; background: var(--accent); color: var(--accent-ink) !important;
  padding: 0.8rem 1.6rem; border-radius: var(--radius);
  font-weight: 600; font-size: 1rem; margin-top: 0.5rem;
  transition: filter 0.15s, transform 0.1s;
}
.cta-button:hover {
  filter: brightness(1.12); text-decoration: none;
}
.cta-button:active { transform: translateY(1px); }

/* ── Reports list ───────────────────────────── */

.reports-section { margin: 3rem 0 2rem; }
.reports-list   { list-style: none; padding: 0; margin: 0; }
.report-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 1rem 0; border-bottom: 1px solid var(--border);
  flex-wrap: wrap; gap: 0.75rem;
}
.report-meta { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.report-city { font-weight: 500; }
.report-time { color: var(--text-muted); font-size: 0.9rem; font-family: var(--mono); }
.report-actions { display: flex; align-items: center; gap: 1rem; font-size: 0.9rem; }
.report-count   { color: var(--text-muted); font-family: var(--mono); font-size: 0.82rem; }
.report-fixed   { color: var(--ok); font-weight: 600; }
.reports-more   { margin-top: 1rem; color: var(--text-muted); font-size: 0.95rem; }

.severity-badge {
  display: inline-block; color: #fff; font-size: 0.72rem; font-weight: 700;
  font-family: var(--mono);
  padding: 0.22rem 0.6rem; border-radius: 4px;
  text-transform: uppercase; letter-spacing: 0.06em;
}

/* ── Bottom CTA ─────────────────────────────── */

.bottom-cta {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 2.25rem 2rem; text-align: center;
  margin: 3rem 0 2rem; box-shadow: var(--shadow);
}
.bottom-cta h2 { margin-top: 0; }

/* ── Content sections ───────────────────────── */

.content-section { margin: 2.25rem 0; }
.content-section p { margin-bottom: 1em; }
.content-section ul, .content-section ol { padding-left: 1.4rem; margin: 0 0 1em; }
.content-section li { margin-bottom: 0.4em; }

/* ── Province city list ─────────────────────── */

.city-list {
  list-style: none; padding: 0; margin: 2rem 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0.75rem;
}
.city-list a {
  display: flex; justify-content: space-between; align-items: baseline; gap: 0.5rem;
  padding: 0.8rem 1rem; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text); transition: border-color 0.15s, box-shadow 0.15s;
}
.city-list a:hover {
  border-color: var(--accent); box-shadow: var(--shadow);
  text-decoration: none;
}
.city-name { font-weight: 500; }
.city-pop  { color: var(--text-muted); font-size: 0.8rem; font-family: var(--mono); }

.empty-note { color: var(--text-muted); font-style: italic; }

/* ── Guides ─────────────────────────────────── */

.guide-list {
  list-style: none; padding: 0; margin: 2rem 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0.85rem;
}
.guide-list a {
  display: flex; flex-direction: column; gap: 0.3rem;
  padding: 1.1rem 1.2rem; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text); transition: border-color 0.15s, box-shadow 0.15s;
}
.guide-list a:hover { border-color: var(--accent); box-shadow: var(--shadow); text-decoration: none; }
.guide-list .guide-title { font-weight: 600; font-size: 1.02rem; }
.guide-list .guide-desc  { color: var(--text-muted); font-size: 0.88rem; line-height: 1.45; }

.guide-body { max-width: 720px; }
.guide-body h2 { margin-top: 2.2em; }
.guide-body table {
  width: 100%; border-collapse: collapse; margin: 1.25rem 0;
  font-size: 0.92rem;
}
.guide-body th, .guide-body td {
  text-align: left; padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--border); vertical-align: top;
}
.guide-body th {
  font-family: var(--mono); font-size: 0.72rem;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-muted);
}
.guide-updated {
  font-family: var(--mono); font-size: 0.78rem; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.05em;
}

.callout {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--paint);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
}
.callout.callout-deadline { border-left-color: var(--accent); }
.callout p:last-child { margin-bottom: 0; }
.callout-label {
  display: block;
  font-family: var(--mono); font-size: 0.72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-muted); margin-bottom: 0.35rem;
}

.steps { counter-reset: step; list-style: none; padding: 0; margin: 1.5rem 0; }
.steps li {
  counter-increment: step;
  position: relative;
  padding: 0 0 1.4rem 3rem;
}
.steps li::before {
  content: counter(step);
  position: absolute; left: 0; top: 0;
  width: 2rem; height: 2rem;
  background: var(--asphalt); color: var(--paint);
  font-family: var(--mono); font-weight: 700; font-size: 0.95rem;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.steps li:not(:last-child)::after {
  content: "";
  position: absolute; left: calc(1rem - 1px); top: 2.3rem; bottom: 0.3rem;
  border-left: 2px dashed var(--border);
}
.steps li strong:first-child { display: block; margin-bottom: 0.2rem; }

/* ── FAQ ────────────────────────────────────── */

.faq-section { margin: 3rem 0 2rem; }
.faq-section h2 { margin-bottom: 1.5rem; }

.faq-item {
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--border);
}
.faq-item:last-child { border-bottom: none; }

.faq-q {
  font-family: var(--font);
  font-size: 1.05rem;
  margin: 0 0 0.5rem;
  font-weight: 600;
  color: var(--text);
  text-transform: none;
}

.faq-a { color: var(--text); line-height: 1.65; }
.faq-a p:last-child { margin-bottom: 0; }

/* ── Related city blocks ────────────────────── */

.related-section {
  margin: 3rem 0 0;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}
.related-section h2 {
  font-family: var(--mono);
  font-size: 0.85rem;
  margin: 0 0 1rem;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.related-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.5rem;
}

.related-list a {
  display: flex;
  flex-direction: column;
  padding: 0.75rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.related-list a:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
  text-decoration: none;
}

.related-name { font-weight: 500; color: var(--text); }
.related-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-family: var(--mono);
  margin-top: 0.15rem;
}

.related-more { margin-top: 1rem; font-size: 0.95rem; }

/* ── Map CTA ────────────────────────────────── */

.map-cta { margin: 0 0 2rem; text-align: center; }
.map-cta-link {
  display: inline-block;
  padding: 0.65rem 1.3rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-weight: 500;
  font-size: 0.95rem;
  transition: border-color 0.15s, color 0.15s;
}
.map-cta-link:hover {
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}

/* ── Footer — closes on the centre line ─────── */

.seo-footer {
  margin-top: 4rem; padding-top: 2rem;
  border-top: 3px dashed var(--paint);
  text-align: center; color: var(--text-muted); font-size: 0.9rem;
}
.footer-links {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 1rem;
  margin-bottom: 1rem;
}
.footer-links a { color: var(--text-muted); }
.footer-links a:hover { color: var(--text); }

/* ── Slide-out menu (mobile) ────────────────── */

.seo-menu-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  opacity: 0; transition: opacity 0.3s; z-index: 999;
}
.seo-menu-overlay.active { opacity: 1; }
.seo-slide-menu {
  position: fixed; top: 0; right: 0; bottom: 0; width: 280px;
  background: var(--bg); border-left: 1px solid var(--border);
  transform: translateX(100%); transition: transform 0.3s; z-index: 1000;
  display: flex; flex-direction: column; padding: 1rem;
}
.seo-slide-menu.active { transform: translateX(0); }
.seo-menu-header {
  display: flex; justify-content: space-between; align-items: center;
  padding-bottom: 1rem; border-bottom: 1px solid var(--border);
}
.seo-menu-title { font-weight: 700; font-size: 1.1rem; font-family: var(--display); text-transform: uppercase; letter-spacing: 0.03em; }
.seo-menu-close {
  background: none; border: none; cursor: pointer; color: var(--text-muted); padding: 0.5rem;
}
.seo-menu-links { display: flex; flex-direction: column; padding: 1rem 0; }
.seo-menu-links a {
  padding: 0.75rem 0; color: var(--text); font-size: 1rem;
  border-bottom: 1px solid var(--border);
}
.seo-menu-links a:hover { color: var(--accent); text-decoration: none; }
.seo-menu-footer {
  margin-top: auto; padding-top: 1rem; border-top: 1px solid var(--border);
  text-align: center; font-size: 0.85rem; color: var(--text-muted);
}
.seo-menu-footer a { color: var(--text-muted); margin: 0 0.5em; }
