:root {
  /* Brand palette — sampled from the SapereComune.it logo */
  --navy: #1E3A5F;          /* wordmark "SAPERE", tower, book */
  --gold: #C2A063;          /* wordmark "COMUNE", side houses */
  --accent: var(--navy);    /* primary interactive colour (links, active fills) */
  --ink: #1b2733;
  --muted: #5a6e80;         /* muted blue-grey (motto), AA on white */
  --line: #dce2e9;
  --bg-soft: #f2f5f8;

  /* Section framing tokens (issue #28) */
  --radius: 8px;            /* shared card/panel corner radius */
  --card-shadow: 0 1px 3px rgba(30, 58, 95, 0.06);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  line-height: 1.5;
  background: #fff;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: 1040px; margin: 0 auto; padding: 0 1rem; }

/* Header / footer */
.site-header {
  background: #fff;
  color: var(--ink);
  border-bottom: 2px solid var(--gold);
}
.site-header .container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 1.25rem;
  min-height: 64px;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}
.site-header .brand {
  display: inline-flex;
  align-items: center;
}
.site-header .brand img {
  height: 44px;
  width: auto;
}
.site-nav {
  /* Secondary tier: always wraps to its own full-width row beneath the search. */
  flex-basis: 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 1.25rem;
  margin-top: 0.3rem;
}
.site-nav > a,
.nav-menu > summary {
  color: var(--muted);
  font-weight: 500;
  font-size: 0.85rem;
}
.site-nav > a:hover {
  color: var(--navy);
  text-decoration: none;
}

/* "Strumenti" disclosure menu */
.nav-menu {
  position: relative;
}
.nav-menu > summary {
  list-style: none;
  cursor: pointer;
  white-space: nowrap;
}
.nav-menu > summary::-webkit-details-marker { display: none; }
.nav-menu > summary::after {
  content: "";
  display: inline-block;
  margin-left: 0.35rem;
  border: 0.3rem solid transparent;
  border-top-color: currentColor;
  border-bottom: 0;
  vertical-align: middle;
}
.nav-menu > summary:hover { color: var(--navy); }
.nav-menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 0.6rem);
  min-width: 190px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 10px 28px rgba(30, 58, 95, 0.16);
  padding: 0.35rem;
  display: grid;
  gap: 0.05rem;
  z-index: 60;
}
.nav-menu-panel a {
  display: block;
  padding: 0.4rem 0.6rem;
  border-radius: 5px;
  color: var(--ink);
  font-weight: 500;
  font-size: 0.9rem;
  white-space: nowrap;
}
.nav-menu-panel a:hover {
  background: var(--bg-soft);
  color: var(--navy);
  text-decoration: none;
}

@media (max-width: 560px) {
  .site-search { flex-basis: 100%; max-width: none; margin-left: 0; margin-top: 0.5rem; }
  .nav-menu-panel { right: auto; left: 0; }
}
.site-footer {
  margin-top: 3rem;
  border-top: 1px solid var(--line);
  background: var(--bg-soft);
  color: var(--muted);
  font-size: 0.85rem;
}
.site-footer .container { padding-top: 1rem; padding-bottom: 1rem; }
.site-footer p { margin: 0.3rem 0; }
.site-footer .footer-tagline { color: var(--ink); }
.site-footer .footer-sources { font-size: 0.8rem; }

main.container { padding-top: 1.5rem; padding-bottom: 2rem; }

/* Typography */
h1 { font-size: 1.7rem; margin: 0.2rem 0 0.6rem; }
h1::after {
  content: "";
  display: block;
  width: 2.5rem;
  height: 3px;
  margin-top: 0.4rem;
  background: var(--gold);
  border-radius: 2px;
}
h2 {
  font-size: 1.2rem;
  margin: 1.6rem 0 0.6rem;
  padding-bottom: 0.3rem;
  border-bottom: 2px solid var(--line);
  background: linear-gradient(var(--gold), var(--gold)) left bottom / 2.5rem 2px no-repeat;
}
.lead { color: var(--muted); margin-top: 0; }
.muted { color: var(--muted); font-size: 0.88rem; }

