:root {
  --bg: #f5f2ea;
  --ink: #193442;
  --muted: #52636b;
  --panel: rgba(25, 52, 66, 0.94);
  --panel-ink: #f8f4e9;
  --line: #d9ddd4;
  --accent: #c95a36;
  --accent-dark: #9d4125;
  --warn: #b45309;
  --soft: #e4eee7;
  --sun: #edc66b;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1180px;
  margin: 0 auto;
  padding: 22px 24px;
  border-bottom: 1px solid var(--line);
}

.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 22px;
  font-weight: 700;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  font-size: 11px;
  letter-spacing: 0;
}

.layout {
  max-width: 1180px;
  margin: 0 auto 48px;
  padding: 0 24px;
}

.search-card,
.content-card,
.neighbors-card {
  margin: 24px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
}

.home-intro {
  max-width: 760px;
  padding: 58px 0 12px;
}

.section-kicker,
.panel-kicker {
  margin: 0 0 10px;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.home-intro h1,
.home-explainer h2,
.featured-content h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 500;
}

.home-intro h1 {
  max-width: 700px;
  margin: 0;
  font-size: clamp(42px, 6vw, 68px);
  line-height: 1.02;
}

.home-intro > p:last-child {
  max-width: 680px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.55;
}

.home-search {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(360px, 1.2fr);
  align-items: end;
  gap: 24px;
  border-color: #cbd5c9;
  background: #fffdf8;
  padding: 24px;
}

.home-search form { margin: 0; }

.search-card h2,
.content-card h2,
.neighbors-card h2 {
  margin: 0 0 4px;
  font-size: 19px;
}

.lead {
  max-width: 760px;
  margin: 8px 0 0;
  color: #334155;
  line-height: 1.55;
}

.breadcrumb {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 13px;
}

.breadcrumb a {
  color: var(--accent-dark);
  font-weight: 600;
  text-decoration: none;
}

.persona-entry {
  margin-top: 20px;
  border: 1px solid #d4dfd9;
  border-radius: 12px;
  padding: 18px;
  background: linear-gradient(135deg, #f2f7f5 0%, #ffffff 80%);
}

.persona-entry h3 {
  margin: 0;
  color: var(--accent-dark);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 20px;
  font-weight: 500;
}

.persona-entry p {
  margin: 6px 0 0;
  color: #334155;
  line-height: 1.45;
}

.persona-nav {
  margin-top: 14px;
}

.focus-entry-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.focus-card {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  border: 1px solid #c9d8d2;
  border-radius: 10px;
  padding: 16px;
  background: #fff;
  color: var(--ink);
  text-decoration: none;
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}

.focus-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 6px 20px rgba(25, 52, 66, 0.08);
}

.focus-card-icon {
  font-size: 28px;
  line-height: 1;
  padding: 8px;
  background: var(--soft);
  border-radius: 8px;
  flex-shrink: 0;
}

.focus-card-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.focus-card-content .section-kicker {
  margin: 0;
  font-size: 11px;
}

.focus-card-content strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
  font-weight: 600;
  color: var(--accent-dark);
}

.focus-card-content p {
  margin: 2px 0 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.focus-card-link {
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  margin-top: auto;
}

.persona-subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.subnav-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #c9d8d2;
  border-radius: 999px;
  padding: 8px 14px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.12s ease;
}

.subnav-pill:hover {
  border-color: var(--accent);
  color: var(--accent-dark);
  background: var(--soft);
}

.subnav-pill.is-active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.persona-heading {
  margin-bottom: 16px;
}

.persona-heading h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 32px;
  font-weight: 500;
  margin: 0 0 6px;
}

.ad-slot-container {
  margin: 18px 0;
  padding: 12px 14px;
  border: 1px dashed #d1dad4;
  border-radius: 8px;
  background: #fafaf7;
  text-align: center;
  min-height: 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
}

.ad-disclaimer {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
  margin-bottom: 4px;
}

.mode-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.mode-badge {
  border: 1px solid #b7d6d0;
  border-radius: 999px;
  background: var(--soft);
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 700;
  padding: 6px 10px;
}

.source-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 14px;
}

.source-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.source-card.is-unavailable {
  background: #f8fafc;
  border-style: dashed;
}

.source-card h3 {
  margin: 0;
  font-size: 14px;
}

.source-card p {
  margin: 6px 0;
  color: var(--muted);
  font-size: 13px;
}

.source-card span {
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 700;
}

.source-card.is-unavailable span {
  color: var(--muted);
}

