/* hugo-directory — "acque" redesign 2026-07: photo-forward, dark-mode, depth.
   Backward compatible: ogni classe esistente resta valida; le feature ricche
   (card foto, hero 3D, badge tipo) si attivano solo se il markup le usa. */

@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/fonts/fraunces-600.woff2') format('woff2');
}

:root {
  --fg: #16222e; --muted: #55677a; --bg: #fbfdfe; --bg-soft: #eef4f8; --surface: #ffffff;
  --accent: #0e7490; --accent-strong: #155e75; --accent-soft: #e0f2f7;
  --border: #dde8ee; --border-2: #c8d8e2;
  --t-termale: #b91c1c; --t-termale-bg: #fee2e2;
  --t-piscina: #1d4ed8; --t-piscina-bg: #dbeafe;
  --t-lago: #15803d; --t-lago-bg: #dcfce7;
  --radius: 14px; --radius-sm: 10px; --maxw: 1120px;
  --shadow: 0 1px 2px rgba(13, 35, 51, .06);
  --shadow-lift: 0 10px 30px rgba(13, 35, 51, .14);
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --hero-grad: linear-gradient(160deg, #0b3648 0%, #0e5e74 45%, #12809b 75%, #4fb3c8 100%);
}
@media (prefers-color-scheme: dark) {
  :root {
    --fg: #e6eef4; --muted: #93a7b8; --bg: #0c141b; --bg-soft: #121e27; --surface: #16232e;
    --accent: #38bdd8; --accent-strong: #67d5ea; --accent-soft: #113747;
    --border: #223441; --border-2: #2e4553;
    --t-termale: #fca5a5; --t-termale-bg: #451a1a;
    --t-piscina: #93c5fd; --t-piscina-bg: #172554;
    --t-lago: #86efac; --t-lago-bg: #14351f;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-lift: 0 10px 30px rgba(0, 0, 0, .5);
    --hero-grad: linear-gradient(160deg, #071e2a 0%, #0a3546 45%, #0d4e63 75%, #12617a 100%);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: var(--sans); color: var(--fg); background: var(--bg);
  line-height: 1.6; font-size: 16px; -webkit-font-smoothing: antialiased; }
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 1.25rem; }
a { color: var(--accent); }
img { max-width: 100%; height: auto; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border); padding: .85rem 0; }
.logo { font-weight: 750; color: var(--fg); text-decoration: none; font-size: 1.05rem;
  letter-spacing: -.01em; display: inline-flex; align-items: center; gap: .55rem; }
.logo::before { content: ""; width: 12px; height: 12px; border-radius: 50% 50% 50% 4px;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  transform: rotate(45deg); }

/* Main + hero */
main { padding: 2.5rem 0 3rem; min-height: 60vh; }
.hero { position: relative; }
.hero h1, main > h1 { font-family: var(--display); font-weight: 600;
  font-size: clamp(2rem, 4.5vw, 3.1rem); line-height: 1.12;
  letter-spacing: -.015em; margin: 0 0 .6rem; }
h1 { font-family: var(--display); font-weight: 600; letter-spacing: -.015em; }
.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); }
h2 { font-family: var(--display); font-weight: 600; font-size: 1.45rem;
  letter-spacing: -.01em; margin: 2.2rem 0 1rem; }
.tool-cta a { display: inline-block; background: var(--accent); color: #fff; text-decoration: none;
  padding: .65rem 1.2rem; border-radius: 999px; font-weight: 600; box-shadow: var(--shadow);
  transition: transform .15s, box-shadow .15s; }
.tool-cta a:hover { transform: translateY(-1px); box-shadow: var(--shadow-lift); }

/* Hero 3D (opt-in: montato solo se site.Data.site.hero3d) */
.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.4rem 1.6rem;
  background: linear-gradient(to top, rgba(5, 20, 30, .78), rgba(5, 20, 30, .25) 65%, transparent);
  color: #f2fafd; pointer-events: none; }
