/* =========================================================
   Capua Turismo — foglio di stile
   Basato sulle linee guida Designers Italia (PA)
   Indice:
   1. Token  2. Base  3. Utility  4. Header  5. Hero
   6. Sezioni e card  7. Mappa  8. Pagina Attività
   9. Scheda (dialog)  10. Footer  11. Modalità totem
   12. Responsive  13. Riduzione movimento / stampa
   ========================================================= */

/* 1. TOKEN ------------------------------------------------ */
:root {
  --c-primary: #126D49;         /* verde del logo del Comune */
  --c-primary-700: #0E5B3D;
  --c-primary-800: #0B4A32;
  --c-primary-900: #07301F;
  --c-primary-50: #EDF5F0;
  --c-primary-100: #D5E8DD;
  --c-accent: #8C6B36;          /* oro / tufo, 5:1 su bianco */
  --c-accent-50: #F7F1E6;

  --c-text: #17221D;
  --c-text-2: #56635C;          /* 6.3:1 su bianco */
  --c-border: #DCE3DF;
  --c-border-strong: #78867F;   /* 3,8:1 su bianco: bordi dei controlli (WCAG 1.4.11) */
  --c-surface: #FFFFFF;
  --c-bg-alt: #F5F6F2;

  --c-success: #00703E;
  --c-success-50: #E6F4EC;
  --c-danger: #B71918;
  --c-danger-50: #FBEAEA;
  --c-focus: #FFB400;

  --font: "Roboto", "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  --fs-base: 1.125rem;          /* 18px */
  --fs-sm: 1rem;
  --fs-xs: .875rem;
  /* scala tipografica: un solo carattere (Roboto) per tutto il sito */
  --fs-h1: clamp(2.25rem, 1.6rem + 2.2vw, 3.25rem);
  --fs-h2: clamp(1.75rem, 1.4rem + 1.2vw, 2.375rem);
  --fs-h3: 1.375rem;            /* titoli delle card */
  --fs-h4: 1.125rem;
  --fs-caps: .8125rem;          /* etichette in maiuscolo */
  --ls-caps: .08em;
  --ls-tight: -.015em;

  --sp-1: .25rem; --sp-2: .5rem; --sp-3: .75rem; --sp-4: 1rem;
  --sp-5: 1.5rem; --sp-6: 2rem; --sp-7: 3rem; --sp-8: 4rem;

  --radius: 8px;
  --radius-lg: 14px;
  --shadow-1: 0 1px 2px rgba(7, 48, 31, .05), 0 6px 20px -8px rgba(7, 48, 31, .14);
  --shadow-2: 0 2px 4px rgba(7, 48, 31, .05), 0 18px 40px -16px rgba(7, 48, 31, .28);

  --container: 1440px;
  --header-h: 0px;
  --touch: 44px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --dur: 200ms;

  --z-map: 1; --z-sticky: 20; --z-drawer: 40; --z-header: 50; --z-totem: 60;
}

/* 2. BASE ------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--fs-base);
  line-height: 1.55;
  color: var(--c-text);
  background: var(--c-surface);
  -webkit-font-smoothing: antialiased;
  touch-action: manipulation;
}
img, svg { display: block; max-width: 100%; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 var(--sp-3); font-weight: 600; color: var(--c-primary-900); letter-spacing: var(--ls-tight); }
h1 { font-weight: 600; font-size: var(--fs-h1); line-height: 1.05; letter-spacing: -.02em; }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }
h4 { font-size: var(--fs-h4); }
/* etichetta in maiuscolo: un solo stile in tutto il sito */
.eyebrow, .tile__cat, .fbtn__k, .fpanel__title, .brand__sub, .hero__kicker, .popup__cat, .footer h2 {
  font-size: var(--fs-caps); font-weight: 600; letter-spacing: var(--ls-caps); text-transform: uppercase; line-height: 1.3;
}
p { margin: 0 0 var(--sp-4); }
a { color: var(--c-primary); text-underline-offset: .18em; }
a:hover { color: var(--c-primary-700); }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
ul { margin: 0; padding: 0; }

:focus-visible {
  outline: 3px solid var(--c-focus);
  outline-offset: 2px;
  box-shadow: 0 0 0 5px var(--c-primary-900);
  border-radius: 2px;
}

.icon { width: 1.25em; height: 1.25em; flex: none; }
.icon--sm { width: 1em; height: 1em; }
.icon--lg { width: 1.75rem; height: 1.75rem; }