/* Consistent section/card framing (issue #28) — shared soft shadow so the
   bordered cards used across comune/province/region/statistics pages read as
   one family rather than a set of one-off styles. */
.stat-card,
.school,
.school-kind,
.index-chart-grid section,
.map-list li,
.it-map-frame,
.context-locator,
.comune-stemma-panel {
  box-shadow: var(--card-shadow);
}

/* Breadcrumb */
.breadcrumb { font-size: 0.85rem; color: var(--muted); margin-bottom: 0.8rem; }
.breadcrumb a { color: var(--muted); }

/* Lists */
.grid {
  list-style: none; padding: 0; margin: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0.5rem;
}
.grid li {
  border: 1px solid var(--line); border-radius: var(--radius); padding: 0.5rem 0.7rem;
}
.grid li a { font-weight: 600; }
.grid li .muted { display: block; }

.cols {
  list-style: none; padding: 0; margin: 0;
  columns: 4; column-gap: 1.2rem; font-size: 0.92rem;
}
.cols li { break-inside: avoid; padding: 0.1rem 0; }

@media (max-width: 720px) {
  .cols { columns: 2; }
}

/* Comune header */
.comune-head { display: flex; align-items: center; gap: 1rem; margin-bottom: 0.5rem; }
.comune-head h1 { margin: 0; }
.stemma { width: 64px; height: 80px; object-fit: contain; }

.fuel-brand-logo { width: 20px; height: 20px; object-fit: contain; vertical-align: -5px; }

/* Inline icons (monochrome, inherit text colour) */
.icn { width: 1.15em; height: 1.15em; flex-shrink: 0; vertical-align: -0.18em; }
.icn-danger { color: #c0392b; }
h2 .icn, h2 span { vertical-align: middle; }
h2 .icn { margin-right: 0.4rem; }

/* Tables */
.infobox, .data { border-collapse: collapse; width: 100%; margin: 0.6rem 0; font-size: 0.93rem; }
.infobox th, .infobox td, .data th, .data td {
  border: 1px solid var(--line); padding: 0.4rem 0.6rem; text-align: left; vertical-align: top;
}
.infobox th { background: var(--bg-soft); width: 220px; }
.data th { background: var(--bg-soft); }
.data tr:nth-child(even) td { background: #fbfcfd; }
.inline-list {
  margin: 0;
  padding-left: 1.1rem;
}
.inline-list li {
  margin: 0.08rem 0;
}

/* Population pyramids */
.pyramid svg { display: block; width: 100%; height: auto; }

/* Demographic index trends */
.index-chart-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 0.8rem;
  margin: 0.8rem 0 1.4rem;
}
.index-chart-grid section {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.65rem 0.75rem;
}
.index-chart-grid h3 { margin: 0; font-size: 1rem; }
.index-chart-grid svg { display: block; width: 100%; height: auto; }

/* Sub-navigation pills */
.subnav { margin: 1rem 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.subnav a, .subnav .active {
  border: 1px solid var(--line); border-radius: 999px;
  padding: 0.3rem 0.85rem; font-size: 0.88rem;
}
.subnav .active { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }

/* Province summaries */
.province-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.6rem;
  margin: 1rem 0 1.2rem;
}
.stat-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 0.65rem 0.75rem;
}
.stat-card span,
.stat-card small {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
}
.stat-card strong {
  display: block;
  margin-top: 0.08rem;
  font-size: 1.25rem;
  line-height: 1.15;
}
.province-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  align-items: start;
}
.compact-table {
  font-size: 0.9rem;
}
.rank-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin: 0.6rem 0 1.4rem;
}
.rank-grid h3 {
  margin: 0 0 0.45rem;
  font-size: 1rem;
}
.ranking {
  list-style-position: inside;
  margin: 0;
  padding: 0;
}
.ranking li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.6rem;
  align-items: baseline;
  padding: 0.28rem 0;
  border-bottom: 1px solid var(--line);
}
.ranking a {
  overflow-wrap: anywhere;
  font-weight: 600;
}
.ranking span {
  color: var(--muted);
  white-space: nowrap;
  font-size: 0.86rem;
}

