/* MappaturaSpiagge.it by Coste360. Stile del portale storico (Bootstrap Italia): testata blu
   #0066cc, apertura blu notte #17324f, angoli a 4px, superfici piatte, tabelle a righe.
   Nessun JavaScript. */
/* Titillium Web (SIL OFL) servito dal Worker: nessuna richiesta a servizi esterni. */
@font-face { font-family: 'Titillium Web'; font-style: normal; font-weight: 400; font-display: swap; src: url('/fonts/titillium-web-regular.woff2') format('woff2'); }
@font-face { font-family: 'Titillium Web'; font-style: normal; font-weight: 600; font-display: swap; src: url('/fonts/titillium-web-600.woff2') format('woff2'); }
@font-face { font-family: 'Titillium Web'; font-style: normal; font-weight: 700; font-display: swap; src: url('/fonts/titillium-web-700.woff2') format('woff2'); }

:root {
  --primary: #0066cc;
  --primary-dark: #004d99;
  --ink: #17324f;
  --ink-deep: #0f2439;
  --surface: #ffffff;
  --surface-subtle: #f5f6f7;
  --border: #d9dadb;
  --text: #1a1a1a;
  --text-muted: #455a64;
  --text-soft: #5d7083;
  --error: #cc334d;
  --radius: 4px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'Titillium Web', Geneva, Tahoma, sans-serif;
  font-size: 18px;
  line-height: 1.5;
  color: var(--text);
  background: var(--surface);
}

a { color: var(--primary); text-underline-offset: 2px; }
a:hover { color: var(--primary-dark); }
:focus-visible { outline: 3px solid #ff9900; outline-offset: 2px; }

.container { width: 100%; max-width: 1184px; margin: 0 auto; padding: 0 24px; }
.muted { color: var(--text-soft); }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 30; background: var(--surface); padding: 8px 14px; }
.skip:focus { left: 16px; }

