/* Welcome Val Mara – foglio di stile del sito (agosto 2026; layout «Orizzonte» scelto dal Comune a settembre 2026)
 * Foglio unico per tutto il sito. Mobile-first; testato su Chrome/Firefox/Safari,
 * telefono, tablet e desktop. Font: Noto Sans Display self-hosted (in mappe/fonts/).
 * Palette ripresa dallo stemma comunale e dai totem:
 *   magenta fiore  #d4157b   rosa petali  #ef7fb4
 *   verde foglie   #4f9e45   verde scuro  #23481f
 *   azzurro onda   #1a86c8   giallo       #ffd23f
 *   beige carta    #f4f2ea
 */

@font-face {
  font-family: "Noto Sans Display";
  font-style: normal;
  font-weight: 200 700;
  font-display: swap;
  src: url("../mappe/fonts/NotoSansDisplay-Roman-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Noto Sans Display";
  font-style: normal;
  font-weight: 200 700;
  font-display: swap;
  src: url("../mappe/fonts/NotoSansDisplay-Roman-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Noto Sans Display";
  font-style: italic;
  font-weight: 200 700;
  font-display: swap;
  src: url("../mappe/fonts/NotoSansDisplay-Italic-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --magenta: #d4157b;
  --magenta-scuro: #a80f60;
  --rosa: #ef7fb4;
  --verde: #4f9e45;
  --verde-scuro: #23481f;
  --verde-medio: #35682d;
  --verde-chiaro: #dcebc8;
  --azzurro: #1a86c8;
  --giallo: #ffd23f;
  --beige: #f4f2ea;
  --carta: #ffffff;
  --ink: #20282e;
  --muted: #5c6670;
  --linea: #ddd8cc;
  --header-h: 3.6rem;
  --raggio: .6rem;
  --ombra: 0 10px 30px rgba(32, 40, 46, .18);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
.sezione[id] { scroll-margin-top: var(--header-h); }   /* ancore delle briciole: la sezione non finisce sotto la testata */
body {
  margin: 0;
  font-family: "Noto Sans Display", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-weight: 300;
  line-height: 1.55;
  color: var(--ink);
  background: var(--beige);
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--magenta-scuro); }
a:hover { color: var(--magenta); }
button { font: inherit; }
h1, h2, h3 { line-height: 1.15; font-weight: 600; }

/* ---------- lingue: si mostra solo la lingua attiva ---------- */
html[data-lang="it"] [lang="en"], html[data-lang="it"] [lang="de"],
html[data-lang="en"] [lang="it"], html[data-lang="en"] [lang="de"],
html[data-lang="de"] [lang="it"], html[data-lang="de"] [lang="en"] { display: none !important; }
.manca { color: var(--muted); font-style: italic; font-size: .9em; }

.salta {
  position: absolute; left: -999px; top: 0; z-index: 100;
  background: var(--verde-scuro); color: #fff; padding: .5rem 1rem;
}
.salta:focus { left: 0; }

/* ---------- testata / navigazione ---------- */
.testata {
  position: sticky; top: 0; z-index: 50;
  background: var(--carta);
  border-bottom: 1px solid var(--linea);
}
.testata-int {
  display: flex; flex-wrap: wrap; align-items: center; gap: .6rem;
  max-width: 74rem; margin: 0 auto;
  min-height: var(--header-h); padding: .35rem 1rem;
}
/* schermi stretti: testata compatta, niente sottotitolo */
@media (max-width: 30rem) {
  .testata-int { gap: .4rem; padding: .35rem .6rem; }
  .marchio { gap: .45rem; }
  .marchio small { display: none; }
  .marchio b { font-size: 1rem; }
  .lingue button { padding: .2rem .4rem; }
}
.marchio {
  display: flex; align-items: center; gap: .6rem;
  text-decoration: none; color: inherit; margin-right: auto;
}
.marchio img { width: 2.1rem; height: auto; }
.marchio b { font-weight: 600; font-size: 1.12rem; letter-spacing: .02em; white-space: nowrap; }
.marchio small { display: block; font-weight: 300; font-size: .72rem; color: var(--muted); letter-spacing: .14em; text-transform: uppercase; }

.lingue { display: flex; gap: .25rem; margin: 0; padding: 0; list-style: none; }
.lingue button {
  border: 1px solid var(--linea); background: transparent; color: inherit;
  border-radius: .35rem; padding: .22rem .5rem; cursor: pointer; font-weight: 500; font-size: .82rem;
}
.lingue button[aria-pressed="true"] { background: var(--verde-scuro); color: #fff; border-color: var(--verde-scuro); }

.apri-menu {
  display: inline-grid; place-items: center;
  width: 2.6rem; height: 2.6rem; padding: 0; color: inherit;
  background: transparent; border: 1px solid var(--linea); border-radius: .4rem; cursor: pointer;
}
.apri-menu svg { width: 1.5rem; height: 1.5rem; fill: currentColor; display: block; }
.apri-menu .ico-chiudi { display: none; }
.apri-menu[aria-expanded="true"] .ico-menu { display: none; }
.apri-menu[aria-expanded="true"] .ico-chiudi { display: block; }

/* menu: pannello a tendina su mobile, barra su desktop.
 * Su mobile il pannello occupa una riga intera della testata (flex-basis 100%),
 * altrimenti resterebbe schiacciato a destra accanto all'hamburger (bug Safari iPhone). */
.nav { display: none; flex: 1 1 100%; }
.nav[data-aperto="1"] { display: block; }
.nav ul { list-style: none; margin: 0; padding: 0; }
.nav { background: var(--carta); border-top: 1px solid var(--linea); }
.nav > ul { max-width: 74rem; margin: 0 auto; padding: .4rem 1rem 1rem; }
.nav a { display: block; padding: .55rem .25rem; text-decoration: none; color: inherit; font-weight: 500; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--magenta); }
.nav .gruppo > button {
  display: flex; width: 100%; align-items: center; justify-content: space-between;
  background: none; border: 0; padding: .55rem .25rem; cursor: pointer; font-weight: 600; color: inherit;
}
.nav .gruppo > button::after { content: "▾"; font-size: .8em; transition: transform .2s; }
.nav .gruppo > button[aria-expanded="true"]::after { transform: rotate(180deg); }
.nav .gruppo > ul { display: none; border-left: 3px solid var(--verde-chiaro); margin: 0 0 .4rem .5rem; padding-left: .6rem; }
.nav .gruppo > button[aria-expanded="true"] + ul { display: block; }
.nav .gruppo > ul a { font-weight: 400; padding: .4rem .25rem; }

@media (min-width: 62rem) {
  .apri-menu { display: none; }
  .nav, .nav[data-aperto] { display: block; background: none; border: 0; }
  .testata-int { flex-wrap: wrap; }
  .nav { order: 5; flex: 0 0 auto; margin-left: auto; margin-right: .75rem; }
  .lingue { order: 6; }
  .nav > ul { display: flex; gap: .35rem; padding: 0; align-items: center; }
  .nav a { padding: .45rem .65rem; }
  .nav .gruppo { position: relative; }
  .nav .gruppo > button { padding: .45rem .65rem; gap: .35rem; }
  .nav .gruppo > ul {
    display: none; position: absolute; top: 100%; left: 0; min-width: 15rem;
    background: var(--carta); border: 1px solid var(--linea); border-radius: .5rem;
    box-shadow: var(--ombra); padding: .4rem; margin: 0; border-left: 1px solid var(--linea);
  }
  .nav .gruppo > button[aria-expanded="true"] + ul { display: block; }
  .nav .gruppo > ul a { padding: .4rem .6rem; border-radius: .3rem; }
  .nav .gruppo > ul a:hover { background: var(--beige); }
}

/* ---------- home «Orizzonte»: immersiva ---------- */
.home .testata { position: fixed; left: 0; right: 0; background: transparent; border-bottom: 0; color: #fff; transition: background .25s, color .25s; }
.home .testata a, .home .testata button { color: #fff; }
.home .testata .lingue button, .home .testata .apri-menu { border-color: rgba(255,255,255,.5); }
.home .testata .lingue button[aria-pressed="true"] { background: #fff; color: var(--verde-scuro); border-color: #fff; }
.home .testata .marchio small { color: rgba(255,255,255,.8); }
.home .testata.piena, .home .testata.menu-aperto { background: var(--verde-scuro); }
.home .nav { background: var(--verde-scuro); border-color: rgba(255,255,255,.2); }
.home .nav a, .home .nav .gruppo > button { color: #fff; }
.home .nav a:hover { color: var(--giallo); }
@media (min-width: 62rem) {
  .home .nav { background: none; }
  .home .nav .gruppo > ul { background: var(--verde-scuro); border-color: rgba(255,255,255,.2); }
  .home .nav .gruppo > ul a:hover { background: rgba(255,255,255,.12); color: #fff; }
}

.eroe {
  position: relative; min-height: 100vh; min-height: 100svh;
  display: grid; place-items: center; text-align: center; color: #fff;
  isolation: isolate; padding: calc(var(--header-h) + 2rem) 1rem 4rem;
}
.eroe > div { max-width: 100%; }
/* foto a rotazione: sovrapposte, si dissolve quella attiva */
.eroe .eroe-foto { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; opacity: 0; transition: opacity 1.2s ease; }
.eroe .eroe-foto.attiva { opacity: 1; }
.pallini { position: absolute; left: 50%; transform: translateX(-50%); bottom: 3.4rem; display: flex; gap: .65rem; z-index: 1; margin: 0; padding: 0; }
.pallino {
  width: .85rem; height: .85rem; border-radius: 50%; padding: 0; cursor: pointer;
  border: 2px solid #fff; background: transparent; box-shadow: 0 1px 6px rgba(0,0,0,.4);
}
.pallino[aria-pressed="true"] { background: #fff; }
@media (prefers-reduced-motion: reduce) { .eroe .eroe-foto { transition: none; } }
.eroe::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgba(20,32,18,.55) 0%, rgba(20,32,18,.15) 40%, rgba(20,32,18,.65) 100%);
}
.eroe img.stemma { width: clamp(4.5rem, 10vw, 6.5rem); margin: 0 auto 1rem; filter: drop-shadow(0 4px 14px rgba(0,0,0,.4)); }
.eroe h1 {
  margin: 0; font-weight: 200; letter-spacing: .04em;
  font-size: clamp(2.4rem, 8vw, 5rem); text-shadow: 0 2px 18px rgba(0,0,0,.45);
}
.eroe h1 b { font-weight: 600; }
.eroe .paesi { margin: .9rem 0 0; font-size: clamp(1rem, 2.5vw, 1.3rem); letter-spacing: .28em; text-transform: uppercase; font-weight: 300; text-shadow: 0 1px 10px rgba(0,0,0,.5); }
.eroe .giu {
  position: absolute; left: 50%; bottom: 1.4rem; transform: translateX(-50%);
  color: #fff; text-decoration: none; font-size: 1.6rem; line-height: 1;
  animation: giu 2s ease-in-out infinite;
}
@keyframes giu { 0%, 100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, .5rem); } }
@media (prefers-reduced-motion: reduce) { .eroe .giu { animation: none; } html { scroll-behavior: auto; } }

/* ---------- sezioni comuni ---------- */
.sezione { padding: 2.6rem 0; }
.sezione-int { max-width: 74rem; margin: 0 auto; padding: 0 1rem; }
.sezione h2 { font-size: clamp(1.5rem, 3.4vw, 2.1rem); margin: 0 0 .4rem; color: var(--verde-scuro); }
.sezione .occhiello { color: var(--magenta); text-transform: uppercase; letter-spacing: .18em; font-size: .8rem; font-weight: 600; margin: 0 0 .3rem; }
.sezione .sotto { color: var(--muted); margin: 0 0 1.6rem; max-width: 60ch; }
.sfondo-carta { background: var(--carta); }
.sfondo-verde { background: var(--verde-scuro); color: #fff; }
.sfondo-verde h2 { color: #fff; }
.sfondo-verde .sotto { color: var(--verde-chiaro); }

/* schede quartieri (home) */
.griglia-quartieri { display: grid; gap: 1rem; }
@media (min-width: 48rem) { .griglia-quartieri { grid-template-columns: repeat(3, 1fr); } }
.scheda-q {
  position: relative; display: block; border-radius: var(--raggio); overflow: hidden;
  text-decoration: none; color: #fff; min-height: 21rem; isolation: isolate;
  box-shadow: var(--ombra);
}
.scheda-q img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -1; transition: transform .4s ease; }
.scheda-q::after { content: ""; position: absolute; inset: 0; z-index: 0; background: linear-gradient(180deg, transparent 35%, rgba(16,24,14,.82) 100%); }
.scheda-q:hover img, .scheda-q:focus-visible img { transform: scale(1.05); }
.scheda-q .txt { position: absolute; left: 0; right: 0; bottom: 0; z-index: 1; padding: 1.1rem 1.2rem; }
.scheda-q .txt small { text-transform: uppercase; letter-spacing: .2em; font-size: .72rem; color: var(--giallo); }
.scheda-q .txt strong { display: block; font-size: 1.6rem; font-weight: 600; }
.scheda-q .txt span { font-size: .9rem; color: #e6e6dd; }

/* tessere paesaggi */
.griglia-paesaggi { display: grid; gap: .8rem; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 48rem) { .griglia-paesaggi { grid-template-columns: repeat(5, 1fr); } }
.tessera {
  position: relative; display: grid; place-items: center; text-align: center;
  border-radius: var(--raggio); overflow: hidden; min-height: 9.5rem;
  text-decoration: none; color: #fff; isolation: isolate; background: var(--verde-medio);
  box-shadow: 0 4px 14px rgba(32,40,46,.14);
}
.tessera img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -1; transition: transform .4s; }
.tessera::after { content: ""; position: absolute; inset: 0; z-index: 0; background: rgba(24, 40, 20, .38); }
.tessera:hover img, .tessera:focus-visible img { transform: scale(1.07); }
.tessera b { position: relative; z-index: 1; font-size: 1.15rem; font-weight: 600; text-shadow: 0 1px 8px rgba(0,0,0,.55); }

/* schede luoghi (griglie con foto) */
.griglia-luoghi { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); }
.scheda-l {
  background: var(--carta); border-radius: var(--raggio); overflow: hidden;
  text-decoration: none; color: inherit; border: 1px solid var(--linea);
  display: flex; flex-direction: column; transition: box-shadow .2s, transform .2s;
}
.scheda-l:hover, .scheda-l:focus-visible { box-shadow: var(--ombra); transform: translateY(-3px); }
.scheda-l .foto { aspect-ratio: 3 / 2; position: relative; width: 100%; flex: none; overflow: hidden; background: var(--verde-chiaro); display: grid; place-items: center; }
/* immagine posizionata in assoluto: su Safari iOS l'altezza 100% dentro un riquadro con aspect-ratio veniva calcolata male e la foto restava schiacciata in basso sul fondo verde (Stefy, 2026-09-19) */
.scheda-l .foto img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.scheda-l .foto svg { width: 2.6rem; height: 2.6rem; fill: var(--verde-medio); }
.scheda-l .txt { padding: .8rem .95rem 1rem; }
.scheda-l .txt b { font-weight: 600; }
.scheda-l .txt small { display: block; color: var(--muted); margin-top: .15rem; }
.scheda-l .presto { display: inline-block; margin-top: .4rem; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--magenta); border: 1px solid currentColor; border-radius: 2rem; padding: .1rem .55rem; }

.bottone {
  display: inline-block; background: var(--magenta); color: #fff; text-decoration: none;
  padding: .6rem 1.25rem; border-radius: 2rem; font-weight: 600; border: 0; cursor: pointer;
}
.bottone:hover { background: var(--magenta-scuro); color: #fff; }
.bottone.secondario { background: transparent; color: inherit; border: 1.5px solid currentColor; }
.bottone.secondario:hover { background: rgba(0,0,0,.06); }
.sfondo-verde .bottone.secondario:hover { background: rgba(255,255,255,.12); }

/* ---------- pagine interne ---------- */
.briciole { max-width: 74rem; margin: 0 auto; padding: .9rem 1rem 0; font-size: .85rem; color: var(--muted); }
.briciole ol { list-style: none; display: flex; flex-wrap: wrap; gap: .35rem; margin: 0; padding: 0; }
.briciole li + li::before { content: "›"; margin-right: .35rem; }
.briciole a { color: inherit; }

.intesta { max-width: 74rem; margin: 0 auto; padding: 1rem 1rem 0; }
.intesta h1 { font-size: clamp(1.7rem, 4.5vw, 2.7rem); color: var(--verde-scuro); margin: .2rem 0 .6rem; }
.intesta .occhiello { color: var(--magenta); text-transform: uppercase; letter-spacing: .18em; font-size: .8rem; font-weight: 600; margin: 0; }

.eroe-pagina { max-width: 74rem; margin: 1rem auto 0; padding: 0 1rem; }
.eroe-pagina img { border-radius: var(--raggio); width: 100%; aspect-ratio: 21 / 9; object-fit: cover; box-shadow: var(--ombra); }

.contenuto { max-width: 74rem; margin: 0 auto; padding: 1.4rem 1rem 2.5rem; }
.articolo { max-width: 46rem; }
.articolo p { margin: 0 0 1rem; }
.articolo h2 { color: var(--verde-scuro); margin: 1.8rem 0 .7rem; font-size: 1.45rem; }
.articolo h2:first-child { margin-top: 0; }

.galleria { display: grid; gap: .7rem; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); margin-top: 1.6rem; }
.galleria a { display: block; border-radius: .45rem; overflow: hidden; }
.galleria img { aspect-ratio: 4 / 3; object-fit: cover; width: 100%; transition: transform .3s; }
.galleria a:hover img { transform: scale(1.05); }

.riquadro {
  background: var(--verde-chiaro); border-radius: var(--raggio);
  padding: 1.1rem 1.2rem; margin-top: 1.8rem; max-width: 46rem;
}
.riquadro b { color: var(--verde-scuro); }
.riquadro p { margin: .3rem 0 0; }
.riquadro.lavori { background: #fdf3d7; }

/* ---------- pagina mappa ---------- */
.mappa-pagina .contenuto { padding-top: .8rem; }
.strumenti { display: flex; flex-wrap: wrap; gap: .5rem .9rem; align-items: center; padding: .6rem 0; }
.strumenti label.tog {
  display: inline-flex; align-items: center; gap: .35rem; padding: .3rem .6rem;
  border: 1px solid var(--linea); border-radius: .4rem; background: var(--carta); cursor: pointer; font-weight: 500;
}
.strumenti label.tog input { margin: 0; accent-color: var(--magenta); }
.strumenti .hint { font-size: .8rem; color: var(--muted); margin: 0; }
.mapwrap { position: relative; height: 62vh; min-height: 20rem; background: #e4e7d4; border-radius: var(--raggio); overflow: hidden; box-shadow: var(--ombra); }
#map { position: absolute; inset: 0; }
.activate {
  position: absolute; inset: 0; z-index: 5;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, var(--verde-chiaro), #cfe0ef);
  border: 0; cursor: default; padding: 1rem;
}
.mapwrap[data-errore="1"] .activate { cursor: pointer; }
.activate span {
  display: inline-block; padding: .8rem 1.3rem; border-radius: 2rem;
  background: var(--magenta); color: #fff; font-weight: 600; font-size: 1.05rem;
  box-shadow: 0 6px 20px rgba(0,0,0,.25);
}
.activate .riprova { display: none; }
.mapwrap[data-errore="1"] .activate .attesa { display: none; }
.mapwrap[data-errore="1"] .activate .riprova { display: inline-block; }
.mapwrap[data-active="1"] .activate { display: none; }
@media (min-width: 48rem) { .mapwrap { height: 70vh; min-height: 28rem; } }

.poi { display: flex; flex-direction: column; align-items: center; gap: .1rem; text-decoration: none; cursor: pointer; width: max-content; }
.poi .ico {
  width: 2rem; height: 2rem; border-radius: 50%;
  background: var(--magenta); color: #fff; display: grid; place-items: center;
  box-shadow: 0 2px 6px rgba(0,0,0,.35); border: 2px solid #fff; transition: transform .12s ease;
}
.poi .ico svg { width: 1.15rem; height: 1.15rem; fill: currentColor; }
.poi:hover .ico, .poi:focus-visible .ico { transform: scale(1.15); }
.poi .lbl {
  font-size: .78rem; font-weight: 500; color: var(--ink); background: rgba(255,255,255,.9);
  padding: .05rem .35rem; border-radius: .25rem; white-space: nowrap; max-width: 11rem; overflow: hidden; text-overflow: ellipsis;
}
.poi.dubbio .ico { background: #b36b00; }
.mapwrap[data-zoom="low"] .poi .lbl { display: none; }
.badge {
  display: grid; place-items: center; width: 1.7rem; height: 1.7rem; border-radius: 50%;
  background: #fff; color: var(--magenta); border: 2.5px solid var(--magenta);
  font-weight: 700; font-size: .9rem; box-shadow: 0 2px 6px rgba(0,0,0,.3);
  text-decoration: none; cursor: pointer;
}
a.badge:hover, a.badge:focus-visible { transform: scale(1.15); }
a.badge:hover::after, a.badge:focus-visible::after { content: attr(title); position: absolute; left: 50%; transform: translate(-50%, 1.6rem); white-space: nowrap; font-size: .75rem; color: #222; background: #fff; padding: .1rem .5rem; border-radius: .3rem; box-shadow: 0 1px 4px rgba(0,0,0,.3); }
.badge-titolo { display: inline-grid; vertical-align: middle; margin-right: .4rem; box-shadow: none; }
.mappa-sentiero { height: 55vh; min-height: 18rem; margin: 0 0 .4rem; }
.dati-sentiero { margin: 0 0 1rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: .4rem 1.4rem; }
.diff { display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .04em; padding: .1rem .45rem; border-radius: .3rem; border: 1.5px solid currentColor; line-height: 1.3; vertical-align: middle; }
.diff-T { color: #2e8b3a; } .diff-E { color: #b8860b; } .diff-EE { color: #d9531e; } .diff-EEA { color: #b3001b; }
.legenda-diff { list-style: none; padding: 0; margin: 0 0 1rem; }
.legenda-diff li { margin: .3rem 0; }
.dati-sentiero b { color: var(--ink); font-weight: 600; margin-right: .3rem; }
.contenuto > .hint { font-size: .8rem; color: var(--muted); margin: 0 0 1.6rem; }
/* pagina del sentiero: partenza/arrivo (colore del sentiero in --c) e puntino che segue il profilo altimetrico */
.capo { display: flex; flex-direction: column; align-items: center; gap: .1rem; width: max-content; pointer-events: none; }
.capo .ico {
  width: 1.5rem; height: 1.5rem; border-radius: 50%; background: #fff; color: var(--c, var(--magenta));
  border: 2.5px solid var(--c, var(--magenta)); display: grid; place-items: center; box-shadow: 0 2px 6px rgba(0,0,0,.3);
}
.capo .ico svg { width: .95rem; height: .95rem; fill: currentColor; }
.capo .lbl { font-size: .72rem; font-weight: 600; color: var(--ink); background: rgba(255,255,255,.9); padding: .02rem .35rem; border-radius: .25rem; white-space: nowrap; }
.segno {
  width: .9rem; height: .9rem; border-radius: 50%; background: var(--c, var(--magenta)); border: 2.5px solid #fff;
  box-shadow: 0 0 0 2px var(--c, var(--magenta)), 0 2px 6px rgba(0,0,0,.35); pointer-events: none;
}
/* riquadro del sentiero dentro la pagina di un luogo (luogo(..., sentiero=N)) */
.scheda-sentiero { margin: 0 0 1.8rem; }
.scheda-sentiero .riquadro { margin-bottom: .8rem; }
.scheda-sentiero .riquadro .dati-sentiero { margin-top: .5rem; }
.scheda-sentiero .profilo { margin-bottom: 0; }
/* profilo altimetrico (js/profilo.js) */
.profilo { margin: 0 0 1.6rem; }
.profilo[hidden] { display: none; }
.profilo figcaption { font-size: .95rem; font-weight: 600; color: var(--verde-scuro); margin: 0 0 .4rem; }
.profilo figcaption small { display: block; font-weight: 400; font-size: .78rem; color: var(--muted); }
.profilo-grafico { background: var(--carta); border: 1px solid var(--linea); border-radius: var(--raggio); padding: .4rem .3rem 0; overflow: hidden; }
.profilo-grafico svg { display: block; width: 100%; height: auto; touch-action: pan-y; font-family: inherit; cursor: crosshair; }
.profilo-grafico .griglia { stroke: var(--linea); stroke-width: 1; }
.profilo-grafico .asse { fill: var(--muted); font-size: 11px; }
.profilo-grafico .cursore line { stroke: var(--ink); stroke-width: 1; stroke-dasharray: 3 2; }
.profilo-grafico .cursore circle { fill: #fff; stroke-width: 2.5; }
.profilo-grafico .cursore rect { fill: #fff; stroke: var(--linea); }
.profilo-grafico .cursore text { fill: var(--ink); font-size: 12px; font-weight: 600; }
.legenda li .colore { display: inline-block; width: 1.4rem; height: .35rem; border-radius: .2rem; margin-left: .45rem; vertical-align: middle; }
.srv {
  width: 1.45rem; height: 1.45rem; border-radius: .3rem; background: #2b2b2b; color: #fff;
  display: grid; place-items: center; border: 1.5px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.35);
  pointer-events: none;
}
.srv svg { width: .95rem; height: .95rem; fill: currentColor; }
.srv.bus { background: #1c5fa8; }
.srv.treno { background: #b3001b; }
.srv.parcheggio { background: #1f6fb2; }
.srv.defibrillatore { background: #0f8a3c; }
.srv.wc { background: #6d4c9f; }
/* punto su cui la mappa è stata aperta (?p=slug dal link "Apri la mappa con questo luogo") */
.poi.focus .ico { transform: scale(1.25); box-shadow: 0 0 0 5px rgba(212,21,123,.35), 0 2px 6px rgba(0,0,0,.35); }
.link-esterno { margin: 1rem 0 0; }
.articolo h3 { color: var(--verde-scuro); font-size: 1.1rem; margin: 1.3rem 0 .4rem; }
.mapwrap[data-servizi="0"] .srv { display: none; }
.maplibregl-cooperative-gesture-screen { font-family: inherit; font-size: 1rem; }
.maplibregl-ctrl button.vm-3d { font-family: inherit; font-weight: 700; font-size: .78rem; color: var(--ink); }
.maplibregl-ctrl button.vm-3d[aria-pressed="true"] { background: var(--magenta); color: #fff; }
.legenda { margin-top: 1.4rem; }
.legenda h2 { font-size: 1.05rem; color: var(--verde-scuro); margin: 0 0 .5rem; }
.legenda ol { margin: 0 0 1rem; padding-left: 1.25rem; }
.legenda li { margin: .2rem 0; }
.legenda .note { font-size: .82rem; color: var(--muted); }
.legenda .tempo { font-size: .8rem; color: var(--muted); white-space: nowrap; }
.legenda ul.poi-elenco { margin: 0 0 1rem; padding-left: 1.1rem; }
.crediti-mappa { font-size: .75rem; color: var(--muted); margin-top: 1rem; }
@media (min-width: 48rem) { .legenda { display: grid; grid-template-columns: 1fr 1fr; gap: 0 2rem; } }

/* ---------- lightbox foto (galleria.js) ---------- */
.lucebox {
  position: fixed; inset: 0; z-index: 100;
  display: none; align-items: center; justify-content: center;
  background: rgba(14, 20, 11, .93);
}
.lucebox.aperta { display: flex; }
html.con-lucebox, html.con-lucebox body { overflow: hidden; }
.lucebox img {
  max-width: calc(100vw - 1.5rem); max-height: calc(100vh - 6.5rem); max-height: calc(100svh - 6.5rem);
  width: auto; height: auto; border-radius: .4rem; box-shadow: 0 12px 40px rgba(0,0,0,.6);
}
.lucebox button {
  position: absolute; z-index: 1; cursor: pointer;
  width: 2.9rem; height: 2.9rem; border-radius: 50%; border: 0;
  background: rgba(255,255,255,.14); color: #fff; font-size: 1.5rem; line-height: 1;
  display: grid; place-items: center;
}
.lucebox button:hover, .lucebox button:focus-visible { background: var(--magenta); }
.lb-chiudi { top: .8rem; right: .8rem; font-size: 1.15rem; }
.lb-prev { left: .6rem; top: 50%; transform: translateY(-50%); }
.lb-next { right: .6rem; top: 50%; transform: translateY(-50%); }
.lb-prev, .lb-next { font-size: 2rem; padding-bottom: .25rem; }
.lb-conta {
  position: absolute; bottom: .9rem; left: 50%; transform: translateX(-50%);
  color: #fff; font-size: .9rem; letter-spacing: .08em;
  background: rgba(0,0,0,.35); padding: .2rem .7rem; border-radius: 1rem;
}
@media (min-width: 48rem) {
  .lucebox img { max-width: calc(100vw - 9rem); }
  .lb-prev { left: 1.2rem; }
  .lb-next { right: 1.2rem; }
}

/* ---------- piè di pagina ---------- */
.pie { background: var(--verde-scuro); color: #dfe8d5; margin-top: 3rem; }
.mappa-pagina .pie, .home .pie { margin-top: 0; }
.pie-int { max-width: 74rem; margin: 0 auto; padding: 2rem 1rem 2.4rem; display: grid; grid-template-columns: auto 1fr auto; gap: 1rem 1.4rem; align-items: center; }
.pie-nome { justify-self: start; }
.pie img { width: 3rem; background: #fff; padding: .35rem .45rem; border-radius: .45rem; }
.pie b { color: #fff; font-weight: 600; letter-spacing: .02em; }
.pie-link { display: flex; flex-direction: column; align-items: flex-end; gap: .35rem; font-size: .92rem; justify-self: end; }
.pie .pie-link a { color: #fff; text-decoration: none; border-bottom: 1px solid rgba(255,255,255,.4); }
.pie .pie-link a:hover { border-color: #fff; }
@media (max-width: 40rem) { .pie-int { grid-template-columns: auto 1fr; } .pie-link { grid-column: 1 / -1; align-items: flex-start; justify-self: start; } }
.crediti { list-style: none; padding: 0; margin: 0 0 1.6rem; }
.crediti li { padding: .3rem 0; border-bottom: 1px solid var(--linea); }
.crediti-pagina h2 { margin-top: 1.6rem; }
.pie small { display: block; font-size: .78rem; margin-top: .2rem; }
