/* hugo-directory — design system famiglia "atlante editoriale" (consolidato 2026-07-15).
   UNICA fonte di token: un blocco :root (light) + un blocco dark (media/data-theme).
   I temi (theme-heritage.css, theme-coastal.css) sovrascrivono SOLO variabili.
   Ogni classe storica resta valida: markup vecchio → render coerente. */

/* ---------- Font (variable, self-hosted) ---------- */
@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/fonts/fraunces-var.woff2') format('woff2');
}
@font-face {
  font-family: 'Fraunces';
  font-style: italic;
  font-weight: 100 900;
  font-display: swap;
  src: url('/fonts/fraunces-italic-var.woff2') format('woff2');
}
@font-face {
  font-family: 'Source Sans 3';
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url('/fonts/sourcesans3-var.woff2') format('woff2');
}

/* ---------- Token: light (base editoriale carta/inchiostro) ---------- */
:root {
  color-scheme: light;
  /* superfici */
  --bg: #f7f6f2; --bg-soft: #efede7; --surface: #fffefb;
  --fg: #1c2620; --muted: #64706a;
  /* accent (i temi lo sovrascrivono) */
  --accent: #2f5d62; --accent-strong: #234a4e; --accent-soft: #e4ecec;
  --border: rgba(28, 38, 32, .10); --border-2: rgba(28, 38, 32, .18);
  /* geometria */
  --radius: 10px; --radius-sm: 8px; --maxw: 1120px;
  --shadow: 0 1px 2px rgba(20, 26, 22, .05);
  --shadow-lift: 0 1px 2px rgba(20, 26, 22, .06), 0 14px 30px -16px rgba(20, 26, 22, .25);
  /* tipografia */
  --sans: 'Source Sans 3', ui-sans-serif, system-ui, sans-serif;
  --display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --w-body: 410; --w-semi: 620; --w-display: 560; --w-black: 760;
  /* hero fallback */
  --hero-grad: linear-gradient(165deg, #22423f 0%, #2f5d62 55%, #48787c 100%);
  /* tinte tipo: famiglia armonizzata (stessa saturazione contenuta, hue distinti) */
  --t-termale: #8c4a3c;  --t-termale-bg: #f3e4df;
  --t-piscina: #3c5a78;  --t-piscina-bg: #e2e9f1;
  --t-lago: #3d6b4f;     --t-lago-bg: #e1ecE4;
  --t-cascata: #5b5378;  --t-cascata-bg: #e8e5f1;
  --t-potabile: #38647e; --t-potabile-bg: #e0ebf2;
  --t-fiume: #46648c;    --t-fiume-bg: #e3e9f3;
  /* qualità acqua */
  --q-eccellente: #2f7a4d; --q-eccellente-bg: #e0efe5;
  --q-buona: #2e7a72;      --q-buona-bg: #ddefec;
  --q-sufficiente: #a06a1d; --q-sufficiente-bg: #f6ecd9;
  --q-scarsa: #a03c33;     --q-scarsa-bg: #f5e2df;
}

/* ---------- Token: dark ---------- */
:root[data-theme="dark"] { color-scheme: dark; }
:root[data-theme="dark"],
:root:not([data-theme="light"]) { --dark-ready: 1; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #11181a; --bg-soft: #172124; --surface: #1b262a;
    --fg: #e8ecea; --muted: #93a29b;
    --accent: #6fb3b8; --accent-strong: #8fc7cb; --accent-soft: #1e3538;
    --border: rgba(232, 236, 234, .09); --border-2: rgba(232, 236, 234, .18);
    --shadow: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-lift: 0 1px 2px rgba(0, 0, 0, .4), 0 14px 32px -14px rgba(0, 0, 0, .6);
    --hero-grad: linear-gradient(165deg, #101d1c 0%, #1c3a3d 55%, #27555a 100%);
    --t-termale: #d9a294;  --t-termale-bg: #3a221c;
    --t-piscina: #a3bcd6;  --t-piscina-bg: #1d2a38;
    --t-lago: #a4c9af;     --t-lago-bg: #1d2f23;
    --t-cascata: #beb3dd;  --t-cascata-bg: #292339;
    --t-potabile: #9ec4d8; --t-potabile-bg: #182b36;
    --t-fiume: #a7bcdd;    --t-fiume-bg: #1c2737;
    --q-eccellente: #8fd0a6; --q-eccellente-bg: #1a3324;
    --q-buona: #8bd0c7;      --q-buona-bg: #14312d;
    --q-sufficiente: #e2b671; --q-sufficiente-bg: #38290e;
    --q-scarsa: #e09a91;     --q-scarsa-bg: #3a1c18;
  }
}
:root[data-theme="dark"] {
  --bg: #11181a; --bg-soft: #172124; --surface: #1b262a;
  --fg: #e8ecea; --muted: #93a29b;
  --accent: #6fb3b8; --accent-strong: #8fc7cb; --accent-soft: #1e3538;
  --border: rgba(232, 236, 234, .09); --border-2: rgba(232, 236, 234, .18);
  --shadow: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-lift: 0 1px 2px rgba(0, 0, 0, .4), 0 14px 32px -14px rgba(0, 0, 0, .6);
  --hero-grad: linear-gradient(165deg, #101d1c 0%, #1c3a3d 55%, #27555a 100%);
  --t-termale: #d9a294;  --t-termale-bg: #3a221c;
  --t-piscina: #a3bcd6;  --t-piscina-bg: #1d2a38;
  --t-lago: #a4c9af;     --t-lago-bg: #1d2f23;
  --t-cascata: #beb3dd;  --t-cascata-bg: #292339;
  --t-potabile: #9ec4d8; --t-potabile-bg: #182b36;
  --t-fiume: #a7bcdd;    --t-fiume-bg: #1c2737;
  --q-eccellente: #8fd0a6; --q-eccellente-bg: #1a3324;
  --q-buona: #8bd0c7;      --q-buona-bg: #14312d;
  --q-sufficiente: #e2b671; --q-sufficiente-bg: #38290e;
  --q-scarsa: #e09a91;     --q-scarsa-bg: #3a1c18;
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: var(--sans); font-weight: var(--w-body); color: var(--fg);
  background: var(--bg); line-height: 1.62; font-size: 16.5px;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 1.25rem; }
a { color: var(--accent); }
img { max-width: 100%; height: auto; }
::selection { background: var(--accent); color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

h1, .hero h1, main > h1 { font-family: var(--display); font-weight: var(--w-black);
  font-size: clamp(2rem, 4.5vw, 3.2rem); line-height: 1.08; letter-spacing: -.02em; margin: 0 0 .6rem; }
h2 { font-family: var(--display); font-weight: var(--w-display); font-size: 1.75rem;
  letter-spacing: -.012em; line-height: 1.2; margin: 2.4rem 0 1rem; }
.hero p, main > p { color: var(--muted); font-size: 1.08rem; max-width: 70ch; margin: 0 0 1rem; }
.hero p strong, main > p strong { color: var(--fg); font-weight: var(--w-semi); }
section.tipi h2, section.regions h2, .nearby h2, .featured h2 { margin-top: 3rem; }
/* label editoriali (eyebrow) riusabili */
.eyebrow, .stats-band, .card-photo .card-sub, .card-lines .cl-meta, .in-breve-title,
.badge-tipo, .badge-baln, .sun-times {
  text-transform: uppercase; letter-spacing: .07em; font-weight: 640; }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border); padding: .95rem 0; }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.logo { font-family: var(--display); font-weight: var(--w-semi); color: var(--fg);
  text-decoration: none; font-size: 1.24rem; letter-spacing: -.005em;
  display: inline-flex; align-items: center; gap: .6rem; }
.logo-mark { width: 24px; height: 24px; border-radius: 6px; flex: none; display: block;
  object-fit: cover; box-shadow: var(--shadow); }
/* fallback quando non c'è l'icona brand: quadratino accent col simbolo del tema */
.logo-mark-fallback { width: 24px; height: 24px; border-radius: 6px; flex: none;
  background: var(--accent); }
.site-nav { display: flex; gap: .1rem; align-items: center; }
.site-nav a { text-transform: uppercase; font-size: .74rem; letter-spacing: .09em;
  font-weight: 660; color: var(--fg); text-decoration: none;
  padding: .45rem .7rem; border-radius: 6px; transition: background .15s, color .15s; }
.site-nav a:hover { background: var(--bg-soft); }
.site-nav .lang-switch { border: 1px solid var(--border-2); margin-left: .45rem; }
.theme-toggle { border: 0; background: transparent; width: 34px; height: 34px;
  color: var(--muted); margin-left: .3rem; cursor: pointer; border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center; }
.theme-toggle:hover { color: var(--fg); background: var(--bg-soft); }
.theme-toggle svg { width: 17px; height: 17px; }
.icon { width: 1em; height: 1em; vertical-align: -.12em; fill: none;
  stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Main + hero ---------- */
main { padding: 2rem 0 3rem; min-height: 60vh; }
.hero { position: relative; }
.tool-cta a, .btn-primary { background: var(--accent); border: 1px solid var(--accent); color: #fff; }
.btn, .tool-cta a { display: inline-block; padding: .6rem 1.15rem; border-radius: var(--radius-sm);
  font-weight: 640; font-size: .95rem; text-decoration: none; border: 1px solid var(--border-2);
  color: var(--fg); background: var(--surface);
  transition: transform .15s, box-shadow .2s, border-color .15s; }
.btn:hover, .tool-cta a:hover { transform: translateY(-1px); box-shadow: var(--shadow-lift); }
.btn-primary { color: #fff; }
.btn-primary:hover { border-color: var(--accent-strong); }
.btn-ghost { background: rgba(12, 18, 15, .5); border-color: rgba(255, 255, 255, .35); color: #f4f8f6; }

/* Hero 3D / mappa */
.hero3d { position: relative; height: min(62vh, 560px); min-height: 340px; margin: 0 0 1.6rem;
  border-radius: var(--radius); overflow: hidden; background: var(--hero-grad);
  box-shadow: var(--shadow-lift); }
.hero3d .hero3d-map { position: absolute; inset: 0; }
.hero3d .hero3d-overlay { position: absolute; inset: auto 0 0 0; z-index: 3; padding: 1.6rem 1.8rem 1.4rem;
  background: linear-gradient(to top, rgba(10, 16, 13, .84), rgba(10, 16, 13, .3) 62%, transparent);
  color: #f2f7f4; pointer-events: none; text-shadow: 0 1px 8px rgba(0, 0, 0, .5); }
.hero3d .hero3d-overlay > * { pointer-events: auto; }
.hero3d .hero3d-overlay h1 { color: #f4f8f6; margin: 0 0 .35rem; font-size: clamp(1.9rem, 4vw, 2.9rem); }
.hero3d .hero3d-overlay p { color: #d5e0da; margin: 0 0 .8rem; font-size: 1.02rem; max-width: 62ch; }
.hero3d .hero3d-hint { position: absolute; top: .9rem; right: 1rem; z-index: 3;
  font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; color: #e9f1ed;
  background: rgba(10, 16, 13, .55); padding: .3rem .7rem; border-radius: 999px; }
.hero3d .maplibregl-ctrl-attrib { font-size: .68rem; }
.hero-cta { display: flex; gap: .6rem; flex-wrap: wrap; margin: .9rem 0 .7rem !important; }
.hero-cta .btn-ghost, .hero-cta .btn-primary { border-radius: var(--radius-sm); }
.hero-legend { list-style: none; display: flex; gap: .55rem; padding: 0; margin: 0;
  font-size: .8rem; color: #cfdcd5; flex-wrap: wrap; }
.hero-legend .legend-btn { display: inline-flex; align-items: center; gap: .4rem;
  border: 1px solid rgba(255, 255, 255, .28); background: rgba(10, 16, 13, .45); color: #e9f1ed;
  border-radius: 999px; padding: .3rem .75rem; font: inherit; font-size: .8rem; font-weight: 620;
  cursor: pointer; transition: opacity .15s, border-color .15s, transform .15s; }
.hero-legend .legend-btn:hover { border-color: rgba(255, 255, 255, .6); transform: translateY(-1px); }
.hero-legend .legend-btn[aria-pressed="false"] { opacity: .38; text-decoration: line-through; }
.hero-legend .legend-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; border-radius: 999px; }
.hero-legend .dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%;
  margin-right: .1rem; vertical-align: 1px; }
/* dot per tipo: usano le tinte tipo (dark-mode friendly) */
.dot.d-termale, .dot.d-sorgente-termale { background: #d9a294; }
.dot.d-piscina, .dot.d-piscina-naturale { background: #a3bcd6; }
.dot.d-lago, .dot.d-lago-balneabile { background: #a4c9af; }
.dot.d-cascata { background: #beb3dd; }
.dot.d-potabile, .dot.d-sorgente-potabile { background: #9ec4d8; }
.dot.d-fiume { background: #a7bcdd; }
.stats-band { display: flex; flex-wrap: wrap; gap: .5rem 1.4rem; align-items: center;
  color: var(--muted); font-size: .74rem; margin: 0 0 1.2rem; }
.stats-band strong { color: var(--fg); font-size: 1.05rem; letter-spacing: 0; }

/* ---------- Griglie / card ---------- */
.region-grid, .entity-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .7rem;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.region-grid a, .entity-list a { display: block; padding: .75rem .95rem; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--fg);
  text-decoration: none; font-weight: 500;
  transition: border-color .15s, box-shadow .2s, transform .2s; }
.region-grid a:hover, .entity-list a:hover { border-color: var(--accent);
  box-shadow: var(--shadow-lift); transform: translateY(-2px); }
.region-grid span { color: var(--muted); font-weight: 400; font-size: .92em; }
.entity-list { content-visibility: auto; contain-intrinsic-size: auto 800px; }

.photo-grid { list-style: none; padding: 0; margin: 0; display: grid; gap: 1.4rem;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  content-visibility: auto; contain-intrinsic-size: auto 1200px; }
.featured-grid { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.card-photo { position: relative; border-radius: var(--radius); overflow: hidden;
  background: var(--surface); border: 1px solid var(--border);
  transition: transform .25s, box-shadow .25s; }
.card-photo:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.card-photo a { display: block; color: inherit; text-decoration: none; overflow: hidden; }
.card-photo .ph { aspect-ratio: 3 / 2; width: 100%; display: block; object-fit: cover;
  background: var(--lqip, var(--bg-soft)); }
.card-photo .ph-fallback { aspect-ratio: 3 / 2; display: flex; align-items: center;
  justify-content: center; color: rgba(255, 255, 255, .85);
  background: var(--lqip, var(--hero-grad)); }
.card-photo .ph-fallback svg { width: 34px; height: 34px; opacity: .9; }
.card-photo .card-body { padding: .8rem .95rem .95rem; }
.card-photo .card-title { font-family: var(--display); font-weight: var(--w-display);
  font-size: 1.12rem; line-height: 1.25; margin: 0 0 .3rem; letter-spacing: -.01em;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-photo:hover .card-title { color: var(--accent); }
.card-photo .card-sub { color: var(--muted); font-size: .7rem; margin: 0; }
.card-photo .badge-tipo { margin-top: .5rem; }

/* liste editoriali per entità senza foto */
.card-lines { list-style: none; padding: 0; margin: 1.6rem 0 0; column-width: 320px; column-gap: 2.5rem; }
.card-lines li { break-inside: avoid; }
.card-lines a { display: flex; justify-content: space-between; gap: 1rem; align-items: baseline;
  padding: .55rem .1rem; border-bottom: 1px solid var(--border); text-decoration: none; color: var(--fg); }
.card-lines a:hover .cl-title { color: var(--accent); }
.card-lines .cl-title { font-weight: 560; font-size: .96rem; }
.card-lines .cl-meta { color: var(--muted); font-size: .72rem; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; max-width: 45%; }

/* Badge tipo (tinte armonizzate) */
.badge-tipo { display: inline-block; padding: .14rem .55rem; border-radius: 4px;
  font-size: .68rem; }
.badge-tipo.t-sorgente-termale { color: var(--t-termale); background: var(--t-termale-bg); }
.badge-tipo.t-piscina-naturale { color: var(--t-piscina); background: var(--t-piscina-bg); }
.badge-tipo.t-lago-balneabile { color: var(--t-lago); background: var(--t-lago-bg); }
.badge-tipo.t-cascata { color: var(--t-cascata); background: var(--t-cascata-bg); }
.badge-tipo.t-sorgente-potabile { color: var(--t-potabile); background: var(--t-potabile-bg); }
.badge-tipo.t-fiume-balneabile { color: var(--t-fiume); background: var(--t-fiume-bg); }

/* Tile categoria fotografiche */
.tipo-tiles { list-style: none; padding: 0; margin: 0 0 .6rem; display: grid; gap: 1.2rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.tipo-tiles .tile-photo { position: relative; display: flex; align-items: flex-end; min-height: 170px;
  border-radius: var(--radius); overflow: hidden; background-size: cover; background-position: center;
  color: #fff; text-decoration: none; box-shadow: var(--shadow);
  transition: transform .2s, box-shadow .25s; }
.tipo-tiles .tile-photo::after { content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(16, 22, 18, .78), rgba(16, 22, 18, .18) 55%, transparent); }
.tipo-tiles .tile-photo:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); }
.tipo-tiles .tile-inner { position: relative; z-index: 1; padding: .9rem 1.05rem; }
.tipo-tiles .tile-label { display: block; font-family: var(--display); font-weight: var(--w-display);
  font-size: 1.25rem; line-height: 1.15; text-shadow: 0 1px 6px rgba(0, 0, 0, .4); }
.tipo-tiles .tile-count { display: block; margin-top: .25rem; font-size: .7rem;
  text-transform: uppercase; letter-spacing: .06em; color: #d7ded9; }
/* fallback senza cover: tinta piatta desaturata */
.tipo-tiles .tile-photo:not([style]) { background: #3c4f46; }
.tipo-tiles .tile-photo:not([style]).tt-sorgente-termale { background: #6e4438; }
.tipo-tiles .tile-photo:not([style]).tt-piscina-naturale { background: #33526b; }
.tipo-tiles .tile-photo:not([style]).tt-lago-balneabile { background: #33604a; }
.tipo-tiles .tile-photo:not([style]).tt-cascata { background: #4c4663; }
.tipo-tiles .tile-photo:not([style]).tt-sorgente-potabile { background: #2f5d62; }
.tipo-tiles .tile-photo:not([style]).tt-fiume-balneabile { background: #2b4a6f; }
/* retrocompat: tile testuali vecchie */
.tipo-tiles a:not(.tile-photo) { display: block; padding: 1.1rem 1.2rem; border-radius: var(--radius);
  color: #fff; text-decoration: none; font-weight: 640; font-size: 1.05rem; min-height: 92px;
  box-shadow: var(--shadow); background: #3c4f46; }
.tipo-tiles .count { display: block; font-size: .85rem; font-weight: 400; opacity: .85; margin-top: .2rem; }

/* ---------- Breadcrumb / scheda ---------- */
.breadcrumb { font-size: .85rem; color: var(--muted); margin-bottom: 1.25rem; letter-spacing: .01em; }
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent); }
article.entity h1 { margin-bottom: .35rem; }
.entity-loc { color: var(--muted); font-size: 1.02rem; margin-top: -.3rem; }
.entity-lead { font-size: 1.08rem; line-height: 1.7; color: var(--fg); max-width: 72ch; margin: .9rem 0 .4rem; }
.entity-lead + .lead-src { font-size: .74rem; color: var(--muted); margin: 0 0 .6rem; }
.entity-media { display: grid; gap: 1rem; margin: 1.1rem 0 .4rem; align-items: start; }
@media (min-width: 900px) {
  .entity-media:has(.entity-photo):has(.minimap) { grid-template-columns: 3fr 2fr; }
  .entity-media .minimap { height: 100%; min-height: 320px; margin: 0; }
}
.entity-media .entity-photo, .entity-media .minimap { margin: 0; }
.entity-photo { margin: 1.1rem 0 .3rem; border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow-lift); }
.entity-photo img { width: 100%; max-height: 460px; object-fit: cover; display: block;
  background: var(--lqip, var(--bg-soft)); }
.photo-credit { font-size: .72rem; color: var(--muted); margin: .45rem .2rem 0; opacity: .85; }
.photo-credit a { color: var(--muted); }
.photo-scope { font-style: italic; }
.entity-actions { display: flex; gap: .6rem; flex-wrap: wrap; margin: 1.1rem 0; }
article.entity > p a { display: inline-block; margin: .4rem .5rem .4rem 0;
  padding: .5rem .9rem; border: 1px solid var(--border-2); border-radius: var(--radius-sm);
  text-decoration: none; font-size: .92rem; color: var(--fg); }
article.entity > p a:hover { border-color: var(--accent); background: var(--accent-soft); }
article.entity > p.entity-actions a { margin: 0; }
.nearby { margin-top: 1.6rem; }

.chips { display: flex; flex-wrap: wrap; gap: .2rem 1.6rem; margin: .4rem 0 .9rem; padding: 0; list-style: none; }
.chips li { padding: .35rem .1rem; font-size: .9rem; color: var(--fg);
  border-bottom: 1px solid var(--border); }
.chips li b { color: var(--muted); font-weight: 620; margin-right: .25rem; }
.minimap { height: 300px; border-radius: var(--radius); border: 1px solid var(--border);
  margin: 1.1rem 0; background: var(--bg-soft); position: relative; z-index: 0; }
table.attributes { border-collapse: collapse; width: 100%; margin: 1.25rem 0;
  border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
table.attributes th, table.attributes td { text-align: left; padding: .65rem .9rem;
  border-bottom: 1px solid var(--border); word-wrap: break-word; overflow-wrap: break-word; vertical-align: top; }
table.attributes tr:last-child th, table.attributes tr:last-child td { border-bottom: 0; }
table.attributes th { width: 34%; background: var(--bg-soft); color: var(--muted); font-weight: 620; }

/* In breve */
.in-breve { border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); padding: .9rem 1.2rem; margin: 1rem 0 1.25rem; }
.in-breve-title { font-size: .72rem; color: var(--muted); margin: 0 0 .55rem; font-family: var(--sans); }
.in-breve-grid { display: flex; flex-wrap: wrap; gap: .4rem 2.4rem; margin: 0; align-items: center; }
.in-breve-item dt, .in-breve-grid dt { font-size: .68rem; text-transform: uppercase;
  letter-spacing: .05em; color: var(--muted); font-weight: 640; margin: 0 0 .15rem; }
.in-breve-item dd, .in-breve-grid dd { margin: .15rem 0 0; font-weight: 520; font-size: 1rem; }
.muted-src { color: var(--muted); font-size: .78rem; }

/* Qualità acqua / balneazione */
.chip-qualita { display: inline-block; padding: .15rem .65rem; border-radius: 999px;
  font-size: .9rem; font-weight: 620; border: 1px solid currentColor; }
.chip-qualita.q-eccellente { color: var(--q-eccellente); background: var(--q-eccellente-bg); }
.chip-qualita.q-buona { color: var(--q-buona); background: var(--q-buona-bg); }
.chip-qualita.q-sufficiente { color: var(--q-sufficiente); background: var(--q-sufficiente-bg); }
.chip-qualita.q-scarsa { color: var(--q-scarsa); background: var(--q-scarsa-bg); }
.storico-qualita { display: inline-flex; gap: .35rem; margin-left: .6rem; vertical-align: middle; }
.storico-dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block;
  background: var(--muted); position: relative; }
.storico-dot.q-eccellente { background: var(--q-eccellente); }
.storico-dot.q-buona { background: var(--q-buona); }
.storico-dot.q-sufficiente { background: var(--q-sufficiente); }
.storico-dot.q-scarsa { background: var(--q-scarsa); }
.storico-label { position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; }
.badge-baln { display: inline-block; padding: .12rem .6rem; border-radius: 4px;
  font-size: .68rem; margin-left: .3rem; }
.b-autorizzata { color: var(--q-eccellente); background: var(--q-eccellente-bg); }
.b-non-monitorata { color: var(--muted); background: var(--bg-soft); }
.b-vietata { color: var(--q-scarsa); background: var(--q-scarsa-bg); }
/* badge accesso (spiagge) */
.badge-accesso { display: inline-block; padding: .12rem .6rem; border-radius: 4px;
  font-size: .68rem; text-transform: uppercase; letter-spacing: .05em; font-weight: 640; margin-left: .3rem; }
.acc-verificato { color: var(--q-eccellente); background: var(--q-eccellente-bg); }
.acc-da-verificare { color: var(--q-sufficiente); background: var(--q-sufficiente-bg); }
/* badge qualità acque (spiagge ARPA) */
.badge-water-quality { display: inline-block; padding: .12rem .6rem; border-radius: 4px;
  font-size: .68rem; margin-left: .3rem; color: var(--q-eccellente); background: var(--q-eccellente-bg); }
.baln-note { font-size: .85rem; color: var(--muted); border-left: 3px solid var(--border-2);
  padding: .4rem .8rem; margin: 1rem 0; }
.baln-note-vietata { border-left-color: var(--q-scarsa); color: var(--fg); background: var(--bg-soft);
  border-radius: 0 8px 8px 0; }
.sun-times { font-size: .78rem; color: var(--muted); }
.marine-live { font-size: .82rem; margin: .35rem 0; padding: .35rem .6rem; border-radius: 8px;
  background: var(--bg-soft, #f4f7f8); }
.marine-live .ml-title { font-weight: 700; margin-right: .3rem; }
.marine-live .ml-item { margin-right: .55rem; white-space: nowrap; }
.marine-live .ml-src { color: var(--muted); font-size: .72rem; }
.racconta { margin-top: 1.4rem; }
.racconta a { font-weight: 620; }
.water-temp, .parking-row { font-size: .92rem; margin: .35rem 0; }
.water-temp .wt-m { display: inline-block; margin-right: .55rem; font-variant-numeric: tabular-nums; }
.water-temp small, .parking-row small { opacity: .65; font-size: .78em; margin-left: .3rem; }

/* Lightbox */
.photo-zoom { display: block; width: 100%; padding: 0; margin: 0; border: 0;
  background: none; cursor: zoom-in; border-radius: inherit; }
.photo-zoom img { display: block; width: 100%; height: auto; border-radius: inherit; }
.photo-lightbox { border: 0; padding: 0; background: transparent; max-width: min(96vw, 1100px); }
.photo-lightbox img { display: block; max-width: 100%; max-height: 88vh; border-radius: 10px; }
.photo-lightbox::backdrop { background: rgba(0, 0, 0, .8); }
.lightbox-close { position: absolute; top: .5rem; right: .5rem; border: 0; cursor: pointer;
  width: 2.75rem; height: 2.75rem; border-radius: 50%; background: rgba(0, 0, 0, .55);
  color: #fff; font-size: 1.1rem; }
.entity-photo .ph-fallback { display: none; }
.entity-photo.img-broken .photo-zoom { display: none; }
.entity-photo.img-broken .ph-fallback { display: flex; align-items: center;
  justify-content: center; min-height: 220px; }
.scheda-footer { margin-top: 2rem; padding-top: .75rem; border-top: 1px solid var(--border);
  font-size: .85rem; color: var(--muted); }
.scheda-footer a { color: inherit; text-decoration: underline; }

/* ---------- Search ---------- */
.site-search { position: relative; margin: 1.25rem 0; max-width: 620px; }
.site-search input { width: 100%; padding: .85rem 1.1rem; font-size: 1rem; color: var(--fg);
  border: 1px solid var(--border-2); border-radius: var(--radius-sm); background: var(--surface);
  font-family: var(--sans); transition: border-color .15s, box-shadow .15s; }
.site-search input:focus { outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft); }
.search-results { list-style: none; margin: .4rem 0 0; padding: .25rem; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); max-height: 60vh; overflow: auto;
  box-shadow: var(--shadow-lift); position: absolute; left: 0; right: 0; z-index: 5; }
.search-results li { border: 0; }
.search-results a { display: block; padding: .55rem .8rem; color: var(--fg); text-decoration: none;
  border-radius: var(--radius-sm); }
.search-results a:hover { background: var(--accent-soft); }
.search-region { color: var(--muted); font-size: .8rem; }
.search-empty { color: var(--muted); font-size: .9rem; margin: .4rem 0; }

/* ---------- SPEC01 (lago / regione×tipo) ---------- */
.spec01-head { margin: 1rem 0 1.4rem; }
.spec01-head h1 { margin-bottom: .25rem; }
.spec01-count { color: var(--muted); margin: 0 0 .35rem; }
.spec01-quality { display: inline-block; padding: .25rem .7rem; border-radius: 999px;
  background: var(--q-eccellente-bg); color: var(--q-eccellente); font-weight: 620; font-size: .88rem; }
.spec01-grid { list-style: none; padding: 0; margin: 1.2rem 0; display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .9rem; }
.spec01-card { background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); overflow: hidden; box-shadow: var(--shadow); }
.spec01-card a { display: block; color: inherit; text-decoration: none; }
.spec01-card img { width: 100%; height: 140px; object-fit: cover; display: block; }
.spec01-card-title { display: block; padding: .6rem .75rem .1rem; font-weight: 620; }
.spec01-card-sub { display: block; padding: 0 .75rem .6rem; color: var(--muted); font-size: .86rem; }
.spec01-card:hover { border-color: var(--border-2); box-shadow: var(--shadow-lift); }
.spec01-tipi { display: flex; flex-wrap: wrap; gap: .5rem; margin: .8rem 0 1rem; }
.spec01-tipo-link { display: inline-block; padding: .35rem .8rem; border: 1px solid var(--border);
  border-radius: 999px; background: var(--surface); text-decoration: none; font-size: .9rem; }
.spec01-tipo-link:hover { border-color: var(--accent); }
.spec01-tipo-count { color: var(--muted); }

/* ---------- Popup mappa ---------- */
.hero3d-popup .maplibregl-popup-content { background: #101c19; color: #e8ecea; border-radius: 12px;
  border: 1px solid #26403a; box-shadow: 0 12px 40px rgba(0, 0, 0, .55); padding: .6rem;
  font-family: var(--sans); }
.hero3d-popup .maplibregl-popup-content img { width: 100%; border-radius: 8px; display: block;
  margin-bottom: .45rem; aspect-ratio: 16/10; object-fit: cover; }
.hero3d-popup .maplibregl-popup-content strong { font-family: var(--display); font-size: .98rem;
  line-height: 1.3; display: block; margin-bottom: .3rem; }
.hero3d-popup .p-links { display: flex; gap: .8rem; font-size: .85rem; }
.hero3d-popup .p-links a { color: #9fd3d8; text-decoration: none; font-weight: 620; }
.hero3d-popup .maplibregl-popup-tip { border-top-color: #101c19; }
.hero3d-popup .maplibregl-popup-close-button { color: #9db8b0; font-size: 1.1rem; right: 4px; top: 2px; }
.hero3d-hover .maplibregl-popup-content { padding: 0 0 .5rem; overflow: hidden; pointer-events: none; }
.hero3d-hover .maplibregl-popup-content img { margin: 0 0 .45rem; border-radius: 0; aspect-ratio: 16/9; }
.hero3d-hover .maplibregl-popup-content strong { padding: 0 .7rem; }
.hero3d-hover .p-tipo { display: block; padding: .1rem .7rem 0; font-size: .68rem;
  text-transform: uppercase; letter-spacing: .06em; color: #9db8b0; }
.maplibregl-ctrl-top-left { top: 3rem; }
/* cluster mappa */
.map-cluster { background: var(--accent); color: #fff; border: 2px solid rgba(255, 255, 255, .85);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-family: var(--sans); box-shadow: 0 2px 10px rgba(0, 0, 0, .3); cursor: pointer; }

/* ---------- Strumento / cookie ---------- */
#arvos-tool .tool-chip[aria-pressed="true"] { background: var(--accent) !important; color: #fff !important;
  border-color: var(--accent) !important; }
#arvos-tool .tool-chip { border-radius: 999px !important; }
#arvos-tool select, #arvos-tool input[type="checkbox"] { accent-color: var(--accent); }
#arvos-tool .tool-fld label { font-size: .7rem; text-transform: uppercase; letter-spacing: .07em; }
#arvos-tool .tool-search { border-radius: 8px !important; }
#arvos-tool .tool-bar { align-items: center; }
#cc-main { --cc-btn-primary-bg: var(--accent); --cc-btn-primary-border-color: var(--accent);
  --cc-btn-primary-hover-bg: var(--accent-strong); --cc-font-family: var(--sans);
  --cc-modal-border-radius: 12px; --cc-btn-border-radius: 8px; }

/* ---------- Prose / footer ---------- */
.page, article.dataset { max-width: 70ch; }
.page h2 { margin-top: 1.6rem; }
.dataset-note { color: var(--muted); font-size: .9rem; }
.site-footer { border-top: 1px solid var(--border); padding: 2rem 0 2.5rem; margin-top: 2rem;
  font-size: .88rem; color: var(--muted); background: var(--bg-soft); }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--accent); }
.site-footer p { line-height: 1.9; }

/* ---------- Motion (entrata card, reduced-motion aware) ---------- */
@media (prefers-reduced-motion: no-preference) {
  .photo-grid .card-photo, .tipo-tiles .tile-photo { animation: rise .5s cubic-bezier(.2, .7, .3, 1) both; }
  .photo-grid .card-photo:nth-child(2), .tipo-tiles .tile-photo:nth-child(2) { animation-delay: .06s; }
  .photo-grid .card-photo:nth-child(3), .tipo-tiles .tile-photo:nth-child(3) { animation-delay: .12s; }
  .photo-grid .card-photo:nth-child(4), .tipo-tiles .tile-photo:nth-child(4) { animation-delay: .18s; }
  @keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  body { font-size: 15.5px; }
  .container { padding: 0 1rem; }
  main { padding: 1.5rem 0 2rem; }
  .region-grid, .entity-list { grid-template-columns: 1fr; }
  .photo-grid { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
  .featured-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: .7rem; }
  .card-photo .card-title { font-size: .98rem; }
  .card-lines { column-width: auto; }
  table.attributes th { width: 40%; }
  .tipo-tiles { grid-template-columns: 1fr 1fr; gap: .7rem; }
  .tipo-tiles .tile-photo { min-height: 120px; }
  .tipo-tiles .tile-label { font-size: 1.02rem; }
  .site-nav a { letter-spacing: .05em; padding: .4rem .45rem; font-size: .72rem; }
  .logo { font-size: 1.05rem; }
  h1 { overflow-wrap: anywhere; }
  .hero3d { height: 68vh; min-height: 420px; }
  .hero3d .hero3d-overlay { padding: 1rem 1.1rem .9rem; }
  .hero3d .hero3d-overlay h1 { font-size: 1.6rem; }
  .hero3d .hero3d-overlay p:not(.hero-cta) { display: none; }
  .hero3d .hero3d-hint { display: none; }
  .hero-legend { font-size: .76rem; gap: .5rem; }
  .btn { padding: .5rem .9rem; font-size: .88rem; }
  .entity-actions { display: grid; grid-template-columns: 1fr; gap: .5rem; }
  .entity-actions .btn { text-align: center; padding: .75rem 1rem; }
  .minimap { height: 240px; }
  .in-breve-grid { gap: .7rem 1.2rem; }
  .breadcrumb { white-space: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .header-row { gap: .5rem; }
  #arvos-tool .tool-bar { flex-direction: column; align-items: stretch; }
}

/* Ingresso gratuito — "Domenica al Museo" (free_entry_metadata) */
.badge-free { display: inline-block; padding: .12rem .6rem; border-radius: 999px;
  font-size: .78rem; font-weight: 600; color: #0a5c2e;
  background: color-mix(in srgb, #29a05c 22%, transparent);
  border: 1px solid color-mix(in srgb, #29a05c 45%, transparent); }
.free-entry-note { border: 1px solid color-mix(in srgb, #29a05c 40%, transparent);
  border-left: 3px solid #29a05c; border-radius: var(--radius);
  background: color-mix(in srgb, #29a05c 7%, var(--surface));
  padding: .9rem 1.2rem; margin: 1rem 0 1.25rem; }
.free-entry-title { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted); margin: 0 0 .45rem; font-family: var(--sans); }
.free-entry-note p { margin: .3rem 0; }
.free-entry-links { font-size: .88rem; }
.free-verify { color: var(--muted); font-size: .82rem; }
.free-intro { margin: .4rem 0 1rem; }
.free-count { font-size: 1.05rem; margin: 0 0 1.2rem; }
.free-region { margin: 0 0 1.6rem; }
.free-region h2 { display: flex; align-items: baseline; gap: .5rem; font-size: 1.1rem;
  margin: 0 0 .5rem; padding-bottom: .3rem; border-bottom: 1px solid var(--border); }
.free-region-n { color: var(--muted); font-size: .8rem; font-weight: 400; }
.free-missing, .free-nav { color: var(--muted); font-size: .85rem; margin-top: 1.2rem; }
/* Ingresso gratuito: masthead (testata) */
.free-hero { position: relative; background: var(--hero-grad); border-radius: var(--radius);
  padding: clamp(1.7rem, 4.5vw, 3rem); margin: .3rem 0 2rem; box-shadow: var(--shadow-lift);
  overflow: hidden; }
.free-hero::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(120% 140% at 100% 0%, rgba(255,255,255,.10), transparent 55%); }
.free-hero-body { position: relative; z-index: 1; max-width: 62ch; }
.free-hero .eyebrow { color: #cbdedb; font-size: .74rem; letter-spacing: .16em; margin: 0 0 .55rem; }
.free-hero h1 { color: #f5f9f7; margin: 0 0 .6rem; }
.free-lede { color: #d6e3de; font-size: clamp(1rem, 1.4vw, 1.12rem); line-height: 1.5;
  max-width: 58ch; margin: 0 0 1.2rem; }
.free-hero .free-count { display: inline-flex; align-items: baseline; gap: .45rem;
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.22); color: #eef5f2;
  padding: .45rem .9rem; border-radius: 999px; font-size: .95rem; font-weight: var(--w-semi); margin: 0; }
.free-hero .free-count b { color: #fff; font-size: 1.15rem; font-family: var(--display); font-weight: var(--w-display); }
@media (prefers-reduced-motion: no-preference) {
  .free-hero-body > * { animation: rise .55s cubic-bezier(.2, .7, .3, 1) both; }
  .free-hero-body > *:nth-child(2) { animation-delay: .05s; }
  .free-hero-body > *:nth-child(3) { animation-delay: .1s; }
  .free-hero-body > *:nth-child(4) { animation-delay: .15s; }
}