/* Testata */
.topbar { background: var(--primary); color: #fff; }
.topbar__inner { display: flex; align-items: center; gap: 24px; min-height: 88px; }
.brand { display: flex; align-items: flex-end; gap: 12px; text-decoration: none; color: #fff; }
.brand__logo { display: block; height: 60px; width: auto; }
.brand__by { padding-bottom: 12px; font-size: 0.78rem; font-weight: 600; letter-spacing: 0.04em; color: rgba(255, 255, 255, 0.85); white-space: nowrap; }
.topbar__nav { margin-left: auto; }
.topbar__nav ul, .topbar__menu ul { list-style: none; margin: 0; padding: 0; }
.topbar__nav ul { display: flex; gap: 4px; }
.topbar__nav a { display: block; padding: 10px 12px; color: #fff; font-weight: 600; font-size: 1rem; text-decoration: none; border-bottom: 3px solid transparent; }
.topbar__nav a:hover { color: #fff; text-decoration: underline; }
.topbar__nav a[aria-current] { border-bottom-color: #fff; }
.topbar__menu { display: none; margin-left: auto; position: relative; }
.topbar__menu summary { list-style: none; cursor: pointer; padding: 8px 16px; border: 1px solid #fff; border-radius: var(--radius); color: #fff; font-weight: 600; }
.topbar__menu summary::-webkit-details-marker { display: none; }
.topbar__menu nav { position: absolute; right: 0; top: calc(100% + 8px); z-index: 20; min-width: 240px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 0; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18); }
.topbar__menu a { display: block; padding: 10px 20px; color: var(--ink); font-weight: 600; text-decoration: none; }
.topbar__menu a:hover { background: var(--surface-subtle); }
@media (max-width: 940px) {
  .topbar__nav { display: none; }
  .topbar__menu { display: block; }
}

/* Apertura */
.hero { background: var(--ink); color: #fff; padding: 48px 0; }
/* Con la foto: velatura uniforme del blu notte, niente gradienti. */
.hero--photo { position: relative; background: var(--ink) var(--hero-image) center / cover no-repeat; padding: 72px 0 56px; }
.hero--photo::before { content: ""; position: absolute; inset: 0; background: rgba(23, 50, 79, 0.78); }
.hero--photo > .container { position: relative; }
.hero a { color: #fff; }
.hero__eyebrow { margin: 0 0 8px; font-weight: 600; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.08em; color: rgba(255, 255, 255, 0.8); }
.hero__title { margin: 0; max-width: 820px; font-size: clamp(2rem, 4.2vw, 3rem); line-height: 1.15; font-weight: 700; }
.hero__lead { margin: 16px 0 0; max-width: 720px; font-size: 1.15rem; color: rgba(255, 255, 255, 0.9); }

.crumbs ol { list-style: none; margin: 0 0 24px; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 8px; font-size: 0.9rem; color: rgba(255, 255, 255, 0.8); }
.crumbs li + li::before { content: "/"; margin-right: 8px; opacity: 0.6; }
.crumbs a { color: #fff; }

/* Numeri in apertura: in riga, separati da un filo. */
.kpis { display: flex; flex-wrap: wrap; gap: 20px 0; margin-top: 40px; padding-top: 24px; border-top: 1px solid rgba(255, 255, 255, 0.25); }
.kpi { display: flex; flex-direction: column; padding: 0 32px; border-left: 1px solid rgba(255, 255, 255, 0.25); }
.kpi:first-child { padding-left: 0; border-left: 0; }
.kpi__value { font-size: 2rem; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; white-space: nowrap; }
.kpi__label { font-size: 0.92rem; color: rgba(255, 255, 255, 0.85); }

/* Sezioni */
.section { padding: 56px 0 0; scroll-margin-top: 16px; }
.section--tight { padding-top: 32px; }
.section__head { margin-bottom: 24px; }
.section__title { margin: 0; font-size: 1.75rem; line-height: 1.25; font-weight: 700; color: var(--ink); }
.section__intro { margin: 8px 0 0; color: var(--text-muted); max-width: 780px; }
.section__more { margin: 24px 0 0; display: flex; flex-wrap: wrap; gap: 12px; }
.sub { margin: 0 0 8px; font-size: 1.1rem; font-weight: 600; color: var(--ink); }
.split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px 32px; }
.prose { max-width: 800px; }
.prose p { margin: 0 0 16px; }

.btn { display: inline-block; padding: 12px 24px; border-radius: var(--radius); background: var(--primary); color: #fff; font-weight: 600; font-size: 1rem; text-decoration: none; }
.btn:hover { background: var(--primary-dark); color: #fff; }
.btn--ghost { background: transparent; color: var(--primary); box-shadow: inset 0 0 0 2px var(--primary); }
.btn--ghost:hover { background: transparent; color: var(--primary-dark); box-shadow: inset 0 0 0 2px var(--primary-dark); }

/* Avviso: i dati aggiornati sono su Coste360.it */
.notice { margin: 0 0 28px; padding: 16px 20px; background: var(--surface-subtle); border-left: 4px solid var(--primary); color: var(--text-muted); }
.notice a { font-weight: 600; white-space: nowrap; }

/* Collegamenti alle pagine del portale */
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--border); border-left: 1px solid var(--border); }
.tile { display: flex; flex-direction: column; gap: 4px; padding: 20px 24px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); text-decoration: none; }
.tile:hover { background: var(--surface-subtle); }
.tile__title { font-weight: 700; color: var(--primary); font-size: 1.1rem; }
.tile:hover .tile__title { text-decoration: underline; }
.tile__text { color: var(--text-muted); font-size: 0.95rem; }

/* Schede */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 24px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 24px; display: flex; flex-direction: column; gap: 8px; }
.card__meta { margin: 0; font-size: 0.85rem; color: var(--text-soft); display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; }
.card__title { margin: 0; font-size: 1.15rem; line-height: 1.3; font-weight: 700; color: var(--ink); }
.card__title a { color: var(--primary); text-decoration: none; }
.card__title a:hover { text-decoration: underline; }
.card__text { margin: 0; color: var(--text-muted); font-size: 0.97rem; display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
/* Le caratteristiche in riga, separate da un punto: niente pastiglie. */
.card__tags { margin: 0; font-size: 0.85rem; color: var(--text-soft); }
.card__tags span + span::before { content: " · "; }
.card__link { margin: auto 0 0; padding-top: 8px; font-weight: 600; font-size: 0.95rem; }
.card__list { margin: 0; padding-left: 20px; color: var(--text-muted); font-size: 0.97rem; }
.card__list li + li { margin-top: 6px; }
.card__list .muted { display: block; font-size: 0.88rem; }

.pill { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-soft); }
.pill--alta { color: var(--primary); }

/* Tabelle */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 1rem; }
.table th { text-align: left; font-weight: 600; color: var(--ink); padding: 12px 16px 12px 0; font-size: 0.9rem; border-bottom: 2px solid var(--ink); vertical-align: bottom; }
.table td { padding: 12px 16px 12px 0; border-bottom: 1px solid var(--border); }
.table th:last-child, .table td:last-child { padding-right: 0; }
.table td:first-child { font-weight: 600; }
.table .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.table .neg { color: var(--error); font-weight: 600; }
.bar { display: block; width: 100%; min-width: 80px; height: 6px; background: #e3e7eb; }
.bar span { display: block; height: 100%; background: var(--primary); }

/* Scelta regione */
.regions { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); border-top: 1px solid var(--border); border-left: 1px solid var(--border); }
.regions li { border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.region { display: flex; flex-direction: column; padding: 14px 20px; text-decoration: none; font-weight: 700; color: var(--primary); }
.region:hover { background: var(--surface-subtle); }
.region:hover span:first-child { text-decoration: underline; }
.region .muted { font-weight: 400; font-size: 0.9rem; }

/* Piede */
.footer { margin-top: 72px; background: var(--ink); color: rgba(255, 255, 255, 0.85); padding: 48px 0; font-size: 0.97rem; }
.footer a { color: #fff; }
.footer__grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; }
.footer__name { margin: 0 0 12px; font-size: 1.25rem; font-weight: 700; color: #fff; }
.footer__name span { font-size: 0.85rem; font-weight: 600; color: rgba(255, 255, 255, 0.8); margin-left: 6px; }
.footer p { margin: 0 0 12px; max-width: 560px; }
.footer__source { font-size: 0.88rem; color: rgba(255, 255, 255, 0.7); }
.footer__title { margin: 0 0 12px; padding-bottom: 8px; font-size: 0.85rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: #fff; border-bottom: 1px solid rgba(255, 255, 255, 0.3); }
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }

@media (max-width: 900px) {
  .split { grid-template-columns: 1fr; }
  .tiles { grid-template-columns: 1fr 1fr; }
  .footer__grid { grid-template-columns: 1fr; gap: 28px; }
}

@media (max-width: 600px) {
  body { font-size: 16px; }
  .container { padding: 0 16px; }
  .topbar__inner { min-height: 72px; gap: 12px; }
  .brand__logo { height: 46px; }
  .brand__by { font-size: 0.7rem; padding-bottom: 8px; }
  .hero { padding: 32px 0; }
  .hero--photo { padding: 40px 0 32px; }
  .hero__lead { font-size: 1.02rem; }
  .kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 24px; margin-top: 28px; padding-top: 20px; }
  .kpi { padding: 0; border-left: 0; }
  .kpi__value { font-size: 1.5rem; }
  .section { padding: 40px 0 0; }
  .section__title { font-size: 1.45rem; }
  .cards { grid-template-columns: 1fr; gap: 16px; }
  .card { padding: 16px 18px; }
  .tiles { grid-template-columns: 1fr; }
  .table { font-size: 0.92rem; }
  .table th { font-size: 0.8rem; padding: 10px 10px 10px 0; }
  .table td { padding: 10px 10px 10px 0; }
  .footer { margin-top: 48px; padding: 36px 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