.hero3d .hero3d-overlay > * { pointer-events: auto; }
.hero3d .hero3d-overlay h1 { color: #f2fafd; margin: 0 0 .35rem; text-shadow: 0 2px 12px rgba(0,0,0,.45); }
.hero3d .hero3d-overlay p { color: #cfe6ee; margin: 0 0 .8rem; font-size: 1.02rem; }
.hero3d .hero3d-hint { position: absolute; top: .9rem; right: 1rem; z-index: 3; font-size: .78rem;
  color: #e6f4f8; background: rgba(8, 30, 42, .55); padding: .3rem .7rem; border-radius: 999px;
  backdrop-filter: blur(6px); }
.hero3d .maplibregl-ctrl-attrib { font-size: .68rem; }
.stats-band { display: flex; flex-wrap: wrap; gap: .5rem 1.4rem; align-items: center;
  color: var(--muted); font-size: .95rem; margin: 0 0 1.2rem; }
.stats-band strong { color: var(--fg); font-size: 1.15rem; }

/* Grids: card standard (senza foto) — retrocompatibili */
.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; }

/* Card fotografiche (attive quando il markup porta .card-photo) */
.photo-grid { list-style: none; padding: 0; margin: 0; display: grid; gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  content-visibility: auto; contain-intrinsic-size: auto 1200px; }
.card-photo { position: relative; border-radius: var(--radius); overflow: hidden;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow);
  transition: transform .25s, box-shadow .25s; }
.card-photo:hover { transform: translateY(-4px) scale(1.012); box-shadow: var(--shadow-lift); }
.card-photo a { display: block; color: inherit; text-decoration: none; }
.card-photo .ph { aspect-ratio: 16 / 10; width: 100%; display: block; object-fit: cover;
  background: var(--lqip, var(--bg-soft)); }
.card-photo .ph-fallback { aspect-ratio: 16 / 10; display: flex; align-items: center;
  justify-content: center; font-size: 2rem; color: #fff;
  background: var(--lqip, var(--hero-grad)); }
.card-photo .card-body { padding: .7rem .9rem .85rem; }
.card-photo .card-title { font-weight: 650; line-height: 1.3; margin: 0 0 .25rem; }
.card-photo .card-sub { color: var(--muted); font-size: .88rem; margin: 0 0 .45rem; }

/* Badge tipo */
.badge-tipo { display: inline-block; padding: .12rem .6rem; border-radius: 999px;
  font-size: .76rem; font-weight: 700; letter-spacing: .01em; }
.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); }

