/* root/assets/css/site.css — stile del sito pubblico, allineato all'app
   Sentiero 406: verde del marchio su fondo grigio chiaro, barre grigio scuro,
   Fira Sans con titoli in grassetto. Colori da src_app/lib/core/theme/app_theme.dart. */

@font-face { font-family: "Fira Sans"; font-weight: 400; font-style: normal; font-display: swap; src: url("../fonts/fira-sans-400.woff") format("woff"); }
@font-face { font-family: "Fira Sans"; font-weight: 600; font-style: normal; font-display: swap; src: url("../fonts/fira-sans-600.woff") format("woff"); }
@font-face { font-family: "Fira Sans"; font-weight: 700; font-style: normal; font-display: swap; src: url("../fonts/fira-sans-700.woff") format("woff"); }

:root {
  --verde: #009163;
  /* Verde più scuro per link e testo piccolo: contrasto 4,5:1 sul grigio di fondo. */
  --verde-strong: #00754F;
  /* Verde chiaro per accenti su fondo scuro. */
  --verde-light: #5CCB9F;
  --oro: #C99400;
  --oro-soft: #FBF0DA;
  --oro-ink: #8A6300;
  --barre: #404040;
  --ink: #222222;
  --ink-soft: #4A4A4A;
  --muted: #707070;
  --bg: #F5F5F5;
  --surface: #FFFFFF;
  --sand: #E9E9E9;
  --border: #E4E4E4;
  --font: "Fira Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --wrap: 1120px;
  --radius: 12px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-wrap: anywhere;
}
img { display: block; max-width: 100%; height: auto; }
a { color: var(--verde-strong); }
a:focus-visible, button:focus-visible, .button:focus-visible, summary:focus-visible { outline: 3px solid var(--oro); outline-offset: 3px; }
h1, h2, h3 { font-family: var(--font); font-weight: 700; line-height: 1.2; color: var(--ink); margin: 0 0 .5em; }
h1 { font-size: clamp(30px, 4.4vw, 46px); }
h2 { font-size: clamp(24px, 2.8vw, 30px); }
h3 { font-size: 20px; }
p { margin: 0 0 1em; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.muted { color: var(--muted); }
.lead { font-size: 19px; color: var(--ink-soft); max-width: 40em; }
.eyebrow { font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--verde-strong); margin-bottom: .6em; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: 16px; top: 16px; background: #fff; padding: 8px 12px; z-index: 20; }

/* ---------- Pulsanti (come nell'app: verde, angoli da 12) ---------- */
.button {
  display: inline-block; padding: 12px 20px; border-radius: var(--radius);
  background: var(--verde); color: #fff; text-decoration: none; font-weight: 700; font-size: 15px;
}
.button:hover { background: var(--verde-strong); }
.button--ghost { background: var(--sand); color: var(--ink); }
.button--ghost:hover { background: #DDDDDD; }

/* ---------- Testata: grigio scuro dell'header dell'app e logo bianco ---------- */
.site-header {
  background: rgba(64, 64, 64, .94); color: #fff; position: sticky; top: 0; z-index: 10;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.header-inner { display: flex; align-items: center; gap: 24px; min-height: 64px; padding-top: 10px; padding-bottom: 10px; }
.brand { display: flex; align-items: center; flex: none; }
.brand img { height: 40px; width: auto; }
.main-nav { margin-left: auto; }
.main-nav ul { display: flex; gap: 6px; list-style: none; margin: 0; padding: 0; }
.main-nav a { display: block; color: #fff; text-decoration: none; font-size: 15px; padding: 6px 14px; border-radius: 999px; white-space: nowrap; }
.main-nav a:hover { background: rgba(255, 255, 255, .14); }
.main-nav a[aria-current="page"] { background: var(--verde); font-weight: 700; }
.site-header a:focus-visible { outline-color: var(--verde-light); }
.lang-switch {
  flex: none; font-size: 13px; font-weight: 700; text-decoration: none; color: #fff;
  border: 1px solid rgba(255, 255, 255, .5); border-radius: 999px; padding: 5px 11px;
}
.lang-switch:hover { background: rgba(255, 255, 255, .14); }

/* ---------- Home ---------- */
.hero { padding: 56px 0 40px; background: linear-gradient(180deg, var(--sand), var(--bg)); }
.hero h1 { color: var(--verde-strong); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.page-body { padding-top: 40px; padding-bottom: 56px; }
.toc { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 22px; margin-bottom: 40px; }
.toc-title { font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.toc ol { margin: 0; padding-left: 1.3em; columns: 2 220px; }
.chapter { margin-bottom: 56px; scroll-margin-top: 90px; }
.rich-text { max-width: 46em; }
.rich-text img { border-radius: var(--radius); }
.privacy h2 { margin-top: 1.4em; }
.privacy h3 { font-size: 18px; margin-top: 1.1em; }

/* ---------- Galleria ---------- */
.gallery { list-style: none; padding: 0; margin: 24px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.gallery figure { margin: 0; }
.gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; }
.gallery figcaption { font-size: 14px; color: var(--muted); margin-top: 6px; }
.gallery a { display: block; border-radius: 10px; cursor: zoom-in; }
.gallery a:hover img { opacity: .9; }

/* ---------- Visualizzatore immagini (assets/js/gallery.js) ---------- */
.lightbox-open, .lightbox-open body { overflow: hidden; }
.lightbox {
  position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0; background: rgba(20, 20, 20, .96); color: #fff;
}
.lightbox::backdrop { background: rgba(20, 20, 20, .96); }
.lightbox-stage {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none;
  padding: 64px 72px 72px;
}
.lightbox-image {
  max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain;
  border-radius: 4px; transition: transform .2s ease, opacity .2s ease; will-change: transform; cursor: zoom-in;
}
.lightbox-image.is-loading { opacity: .35; }
.lightbox.is-zoomed .lightbox-image { cursor: grab; }
.lightbox.is-zoomed .lightbox-image:active { cursor: grabbing; }
.lightbox-bar {
  position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center; gap: 8px;
  padding: 12px 16px; background: linear-gradient(rgba(20, 20, 20, .7), rgba(20, 20, 20, 0));
}
.lightbox-counter { margin: 0 auto 0 0; font-size: 15px; color: #DDDDDD; }
.lightbox-button {
  display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, .14); color: #fff; font: 700 26px/1 var(--font); cursor: pointer;
}
.lightbox-button:hover { background: rgba(255, 255, 255, .26); }
.lightbox-button:disabled { opacity: .35; cursor: default; }
.lightbox-button:focus-visible { outline: 3px solid var(--verde-light); outline-offset: 2px; }
.lightbox-close { background: var(--verde); }
.lightbox-close:hover { background: var(--verde-strong); }
.lightbox-nav { position: absolute; top: 50%; margin-top: -24px; width: 48px; height: 48px; font-size: 34px; }
.lightbox-prev { left: 12px; }
.lightbox-next { right: 12px; }
.lightbox.is-single .lightbox-nav { display: none; }
.lightbox-caption {
  position: absolute; left: 0; right: 0; bottom: 0; margin: 0; padding: 28px 24px 18px; text-align: center;
  font-size: 15px; color: #EEEEEE; background: linear-gradient(rgba(20, 20, 20, 0), rgba(20, 20, 20, .75));
}
.lightbox.is-zoomed .lightbox-caption, .lightbox.is-zoomed .lightbox-nav { opacity: 0; pointer-events: none; }
@media (max-width: 640px) {
  .lightbox-stage { padding: 64px 0 64px; }
  .lightbox-nav { top: auto; bottom: 12px; margin-top: 0; }
  .lightbox-caption { padding: 24px 72px 22px; }
}

/* ---------- Richiamo all'app ---------- */
.app-promo { background: var(--barre); color: #fff; }
.app-promo--home { margin: 0; }
.app-promo-inner { display: flex; align-items: center; gap: 24px; padding-top: 28px; padding-bottom: 28px; flex-wrap: wrap; }
.app-promo-icon { width: 72px; height: 72px; border-radius: 16px; flex: none; }
.app-promo-text { flex: 1 1 320px; }
.app-promo h2 { color: #fff; font-size: 24px; margin-bottom: .3em; }
.app-promo p { margin: 0; color: #E4E4E4; }
.app-promo a { color: var(--verde-light); font-weight: 600; }
.app-promo .eyebrow { color: var(--verde-light); }
.store-badges { display: flex; flex-wrap: wrap; gap: 10px; }
.store-badge {
  display: inline-block; padding: 9px 16px; border-radius: var(--radius); line-height: 1.25;
  background: var(--verde); color: #fff; text-decoration: none; font-weight: 700; font-size: 15px;
}
.store-badge:hover { background: var(--verde-strong); }
.store-badge small { display: block; font-size: 11px; font-weight: 500; letter-spacing: .4px; text-transform: uppercase; opacity: .8; }
.store-badge--soon { background: transparent; color: inherit; border: 1px solid currentColor; opacity: .85; }
.store-badge--soon:hover { background: transparent; }

/* ---------- Piè di pagina ---------- */
.site-footer { margin-top: 40px; background: var(--sand); }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 28px; padding-top: 36px; padding-bottom: 40px; font-size: 15px; }
.footer-brand { font-size: 20px; font-weight: 700; color: var(--verde-strong); margin-bottom: .3em; }
.footer-title { font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.footer-list { list-style: none; margin: 0 0 12px; padding: 0; }
.footer-list li { margin-bottom: 6px; }

/* ---------- Intestazione delle sezioni ---------- */
.page-header { padding: 44px 0 8px; }
.back-link { display: inline-block; margin-bottom: 14px; font-size: 15px; text-decoration: none; }
.back-link::before { content: "← "; }

/* ---------- Schede ---------- */
.card-grid { list-style: none; padding: 0; margin: 24px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 22px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; height: 100%; display: flex; flex-direction: column; position: relative; }
.card:hover { border-color: var(--verde); }
.card-media { aspect-ratio: 16 / 10; background: var(--sand); }
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 16px 18px 18px; }
.card-title { font-size: 19px; margin-bottom: .35em; }
.card-title a { color: var(--ink); text-decoration: none; }
.card-title a::after { content: ""; position: absolute; inset: 0; }
.card-meta { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 14px; color: var(--muted); }
.trail-swatch { display: inline-block; width: 22px; height: 4px; border-radius: 2px; vertical-align: middle; margin-right: 8px; }

/* ---------- Categorie e filtri (chip come nell'app) ---------- */
.category-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 8px; padding: 0; list-style: none; }
.category { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-soft); }
.category::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--c, var(--verde)); }
.filters { margin: 24px 0 0; }
.filters ul { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 8px 0 0; padding: 0; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 999px; background: var(--sand); color: var(--ink-soft); text-decoration: none; font-size: 14px; }
.chip:hover { background: #DDDDDD; }
.chip[aria-current="true"] { background: var(--verde-strong); color: #fff; }

/* ---------- Dettaglio ---------- */
.detail-cover { margin: 8px 0 28px; }
.detail-cover img { width: 100%; max-height: 460px; object-fit: cover; border-radius: var(--radius); }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 40px; align-items: start; }
.detail-section { margin-top: 40px; }
.facts { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; }
.facts h2 { font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.facts dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; font-size: 15px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 600; }
.notice { border-radius: var(--radius); padding: 14px 18px; margin: 0 0 24px; }
.notice--warning { background: var(--oro-soft); border: 1px solid #F0DDB2; color: var(--ink); }
.notice-title { font-weight: 700; color: var(--oro-ink); margin-bottom: .2em; }
.audio-player { margin: 0 0 24px; }
.audio-player audio { width: 100%; }
.practical-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 16px; }
.practical-list li { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; display: flex; gap: 16px; }
.practical-list img { width: 110px; height: 82px; object-fit: cover; border-radius: 8px; flex: none; }
.practical-list h3 { font-size: 18px; margin-bottom: .3em; }
.video-file { margin-left: 0; margin-right: 0; }
.video-file video { width: 100%; border-radius: var(--radius); background: #000; }
.poi-list .category { margin-right: 10px; font-size: 13px; }
.video-embed { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; background: #000; }
.video-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.poi-list { list-style: none; padding: 0; margin: 0; counter-reset: poi; display: grid; gap: 10px; }
.poi-list li { counter-increment: poi; }
.poi-list a { display: flex; align-items: center; gap: 14px; padding: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); text-decoration: none; color: var(--ink); }
.poi-list a:hover { border-color: var(--verde); }
.poi-list a::before { content: counter(poi); flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--verde); color: #fff; font-size: 14px; font-weight: 700; display: grid; place-items: center; }
.poi-list img { width: 64px; height: 48px; object-fit: cover; border-radius: 8px; flex: none; }
.poi-list strong { display: block; font-weight: 600; }

/* ---------- Mappe ---------- */
.map { height: 440px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); background: var(--sand); position: relative; margin-top: 24px; }
.map--small { height: 280px; }
.map-fallback { padding: 20px; color: var(--muted); font-size: 15px; }
.map-toggle { position: absolute; top: 10px; right: 10px; z-index: 2; display: flex; border-radius: 999px; overflow: hidden; box-shadow: 0 1px 4px rgba(0, 0, 0, .25); }
.map-toggle button { border: 0; padding: 6px 12px; font: 600 13px var(--font); background: #fff; color: var(--ink); cursor: pointer; }
.map-toggle button[aria-pressed="true"] { background: var(--verde); color: #fff; }
.map-marker { width: 16px; height: 16px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 3px rgba(0, 0, 0, .6); cursor: pointer; padding: 0; }
.maplibregl-popup-content { font: 15px/1.4 var(--font); }
.maplibregl-popup-content a { font-weight: 600; }

/* ---------- Pagina dell'app ---------- */
.app-hero { padding: 48px 0 56px; background: var(--surface); }
.app-hero-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); gap: 48px; align-items: center; }
.app-hero h1 em { font-style: normal; color: var(--verde); }
.app-hero .store-badges { margin-top: 28px; }
.app-hero .store-badge--soon { color: var(--ink); }
.app-note { margin-top: 14px; font-size: 15px; }
.app-hero-art { width: 100%; max-width: 360px; margin: 0 auto; }
.app-section { padding: 72px 0; }
.app-section--tight { padding-top: 0; }
.app-band { padding: 72px 0; background: var(--barre); color: #E4E4E4; }
.app-band h2, .app-band h3 { color: #fff; }
.app-band .eyebrow { color: var(--verde-light); }
.app-band .lead { color: #D6D6D6; }
.app-land-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; margin-top: 36px; }
.app-places { list-style: none; margin: 0; padding: 0; }
.app-places li { padding: 18px 0; border-bottom: 1px solid rgba(255, 255, 255, .16); }
.app-places li:first-child { padding-top: 0; }
.app-places h3 { font-size: 19px; margin-bottom: 6px; }
.app-places p { margin: 0; color: #CFCFCF; font-size: 16px; }
.app-features { list-style: none; margin: 40px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.app-feature { background: var(--surface); border-radius: var(--radius); padding: 26px; }
.app-feature-icon { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; margin-bottom: 18px; background: var(--verde); color: #fff; }
.app-feature-icon svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.app-feature h3 { font-size: 19px; margin-bottom: 8px; }
.app-feature p { margin: 0; color: var(--ink-soft); font-size: 16px; }
.app-steps { list-style: none; counter-reset: step; margin: 40px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 36px; }
.app-steps li { counter-increment: step; position: relative; padding-top: 60px; }
.app-steps li::before {
  content: counter(step); position: absolute; top: 0; left: 0;
  width: 44px; height: 44px; border-radius: 50%; background: var(--verde); color: #fff;
  display: grid; place-items: center; font-size: 22px; font-weight: 700;
}
.app-steps h3 { font-size: 19px; margin-bottom: 8px; }
.app-steps p { margin: 0; color: var(--ink-soft); font-size: 16px; }
.app-faq { background: var(--sand); }
.app-faq-list { margin-top: 28px; max-width: 820px; }
.app-faq details { border-bottom: 1px solid #D4D4D4; }
.app-faq summary { cursor: pointer; list-style: none; padding: 20px 40px 20px 0; position: relative; font-size: 19px; font-weight: 600; }
.app-faq summary::-webkit-details-marker { display: none; }
.app-faq summary::after { content: "+"; position: absolute; right: 4px; top: 14px; font-size: 28px; font-weight: 400; color: var(--verde-strong); }
.app-faq details[open] summary::after { content: "–"; }
.app-faq details p { padding: 0 0 22px; margin: 0; color: var(--ink-soft); max-width: 44em; }
.app-privacy-link { margin: 24px 0 0; font-size: 15px; }
.app-closing { text-align: center; padding: 80px 0; }
.app-closing img { width: 84px; height: 84px; border-radius: 22px; margin: 0 auto 24px; }
.app-closing p { margin: 0 auto 24px; max-width: 34em; color: var(--ink-soft); font-size: 18px; }
.app-closing .store-badges { justify-content: center; }
.app-closing .store-badge--soon { color: var(--ink); }

/* ---------- Contatti ---------- */
.contacts-grid { display: grid; grid-template-columns: 3fr 2fr; gap: 24px; margin-top: 32px; align-items: start; }
.contacts-side { display: grid; gap: 24px; }
.contact-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px 24px; }
.contact-card h2 { font-size: 20px; margin: 0 0 12px; }
.contact-card p { margin: 0 0 10px; }
.contact-card p:last-child { margin-bottom: 0; }
.contact-card a { overflow-wrap: anywhere; }
.contact-card--alert { background: var(--oro-soft); border-color: transparent; }
.contact-emergency { font-weight: 700; font-size: 20px; }
.contact-name { font-weight: 600; }
.contact-list { display: grid; grid-template-columns: max-content 1fr; gap: 8px 20px; margin: 16px 0 0; }
.contact-list dt { color: var(--muted); }
.contact-list dd { margin: 0; }
.contact-social { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 20px; }
.contacts-staff { margin-top: 48px; }
.staff-list { list-style: none; margin: 20px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.staff-role { font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--verde-strong); }
.contacts-source { margin-top: 40px; font-size: 15px; }

/* ---------- Errore ---------- */
.error-page { min-height: 40vh; }

/* ---------- Mobile ---------- */
@media (max-width: 860px) {
  .detail-grid, .app-hero-grid, .app-land-grid, .contacts-grid { grid-template-columns: 1fr; }
  .app-features { grid-template-columns: 1fr 1fr; }
  .app-steps { grid-template-columns: 1fr; gap: 28px; }
  .app-hero-art { max-width: 260px; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .wrap { padding-left: 16px; padding-right: 16px; }
  .header-inner { flex-wrap: wrap; gap: 8px 16px; }
  .main-nav { order: 3; width: 100%; margin-left: 0; overflow-x: auto; }
  .main-nav ul { gap: 4px; }
  .main-nav a { padding: 6px 10px; font-size: 14px; }
  .lang-switch { margin-left: auto; }
  .hero { padding: 36px 0 28px; }
  .map { height: 340px; }
  .practical-list li { flex-direction: column; }
  .contact-list { grid-template-columns: 1fr; gap: 2px; }
  .contact-list dd { margin-bottom: 10px; }
  .app-features { grid-template-columns: 1fr; }
  .app-section, .app-band { padding: 56px 0; }
  .lead { font-size: 17px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