/* 3. UTILITY ---------------------------------------------- */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--sp-4); }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skiplinks a {
  position: absolute; left: var(--sp-2); top: -100px; z-index: 100;
  background: var(--c-focus); color: var(--c-primary-900); padding: var(--sp-2) var(--sp-4);
  font-weight: 600; border-radius: var(--radius);
}
.skiplinks a:focus { top: var(--sp-2); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  min-height: var(--touch); padding: .5rem 1.25rem;
  border: 1.5px solid transparent; border-radius: 999px;
  font-weight: 500; font-size: var(--fs-sm); text-decoration: none; line-height: 1.2;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.btn--primary { background: var(--c-primary); color: #fff; }
.btn--primary:hover { background: var(--c-primary-700); color: #fff; }
.btn--outline { background: transparent; border-color: var(--c-primary); color: var(--c-primary); }
.btn--outline:hover { background: var(--c-primary-50); color: var(--c-primary-700); }
.btn--ghost { background: transparent; color: var(--c-primary); padding-inline: .75rem; }
.btn--ghost:hover { background: var(--c-primary-50); }
.btn--white { background: #fff; color: var(--c-primary-800); }
.btn--white:hover { background: var(--c-primary-50); color: var(--c-primary-900); }
.btn--block { width: 100%; }
.btn:active { transform: scale(.98); }

.badge {
  display: inline-flex; align-items: center; gap: .35em;
  font-size: var(--fs-xs); font-weight: 500; line-height: 1.2;
  padding: .3em .6em; border-radius: 999px;
  background: var(--c-bg-alt); color: var(--c-text-2);
}

/* 4. HEADER ----------------------------------------------- */
.header { position: relative; z-index: var(--z-header); }
.header-slim { background: var(--c-primary-900); color: #fff; font-size: var(--fs-xs); }
.header-slim .container { display: flex; align-items: center; justify-content: space-between; min-height: 48px; gap: var(--sp-4); }
.header-slim a { color: #fff; text-decoration: none; font-weight: 500; display: inline-flex; align-items: center; gap: .4em; min-height: var(--touch); }
.header-slim a:hover { text-decoration: underline; }
.lang { display: flex; gap: var(--sp-1); list-style: none; }
.lang a { padding-inline: .6em; border-radius: var(--radius); }
.lang a[aria-current="true"] { background: rgba(255,255,255,.16); }

.header-center { background: #fff; color: var(--c-text); border-bottom: 1px solid var(--c-border); }
.header-center .container { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4); padding-block: var(--sp-4); }
.brand { display: flex; align-items: center; gap: var(--sp-4); color: var(--c-primary-900); text-decoration: none; }
.brand:hover { color: var(--c-primary-900); }
.brand__logo { height: 72px; width: auto; }
.brand__comune { display: flex; flex-direction: column; line-height: 1.1; }
.brand__comune strong { font-size: 1.5rem; font-weight: 600; color: var(--c-primary); letter-spacing: var(--ls-tight); }
.brand__comune small { font-size: var(--fs-xs); color: var(--c-text-2); margin-top: .25em; }
.brand__sep { width: 1px; align-self: stretch; margin-block: var(--sp-2); background: var(--c-border); }
.brand__text { display: flex; flex-direction: column; line-height: 1.15; }
.brand__title { font-size: 1.625rem; font-weight: 600; color: var(--c-primary); line-height: 1; letter-spacing: var(--ls-tight); }
.brand__sub { color: var(--c-text-2); margin-top: .3em; }


/* menu: logo a sinistra, voci a destra sulla stessa riga */
.header-menu { margin-left: auto; }
.nav-list { display: flex; align-items: center; gap: var(--sp-1) var(--sp-5); list-style: none; }
.nav-list a {
  position: relative; display: inline-flex; align-items: center; min-height: 48px; padding: 0 .25rem;
  color: var(--c-primary-900); text-decoration: none; font-weight: 600; font-size: var(--fs-base);
  transition: color var(--dur) var(--ease);
}
.nav-list a::after {
  content: ""; position: absolute; left: .25rem; right: .25rem; bottom: 6px; height: 2px; border-radius: 2px;
  background: currentColor; transform: scaleX(0); transform-origin: left; transition: transform var(--dur) var(--ease);
}
.nav-list a:hover { color: var(--c-primary); }
.nav-list a:hover::after, .nav-list a[aria-current="page"]::after { transform: scaleX(1); }
.nav-list a[aria-current="page"] { color: var(--c-primary); }
.nav-long { margin-left: .28em; }

/* breadcrumb */
.breadcrumb { font-size: var(--fs-sm); }
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); padding: 0; margin: 0; }
.breadcrumb li { display: flex; align-items: center; gap: var(--sp-2); color: var(--c-text-2); }
.breadcrumb li + li::before { content: ""; width: 6px; height: 6px; border-top: 1.5px solid var(--c-border-strong); border-right: 1.5px solid var(--c-border-strong); rotate: 45deg; }
.breadcrumb a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 500; color: var(--c-primary); text-underline-offset: .2em; }
.breadcrumb [aria-current="page"] { color: var(--c-text); font-weight: 500; }

/* 5. HERO ------------------------------------------------- */
.hero {
  position: relative; isolation: isolate; overflow: hidden;
  display: grid; place-items: center; text-align: center;
  min-height: clamp(440px, 64vh, 720px); padding: var(--sp-8) var(--sp-4);
  grid-template-columns: minmax(0, 1fr);
  background: var(--c-primary-900); color: #fff;
}
.hero__media, .hero__media img { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero__media { z-index: -2; }
.hero__media img { object-fit: cover; object-position: center 60%; }
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(ellipse 65% 55% at 50% 50%, rgba(4, 30, 19, .45), rgba(4, 30, 19, .12) 70%),
    linear-gradient(to bottom, rgba(4, 30, 19, .30), rgba(4, 30, 19, .05) 40%, rgba(4, 30, 19, .70));
}
.hero__content { display: flex; flex-direction: column; align-items: center; gap: var(--sp-4); width: 100%; min-width: 0; }
.hero__kicker {
  padding: .35em 1em; border: 1px solid rgba(255,255,255,.6); border-radius: 999px;
}
.hero h1 {
  margin: 0; color: #fff;
  font-size: clamp(3.25rem, 1.2rem + 8vw, 8rem); line-height: .95;
  text-shadow: 0 2px 30px rgba(4, 30, 19, .45);
}
.hero__lead { margin: 0; font-size: clamp(1.125rem, 1rem + .6vw, 1.5rem); font-weight: 400; text-shadow: 0 1px 12px rgba(4, 30, 19, .5); }
.hero__lead::before { content: ""; display: block; width: 48px; height: 1px; margin: 0 auto var(--sp-4); background: rgba(255,255,255,.7); }

.input {
  width: 100%; min-height: 52px; padding: .6rem 1rem;
  border: 2px solid var(--c-border-strong); border-radius: var(--radius); background: #fff;
  font-size: var(--fs-base);
}
.input:hover { border-color: var(--c-primary-700); }
.input:focus-visible { border-color: var(--c-primary); }
.input-icon { position: relative; flex: 1; }
.input-icon .icon { position: absolute; left: .9rem; top: 50%; transform: translateY(-50%); color: var(--c-text-2); pointer-events: none; }
.input-icon .input { padding-left: 2.75rem; }

/* 6. SEZIONI E CARD --------------------------------------- */
.section { padding-block: var(--sp-8); }
.section--alt { background: var(--c-bg-alt); }
.section__head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--sp-4); margin-bottom: var(--sp-6); }
.section__head p { margin: 0; color: var(--c-text-2); max-width: 60ch; }
.section__head h2 { margin-bottom: var(--sp-2); }

/* categorie */
.cat-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: var(--sp-4); list-style: none; }
.cat-tile {
  height: 100%; display: flex; flex-direction: column; align-items: flex-start; gap: var(--sp-3);
  padding: var(--sp-5); border-radius: var(--radius-lg); background: #fff;
  border: 1px solid var(--c-border); text-decoration: none; color: var(--c-text);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.cat-tile:hover { border-color: var(--c-primary-100); box-shadow: var(--shadow-2); color: var(--c-text); transform: translateY(-2px); }
.cat-tile__icon { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: var(--c-primary-50); color: var(--c-primary); transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease); }
.cat-tile:hover .cat-tile__icon { background: var(--c-primary); color: #fff; }
.cat-tile__label { font-weight: 500; font-size: var(--fs-base); line-height: 1.25; color: var(--c-primary-900); }
.cat-tile__count { margin-top: auto; font-size: var(--fs-xs); color: var(--c-text-2); display: inline-flex; align-items: center; gap: .3em; }

/* stato apertura */
.status { font-weight: 500; }
.status--open { color: var(--c-success); }
.status--closed { color: var(--c-danger); }

/* home, in evidenza: griglia di card con icona (stessa card della pagina Attività) */
.tile-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-4); list-style: none; }
.tile-grid > li { display: flex; }
.tile-grid > li > .rcard { flex: 1; }
.tile__cat { color: var(--c-accent); }

/* home: mappa */
.section--map { padding-bottom: 0; }
.home-map { height: 560px; }
.home-map .map { height: 100%; border-radius: 0; border: 0; border-top: 1px solid var(--c-border); }