/* Tiles categoria in home */
.tipo-tiles { list-style: none; padding: 0; margin: 0 0 .6rem; display: grid; gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.tipo-tiles a { display: block; padding: 1.1rem 1.2rem; border-radius: var(--radius);
  color: #fff; text-decoration: none; font-weight: 650; font-size: 1.05rem;
  box-shadow: var(--shadow); transition: transform .2s, box-shadow .2s; position: relative;
  overflow: hidden; min-height: 92px; }
.tipo-tiles a::after { content: "→"; position: absolute; right: 1rem; bottom: .8rem;
  opacity: .8; font-weight: 400; }
.tipo-tiles a:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); }
.tipo-tiles .count { display: block; font-size: .85rem; font-weight: 400; opacity: .85; margin-top: .2rem; }
.tipo-tiles .tt-sorgente-termale { background: linear-gradient(140deg, #7f1d1d, #dc2626 90%); }
.tipo-tiles .tt-piscina-naturale { background: linear-gradient(140deg, #1e3a8a, #2563eb 90%); }
.tipo-tiles .tt-lago-balneabile { background: linear-gradient(140deg, #14532d, #16a34a 90%); }

/* Breadcrumb */
.breadcrumb { font-size: .85rem; color: var(--muted); margin-bottom: 1.25rem; }
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent); }

/* Entity page */
.entity-loc { color: var(--muted); font-size: 1rem; margin-top: -.3rem; }
.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: .78rem; color: var(--muted); margin: .35rem 0 1rem; }
.photo-credit a { color: var(--muted); }
.photo-scope { font-style: italic; }
.chips { display: flex; flex-wrap: wrap; gap: .45rem; margin: .9rem 0; padding: 0; list-style: none; }
.chips li { background: var(--bg-soft); border: 1px solid var(--border); border-radius: 999px;
  padding: .3rem .8rem; font-size: .86rem; color: var(--fg); }
.chips li b { color: var(--muted); font-weight: 600; 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; }
.minimap[data-loaded="0"]::after { content: "🗺"; position: absolute; inset: 0; display: flex;
  align-items: center; justify-content: center; font-size: 1.6rem; opacity: .45; }
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: 600; }
article.entity > p a { display: inline-block; margin: .4rem .5rem .4rem 0;
  padding: .5rem .9rem; border: 1px solid var(--border-2); border-radius: 999px;
  text-decoration: none; font-size: .92rem; color: var(--fg); }
article.entity > p a:hover { border-color: var(--accent); background: var(--accent-soft); }
.nearby { margin-top: 1.6rem; }

/* 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: 999px; background: var(--surface);
  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; }

/* Prose pages (about/privacy/dataset) */
.page, article.dataset { max-width: 70ch; }
.page h2 { margin-top: 1.6rem; }
.dataset-note { color: var(--muted); font-size: .9rem; }

/* Footer */
.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); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

@media (max-width: 768px) {
  body { font-size: 15.5px; }
  .container { padding: 0 1rem; }
  .region-grid, .entity-list { grid-template-columns: 1fr; }
  .photo-grid { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
  table.attributes th { width: 40%; }
  main { padding: 1.5rem 0 2rem; }
  .hero3d { height: 46vh; min-height: 300px; }
}

/* ===== Detail pass 2026-07-04 (SEO/design elevate) ===== */

/* Header nav */
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.site-nav { display: flex; gap: .25rem; }
.site-nav a { color: var(--muted); text-decoration: none; font-size: .92rem; font-weight: 550;
  padding: .35rem .8rem; border-radius: 999px; transition: color .15s, background .15s; }
.site-nav a:hover { color: var(--accent); background: var(--accent-soft); }

/* Bottoni unificati */
.btn { display: inline-block; padding: .6rem 1.15rem; border-radius: 999px; font-weight: 600;
  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 { transform: translateY(-1px); box-shadow: var(--shadow-lift); border-color: var(--accent); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { border-color: var(--accent-strong); }
.btn-ghost { background: rgba(10, 32, 44, .45); border-color: rgba(255,255,255,.35); color: #f2fafd;
  backdrop-filter: blur(8px); }

/* Hero 3D: overlay glass raffinato + legenda */
.hero3d .hero3d-overlay { padding: 1.6rem 1.8rem 1.4rem;
  background: linear-gradient(to top, rgba(4, 16, 24, .88), rgba(4, 16, 24, .38) 60%, transparent); }
.hero3d .hero3d-overlay h1 { font-size: clamp(1.9rem, 4vw, 2.9rem); }
.hero3d .hero3d-overlay p { max-width: 62ch; }
.hero-cta { display: flex; gap: .6rem; flex-wrap: wrap; margin: .9rem 0 .7rem !important; }
.hero-legend { list-style: none; display: flex; gap: 1.1rem; padding: 0; margin: 0;
  font-size: .82rem; color: #bcd9e4; flex-wrap: wrap; }
.hero-legend .dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%;
  margin-right: .35rem; box-shadow: 0 0 8px currentColor; vertical-align: 1px; }
.dot.d-termale { background: #f87171; color: #f87171; }
.dot.d-piscina { background: #60a5fa; color: #60a5fa; }
.dot.d-lago { background: #4ade80; color: #4ade80; }
.hero3d .hero3d-hint { font-size: .74rem; letter-spacing: .02em; text-transform: uppercase;
  background: rgba(4, 18, 28, .6); }

/* Popup MapLibre dark elegante */
.hero3d-popup .maplibregl-popup-content { background: #0e1c26; color: #e6eef4; border-radius: 12px;
  border: 1px solid #24404f; 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-size: .95rem; 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: #67d5ea; text-decoration: none; font-weight: 600; }
.hero3d-popup .maplibregl-popup-tip { border-top-color: #0e1c26; }
.hero3d-popup .maplibregl-popup-close-button { color: #9db8c4; font-size: 1.1rem; right: 4px; top: 2px; }

/* Entity: media affiancate su desktop, azioni, credito */
.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 { margin: 0; }
.entity-media .minimap { margin: 0; }
.entity-actions { display: flex; gap: .6rem; flex-wrap: wrap; margin: 1.1rem 0; }
article.entity > p.entity-actions a { margin: 0; border-radius: 999px; }
.photo-credit { margin: .45rem .2rem 0; }

/* Card: zoom foto al hover, titolo più presente */
.card-photo .ph { transition: transform .35s; }
.card-photo:hover .ph { transform: scale(1.04); }
.card-photo a { overflow: hidden; }
.card-photo .card-title { font-size: 1.02rem; letter-spacing: -.01em; }

/* Micro-rifiniture globali */
::selection { background: var(--accent); color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.breadcrumb { letter-spacing: .01em; }
h2 { position: relative; padding-left: .85rem; }
h2::before { content: ""; position: absolute; left: 0; top: .3em; bottom: .3em; width: 4px;
  border-radius: 4px; background: linear-gradient(var(--accent), var(--accent-strong)); }
.site-footer p { line-height: 1.9; }

@media (max-width: 768px) {
  .site-nav a { padding: .3rem .55rem; font-size: .85rem; }
  .hero-legend { gap: .7rem; }
}

/* Mobile hero 3D: overlay compatto — la mappa deve restare visibile */
@media (max-width: 768px) {
  .hero3d { height: 68vh; min-height: 420px; }
  .hero3d .hero3d-overlay p:not(.hero-cta) { display: none; }
  .hero3d .hero3d-overlay { padding: 1rem 1.1rem .9rem; }
  .hero3d .hero3d-overlay h1 { font-size: 1.6rem; }
  .hero3d .hero3d-hint { display: none; }
  .hero-legend { font-size: .76rem; gap: .6rem; }
  .btn { padding: .5rem .9rem; font-size: .88rem; }
}

/* ===== SPEC01 ia ===== */
/* Pagine lago e regione×tipo: card compatte self-contained (non entity_cards). */
.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(--t-lago-bg); color: var(--t-lago); font-weight: 600; 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: 600; }
.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); }

/* ===== SPEC04 scheda ===== */
:root {
  --q-eccellente: #16a34a; --q-eccellente-bg: #dcfce7;
  --q-buona: #0d9488;      --q-buona-bg: #ccfbf1;
  --q-sufficiente: #d97706; --q-sufficiente-bg: #fef3c7;
  --q-scarsa: #dc2626;     --q-scarsa-bg: #fee2e2;
}
@media (prefers-color-scheme: dark) {
  :root {
    --q-eccellente: #4ade80; --q-eccellente-bg: #14361f;
    --q-buona: #2dd4bf;      --q-buona-bg: #0e2f2b;
    --q-sufficiente: #fbbf24; --q-sufficiente-bg: #3a2c0a;
    --q-scarsa: #f87171;     --q-scarsa-bg: #3b1414;
  }
}
.in-breve { border: 1px solid var(--border); border-radius: var(--radius, 14px);
  background: var(--surface, var(--bg-soft)); padding: 1rem 1.25rem; margin: 1rem 0 1.25rem; }
.in-breve-title { font-size: 1rem; margin: 0 0 .6rem; }
.in-breve-grid { display: flex; flex-wrap: wrap; gap: .75rem 2rem; margin: 0; }
.in-breve-item dt { font-size: .8rem; color: var(--muted); margin: 0 0 .15rem; }
.in-breve-item dd { margin: 0; font-weight: 500; }
.chip-qualita { display: inline-block; padding: .15rem .65rem; border-radius: 999px;
  font-size: .9rem; font-weight: 600; 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; }
/* 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; }
/* broken-image fallback sulla scheda */
.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; font-size: 3rem; }
/* footer scheda */
.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; }
@media (prefers-reduced-motion: reduce) {
  .photo-zoom, .btn-copy-coords { transition: none; }
}

/* ===== SPEC05 mappe ===== */
/* Legenda hero come controllo: bottoni veri con aria-pressed. */
.hero-legend .legend-btn {
  display: inline-flex; align-items: center; gap: .4rem;
  background: none; border: 0; padding: 0; margin: 0;
  font: inherit; color: inherit; cursor: pointer;
  opacity: 1; transition: opacity .15s ease;
}
.hero-legend .legend-btn[aria-pressed="false"] { opacity: .35; }
.hero-legend .legend-btn:hover { opacity: .8; }
.hero-legend .legend-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; border-radius: 4px; }

/* ===== SPEC-EXT cascata (4° tipo, expansion daemon #629) ===== */
:root { --t-cascata: #6d28d9; --t-cascata-bg: #ede9fe; }
@media (prefers-color-scheme: dark) {
  :root { --t-cascata: #c4b5fd; --t-cascata-bg: #2e1065; }
}
.badge-tipo.t-cascata { color: var(--t-cascata); background: var(--t-cascata-bg); }
.tipo-tiles .tt-cascata { background: linear-gradient(140deg, #4c1d95, #7c3aed 90%); }
.dot.d-cascata { background: #a78bfa; color: #a78bfa; }

/* ===== SPEC-POLISH light/dark + mobile (2026-07-04 sera) ===== */
/* Legenda hero: pill vere, non testo nudo */
.hero-legend .legend-btn { border: 1px solid rgba(255,255,255,.28); background: rgba(8,28,40,.45);
  color: #e6f4f8; border-radius: 999px; padding: .3rem .75rem; font-size: .8rem; font-weight: 600;
  cursor: pointer; display: inline-flex; align-items: center; gap: .4rem;
  backdrop-filter: blur(6px); 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; }
/* Overlay hero sul tema chiaro: la mappa voyager è chiara → serve contrasto scuro comunque */
.hero3d .hero3d-overlay { text-shadow: 0 1px 8px rgba(0,0,0,.5); }

/* Filtri strumento: chip coerenti col design system */
#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); }

/* In breve: dt più leggeri, valori in evidenza */
.in-breve-grid dt { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em;
  color: var(--muted); font-weight: 650; }
.in-breve-grid dd { margin: .15rem 0 0; font-size: 1rem; }
.muted-src { color: var(--muted); font-size: .78rem; }

/* Mobile: la scheda deve essere perfetta a 390px */
@media (max-width: 768px) {
  .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; }
  .logo { font-size: .95rem; }
  h1 { overflow-wrap: anywhere; }
  #arvos-tool .tool-bar { flex-direction: column; align-items: stretch; }
}

/* ===== SPEC-EXT sorgente-potabile (5° tipo, expansion daemon) ===== */
:root { --t-potabile: #0369a1; --t-potabile-bg: #e0f2fe; }
@media (prefers-color-scheme: dark) {
  :root { --t-potabile: #7dd3fc; --t-potabile-bg: #082f49; }
}
.badge-tipo.t-sorgente-potabile { color: var(--t-potabile); background: var(--t-potabile-bg); }
.tipo-tiles .tt-sorgente-potabile { background: linear-gradient(140deg, #075985, #0284c7 90%); }
.dot.d-potabile { background: #38bdf8; color: #38bdf8; }

/* ===== Theme switcher manuale (system/light/dark) ===== */
:root[data-theme="dark"] {
    --fg: #e6eef4; --muted: #93a7b8; --bg: #0c141b; --bg-soft: #121e27; --surface: #16232e;
    --accent: #38bdd8; --accent-strong: #67d5ea; --accent-soft: #113747;
    --border: #223441; --border-2: #2e4553;
    --t-termale: #fca5a5; --t-termale-bg: #451a1a;
    --t-piscina: #93c5fd; --t-piscina-bg: #172554;
    --t-lago: #86efac; --t-lago-bg: #14351f;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-lift: 0 10px 30px rgba(0, 0, 0, .5);
    --hero-grad: linear-gradient(160deg, #071e2a 0%, #0a3546 45%, #0d4e63 75%, #12617a 100%);
}
:root[data-theme="light"] {
  --fg: #16222e; --muted: #55677a; --bg: #fbfdfe; --bg-soft: #eef4f8; --surface: #ffffff;
  --accent: #0e7490; --accent-strong: #155e75; --accent-soft: #e0f2f7;
  --border: #dde8ee; --border-2: #c8d8e2;
  --t-termale: #b91c1c; --t-termale-bg: #fee2e2;
  --t-piscina: #1d4ed8; --t-piscina-bg: #dbeafe;
  --t-lago: #15803d; --t-lago-bg: #dcfce7;
  --radius: 14px; --radius-sm: 10px; --maxw: 1120px;
  --shadow: 0 1px 2px rgba(13, 35, 51, .06);
  --shadow-lift: 0 10px 30px rgba(13, 35, 51, .14);
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --hero-grad: linear-gradient(160deg, #0b3648 0%, #0e5e74 45%, #12809b 75%, #4fb3c8 100%);
  color-scheme: light;
}
:root[data-theme="dark"] { color-scheme: dark; }
.theme-toggle { border: 1px solid var(--border); background: var(--surface); color: var(--fg);
  border-radius: 999px; width: 32px; height: 32px; font-size: .95rem; cursor: pointer;
  line-height: 1; transition: border-color .15s, transform .15s; }
.theme-toggle:hover { border-color: var(--accent); transform: translateY(-1px); }

/* Legend dots keyed by full tipo_slug (data-driven legend, 2026-07-04) —
   the short aliases above (.d-termale, …) stay for older builds. */
.dot.d-sorgente-termale { background: #f87171; color: #f87171; }
.dot.d-piscina-naturale { background: #60a5fa; color: #60a5fa; }
.dot.d-lago-balneabile { background: #4ade80; color: #4ade80; }
.dot.d-cascata { background: #a78bfa; color: #a78bfa; }
.dot.d-sorgente-potabile { background: #38bdf8; color: #38bdf8; }

/* ===== REDESIGN v3 — de-slop editoriale (ricerca AllTrails/AtlasObscura/Komoot) ===== */
:root {
  --bg: #f7f6f2; --bg-soft: #efede7; --surface: #ffffff;
  --fg: #1c2620; --muted: #67736c;
  --accent: #2f5d62; --accent-strong: #234a4e; --accent-soft: #e4ecec;
  --border: rgba(28, 38, 32, .09); --border-2: rgba(28, 38, 32, .16);
  --radius: 10px; --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(0,0,0,.05);
  --shadow-lift: 0 1px 2px rgba(0,0,0,.06), 0 12px 28px -14px rgba(0,0,0,.22);
}
@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);
} }
: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);
}

/* Bottoni: editoriali, non pillole (pill solo per filtri/legenda) */
.btn, .tool-cta a { border-radius: var(--radius-sm); font-weight: 600; }
.btn-primary, .tool-cta a { background: var(--accent); border-color: var(--accent); }

/* Sezioni: eyebrow + h2 serif grande, via la barra accent */
h2 { padding-left: 0; font-size: 1.7rem; }
h2::before { display: none; }
section.tipi h2, section.regions h2, .nearby h2 { margin-top: 3rem; }

/* Card: meta sotto foto, hairline + ombra stratificata, niente zoom vistoso */
.card-photo { border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-photo:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.card-photo:hover .ph { transform: none; }
.card-photo .ph { aspect-ratio: 3 / 2; }
.card-photo .card-title { font-family: var(--display); font-weight: 600; font-size: 1.06rem; }
.card-photo .card-sub { text-transform: uppercase; font-size: .72rem; letter-spacing: .05em; }
.badge-tipo { border-radius: 4px; font-size: .68rem; letter-spacing: .05em; text-transform: uppercase; }

/* Tile categoria fotografiche duotone */
.tipo-tiles { gap: 1.2rem; }
.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(18, 24, 20, .78), rgba(18, 24, 20, .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: 600;
  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: .72rem;
  text-transform: uppercase; letter-spacing: .06em; color: #d9e2dc; }
/* fallback senza cover: tinta piatta desaturata, MAI gradiente hue-shift */
.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; }

/* Hero: meno glassy — hint sobrio, overlay più sottile */
.hero3d .hero3d-hint { background: rgba(10, 18, 16, .55); backdrop-filter: none;
  font-size: .68rem; letter-spacing: .08em; }
.hero3d .hero3d-overlay { background: linear-gradient(to top, rgba(12, 18, 15, .82), rgba(12, 18, 15, .25) 62%, transparent); }
.hero-cta .btn-ghost { backdrop-filter: none; background: rgba(12, 18, 15, .5); border-radius: var(--radius-sm); }
.hero-cta .btn-primary { border-radius: var(--radius-sm); }
.stats-band { text-transform: uppercase; font-size: .74rem; letter-spacing: .06em; }
.stats-band strong { font-size: 1.05rem; letter-spacing: 0; }

/* Chips/meta: testo, non gioielli */
.chips li { border-radius: 6px; background: transparent; border: 0;
  border-bottom: 1px solid var(--border); padding: .35rem .1rem; font-size: .9rem; }
.chips { gap: .2rem 1.6rem; }
.in-breve { background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1rem 1.2rem; }

/* Griglie: respiro */
.photo-grid { gap: 1.4rem; }
main { padding-top: 2rem; }

/* ===== REDESIGN v4 — navbar, card, scheda (feedback operatore) ===== */
/* Navbar editoriale */
.site-header { background: var(--bg); backdrop-filter: none; -webkit-backdrop-filter: none;
  padding: 1.05rem 0; }
.logo { font-family: var(--display); font-weight: 600; font-size: 1.22rem; letter-spacing: 0; gap: .6rem; }
.logo::before { display: none; }
.logo-mark { width: 22px; height: 22px; border-radius: 50%; flex: none;
  background: radial-gradient(circle at 32% 30%, var(--accent-strong), var(--accent) 58%, transparent 60%),
              radial-gradient(circle at 70% 72%, var(--accent) 0 38%, transparent 40%);
  border: 1.5px solid var(--accent); }
.site-nav { gap: .1rem; align-items: center; }
.site-nav a { text-transform: uppercase; font-size: .74rem; letter-spacing: .09em; font-weight: 650;
  color: var(--fg); padding: .45rem .7rem; border-radius: 6px; }
.site-nav a:hover { background: var(--bg-soft); color: var(--fg); }
.site-nav .lang-switch { border: 1px solid var(--border-2); margin-left: .45rem; }
.theme-toggle { border: 0; background: transparent; width: 34px; height: 34px; font-size: 1.02rem;
  color: var(--muted); margin-left: .3rem; }
.theme-toggle:hover { color: var(--fg); transform: none; background: var(--bg-soft); border-radius: 6px; }

/* Card foto: pulizia — niente badge-jewel, titolo serif, sub sottile */
.card-photo { box-shadow: none; }
.card-photo:hover { box-shadow: var(--shadow-lift); }
.card-photo .card-body { padding: .8rem .95rem .95rem; }
.card-photo .card-title { font-size: 1.12rem; line-height: 1.25; margin-bottom: .3rem;
  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 { margin: 0; font-size: .7rem; }
.card-photo .badge-tipo { margin-top: .5rem; }

/* Card compatte per chi non ha foto: righe editoriali, non scatoloni vuoti */
.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: 550; font-size: .95rem; }
.card-lines .cl-meta { color: var(--muted); font-size: .74rem; text-transform: uppercase;
  letter-spacing: .05em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 45%; }

/* Scheda: in-breve come riga dati inline, credito discreto */
.in-breve { padding: .9rem 1.2rem; }
.in-breve-title { font-size: .74rem; text-transform: uppercase; letter-spacing: .08em;
  color: var(--muted); margin: 0 0 .55rem; font-family: var(--sans); font-weight: 700; }
.in-breve-grid { gap: .4rem 2.4rem; align-items: center; }
.in-breve-grid dt { font-size: .68rem; }
.photo-credit { font-size: .72rem; opacity: .85; }
.entity-loc { font-size: 1.02rem; }
article.entity h1 { margin-bottom: .35rem; }
.chips { margin-top: .4rem; }

/* ===== v4.1 — home featured, tool search, mobile polish ===== */
.featured h2 { margin-top: 2.6rem; }
.featured-grid { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
#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; }
@media (max-width: 768px) {
  .tipo-tiles { grid-template-columns: 1fr 1fr; gap: .7rem; }
  .tipo-tiles .tile-photo { min-height: 120px; }
  .tipo-tiles .tile-label { font-size: 1.02rem; }
  .featured-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: .7rem; }
  .card-photo .card-title { font-size: .95rem; }
  .site-nav a { letter-spacing: .05em; padding: .4rem .45rem; }
  .card-lines { column-width: auto; }
}

/* ===== tipo fiume-balneabile (EEA River, 2026-07-04) ===== */
:root { --t-fiume: #1d4e89; --t-fiume-bg: #dbeafe; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --t-fiume: #93b8e8; --t-fiume-bg: #12263f; } }
:root[data-theme="dark"] { --t-fiume: #93b8e8; --t-fiume-bg: #12263f; }
.badge-tipo.t-fiume-balneabile { color: var(--t-fiume); background: var(--t-fiume-bg); }
.tipo-tiles .tile-photo:not([style]).tt-fiume-balneabile { background: #2b4a6f; }
.dot.d-fiume { background: #6ea8dc; color: #6ea8dc; }

/* ===== hover preview card sulla mappa ===== */
.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; font-family: var(--display); }
.hero3d-hover .p-tipo { display: block; padding: .1rem .7rem 0; font-size: .68rem;
  text-transform: uppercase; letter-spacing: .06em; color: #9db8c4; }
.maplibregl-ctrl-top-left { top: 3rem; }
/* banner cookie: coerenza col design system */
#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; }

/* ===== spec 11+13: badge balneabilità, note, sole, racconta ===== */
.badge-baln { display: inline-block; padding: .12rem .6rem; border-radius: 4px;
  font-size: .68rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  margin-left: .3rem; }
.b-autorizzata { color: #166534; background: #dcfce7; }
.b-non-monitorata { color: #57534e; background: #e7e5e4; }
.b-vietata { color: #b91c1c; background: #fee2e2; }
:root[data-theme="dark"] .b-autorizzata, :root:not([data-theme="light"]) .dark-b-auto { }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --noop: 0; } }
:root[data-theme="dark"] .b-autorizzata { color: #86efac; background: #14351f; }
:root[data-theme="dark"] .b-non-monitorata { color: #d6d3d1; background: #292524; }
:root[data-theme="dark"] .b-vietata { color: #fca5a5; background: #451a1a; }
.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: #b91c1c; color: var(--fg); background: var(--bg-soft);
  border-radius: 0 8px 8px 0; }
.sun-times { font-size: .82rem; color: var(--muted); text-transform: uppercase;
  letter-spacing: .05em; }
.racconta { margin-top: 1.4rem; }
.racconta a { font-weight: 600; }

/* SPEC 12/13 — water temp, parking, safety */
.water-temp, .parking-row { font-size: .92rem; margin: .35rem 0; color: var(--fg-muted, inherit); }
.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; }
