/* ──────────────────────────────────────────────────────────────────────────
   The Rasner Group · Shared Stylesheet
   Used by: index.html and every town report page
   ────────────────────────────────────────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;600;700&family=DM+Sans:ital,wght@0,300;0,400;0,500;1,400&display=swap');

:root {
  --ink:        #333333;
  --teal-dark:  #295c6f;
  --teal-mid:   #71a495;
  --teal-light: #e1ece8;
  --bg:         #f2f2f2;
  --white:      #ffffff;
  --muted:      #7a8a87;
  --border:     #d6e4e0;
  --green:      #2e7d5a;
  --red:        #b84040;
  --nav-h:      64px;
}

*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }

html { scroll-behavior:smooth; }

body {
  background: var(--bg);
  font-family: 'DM Sans', sans-serif;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

/* ── SITE NAV ─────────────────────────────────────────────────────────────── */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  height: var(--nav-h);
  display: flex;
  align-items: center;
  padding: 0 40px;
  gap: 32px;
}

.site-nav .brand {
  font-family: 'Playfair Display', serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  flex-shrink: 0;
}
.site-nav .brand span { color: var(--teal-dark); }

.site-nav .nav-links {
  display: flex;
  gap: 0;
  list-style: none;
  flex: 1;
}
.site-nav .nav-links a {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--muted);
  padding: 8px 16px;
  transition: color 0.2s;
}
.site-nav .nav-links a:hover,
.site-nav .nav-links a.active { color: var(--teal-dark); }

.site-nav .back-link {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color 0.2s;
  margin-right: auto;
}
.site-nav .back-link:hover { color: var(--teal-dark); }
.site-nav .back-link::before { content: '←'; font-size: 13px; }

/* ── HERO ─────────────────────────────────────────────────────────────────── */
.hero {
  background: var(--teal-dark);
  color: var(--white);
  padding: 80px 40px 72px;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    -45deg,
    transparent,
    transparent 60px,
    rgba(255,255,255,0.025) 60px,
    rgba(255,255,255,0.025) 61px
  );
}
.hero-inner { max-width: 1100px; margin: 0 auto; position: relative; }
.hero-eyebrow {
  font-size: 11px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--teal-mid);
  font-weight: 500;
  margin-bottom: 14px;
}
.hero h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(32px, 5vw, 58px);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.025em;
  margin-bottom: 18px;
}
.hero h1 em { font-style: normal; color: var(--teal-mid); }
.hero p {
  font-size: 15px;
  color: rgba(255,255,255,0.65);
  max-width: 520px;
  line-height: 1.6;
}

/* ── CONTENT WRAPPER ──────────────────────────────────────────────────────── */
.page-body { max-width: 1100px; margin: 0 auto; padding: 48px 40px 80px; }

/* ── SECTION HEADERS ──────────────────────────────────────────────────────── */
.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  border-bottom: 2px solid var(--ink);
  padding-bottom: 12px;
  margin-bottom: 28px;
}
.section-header h2 {
  font-family: 'Playfair Display', serif;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.section-header .section-meta {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
}

/* ── TOWN GRID (index page) ───────────────────────────────────────────────── */
.town-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 2px;
  background: var(--ink);
  border: 1px solid var(--ink);
  margin-bottom: 16px;
}

.town-card {
  background: var(--white);
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: background 0.18s;
  cursor: pointer;
  position: relative;
}
.town-card::after {
  content: '→';
  position: absolute;
  right: 22px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  color: var(--teal-light);
  transition: color 0.18s, right 0.18s;
}
.town-card:hover { background: var(--teal-light); }
.town-card:hover::after { color: var(--teal-dark); right: 18px; }