/* Administrative SVG maps */
.map-browse {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(280px, 1.1fr);
  gap: 1rem;
  align-items: start;
  margin: 1rem 0 1.5rem;
}
.it-map-frame {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfd;
  padding: 0.75rem;
}
.it-svg-map {
  display: block;
  width: 100%;
  height: auto;
  max-height: 620px;
}
.it-svg-map path {
  fill: #e8f2ed;
  stroke: var(--navy);
  stroke-width: 0.45;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  transition: fill 0.12s ease-out, stroke 0.12s ease-out;
}
.it-svg-map-comuni path {
  stroke-width: 0.25;
}
.it-svg-map-comuni a.pop-bin-0 path { fill: #edf7ef; }
.it-svg-map-comuni a.pop-bin-1 path { fill: #d8eddc; }
.it-svg-map-comuni a.pop-bin-2 path { fill: #bfe1c8; }
.it-svg-map-comuni a.pop-bin-3 path { fill: #93c9a4; }
.it-svg-map-comuni a.pop-bin-4 path { fill: #58a97b; }
.it-svg-map-comuni a.pop-bin-5 path { fill: #2f8d63; }
.it-svg-map-comuni a.pop-bin-6 path { fill: #1f764f; }
.it-svg-map-comuni a.pop-bin-7 path { fill: #155e3d; }
.it-svg-map-comuni a.pop-bin-8 path { fill: #0f472e; }
.it-svg-map-comuni a.pop-bin-9 path { fill: #0a2f20; }
.it-svg-map a {
  cursor: pointer;
  outline: none;
}
.it-svg-map a:hover path,
.it-svg-map a:focus path,
.it-svg-map a.is-active path {
  fill: #f7c96b;
  stroke: #9f5f10;
}
.it-svg-map-comuni a:hover path,
.it-svg-map-comuni a:focus path,
.it-svg-map-comuni a.is-active path {
  fill: #f7c96b;
  stroke: #9f5f10;
}
.map-tooltip {
  position: fixed;
  z-index: 50;
  pointer-events: none;
  max-width: 240px;
  padding: 0.45rem 0.55rem;
  border-radius: 4px;
  background: #1b1f23;
  color: #fff;
  box-shadow: 0 8px 24px rgba(27, 31, 35, 0.22);
  font-size: 0.86rem;
  line-height: 1.25;
}
.map-tooltip strong {
  display: block;
  font-size: 0.9rem;
  font-weight: 700;
}
.map-tooltip span {
  display: block;
  color: #d7dde3;
}
.map-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 0.45rem;
}
.map-list li {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.5rem 0.65rem;
  background: #fff;
  transition: background 0.12s ease-out, border-color 0.12s ease-out;
}
.map-list li.is-active {
  border-color: #d08a22;
  background: #fff7df;
}
.map-list li a {
  font-weight: 600;
}
.map-list li .muted {
  display: block;
}
.territory-section {
  margin: 1rem 0 1.5rem;
}
.territory-map-frame {
  max-width: 760px;
  margin-bottom: 1rem;
}
.territory-index {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 0.25rem 0.8rem;
  font-size: 0.92rem;
}
.territory-index li {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.5rem;
  align-items: baseline;
  padding: 0.28rem 0.45rem;
  border-radius: 4px;
}
.territory-index li.is-active {
  background: #fff7df;
}
.territory-index a {
  overflow-wrap: anywhere;
  font-weight: 600;
}
.territory-index .muted {
  white-space: nowrap;
  font-size: 0.82rem;
}

/* Contextual page shell: persistent sidebar + body */
.page-shell {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  gap: 1.6rem;
  align-items: start;
}
.context-sidebar {
  position: sticky;
  top: 1rem;
  align-self: start;
  font-size: 0.9rem;
}
.page-body { min-width: 0; }

.context-locator {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfd;
  padding: 0.5rem;
  margin-bottom: 0.9rem;
}
.context-locator .it-svg-map { max-height: 320px; }

.context-nav .group-title {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0.9rem 0 0.3rem;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.context-nav .group-title .icn { width: 1em; height: 1em; }
.context-nav ul { list-style: none; margin: 0; padding: 0; }
.context-nav li { margin: 0; }
.context-nav a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.34rem 0.6rem;
  border-radius: 5px;
  color: var(--ink);
  line-height: 1.25;
}
.context-nav a .icn { color: var(--muted); }
.context-nav a:hover { background: var(--bg-soft); text-decoration: none; }
.context-nav a.active {
  background: var(--accent);
  color: #fff;
  font-weight: 600;
}
.context-nav a.active .icn { color: #fff; }

/* Comune data card: infobox beside stemma + at-a-glance cards */
.comune-card.has-aside {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 256px;
  gap: 1.2rem;
  align-items: start;
}
.comune-card .infobox { margin-top: 0; }
.comune-aside { display: flex; flex-direction: column; gap: 0.8rem; }
.comune-stemma-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfd;
  padding: 1rem;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}
.stemma-lg { width: 116px; height: auto; }

/* At-a-glance "operational" cards (pronto soccorso, cheapest fuel) */
.quick-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 0.7rem 0.8rem;
  box-shadow: var(--card-shadow);
}
.quick-emergency { border-left: 3px solid #c0392b; }
.quick-fuel { border-left: 3px solid var(--accent); }
.quick-flag { border-left: 3px solid #1565c0; }
.icn-blue { color: #1565c0; }
.quick-title {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
}
.quick-line {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  padding: 0.3rem 0;
  font-size: 0.9rem;
}
.quick-line + .quick-line { border-top: 1px solid var(--line); }
.quick-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
}
.quick-fuel .quick-line { flex-direction: row; align-items: baseline; justify-content: space-between; }
.quick-fuel .quick-val strong { font-size: 1.05rem; }
.quick-note { margin: 0.4rem 0 0; font-size: 0.82rem; }
.quick-more { display: inline-block; margin-top: 0.5rem; font-size: 0.85rem; font-weight: 600; }

/* Bandiera Blu pages */
.bb-years { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0 0 1.4rem; }
.bb-year {
  display: inline-block; padding: 0.25rem 0.6rem; border: 1px solid var(--line);
  border-radius: var(--radius); font-size: 0.9rem; font-weight: 600;
  background: #fff; color: var(--accent); text-decoration: none;
}
.bb-year:hover { background: #f0f6ff; }
.bb-year.is-current { background: #1565c0; border-color: #1565c0; color: #fff; }
.bb-regione { display: flex; align-items: center; gap: 0.4rem; margin: 1.6rem 0 0.4rem; }
.bb-provincia { margin: 0.9rem 0 0.3rem; font-size: 1rem; color: var(--muted); }
.bb-comuni { margin: 0 0 0.6rem; padding-left: 1.2rem; columns: 2; column-gap: 2rem; }
.bb-comuni li { margin: 0.15rem 0; break-inside: avoid; }
.bb-spiagge { color: var(--muted); font-size: 0.88rem; }
.bb-spiagge::before { content: " — "; }
@media (max-width: 600px) { .bb-comuni { columns: 1; } }
.bb-pin {
  width: 18px; height: 18px; border-radius: 50%;
  background: #1565c0; border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,.45);
}
.bb-map-note { margin: 0.4rem 0 1.2rem; }

/* Calendario scolastico */
.cs-years { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0 0 1.4rem; }
.cs-year {
  display: inline-block; padding: 0.25rem 0.6rem; border: 1px solid var(--line);
  border-radius: var(--radius); font-size: 0.9rem; font-weight: 600;
  background: #fff; color: var(--accent); text-decoration: none;
}
.cs-year:hover { background: #f0f6ff; }
.cs-year.is-current { background: #1565c0; border-color: #1565c0; color: #fff; }
.cs-table th[scope="row"] { text-align: left; }
.cs-nota { display: block; font-size: 0.8rem; font-weight: 400; color: var(--muted); margin-top: 0.15rem; }
.cs-sospensioni, .cs-festivita { margin: 0; padding-left: 1.1rem; }
.cs-sospensioni li, .cs-festivita li { margin: 0.1rem 0; }
.cs-sospensioni { font-size: 0.88rem; }
.quick-calendario .cs-mini { margin: 0.3rem 0 0; font-size: 0.9rem; }
.quick-calendario .cs-mini dt { font-weight: 600; color: var(--muted); }
.quick-calendario .cs-mini dd { margin: 0 0 0.35rem; }

/* Visual month-grid calendar component */
.cs-cal { margin: 0 0 1.6rem; }
.cs-cal-controls { margin: 0 0 0.4rem; }
.cs-cal-pick { font-weight: 600; }
.cs-cal-pick select { margin-left: 0.4rem; font: inherit; padding: 0.2rem 0.4rem; border: 1px solid var(--line); border-radius: var(--radius); }
.cs-cal-only { font-weight: 700; margin: 0; }
.cs-cal-summary p { margin: 0.2rem 0 0.6rem; }
.cs-cal-legend { display: flex; flex-wrap: wrap; gap: 0.3rem 1rem; margin: 0 0 1rem; font-size: 0.85rem; color: var(--muted); }
.cs-leg { display: inline-flex; align-items: center; gap: 0.35rem; }
.cs-sw { width: 0.85rem; height: 0.85rem; border-radius: 3px; display: inline-block; border: 1px solid rgba(0,0,0,.12); }
.cs-cal-months { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 1rem; }
.cs-month-name { font-weight: 700; font-size: 0.95rem; margin: 0 0 0.35rem; }
.cs-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cs-dow { text-align: center; font-size: 0.7rem; font-weight: 600; color: var(--muted); padding-bottom: 2px; }
.cs-day {
  text-align: center; font-size: 0.78rem; line-height: 1.9; border-radius: 3px;
  border: 1px solid rgba(0,0,0,.06);
}
.cs-blank { border: 0; }
/* Day-type colors (also used as legend swatches) */
.cs-lez  { background: #eef4ff; color: #1a3a5c; }
.cs-fest { background: #ffd6d6; color: #8a1f1f; font-weight: 600; }
.cs-nat  { background: #e3dbff; color: #3a2a6b; }
.cs-pas  { background: #d7f0de; color: #1d5a32; }
.cs-sosp { background: #ffe3c2; color: #8a4b12; }
.cs-we   { background: #f1f1f1; color: #aaa; }
.cs-out  { background: #fff; color: #ccc; border-color: rgba(0,0,0,.03); }
.cs-start, .cs-end { background: #1565c0; color: #fff; font-weight: 700; border-color: #1565c0; }
i.cs-sw.cs-lez, i.cs-sw.cs-fest, i.cs-sw.cs-nat, i.cs-sw.cs-pas, i.cs-sw.cs-sosp, i.cs-sw.cs-we { line-height: 0; }
@media (max-width: 520px) { .cs-cal-months { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); } }

/* Desktop: keep sidebar visually on the left even though it follows the
   content in source order (so mobile shows content first). */
.context-sidebar { order: -1; }

@media (max-width: 860px) {
  .page-shell { grid-template-columns: 1fr; }
  .context-sidebar { position: static; order: 0; }
  .context-locator { max-width: 340px; }
}
@media (max-width: 640px) {
  .comune-card.has-aside { grid-template-columns: 1fr; }
  .comune-stemma-panel { justify-content: flex-start; }
}

/* Map */
#map { height: 460px; border: 1px solid var(--line); border-radius: var(--radius); }

/* School cards on comune scuole page */
h2 .count { color: var(--muted); font-weight: 400; font-size: 0.85rem; }
.school-heading {
  display: flex; align-items: center; gap: 0.5rem;
}
.school-heading .school-kind-icon {
  width: 24px; height: 24px; flex: 0 0 auto;
}
.school-kind-section {
  margin: 1rem 0 0.35rem; color: var(--muted);
  font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0;
}
.school-kind-list {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.7rem; margin: 0.7rem 0 1.4rem;
}
.school-kind {
  border: 1px solid var(--line); border-radius: var(--radius); background: #fff;
  padding: 0.75rem 0.9rem; display: grid; align-items: center;
  grid-template-columns: 28px 1fr auto; gap: 0.7rem;
}
.school-kind-icon {
  width: 28px; height: 28px; color: var(--accent);
  fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
}
.school-kind span { overflow-wrap: anywhere; }
.school-kind strong { color: var(--muted); font-size: 0.9rem; }
.school-list {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 0.8rem; margin: 0.6rem 0 1.4rem;
}
.school {
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 0.7rem 0.9rem; background: #fff;
}
.school h3 { margin: 0 0 0.3rem; font-size: 1.0rem; line-height: 1.3; }
.school p { margin: 0.25rem 0; font-size: 0.88rem; }
.school .addr { color: var(--ink); }
.school .parent { color: var(--muted); font-size: 0.85rem; }
.school .meta { color: var(--muted); font-size: 0.82rem; }
.school .meta code { background: var(--bg-soft); padding: 1px 5px; border-radius: 3px; }
.school .contacts { font-size: 0.82rem; word-break: break-word; }
.school .contacts .sep { color: var(--line); margin: 0 4px; }

.bank-heading { margin: 1.3rem 0 0.5rem; font-size: 1.05rem; }
.bank-list {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 0.8rem; margin: 0.5rem 0 1.2rem;
}
.bank {
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 0.7rem 0.9rem; background: #fff;
}
.bank p { margin: 0.2rem 0; font-size: 0.88rem; }
.bank .addr { color: var(--ink); }
.bank .loc { color: var(--muted); font-size: 0.85rem; }
.bank .meta { color: var(--muted); font-size: 0.82rem; display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.bank .meta code { background: var(--bg-soft); padding: 1px 6px; border-radius: 3px; }
.bank .meta .tipo { text-transform: capitalize; }

@media (max-width: 720px) {
  .map-browse { grid-template-columns: 1fr; }
  .province-grid,
  .rank-grid { grid-template-columns: 1fr; }
  .territory-index { grid-template-columns: 1fr; }
}

/* Visually-hidden labels */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

/* Header search */
.site-search {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1 1 320px;
  max-width: 620px;
  margin-left: 1.75rem;
}
.site-search input[type="search"] {
  width: 100%;
  padding: 0.62rem 0.9rem 0.62rem 2.4rem;
  font-size: 1.05rem;
  color: var(--ink);
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%235a6e80' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E") no-repeat 0.8rem center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.site-search input[type="search"]:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.12);
}
.search-results {
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 10px 28px rgba(30, 58, 95, 0.16);
  padding: 0.25rem;
  z-index: 70;
  max-height: 70vh;
  overflow-y: auto;
}
.search-result {
  display: flex;
  flex-direction: column;
  padding: 0.4rem 0.6rem;
  border-radius: 5px;
  color: var(--ink);
}
.search-result:hover,
.search-result.is-active {
  background: var(--bg-soft);
  text-decoration: none;
}
.search-result-title { font-weight: 600; color: var(--navy); }
.search-result-subtitle { font-size: 0.8rem; color: var(--muted); }


/* /cerca results page */
.cerca-page {
  display: flex;
  gap: 0.5rem;
  margin: 1rem 0 1.5rem;
}
.cerca-page input[type="search"] {
  flex: 1 1 auto;
  padding: 0.5rem 0.8rem;
  font-size: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.cerca-page button {
  padding: 0.5rem 1.1rem;
  font-weight: 600;
  color: #fff;
  background: var(--navy);
  border: 0;
  border-radius: var(--radius);
  cursor: pointer;
}
.cerca-results { list-style: none; padding: 0; margin: 0; }
.cerca-results li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--line);
}
.cerca-results li .muted { display: block; }

/* Homepage entry points */
.home-stats { display: grid; gap: 1.5rem; grid-template-columns: 2fr 1fr; align-items: start; }
.home-stats .trend svg { width: 100%; height: auto; }
.ranking { margin: 0; padding-left: 1.4rem; }
.ranking li { margin: 0.2rem 0; }
.ranking li .muted { margin-left: 0.4rem; }
.entry-points {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}
.entry-points a {
  display: inline-block;
  padding: 0.45rem 0.9rem;
  font-weight: 600;
  color: var(--navy);
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.entry-points a:hover { background: #fff; border-color: var(--navy); text-decoration: none; }

/* Homepage region browser: small map thumbnail + compact inline region links,
   so the map no longer dominates the fold (the full-size variant lives on /:regione). */
.home-regioni {
  grid-template-columns: minmax(220px, 300px) 1fr;
  margin: 0.6rem 0 1.8rem;
}
.home-regioni .it-svg-map { max-height: 340px; }
.region-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 0.4rem;
}
.region-links li {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
  padding: 0.32rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  transition: background 0.12s ease-out, border-color 0.12s ease-out;
}
.region-links li.is-active { border-color: #d08a22; background: #fff7df; }
.region-links li a { font-weight: 600; }
.region-links li .muted { font-size: 0.78rem; }

@media (max-width: 760px) {
  .home-regioni { grid-template-columns: 1fr; }
  .home-regioni .it-map-frame { max-width: 360px; }
}

/* Homepage feature cards (timely content) */
.feature-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin: 0.6rem 0 1.8rem;
}
.feature-card {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-left: 4px solid var(--gold);
  border-radius: var(--radius);
  background: var(--bg-soft);
  box-shadow: var(--card-shadow);
  color: var(--ink);
}
.feature-card:hover { background: #fff; border-left-color: var(--navy); text-decoration: none; }
.feature-body { display: flex; flex-direction: column; gap: 0.35rem; min-width: 0; }
.feature-icon {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  font-size: 24px;
  line-height: 1;
}
.feature-icon-flag { background: #e3f0fb; }
.feature-icon-school { background: #fbf0db; }
.feature-icon-fuel { background: #fbe4e4; }
.feature-kicker {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.feature-card strong { color: var(--navy); font-size: 1.05rem; }

/* Homepage demographic superlatives */
.superlatives {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin: 0.6rem 0 1.8rem;
}
.superlative-card {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  color: var(--ink);
}
.superlative-card:hover { border-color: var(--navy); text-decoration: none; }
.superlative-card strong { color: var(--navy); }
.superlative-value { font-size: 1.15rem; font-weight: 700; color: var(--ink); }

/* Homepage tools & services grid */
.tool-grid {
  list-style: none; padding: 0; margin: 0.6rem 0 1.5rem;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 0.7rem;
}
.tool-grid li { display: flex; }
.tool-grid a {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  width: 100%;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--card-shadow);
  color: var(--ink);
}
.tool-grid a:hover { border-color: var(--navy); text-decoration: none; }
.tool-grid strong { color: var(--navy); }

@media (max-width: 720px) {
  .home-stats { grid-template-columns: 1fr; }
  .feature-cards,
  .superlatives { grid-template-columns: 1fr; }
}