.muted {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.entry-help {
  margin: 10px 0 0;
  border-left: 4px solid var(--accent);
  padding: 8px 10px;
  background: var(--soft);
  color: var(--accent-dark);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
}

.search-row {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.search-row input {
  flex: 1 1 auto;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 11px 12px;
  font-size: 16px;
  min-width: 0;
}

.search-row button {
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  padding: 11px 15px;
  font-size: 15px;
  cursor: pointer;
}

.search-row button:hover {
  background: var(--accent-dark);
}

.search-feedback {
  min-height: 20px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.search-results {
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}

.search-results:empty {
  border: 0;
}

.search-results button {
  width: 100%;
  text-align: left;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: #fff;
  padding: 10px 12px;
  cursor: pointer;
  font-size: 14px;
}

.search-results li:last-child button {
  border-bottom: 0;
}

.search-results button:hover {
  background: #f8fafc;
}

.result-main {
  display: block;
  font-weight: 600;
}

.result-sub {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.map-wrap {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.commune-wikipedia-card {
  margin: 24px 0 0;
  border-bottom: 1px solid var(--line);
  padding: 0 0 20px;
}

.commune-wikipedia-card h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 28px;
  font-weight: 500;
}

.commune-wikipedia-card .lead {
  max-width: 880px;
}

.wikipedia-attribution {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.wikipedia-attribution a {
  color: var(--accent-dark);
}

.home-map { border-color: #c5d1ca; box-shadow: 0 18px 45px rgba(25, 52, 66, 0.12); }

#map {
  height: min(66vh, 680px);
}

.map-fallback-message {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  text-align: center;
  font-size: 14px;
  color: var(--muted);
  background: #f8fafc;
}

.panel {
  position: absolute;
  z-index: 2;
  top: 12px;
  left: 12px;
  max-width: 360px;
  background: var(--panel);
  color: var(--panel-ink);
  padding: 10px 12px;
  border-radius: 10px;
  line-height: 1.35;
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.panel-kicker { color: var(--sun); }

.panel h2 {
  margin: 0 0 6px;
  font-size: 16px;
}

.panel p {
  margin: 4px 0;
  font-size: 13px;
}

.neighbors-card ul {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}

.neighbors-card li {
  border-bottom: 1px solid var(--line);
}

.neighbors-card li:last-child {
  border-bottom: 0;
}

.neighbors-card button {
  width: 100%;
  border: 0;
  background: #fff;
  text-align: left;
  padding: 10px 12px;
  cursor: pointer;
}

.neighbors-card h3 {
  margin: 0;
  font-size: 15px;
}

.neighbors-block ul {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  border: 0;
  overflow: visible;
  background: transparent;
}

.neighbors-block li,
.neighbors-block li:last-child {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.neighbors-block button {
  min-height: 74px;
}

.list-block + .list-block {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
}

.persona-data-blocks {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

.persona-data-block {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 12px;
}

.persona-data-block.is-empty {
  border-style: dashed;
  background: #f8fafc;
}

.persona-data-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.persona-data-head h3 {
  margin: 2px 0 0;
  font-size: 16px;
}

.persona-data-head span {
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--soft);
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 700;
  padding: 5px 8px;
}

.persona-data-type {
  margin: 0;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.persona-data-intro,
.empty-block {
  margin: 8px 0 0;
  color: #334155;
  font-size: 14px;
  line-height: 1.45;
}

.empty-block {
  color: var(--muted);
}

.persona-poi-list {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}

.persona-poi-list li {
  border-bottom: 1px solid var(--line);
}

.persona-poi-list li:last-child {
  border-bottom: 0;
}

.persona-poi-list button {
  width: 100%;
  border: 0;
  background: #fff;
  padding: 10px 12px;
  text-align: left;
  cursor: pointer;
}

.persona-poi-list button:disabled {
  cursor: default;
}

.persona-poi-list button:not(:disabled):hover {
  background: #f8fafc;
}

.bpe-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
}

.bpe-pagination button {
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 6px 8px;
  font: inherit;
  cursor: pointer;
}

.bpe-pagination button:disabled { cursor: default; opacity: .5; }

.bpe-theme-intro { margin: 0 0 10px; color: var(--muted); line-height: 1.45; }
.bpe-back-link { color: var(--accent-dark); font-size: 14px; font-weight: 700; }
.bpe-theme-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.bpe-theme-card { display: flex; align-items: flex-start; gap: 8px; min-width: 0; padding: 9px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: #fff; text-decoration: none; }
.bpe-theme-card:hover { border-color: var(--accent); background: var(--soft); }
.bpe-theme-card strong, .bpe-theme-card small { display: block; }
.bpe-theme-card strong { font-size: 13px; line-height: 1.25; }
.bpe-theme-card small { margin-top: 3px; color: var(--muted); font-size: 11px; line-height: 1.25; }
.bpe-theme-icon { font-size: 19px; line-height: 1; }
.poi-ad-slot { display: flex; align-items: center; justify-content: center; min-height: 62px; border-bottom: 1px solid var(--line); background: #f8fafc; color: var(--muted); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }

.persona-poi-main {
  display: block;
  font-weight: 700;
}

.persona-poi-sub {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.persona-kv-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
  gap: 8px 12px;
  margin: 10px 0 0;
}

.persona-kv-list dt {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.persona-kv-list dd {
  margin: 0;
  color: var(--ink);
  font-size: 13px;
}

.demography-population { display: block; font-family: Georgia, "Times New Roman", serif; font-size: 28px; font-weight: 500; }
.demography-evolution { margin: 12px 0; color: #334155; font-size: 14px; }
.demography-focus-link { color: var(--accent-dark); font-size: 14px; font-weight: 700; text-decoration: none; }
.demography-focus-link:hover { text-decoration: underline; }
.demography-profile { grid-column: 1 / -1; }
.demography-overview { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 16px 0 0; }
.demography-overview > div { border: 1px solid #e2e8f0; border-radius: 8px; padding: 10px 12px; }
.demography-overview dt { color: var(--muted); font-size: 12px; font-weight: 700; }
.demography-overview dd { margin: 4px 0 0; font-size: 17px; font-weight: 700; }
.demography-section { margin-top: 24px; }
.demography-section h4 { margin: 0 0 10px; font-size: 16px; }
.demography-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.demography-table th, .demography-table td { border-bottom: 1px solid #e2e8f0; padding: 8px; text-align: right; }
.demography-table th:first-child, .demography-table td:first-child { text-align: left; }
.age-pyramid { max-width: 720px; margin-top: 12px; }
.age-pyramid-row { display: grid; grid-template-columns: minmax(0, 1fr) 88px minmax(0, 1fr); align-items: center; min-height: 28px; gap: 8px; }
.age-pyramid-side { display: flex; min-height: 15px; align-items: center; }
.age-pyramid-side.left { justify-content: flex-end; }
.age-pyramid-bar { display: block; min-width: 1px; height: 15px; border-radius: 2px; }
.age-pyramid-bar.female { background: #c65d93; }
.age-pyramid-bar.male { background: #3b82b6; }
.age-pyramid-label { color: var(--muted); font-size: 12px; text-align: center; white-space: nowrap; }
.demography-source { margin: 20px 0 0; color: var(--muted); font-size: 12px; }

.taxonomy-filter {
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  background: #f8fafc;
}

.taxonomy-filter-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.taxonomy-filter-head strong {
  font-size: 14px;
}

.taxonomy-reset {
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #0f172a;
  border-radius: 8px;
  padding: 5px 9px;
  font-size: 12px;
  cursor: pointer;
}

.taxonomy-reset:hover {
  background: #f1f5f9;
}

.taxonomy-options {
  margin-top: 8px;
  display: grid;
  gap: 8px;
}

.taxonomy-category {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  padding: 8px;
}

.taxonomy-option,
.taxonomy-sub-option {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.taxonomy-option input,
.taxonomy-sub-option input {
  margin: 0;
}

.taxonomy-sub-list {
  margin-top: 6px;
  padding-left: 18px;
  display: grid;
  gap: 5px;
}

.neighbors-card button:hover {
  background: #f8fafc;
}

.neighbor-main {
  display: block;
  font-weight: 600;
}

.neighbor-sub {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.covo-main {
  display: block;
  font-weight: 600;
}

.covo-sub {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.culture-main {
  display: block;
  font-weight: 600;
}

.culture-sub {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

@media (max-width: 640px) {
  .hero {
    padding: 14px 10px 6px;
  }

  .hero h1 {
    font-size: 26px;
  }

  .map-wrap {
    margin: 0 8px;
  }

  .panel {
    left: 8px;
    right: 8px;
    max-width: none;
  }

  .search-card,
  .content-card,
  .neighbors-card {
    margin: 8px;
    padding: 12px;
  }

  .commune-wikipedia-card {
    margin: 16px 8px 0;
    padding-bottom: 16px;
  }

  .persona-nav,
  .source-grid {
    grid-template-columns: 1fr;
  }

  .search-row {
    flex-direction: column;
  }

  .taxonomy-filter-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .taxonomy-reset {
    align-self: flex-start;
  }

  .persona-data-head {
    flex-direction: column;
  }

  .persona-data-head span {
    align-self: flex-start;
  }

  .bpe-theme-grid { grid-template-columns: 1fr; }

  .persona-kv-list {
    grid-template-columns: 1fr;
  }
}

/* The hidden attribute must win over grid/flex declarations. */
[hidden] { display: none !important; }
.hero h1 a { color: inherit; text-decoration: none; }
.beta-label { font-weight: 700; color: var(--accent-dark); }
.site-footer { max-width: 1100px; margin: 24px auto; padding: 0 16px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.panel { position: relative; top: auto; left: auto; right: auto; max-width: none; border-radius: 0; }
#map { height: min(56vh, 560px); min-height: 280px; }
#sources-details { margin-top: 16px; }
#sources-details summary { cursor: pointer; padding: 12px 0; font-weight: 600; }
.source-card a { color: var(--accent-dark); overflow-wrap: anywhere; }
.poi-address { margin: 0; padding: 0 12px 10px; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.persona-poi-list button[aria-pressed="true"] { background: var(--soft); box-shadow: inset 4px 0 var(--accent); }
:focus-visible { outline: 3px solid #b45309; outline-offset: 3px; }
.taxonomy-option, .taxonomy-sub-option { min-height: 40px; cursor: pointer; }
.taxonomy-reset { min-height: 44px; }
.map-wrap { scroll-margin-top: 12px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* Annual property indicators: preserve readable counts on narrow screens. */
.property-table-wrap { overflow-x:auto; margin:1rem 0; border:1px solid #dce2df; border-radius:10px; }
.property-table { width:100%; min-width:450px; border-collapse:collapse; font-size:.9rem; }
.property-table caption { text-align:left; padding:12px; font-size:1.05rem; font-weight:700; }
.property-table th, .property-table td { padding:12px; text-align:left; border-top:1px solid #e5e9e7; }
.property-table thead th { background:#f1f5f2; }
.property-table td strong, .property-table td span { display:block; white-space:nowrap; }
.property-table td span { margin-top:4px; font-size:.8rem; color:#52645b; }
.property-table tbody tr:first-child { background:#f7faf8; }
.property-missing, .property-note { color:#52645b; font-size:.82rem; line-height:1.5; }

/* Additive weather layer: compact station availability on the map, charts on the property detail page. */
.weather-block { margin-top:16px; padding-top:14px; border-top:1px dashed var(--line); }
.weather-head { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; }
.weather-head h3 { margin:0; font-size:15px; }
.weather-filters { display:flex; flex-wrap:wrap; gap:8px; }
.weather-filters label { display:flex; align-items:center; gap:6px; min-height:32px; padding:4px 8px; border:1px solid #bfdbfe; border-radius:999px; background:#eff6ff; color:#1e3a8a; font-size:12px; font-weight:700; cursor:pointer; }
.weather-filters input { margin:0; }
.weather-filters label:has(input:disabled) { color:var(--muted); border-color:var(--line); background:#f8fafc; cursor:default; }
.weather-help { margin:8px 0 0; color:var(--muted); font-size:13px; line-height:1.45; }
.weather-marker { width:18px; height:18px; padding:0; border:3px solid #fff; border-radius:50% 50% 50% 0; background:#2563eb; box-shadow:0 1px 5px rgba(15,23,42,.38); cursor:pointer; transform:rotate(-45deg); }
.weather-marker:focus-visible { outline:3px solid #f59e0b; outline-offset:3px; }
.weather-popup { min-width:290px; color:var(--ink); }
.weather-popup h3 { margin:0; font-size:16px; }
.weather-popup p { margin:5px 0; color:var(--muted); font-size:12px; line-height:1.35; }
.weather-chart-baseline { stroke:#94a3b8; stroke-width:1; }
.weather-detail-content { display:grid; gap:14px; margin-top:16px; }
.weather-detail-band { overflow-x:auto; padding:14px; border:1px solid #dce2df; border-radius:8px; background:#fff; }
.weather-detail-band h4 { margin:0 0 8px; font-size:14px; }
.weather-detail-band svg { display:block; width:100%; min-width:620px; height:auto; }
.weather-year-line { stroke:#d0ded3; stroke-width:1; }
.weather-year-text { fill:#52645b; font-size:10px; font-weight:700; }
@media (max-width:640px) { .weather-head { flex-direction:column; } .weather-filters { width:100%; } }

/* Home editorial sections keep the map as the primary interaction. */
#home-card.content-card {
  border: 0;
  background: transparent;
  padding: 24px 0 0;
}

.home-explainer {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  column-gap: 48px;
  row-gap: 14px;
  padding: 50px 0 58px;
  border-top: 1px solid var(--line);
}

.home-explainer .section-kicker,
.home-explainer h2 {
  grid-column: 1;
}

.home-explainer h2 {
  margin: 0;
  font-size: 34px;
  line-height: 1.15;
}

.home-explainer > p:not(.section-kicker) {
  grid-column: 2;
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.65;
}

.home-explainer .home-note {
  align-self: end;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
}

.featured-commune {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  min-height: 500px;
  background: #193442;
  color: #f9f4e8;
}

.featured-image {
  position: relative;
  min-height: 360px;
  margin: 0;
  overflow: hidden;
}

.featured-image::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(90deg, transparent 48%, rgba(25, 52, 66, 0.45));
  pointer-events: none;
}

.featured-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.featured-image figcaption {
  position: absolute;
  z-index: 1;
  bottom: 12px;
  left: 14px;
  margin: 0;
  font-size: 11px;
}

.featured-image figcaption a { color: #fff; }

.featured-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: 48px;
}

.featured-content .section-kicker { color: var(--sun); }

.featured-content h2 {
  margin: 0 0 18px;
  color: #fff;
  font-size: 48px;
  line-height: 1;
}

.featured-content p:not(.section-kicker) {
  margin: 0 0 14px;
  color: #e3e9df;
  line-height: 1.58;
}

.primary-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  border-bottom: 2px solid var(--sun);
  padding: 8px 0;
  color: #fff;
  font-weight: 700;
  text-decoration: none;
}

.primary-link:hover { color: var(--sun); }

.territory-discovery,
.city-discovery { padding-top: 58px; }

.territory-section-head h2,
.city-discovery h2,
.territory-list h2 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: 34px; font-weight: 500; }
.region-links { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 22px; }
.region-link { display: flex; min-height: 132px; flex-direction: column; justify-content: end; padding: 18px; background-image: linear-gradient(0deg, rgba(25,52,66,.9), rgba(25,52,66,.06)), var(--region-image); background-position: center; background-size: cover; color: #fff; text-decoration: none; }
.region-link span { font-family: Georgia, "Times New Roman", serif; font-size: 22px; }
.region-link small { margin-top: 4px; color: #f4dfaa; }
.city-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.city-links a { border: 1px solid #d8c7a7; background: #fffdf8; color: var(--accent-dark); font-weight: 700; padding: 8px 10px; text-decoration: none; }
.city-links a:hover { border-color: var(--accent); background: #f8ead0; text-decoration: underline; }
.department-links a { color: var(--accent-dark); font-weight: 700; text-decoration: none; }
.department-links a:hover { text-decoration: underline; }
.city-discovery { padding-bottom: 28px; }

.commune-indicators-section { margin: 24px 0; }
.commune-indicators-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: stretch; }
.indicator-card { border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 20px 22px; display: flex; flex-direction: column; }
.indicator-card-head { border-bottom: 1px solid #edf1ea; padding-bottom: 12px; margin-bottom: 16px; }
.indicator-card-head h3 { margin: 0 0 4px; font-family: Georgia, "Times New Roman", serif; font-size: 22px; font-weight: 500; color: var(--ink); }
.indicator-card-subtitle { margin: 0; color: var(--muted); font-size: 13px; }
.indicator-card-body { flex: 1; display: flex; flex-direction: column; gap: 14px; }
.weather-indicator-item, .immo-subgroup { background: #faf8f3; border: 1px solid #ece6d8; border-radius: 6px; padding: 12px 14px; }
.weather-indicator-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; gap: 8px; }
.weather-indicator-head strong { font-size: 14px; color: var(--ink); }
.weather-indicator-head small { font-size: 12px; color: var(--muted); font-weight: 500; }
.weather-fixed-chart svg { width: 100%; height: auto; display: block; }
.weather-ref-line { stroke: #d0ded3; stroke-dasharray: 2 2; stroke-width: 1; }
.weather-ref-text { font-size: 8px; fill: #6b7280; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
.weather-month-text { font-size: 8px; fill: #4a5568; text-anchor: middle; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
.weather-fixed-caption { margin: 6px 0 0; font-size: 11px; color: var(--muted); }
.immo-subgroup h4 { margin: 0 0 8px; font-size: 14px; font-weight: 700; color: var(--ink); }
.immo-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.immo-table th, .immo-table td { padding: 5px 6px; text-align: left; border-bottom: 1px solid #eee8db; }
.immo-table tr:last-child th, .immo-table tr:last-child td { border-bottom: 0; }
.immo-table .immo-bracket { color: var(--ink); font-weight: 500; }
.immo-table .immo-price { text-align: right; font-weight: 700; color: var(--accent-dark); white-space: nowrap; }
.immo-table .immo-sales { text-align: right; color: var(--muted); font-size: 11px; white-space: nowrap; }
.immo-table tr.is-total { background: #f2ede1; font-weight: 700; }
.immo-table tr.is-total td { font-weight: 700; color: var(--ink); }

.territory-template { padding: 56px 0 24px; }
.territory-heading { max-width: 780px; }
.territory-heading h1 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: 52px; font-weight: 500; }
.territory-lead { margin: 18px 0 0; color: var(--muted); font-size: 18px; line-height: 1.6; }
.territory-visuals { display: grid; grid-template-columns: 1.35fr .65fr; gap: 10px; height: 280px; margin: 32px 0; }
.territory-visuals img { width: 100%; height: 100%; object-fit: cover; }
.territory-lists { display: grid; grid-template-columns: 1fr; padding: 48px 0; }
.territory-departments-section { padding: 52px 0 20px; }
.department-links { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 22px; }
.department-link { display: flex; min-height: 136px; flex-direction: column; justify-content: end; padding: 16px; background-image: linear-gradient(0deg, rgba(25,52,66,.9), rgba(25,52,66,.08)), var(--department-image); background-position: center; background-size: cover; color: #fff !important; }
.department-link:hover { color: #fff !important; text-decoration: none !important; }
.department-link span { font-family: Georgia, "Times New Roman", serif; font-size: 20px; }
.department-link small { margin-top: 5px; color: #f4dfaa; font-weight: 700; }
body.is-territory .layout { display: flex; flex-direction: column; }
body.is-territory .map-wrap { order: 1; }
body.is-territory .home-search { order: 2; }
body.is-territory .territory-template { order: 3; }
body.is-territory .territory-departments-section { order: 4; }

@media (max-width: 760px) {
  .site-header { padding: 16px; }
  .site-brand { font-size: 19px; }
  .layout { margin-bottom: 32px; padding: 0 16px; }
  .home-intro { padding: 38px 0 8px; }
  .home-intro h1 { font-size: 44px; }
  .home-intro > p:last-child { font-size: 16px; }
  .home-search { grid-template-columns: 1fr; gap: 16px; padding: 18px; }
  .home-explainer { display: block; padding: 42px 0; }
  .home-explainer h2 { margin-bottom: 20px; font-size: 30px; }
  .home-explainer > p:not(.section-kicker) { margin-top: 14px; }
  .featured-commune { grid-template-columns: 1fr; min-height: 0; }
  .featured-image { min-height: 280px; }
  .featured-image::after { background: linear-gradient(0deg, rgba(25, 52, 66, 0.35), transparent 45%); }
  .featured-content { padding: 32px 24px 38px; }
  .featured-content h2 { font-size: 42px; }
  .region-links { grid-template-columns: 1fr 1fr; }
  .region-link { min-height: 112px; padding: 14px; }
  .region-link span { font-size: 18px; }
  .territory-template { padding-top: 36px; }
  .territory-heading h1 { font-size: 42px; }
  .territory-visuals { height: 220px; }
  .territory-lists { grid-template-columns: 1fr; gap: 34px; padding: 38px 0; }
  .territory-departments-section { padding-top: 38px; }
  .department-links { grid-template-columns: 1fr 1fr; }
  .department-link { min-height: 112px; padding: 14px; }
  .department-link span { font-size: 18px; }
  .commune-indicators-grid { grid-template-columns: 1fr; }
  .demography-overview { grid-template-columns: 1fr; }
  .age-pyramid-row { grid-template-columns: minmax(0, 1fr) 76px minmax(0, 1fr); gap: 5px; }
  .focus-entry-grid { grid-template-columns: 1fr; }
  .neighbors-block ul { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .neighbors-block button { padding: 8px; }
}