/* info utili */
.info-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-4); list-style: none; }
.info-card { display: flex; gap: var(--sp-4); align-items: flex-start; padding: var(--sp-5); background: #fff; border-radius: var(--radius-lg); box-shadow: var(--shadow-1); height: 100%; }
.info-card__icon { width: 48px; height: 48px; border-radius: 50%; background: var(--c-primary-50); color: var(--c-primary); display: grid; place-items: center; flex: none; }
.info-card h3 { font-size: var(--fs-h4); margin-bottom: var(--sp-1); }
.info-card p { margin: 0; color: var(--c-text-2); font-size: var(--fs-sm); }

.cta-band { background: var(--c-primary-900) radial-gradient(ellipse at 100% 0%, rgba(176, 138, 78, .3), transparent 55%); color: #fff; border-radius: var(--radius-lg); padding: var(--sp-7) var(--sp-6); display: flex; flex-wrap: wrap; gap: var(--sp-4); align-items: center; justify-content: space-between; margin-top: var(--sp-6); }
.cta-band h3 { color: #fff; margin: 0 0 var(--sp-1); font-size: var(--fs-h2); }
.cta-band p { margin: 0; opacity: .95; }

/* 7. MAPPA ------------------------------------------------ */
.map {
  position: relative; z-index: var(--z-map); width: 100%; height: 100%; min-height: 360px;
  border-radius: var(--radius-lg); border: 1px solid var(--c-border); background: var(--c-primary-50);
  overflow: hidden;
}
.map-hint { position: absolute; z-index: 500; left: 50%; bottom: var(--sp-4); transform: translateX(-50%);
  background: rgba(0, 38, 77, .88); color: #fff; font-size: var(--fs-xs); padding: .35rem .8rem; border-radius: 999px; pointer-events: none;
  opacity: 0; transition: opacity var(--dur) var(--ease); }
.map-hint.is-visible { opacity: 1; }

.pin-wrap { background: none; border: 0; }
.cluster-wrap { background: none; border: 0; }
.cluster {
  display: grid; place-items: center; width: var(--s); height: var(--s); border-radius: 50%;
  background: var(--c-primary); color: #fff; font-weight: 600; font-size: .9375rem; font-variant-numeric: tabular-nums;
  box-shadow: 0 0 0 5px rgba(18, 109, 73, .25), 0 3px 8px rgba(4, 30, 19, .35); border: 2px solid #fff;
  transition: transform var(--dur) var(--ease);
}
.cluster-wrap:hover .cluster { transform: scale(1.08); }
.map-tiles { filter: saturate(.55) contrast(.95) brightness(1.02); }
.pin {
  --c: var(--c-primary);
  position: relative; display: grid; place-items: center; width: 40px; height: 40px;
  background: var(--c); color: #fff; border: 3px solid #fff; border-radius: 50% 50% 50% 4px;
  transform: rotate(-45deg); box-shadow: 0 2px 6px rgba(0,0,0,.35);
  transition: transform var(--dur) var(--ease);
}
.pin .icon { transform: rotate(45deg); width: 20px; height: 20px; }
.leaflet-marker-icon:focus-visible { outline: none; box-shadow: none; }
.leaflet-marker-icon:focus-visible .pin,
.pin-wrap.is-active .pin { transform: rotate(-45deg) scale(1.25); box-shadow: 0 0 0 4px var(--c-focus), 0 4px 10px rgba(0,0,0,.4); }

.leaflet-container { font-family: var(--font); font-size: var(--fs-sm); }
.leaflet-container .leaflet-control-attribution a { color: var(--c-primary-800); }
.leaflet-container a.leaflet-popup-close-button { width: 36px; height: 36px; font-size: 24px; line-height: 34px; color: var(--c-text-2); }
.leaflet-popup-content-wrapper { border-radius: var(--radius-lg); box-shadow: var(--shadow-2); }
.leaflet-popup-content { margin: var(--sp-4) var(--sp-5) var(--sp-4) var(--sp-4); min-width: 220px; line-height: 1.45; }
.popup__cat { display: inline-flex; align-items: center; gap: .35em; color: var(--c); }
.popup__title { font-size: 1.125rem; font-weight: 600; margin: .2rem 0 .3rem; color: var(--c-primary-900); }
.popup__line { margin: 0 0 .25rem; color: var(--c-text-2); font-size: .9375rem; }
.popup__actions { display: flex; gap: var(--sp-2); margin-top: var(--sp-3); }
.popup__actions .btn { min-height: 44px; padding: .4rem 1.1rem; font-size: .9375rem; }
.leaflet-container a.btn--primary, .leaflet-container a.btn--primary:hover { color: #fff; }
.leaflet-container a.btn--outline { color: var(--c-primary); }
.leaflet-container a.btn--outline:hover { color: var(--c-primary-800); }
.leaflet-control-zoom a { width: 40px !important; height: 40px !important; line-height: 40px !important; font-size: 20px !important; }

/* 8. PAGINA ATTIVITÀ (lista + mappa a tutto schermo) ------ */
.explore-head {
  position: sticky; top: 0; z-index: 30; background: rgba(255,255,255,.97);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--c-border);
  /* i filtri si allineano ai bordi del contenitore della navbar (logo ↔ pulsante) */
  --edge: max(var(--sp-4), calc((100% - var(--container)) / 2 + var(--sp-4)));
}
.explore-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-3);
  padding: var(--sp-3) var(--edge); border-bottom: 1px solid var(--c-border);
}

/* pulsanti filtro e menu a tendina */
.fdrop { position: relative; }
.fbtn {
  display: inline-flex; align-items: center; gap: .55em; min-height: 48px; padding: 0 1rem;
  border: 1px solid var(--c-border-strong); border-radius: 10px; background: #fff; color: var(--c-primary-900);
  font-size: var(--fs-sm); font-weight: 500; white-space: nowrap;
  transition: border-color var(--dur) var(--ease), background-color var(--dur) var(--ease);
}
.fbtn:hover { border-color: var(--c-primary); }
.fbtn > .icon:first-child { color: var(--c-primary); }
.fbtn__k { font-size: .75rem; color: var(--c-text-2); }
.fbtn__chev { transform: rotate(90deg); color: var(--c-text-2); transition: transform var(--dur) var(--ease); }
.fbtn[aria-expanded="true"] { border-color: var(--c-primary); box-shadow: 0 0 0 3px var(--c-primary-50); }
.fbtn[aria-expanded="true"] .fbtn__chev { transform: rotate(-90deg); }
.fbtn__dot { width: .6em; height: .6em; border-radius: 50%; border: 2px solid var(--c-success); }
.fbtn--toggle[aria-pressed="true"] { background: var(--c-primary-900); border-color: var(--c-primary-900); color: #fff; }
.fbtn--toggle[aria-pressed="true"] .fbtn__dot { background: #6FD49B; border-color: #6FD49B; }
.fpanel {
  position: absolute; z-index: 40; top: calc(100% + 8px); left: 0; translate: var(--shift, 0) 0;
  width: max-content; min-width: 280px; max-width: calc(100vw - 24px);
  padding: var(--sp-4) var(--sp-5); background: #fff; border: 1px solid var(--c-border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-2);
}
.fpanel--end { left: auto; right: 0; }
.fpanel fieldset { border: 0; margin: 0; padding: 0; }
.fpanel__title { padding: 0; margin-bottom: var(--sp-2); color: var(--c-text-2); }
.fpanel__foot { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4); margin-top: var(--sp-3); padding-top: var(--sp-3); border-top: 1px solid var(--c-border); }

.check { display: flex; align-items: center; gap: var(--sp-3); min-height: var(--touch); padding: .2rem .5rem; margin-inline: -.5rem; border-radius: var(--radius); cursor: pointer; font-size: var(--fs-sm); }
.check:hover { background: var(--c-bg-alt); }
.check input { width: 22px; height: 22px; margin: 0; accent-color: var(--c-primary); flex: none; cursor: pointer; }
.check__icon { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.check__icon--plain { background: var(--c-primary-50); color: var(--c-primary); }
.check__icon .icon { width: 17px; height: 17px; }
.check__label { flex: 1; }
.check__count { font-size: var(--fs-xs); color: var(--c-text-2); font-variant-numeric: tabular-nums; }

/* switch mostra/nascondi mappa (desktop e totem) */
.map-switch {
  display: inline-flex; align-items: center; gap: .65em; min-height: 48px; padding: 0 .25rem 0 .5rem;
  border: 0; background: none; color: var(--c-primary-900); font-size: var(--fs-sm); font-weight: 500; white-space: nowrap;
}
.map-switch__track {
  position: relative; width: 46px; height: 28px; flex: none; border-radius: 999px;
  background: var(--c-border-strong); transition: background-color var(--dur) var(--ease);
}
.map-switch__track::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(4, 30, 19, .3); transition: transform var(--dur) var(--ease);
}
.map-switch[aria-checked="true"] .map-switch__track { background: var(--c-primary); }
.map-switch[aria-checked="true"] .map-switch__track::after { transform: translateX(18px); }
.map-switch:hover .map-switch__track { box-shadow: 0 0 0 4px var(--c-primary-50); }
.map-switch { margin-left: auto; }
.explore-bar__sep { width: 1px; height: 28px; background: var(--c-border); }

@media (min-width: 992px) {
  .explore[data-map="off"] { grid-template-columns: 1fr; }
  .explore[data-map="off"] .explore__map { display: none; }
  .explore[data-map="off"] .explore__list { padding-inline: max(var(--sp-4), calc((100% - var(--container)) / 2 + var(--sp-4))); }
  .explore[data-map="off"] .rlist { grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); }
}

/* chip categorie */
.cat-chips {
  display: flex; justify-content: space-between; gap: var(--sp-2); padding: var(--sp-3) var(--edge);
  overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.cat-chips::-webkit-scrollbar { display: none; }
.cchip {
  flex: none; display: inline-flex; align-items: center; gap: .5em; min-height: 44px; padding: 0 1.1rem;
  border: 1px solid var(--c-border-strong); border-radius: 999px; background: #fff; color: var(--c-primary-900);
  font-size: var(--fs-sm); font-weight: 500; white-space: nowrap;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.cchip .icon { color: var(--c-primary); }
.cchip:hover { border-color: var(--c-primary); }
.cchip__n { font-size: .8em; font-weight: 500; color: var(--c-text-2); font-variant-numeric: tabular-nums; }
.cchip[aria-pressed="true"] { background: var(--c-primary-900); border-color: var(--c-primary-900); color: #fff; }
.cchip[aria-pressed="true"] .icon, .cchip[aria-pressed="true"] .cchip__n { color: rgba(255,255,255,.85); }

/* split: lista a sinistra, mappa fissa a destra */
.explore { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); background: var(--c-bg-alt); }
.explore-page { --edge-v: max(var(--sp-4), calc((100vw - var(--container)) / 2 + var(--sp-4))); }
.explore__list { padding: var(--sp-3) var(--sp-6) var(--sp-8) var(--edge-v); min-width: 0; }
.explore__intro { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-3); margin-bottom: var(--sp-4); }
.page-head { background: #fff; border-bottom: 1px solid var(--c-border); padding-block: var(--sp-3) var(--sp-4); }
.page-head .cat-chips { padding: var(--sp-3) 0 var(--sp-1); }
.page-head .breadcrumb { font-size: var(--fs-xs); }
.page-head .breadcrumb a { min-height: 32px; }
.is-totem .page-head .breadcrumb { font-size: var(--fs-sm); }
.is-totem .page-head .breadcrumb a { min-height: 44px; }
.page-head h1 { margin: var(--sp-1) 0 0; font-size: var(--fs-h2); }
.results-count { display: inline-flex; align-items: center; min-height: 36px; margin: 0; font-size: var(--fs-xs); font-weight: 500; line-height: 1; color: var(--c-text-2); }
.results-count:focus { outline: none; }
.active-chips { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); list-style: none; margin: 0; padding: 0; }
.active-chips:empty { display: none; }
.chip { display: inline-flex; align-items: center; gap: .35em; min-height: 36px; padding: 0 .5rem 0 .9rem; border-radius: 999px; border: 1px solid var(--c-primary-100); background: var(--c-primary-50); color: var(--c-primary-800); font-size: var(--fs-xs); font-weight: 500; line-height: 1; }
.chip:hover { background: var(--c-primary-100); }
.chip .icon { width: 16px; height: 16px; }
.active-chips .link-btn { font-size: var(--fs-xs); line-height: 1; }
.link-btn { background: none; border: 0; color: var(--c-primary); font-weight: 500; text-decoration: underline; text-underline-offset: .2em; font-size: var(--fs-xs); min-height: 36px; padding: 0 .4rem; }

.explore__map { position: sticky; top: var(--head-h, 0px); align-self: start; height: calc(100dvh - var(--head-h, 0px)); z-index: 5; }
.explore__map .map { height: 100%; min-height: 0; border: 0; border-left: 1px solid var(--c-border); border-radius: 0; }
.map-area-btn {
  position: absolute; z-index: 800; top: var(--sp-4); left: 50%; translate: -50% 0;
  display: inline-flex; align-items: center; gap: .5em; min-height: 44px; padding: 0 1.2rem;
  border: 0; border-radius: 999px; background: #fff; color: var(--c-primary-900);
  font-size: var(--fs-sm); font-weight: 600; box-shadow: var(--shadow-2);
}
.map-area-btn:hover { background: var(--c-primary); color: #fff; }
.map-area-btn[hidden] { display: none; }
.map-auto {
  position: absolute; z-index: 800; left: var(--sp-4); bottom: var(--sp-5);
  display: inline-flex; align-items: center; gap: .6em; min-height: 44px; padding: 0 1rem;
  background: #fff; border-radius: 999px; box-shadow: var(--shadow-1);
  font-size: var(--fs-xs); font-weight: 500; color: var(--c-primary-900); cursor: pointer;
}
.map-auto input { width: 20px; height: 20px; margin: 0; accent-color: var(--c-primary); }

/* card orizzontale */
.rlist { display: grid; gap: var(--sp-4); list-style: none; }
.rlist > li { display: flex; }
.rlist > li > .rcard { flex: 1; }
.rcard {
  position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start;
  gap: var(--sp-4); padding: var(--sp-5);
  background: #fff; border: 1px solid var(--c-border); border-radius: 18px; box-shadow: var(--shadow-1);
  transition: box-shadow 300ms var(--ease), transform 300ms var(--ease), border-color 300ms var(--ease);
}
.rcard.is-active { border-color: var(--c-primary); box-shadow: 0 0 0 1px var(--c-primary), var(--shadow-2); }
.rcard:focus-within { outline: 3px solid var(--c-focus); outline-offset: 3px; }
/* icona di categoria: stesso colore del segnaposto sulla mappa */
.rcard__icon {
  display: grid; place-items: center; width: 64px; height: 64px; border-radius: 18px;
  background: var(--c-primary-50); color: var(--c-primary);
}
.rcard__icon .icon { width: 30px; height: 30px; stroke-width: 1.75; }
.rcard__body { display: flex; flex-direction: column; gap: var(--sp-1); min-width: 0; height: 100%; }
.rcard .tile__cat, .rcard__title { margin: 0 52px 0 0; }
.rcard__title { font-size: var(--fs-h3); line-height: 1.2; }
.rcard__title a { color: inherit; text-decoration: none; }
.rcard__title a::after { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.rcard__title a:focus-visible { outline: none; box-shadow: none; }
.rcard__type { margin: 0 0 var(--sp-1); font-size: var(--fs-sm); color: var(--c-text); }
.rcard__addr { display: flex; align-items: center; gap: .4em; margin: 0; font-size: var(--fs-xs); color: var(--c-text-2); }
.rcard__addr .icon { color: var(--c-primary); }
.rcard__desc {
  margin: var(--sp-2) 0 var(--sp-3); font-size: var(--fs-sm); color: var(--c-text); line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.rcard__facts {
  margin-top: auto; padding-top: var(--sp-3); border-top: 1px solid var(--c-border);
  display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-4); list-style: none;
  font-size: var(--fs-xs); color: var(--c-text-2);
}
.rcard__facts li { display: inline-flex; align-items: center; gap: .4em; }
.rcard__facts .icon { color: var(--c-primary); }
.rcard .tile__cat { color: var(--c); }
.rcard__facts { margin-top: 0; grid-column: 1 / -1; }
.rcard { grid-template-rows: 1fr auto; }
.rcard__warn { color: #8A5A00; font-weight: 500; }
.rcard__facts .rcard__warn .icon { color: #B07400; }
.results-more { display: flex; margin: var(--sp-5) auto 0; }
.results-more[hidden] { display: none; }
.fpanel--wide { min-width: 360px; }
.fpanel fieldset { max-height: min(56vh, 520px); overflow: auto; scrollbar-width: none; -ms-overflow-style: none; }
.fpanel fieldset::-webkit-scrollbar { display: none; }
.rcard__facts .status--open .icon { color: var(--c-success); }
.rcard__facts .status--closed .icon { color: var(--c-danger); }
.rcard__locate {
  position: absolute; z-index: 2; top: var(--sp-5); right: var(--sp-5); display: grid; place-items: center; width: 44px; height: 44px; padding: 0;
  border: 1px solid var(--c-border-strong); border-radius: 50%; background: #fff; color: var(--c-primary);
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.rcard__locate .icon { width: 20px; height: 20px; }
.rcard__locate:hover { background: var(--c-primary); border-color: var(--c-primary); color: #fff; }
@media (hover: hover) {
  .rcard:hover { box-shadow: var(--shadow-2); transform: translateY(-2px); border-color: var(--c-primary-100); }
}

.empty { text-align: center; padding: var(--sp-7) var(--sp-4); border: 2px dashed var(--c-border); border-radius: var(--radius-lg); color: var(--c-text-2); background: #fff; }
.empty h2 { font-size: var(--fs-h3); }

/* pulsante Lista/Mappa (solo schermi stretti) */
.view-fab { display: none; }

/* 9. SCHEDA (popup centrato) ------------------------------- */
.scheda {
  width: min(880px, calc(100% - 2rem)); max-width: none; max-height: calc(100dvh - 2rem); margin: auto;
  padding: 0; border: 0; border-radius: 24px; overflow: hidden;
  background: #fff; color: var(--c-text); box-shadow: 0 30px 80px -20px rgba(4, 30, 19, .45);
}
.scheda[open] { display: flex; flex-direction: column; animation: pop-in 240ms var(--ease); }
.scheda::backdrop { background: rgba(4, 30, 19, .55); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
@keyframes pop-in { from { opacity: 0; transform: translateY(16px) scale(.97); } to { opacity: 1; transform: none; } }
.has-sheet body { overflow: hidden; }
.scheda__wrap { position: relative; width: 100%; padding-inline: var(--sp-6); }
.scheda__head { flex: none; background: var(--c-bg-alt); border-bottom: 1px solid var(--c-border); padding-block: var(--sp-6) var(--sp-5); }
.scheda__head .scheda__wrap { padding-right: calc(var(--sp-6) + 72px); }
.scheda__eyebrow { margin: 0 0 var(--sp-2); color: var(--c-accent); }
.scheda__head h2 {
  margin: 0; font-weight: 600; letter-spacing: -.02em; line-height: 1.15;
  font-size: clamp(1.75rem, 1.3rem + 1.6vw, 2.75rem);
}
.scheda__sub { margin: var(--sp-2) 0 0; color: var(--c-text-2); font-size: var(--fs-base); }
.scheda__close {
  position: absolute; right: var(--sp-6); top: 0; width: 56px; height: 56px; display: grid; place-items: center;
  border: 1px solid var(--c-border-strong); background: #fff; color: var(--c-primary-900); border-radius: 50%;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.scheda__close:hover { background: var(--c-primary-900); color: #fff; }
.scheda__body { flex: 1 1 auto; min-height: 0; overflow: auto; overscroll-behavior: contain; padding-block: var(--sp-6); }
.scheda__body .scheda__wrap { display: grid; gap: var(--sp-5); }

.scheda__dir { display: inline-flex; align-items: center; gap: .4em; min-height: 44px; font-weight: 600; color: var(--c-primary); }

.scheda__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-3); margin: 0; }
@media (max-width: 991px) { .scheda__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 599px) { .scheda__grid { grid-template-columns: 1fr; } }
.scheda__field { padding: var(--sp-4) var(--sp-5); background: var(--c-bg-alt); border: 1px solid var(--c-border); border-radius: 18px; }
.scheda__field dt { margin-bottom: var(--sp-1); font-size: var(--fs-caps); font-weight: 600; letter-spacing: var(--ls-caps); text-transform: uppercase; color: var(--c-text-2); }
.scheda__field dd { display: flex; align-items: center; gap: var(--sp-2); margin: 0; font-size: var(--fs-base); font-weight: 500; color: var(--c-primary-900); }
.scheda__field dd .icon { flex: none; color: var(--c-primary); }
.scheda__muted { font-weight: 400; color: var(--c-text-2); }
.scheda__note { padding: var(--sp-4) var(--sp-5); background: #FFF8E6; border: 1px solid #EED9A4; border-radius: 18px; color: #6B4A12; }
.scheda__note-title { display: flex; align-items: center; gap: var(--sp-2); margin: 0 0 var(--sp-1); font-weight: 600; }
.scheda__note p:last-child { margin: 0; }

.scheda__foot { flex: none; background: var(--c-bg-alt); border-top: 1px solid var(--c-border); padding-block: var(--sp-4); }
.scheda__foot .scheda__wrap { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4); }
.scheda__map { padding-inline: 0; font-weight: 600; text-transform: uppercase; letter-spacing: var(--ls-caps); font-size: var(--fs-sm); }
.btn--dark { background: var(--c-primary-900); color: #fff; min-width: 140px; }
.btn--dark:hover { background: var(--c-primary-800); color: #fff; }

/* 10. FOOTER ---------------------------------------------- */
.footer { background: var(--c-primary-900); color: #fff; font-size: var(--fs-sm); margin-top: 0; }
.footer a { color: #fff; }
.footer a:hover { color: #fff; text-decoration-thickness: 2px; }
.footer__top { padding-block: var(--sp-7) var(--sp-6); }
.footer__brand { display: flex; align-items: center; gap: var(--sp-3); padding-bottom: var(--sp-5); margin-bottom: var(--sp-6); border-bottom: 1px solid rgba(255,255,255,.25); text-decoration: none; }
.footer__logo { height: 56px; width: auto; }
.footer__brand span:not(.footer__comune) { padding-left: var(--sp-3); border-left: 1px solid rgba(255,255,255,.4); }
.footer__comune { display: flex; flex-direction: column; line-height: 1.1; margin-right: var(--sp-2); }
.footer__comune strong { font-size: 1.25rem; font-weight: 600; letter-spacing: var(--ls-tight); }
.footer__comune small { font-size: var(--fs-xs); opacity: .85; margin-top: .25em; }
.footer__brand > span:not(.footer__comune) { font-size: 1.5rem; font-weight: 600; line-height: 1.1; letter-spacing: var(--ls-tight); }
.footer__brand span:not(.footer__comune) small { display: block; font-size: var(--fs-xs); font-weight: 400; opacity: .85; margin-top: .25em; }
.footer__cols { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: var(--sp-6); }
.footer h2 { color: #fff; margin-bottom: var(--sp-3); padding-bottom: var(--sp-2); border-bottom: 1px solid rgba(255,255,255,.25); }
.footer ul { list-style: none; display: grid; gap: var(--sp-1); }
.footer li a { display: inline-flex; align-items: center; min-height: 36px; text-decoration: none; }
.footer li a:hover { text-decoration: underline; }
.footer address { font-style: normal; line-height: 1.7; }
.footer__bottom { background: #04221A; padding-block: var(--sp-4); font-size: var(--fs-xs); }
.footer__bottom .container { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--sp-3); }
.footer__bottom ul { display: flex; flex-wrap: wrap; gap: var(--sp-1) var(--sp-4); }

/* barra di navigazione totem (nascosta di default) */
.totem-bar { display: none; }

/* 11. MODALITÀ TOTEM --------------------------------------
   Classe .is-totem su <html>, impostata dallo script nel <head>:
   automatica su schermi verticali ≥800×1400 px CSS (1080×1920 anche
   con zoom di sistema fino al 135 per cento) oppure forzata con ?totem=1.
   Le regole prevalgono su quelle mobile (≤991px), così il layout
   totem resta identico qualunque sia lo zoom.
   ---------------------------------------------------------- */
.is-totem { --fs-base: 1.375rem; --fs-sm: 1.25rem; --fs-xs: 1.0625rem; --touch: 64px;
  --fs-h1: 4rem; --fs-h2: 3rem; --fs-h3: 2rem; --fs-h4: 1.5rem; --fs-caps: 1rem; }
.is-totem body { padding-bottom: 112px; user-select: none; -webkit-user-select: none; overscroll-behavior: none; }
.is-totem .no-totem, .is-totem .skiplinks, .is-totem .header-slim, .is-totem .lang { display: none !important; }
.is-totem .container { max-width: 1040px; padding-inline: var(--sp-6); }
.is-totem .btn { min-height: 64px; padding-inline: 1.75rem; }
.is-totem .check input { width: 30px; height: 30px; }
.is-totem .brand__logo { height: 100px; }
.is-totem .brand__title { font-size: 2.25rem; }
.is-totem .brand__comune strong { font-size: 1.875rem; }
.is-totem .brand__comune small { font-size: 1rem; }
.is-totem .nav-list a { min-height: 72px; font-size: 1.5rem; }
.is-totem .hero { min-height: 900px; }
.is-totem .hero__media img { object-position: center 55%; }
.is-totem .hero h1 { font-size: 8.25rem; }
.is-totem .hero__lead { font-size: 2.25rem; }
.is-totem .tile-grid { grid-template-columns: 1fr; gap: var(--sp-4); }
.is-totem .home-map { height: 820px; }
.is-totem .cat-grid { grid-template-columns: repeat(3, 1fr); }
.is-totem .cat-tile__icon { width: 72px; height: 72px; }
.is-totem .cat-tile__icon .icon { width: 34px; height: 34px; }
/* attività sul totem: mappa fissa in alto, lista che scorre sotto */
.is-totem .explore-head { --edge: max(var(--sp-6), calc((100% - 1040px) / 2 + var(--sp-6))); }
.is-totem .cat-chips { justify-content: flex-start; }
.is-totem .fbtn__k { display: none; }
.is-totem .fbtn { min-height: 68px; padding-inline: 1.4rem; }
.is-totem .cchip { min-height: 64px; padding-inline: 1.5rem; }
.is-totem .fpanel { min-width: 420px; padding: var(--sp-5) var(--sp-6); }
.is-totem .explore { grid-template-columns: 1fr; }
.is-totem .explore__map { order: -1; height: 720px; position: sticky; top: var(--head-h, 0px); }
/* il totem mostra sempre lista + mappa insieme (niente pulsante Lista/Mappa) */
.is-totem .view-fab { display: none !important; }
.is-totem .explore[data-view] .explore__list, .is-totem .explore[data-view] .explore__map { display: block; }
.is-totem .explore[data-map="off"] .explore__map { display: none; }
.is-totem .map-switch { display: none; }  /* sul totem la mappa si mostra/nasconde dalla barra in basso */
.is-totem .fdrop--end { margin-left: auto; }
.is-totem .explore-bar__sep { display: none; }
.is-totem .explore__list { padding-bottom: var(--sp-7); }
.is-totem .explore__map .map { border-left: 0; border-bottom: 1px solid var(--c-border); }
.is-totem .explore-page { --edge-v: max(var(--sp-6), calc((100vw - 1040px) / 2 + var(--sp-6))); }
.is-totem .explore__list { padding: var(--sp-4) var(--edge-v) var(--sp-6); }
.is-totem .rcard { padding: var(--sp-6); gap: var(--sp-5); }
.is-totem .rcard__icon { width: 88px; height: 88px; border-radius: 24px; }
.is-totem .rcard__icon .icon { width: 42px; height: 42px; }
.is-totem .rcard__locate { width: 68px; height: 68px; top: var(--sp-6); right: var(--sp-6); }
.is-totem .rcard .tile__cat, .is-totem .rcard__title { margin-right: 80px; }
.is-totem .rcard__locate .icon { width: 30px; height: 30px; }
.is-totem .map-switch { min-height: 68px; }
.is-totem .map-switch__track { width: 60px; height: 36px; }
.is-totem .map-switch__track::after { width: 30px; height: 30px; }
.is-totem .map-switch[aria-checked="true"] .map-switch__track::after { transform: translateX(24px); }
.is-totem .explore[data-map="off"] .rlist { grid-template-columns: 1fr; }
.is-totem .map-area-btn, .is-totem .map-auto { min-height: 64px; padding-inline: 1.5rem; }
.is-totem .map-auto input { width: 28px; height: 28px; }
.is-totem .pin { width: 52px; height: 52px; }
.is-totem .pin .icon { width: 26px; height: 26px; }
.is-totem .leaflet-control-zoom a { width: 60px !important; height: 60px !important; line-height: 60px !important; font-size: 30px !important; }
.is-totem .leaflet-popup-content { font-size: 1.125rem; min-width: 300px; }
.is-totem .scheda { width: min(960px, calc(100% - 4rem)); max-height: calc(100dvh - 4rem - 112px); margin-block: auto calc(2rem + 112px); }
.is-totem .scheda__close { width: 72px; height: 72px; }
.is-totem .scheda__head .scheda__wrap { padding-right: calc(var(--sp-6) + 88px); }
.is-totem .scheda__grid { grid-template-columns: 1fr 1fr; }
.is-totem .btn--dark { min-height: 72px; min-width: 200px; }
.is-totem .cluster { font-size: 1.125rem; }
.is-totem .footer__cols { grid-template-columns: 1fr 1fr; }
.is-totem .totem-bar {
  display: flex; position: fixed; z-index: var(--z-totem); left: 0; right: 0; bottom: 0;
  background: var(--c-primary-900); padding: var(--sp-3) var(--sp-5); gap: var(--sp-3);
  box-shadow: 0 -4px 16px rgba(0,0,0,.25);
}
.totem-bar a, .totem-bar button {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: var(--sp-3);
  min-height: 80px; border-radius: var(--radius-lg); border: 2px solid rgba(255,255,255,.4);
  background: transparent; color: #fff; font-size: 1.375rem; font-weight: 600; text-decoration: none;
}
.totem-bar a[aria-current="page"] { background: #fff; color: var(--c-primary-900); border-color: #fff; }
.totem-bar .icon { width: 30px; height: 30px; }
/* in home non c'è nulla a cui tornare: restano solo i pulsanti utili */
body[data-page="home"] .totem-bar [data-totem-back], body[data-page="home"] .totem-bar [data-nav="home"] { display: none; }

/* 12. RESPONSIVE ------------------------------------------ */
@media (max-width: 1199px) {
  .cat-grid { grid-template-columns: repeat(3, 1fr); }
  .explore { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
  .tile-grid { grid-template-columns: repeat(2, 1fr); }
  .footer__cols { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 991px) {
  .home-map { height: 440px; }
  
  .info-grid { grid-template-columns: 1fr; }

  /* attività: una vista alla volta, pulsante Lista/Mappa (lo switch non serve) */
  .map-switch, .explore-bar__sep { display: none; }
  .explore { grid-template-columns: 1fr; }
  .explore[data-view="lista"] .explore__map { display: none; }
  .explore[data-view="mappa"] .explore__list { display: none; }
  .explore__map { position: relative; top: 0; height: calc(100dvh - var(--head-h, 0px)); }
  .explore__map .map { border-left: 0; }
  .explore__list { padding: var(--sp-2) var(--sp-4) 6rem; }
  .cat-chips { justify-content: flex-start; }
  .view-fab {
    position: fixed; z-index: 35; left: 50%; bottom: max(var(--sp-5), env(safe-area-inset-bottom));
    translate: -50% 0; display: inline-flex; align-items: center; gap: .5em;
    min-height: 52px; padding: 0 1.4rem; border: 0; border-radius: 999px;
    background: var(--c-primary-900); color: #fff; font-weight: 600; font-size: var(--fs-sm);
    box-shadow: 0 10px 30px -8px rgba(4, 30, 19, .55);
  }
}

@media (max-width: 767px) {
  :root { --fs-base: 1.0625rem; }
  .section { padding-block: var(--sp-7); }
  .hero { min-height: min(72svh, 620px); }
  .hero h1 { font-size: clamp(2.75rem, 14vw, 4.5rem); }
  .brand__logo { height: 44px; }
  .brand__title { font-size: 1.2rem; }
  .brand__sub { display: none; }
  .brand__comune small { display: none; }
  .brand__comune strong { font-size: 1rem; }
  .nav-long { display: none; }
  .nav-list a { font-size: var(--fs-sm); }
  .tile-grid { grid-template-columns: 1fr; }
  .home-map { height: 380px; }
  .cat-grid { grid-template-columns: repeat(2, 1fr); gap: var(--sp-3); }
  .cat-tile { padding: var(--sp-4); }
  .rcard { gap: var(--sp-3); padding: var(--sp-4); }
  .rcard__locate { top: var(--sp-4); right: var(--sp-4); }
  .rcard__icon { width: 52px; height: 52px; border-radius: 14px; }
  .rcard__icon .icon { width: 26px; height: 26px; }
  .explore-head { background: #fff; -webkit-backdrop-filter: none; backdrop-filter: none; }
  .explore-bar { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .explore-bar::-webkit-scrollbar { display: none; }
  .fbtn { min-height: 44px; padding-inline: .8rem; }
  .fbtn__k { display: none; }
  /* menu dei filtri come pannello dal basso */
  .fpanel {
    position: fixed; z-index: 70; top: auto; left: var(--sp-3); right: var(--sp-3); bottom: var(--sp-3);
    translate: none; width: auto; min-width: 0; max-width: none; max-height: 70dvh; overflow: auto;
    box-shadow: 0 -10px 60px rgba(4, 30, 19, .35);
  }
  .footer__cols { grid-template-columns: 1fr; gap: var(--sp-5); }
  .scheda__wrap { padding-inline: var(--sp-4); }
  .scheda__head .scheda__wrap { padding-right: calc(var(--sp-4) + 64px); }
  .scheda__close { right: var(--sp-4); width: 48px; height: 48px; }
  .header-slim .slim-label { display: none; }
}

/* 13. ACCESSIBILITÀ / STAMPA ------------------------------ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
@media (forced-colors: active) {
  .pin { forced-color-adjust: none; }
  .rcard { border: 2px solid CanvasText; }
}
@media print {
  .explore-head, .totem-bar, .explore__map, .view-fab, .footer__bottom { display: none !important; }
  .explore { display: block; }
}

/* a11y: i filtri fissi non devono coprire l'elemento a fuoco (WCAG 2.4.11) */
html { scroll-padding-top: calc(var(--head-h, 0px) + 1rem); }
/* Categoria e Tipologia hanno lo stesso valore iniziale: l'etichetta resta visibile anche su mobile e totem */
.is-totem .fbtn[data-drop="p-categoria"]:not([data-set]) .fbtn__k, .is-totem .fbtn[data-drop="p-tipologia"]:not([data-set]) .fbtn__k { display: inline; }
@media (max-width: 991px) { .fbtn[data-drop="p-categoria"] .fbtn__k, .fbtn[data-drop="p-tipologia"] .fbtn__k { display: inline; } }

/* Filtri: su tablet e mobile (non totem) i tre filtri diventano un unico pannello "Filtri" */
.fbtn--filters, .fsheet__head, .fsheet__foot { display: none; }
.fsheet, .fsheet__body { display: contents; }
.fbtn__badge { display: inline-grid; place-items: center; min-width: 1.5em; height: 1.5em; padding: 0 .4em; border-radius: 999px; background: var(--c-primary-900); color: #fff; font-size: .75rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.fbtn__badge[hidden] { display: none; }
@media (max-width: 991px) {
  html:not(.is-totem) .explore-head { -webkit-backdrop-filter: none; backdrop-filter: none; background: #fff; }
  html:not(.is-totem) .explore-bar { justify-content: space-between; }
  html:not(.is-totem) .fbtn--filters { display: inline-flex; }
  html:not(.is-totem) .fsheet { display: none; }
  html:not(.is-totem) .fsheet.is-open { display: flex; flex-direction: column; position: fixed; inset: 0; z-index: 90; background: #fff; }
  .fsheet.is-open .fsheet__head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--c-border); }
  .fsheet.is-open .fsheet__head h2 { margin: 0; font-size: var(--fs-h3); }
  .fsheet.is-open .fsheet__close { position: static; flex: none; }
  .fsheet.is-open .fsheet__body { display: block; flex: 1 1 auto; min-height: 0; overflow: auto; overscroll-behavior: contain; padding: var(--sp-2) var(--sp-4) var(--sp-5); }
  .fsheet.is-open .fsheet__foot { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4) max(var(--sp-3), env(safe-area-inset-bottom)); border-top: 1px solid var(--c-border); background: #fff; }
  .fsheet.is-open .fdrop { border-bottom: 1px solid var(--c-border); padding-block: var(--sp-1); }
  .fsheet.is-open .fbtn { width: 100%; justify-content: flex-start; min-height: 56px; padding-inline: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; font-size: var(--fs-base); }
  .fsheet.is-open .fbtn__k { display: inline; }
  .fsheet.is-open .fbtn__chev { margin-left: auto; }
  .fsheet.is-open .fpanel { position: static; translate: none; width: auto; min-width: 0; max-width: none; max-height: none; padding: 0 0 var(--sp-3); border: 0; box-shadow: none; background: transparent; }
  .fsheet.is-open .fpanel fieldset { max-height: none; overflow: visible; }
  .fsheet.is-open .fpanel__title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  body.has-fsheet { overflow: hidden; }
  body.has-fsheet .explore-head { z-index: 95; }
  body.has-fsheet .view-fab { display: none; }
}

/* Menu a hamburger (tablet/mobile e totem): voci di menu e lingua */
.nav-toggle, .menu-lang { display: none; }
.nav-toggle { align-items: center; gap: .6em; min-height: 48px; padding: 0 1rem; border: 1px solid var(--c-border-strong); border-radius: 10px; background: #fff; color: var(--c-primary-900); font-size: var(--fs-sm); font-weight: 600; }
.nav-toggle:hover { border-color: var(--c-primary); }
.nav-toggle__bars, .nav-toggle__bars::before, .nav-toggle__bars::after { display: block; width: 22px; height: 2px; border-radius: 2px; background: currentColor; transition: transform var(--dur) var(--ease), opacity var(--dur) var(--ease); }
.nav-toggle__bars { position: relative; }
.nav-toggle__bars::before, .nav-toggle__bars::after { content: ""; position: absolute; left: 0; }
.nav-toggle__bars::before { top: -7px; }
.nav-toggle__bars::after { top: 7px; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars::before { top: 0; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars::after { top: 0; transform: rotate(-45deg); }
.use-burger .header-center { position: relative; }
.use-burger .nav-toggle { display: inline-flex; margin-left: auto; }
.use-burger .header-slim .lang { display: none; }
.use-burger .header-menu { display: none; position: absolute; top: 100%; left: 0; right: 0; z-index: 60; margin: 0; padding: var(--sp-4) max(var(--sp-4), calc((100% - var(--container)) / 2 + var(--sp-4))) var(--sp-6); background: #fff; border-bottom: 1px solid var(--c-border); box-shadow: var(--shadow-2); }
.use-burger .header-menu.is-open { display: block; }
.use-burger .nav-list { flex-direction: column; align-items: stretch; gap: 0; padding: 0; margin: 0; }
.use-burger .nav-list a { width: 100%; min-height: 64px; padding: 0 .25rem; border-bottom: 1px solid var(--c-border); }
.use-burger .nav-list a::after { display: none; }
.use-burger .nav-list a[aria-current="page"] { padding-left: .9rem; box-shadow: inset 4px 0 0 var(--c-primary); }
.use-burger .nav-long { display: inline; }
.use-burger .menu-lang { display: flex; align-items: center; gap: var(--sp-3); margin-top: var(--sp-7); }
.menu-lang__label { font-size: var(--fs-xs); font-weight: 600; letter-spacing: var(--ls-caps); text-transform: uppercase; color: var(--c-text-2); }
.menu-lang__list { display: flex; gap: var(--sp-2); list-style: none; margin: 0; padding: 0; }
.menu-lang__list a { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 56px; padding-inline: .75rem; font-size: var(--fs-xs); border: 1px solid var(--c-border-strong); border-radius: 10px; color: var(--c-primary-900); font-weight: 600; text-decoration: none; }
.menu-lang__list a[aria-current="true"] { background: var(--c-primary-900); border-color: var(--c-primary-900); color: #fff; }
.is-totem .nav-toggle { min-height: 72px; padding-inline: 1.5rem; font-size: 1.5rem; }
.is-totem .nav-toggle__bars, .is-totem .nav-toggle__bars::before, .is-totem .nav-toggle__bars::after { width: 30px; height: 3px; }
.is-totem .nav-toggle__bars::before { top: -9px; }
.is-totem .nav-toggle__bars::after { top: 9px; }
.is-totem .header-menu { padding-inline: max(var(--sp-6), calc((100% - 1040px) / 2 + var(--sp-6))); }
.is-totem .menu-lang__list a { min-height: 60px; min-width: 80px; font-size: 1.125rem; }
.is-totem .nav-list a { min-height: 88px; }
/* barra in basso del totem: il pulsante mappa è un interruttore nella pagina Attività */
.totem-bar #totem-map-toggle[data-on="true"] { background: #fff; color: var(--c-primary-900); border-color: #fff; }

/* valori dei filtri: se lunghi vengono tagliati (il testo completo resta nelle etichette dei filtri attivi) */
.fbtn__v { display: inline-block; max-width: 14em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
.is-totem .fbtn[data-set] .fbtn__v { max-width: 7em; }
.is-totem .fbtn[data-set] .fbtn__k { display: none; }
.fsheet.is-open .fbtn__v { max-width: none; }
/* totem: conteggio e filtri attivi dentro la barra fissa, sotto i filtri */
.explore-head > .explore__intro { margin: 0; padding: var(--sp-3) var(--edge); border-top: 1px solid var(--c-border); }

/* tablet/mobile e totem: il totale non si vede, resta solo per gli screen reader (area status) */
@media (max-width: 991px) {
  .results-count { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}
.is-totem .results-count { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
/* senza filtri attivi la riga non occupa spazio */
@media (max-width: 991px) { .explore__intro:not(:has(li)) { margin: 0; } }
.is-totem .explore__intro:not(:has(li)), .is-totem .explore-head > .explore__intro:not(:has(li)) { margin: 0; padding: 0; border: 0; }