.town-card-region {
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
}
.town-card-name {
  font-family: 'Playfair Display', serif;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.town-card-quarter {
  font-size: 11px;
  color: var(--teal-dark);
  font-weight: 500;
}

/* ── SEARCH ───────────────────────────────────────────────────────────────── */
.search-wrap {
  margin-bottom: 28px;
  display: flex;
  gap: 0;
}
.search-wrap input {
  flex: 1;
  border: 1px solid var(--border);
  border-right: none;
  padding: 12px 18px;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  color: var(--ink);
  background: var(--white);
  outline: none;
  transition: border-color 0.2s;
}
.search-wrap input:focus { border-color: var(--teal-dark); }
.search-wrap input::placeholder { color: var(--muted); }
.search-wrap .search-icon {
  width: 48px;
  background: var(--teal-dark);
  border: 1px solid var(--teal-dark);
  display: grid;
  place-items: center;
  color: var(--white);
  font-size: 15px;
  flex-shrink: 0;
}

/* ── REPORT PAGE ──────────────────────────────────────────────────────────── */
.report-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  border-bottom: 2px solid var(--ink);
  padding-bottom: 16px;
  margin-bottom: 0;
}
.report-header .eyebrow {
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
  margin-bottom: 6px;
}
.report-header h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(26px, 4vw, 42px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.report-header h1 span { color: var(--teal-dark); }
.report-header .report-meta {
  text-align: right;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.9;
}

/* ── TABS ─────────────────────────────────────────────────────────────────── */
.section-nav {
  display: flex;
  gap: 2px;
  margin: 22px 0 0;
  flex-wrap: wrap;
}
.nav-tab {
  padding: 10px 26px;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 500;
  cursor: pointer;
  border: none;
  background: var(--teal-light);
  color: var(--muted);
  transition: all 0.2s;
  font-family: 'DM Sans', sans-serif;
}
.nav-tab:hover { background: #c8ddd8; color: var(--ink); }
.nav-tab.active { background: var(--teal-dark); color: var(--white); }

/* ── REPORT SECTIONS ──────────────────────────────────────────────────────── */
.report-section { display: none; }
.report-section.active { display: block; }

/* ── KPI STRIP ────────────────────────────────────────────────────────────── */
.kpi-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--ink);
  border: 1px solid var(--ink);
  margin: 20px 0;
}
.kpi { background: var(--white); padding: 18px 20px; }
.kpi.dark { background: var(--teal-dark); color: var(--white); }
.kpi-label {
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 7px;
  font-weight: 500;
}
.kpi.dark .kpi-label { color: rgba(255,255,255,0.55); }
.kpi-value {
  font-family: 'Playfair Display', serif;
  font-size: clamp(16px, 2.2vw, 24px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
}
.kpi-change { font-size: 11px; color: var(--green); margin-top: 5px; font-weight: 500; }
.kpi-change.down { color: var(--red); }
.kpi-change.neutral { color: var(--muted); }

/* ── CHART GRID ───────────────────────────────────────────────────────────── */
.chart-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.chart-grid.wide { grid-template-columns: 1.45fr 1fr; }

.card {
  background: var(--white);
  border: 1px solid var(--border);
  padding: 22px 24px 18px;
  position: relative;
}
.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--teal-dark);
}
.card-label {
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
  margin-bottom: 3px;
}
.card-title {
  font-family: 'Playfair Display', serif;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 16px;
  color: var(--ink);
}
.chart-wrap { position: relative; height: 210px; }
.legend-row {
  display: flex;
  gap: 18px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
}
.legend-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.chart-note { font-size: 11px; color: var(--muted); margin-top: 10px; }

/* ── REPORT FOOTER ────────────────────────────────────────────────────────── */
.report-footer {
  border-top: 1px solid var(--border);
  padding-top: 16px;
  margin-top: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--muted);
}
.footer-brand {
  font-family: 'Playfair Display', serif;
  font-size: 13px;
  color: var(--ink);
  font-weight: 600;
}

/* ── SITE FOOTER (index) ──────────────────────────────────────────────────── */
.site-footer {
  background: var(--ink);
  color: rgba(255,255,255,0.5);
  text-align: center;
  font-size: 11px;
  letter-spacing: 0.1em;
  padding: 28px 40px;
  line-height: 1.8;
}
.site-footer strong { color: rgba(255,255,255,0.85); }

/* ── RESPONSIVE ───────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .site-nav { padding: 0 20px; gap: 16px; }
  .hero { padding: 52px 24px 48px; }
  .page-body { padding: 36px 20px 60px; }
  .town-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .chart-grid, .chart-grid.wide { grid-template-columns: 1fr; }
  .kpi-strip { grid-template-columns: repeat(2, 1fr); }
  .report-header { flex-direction: column; align-items: flex-start; gap: 10px; }
  .report-header .report-meta { text-align: left; }
  .town-grid { grid-template-columns: 1fr; }
}
