/* ============================================
   FESTIVAL LAMBRO — design tokens
   Palette presa dal logo: giallo sole, verde prato,
   rosso ciliegia, azzurro Lambro, asfalto, panna.
   ============================================ */
@import url('https://fonts.googleapis.com/css2?family=Caveat:wght@600;700&family=Work+Sans:wght@400;500;600;700&family=Space+Mono:wght@400;700&display=swap');

:root{
  --yellow: #F2B632;
  --green:  #6FA83E;
  --red:    #C4234B;
  --teal:   #3E9FB8;
  --ink:    #1C1B19;
  --cream:  #FBF7EF;
  --paper:  #FFFFFF;

  --font-display: 'Caveat', cursive;
  --font-body: 'Work Sans', system-ui, sans-serif;
  --font-mono: 'Space Mono', monospace;

  --radius: 14px;
  --shadow-soft: 0 6px 20px rgba(28,27,25,0.10);
}

*{ box-sizing:border-box; }
html,body{ margin:0; padding:0; }

body{
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  padding-bottom: 76px; /* spazio per tab bar */
}

a{ color:inherit; text-decoration:none; }
button{ font-family:inherit; }

#app-shell{ display: none; }

/* ---------- cancello d'ingresso ---------- */
.install-gate{
  display: none; /* JS lo mostra con flex se non siamo nella app installata */
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: var(--ink);
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow-y: auto;
}
.gate-panel{ display:none; max-width: 380px; text-align: center; }
.gate-logo{
  height: 64px;
  margin-bottom: 24px;
}
.gate-title{
  font-family: var(--font-display);
  font-size: 28px;
  color: var(--cream);
  margin: 0 0 10px;
}
.gate-text{
  color: #c9c5ba;
  font-size: 14px;
  line-height: 1.5;
  margin: 0 0 20px;
}
.gate-install-btn{
  width: 100%;
  padding: 14px;
  font-size: 16px;
}
.gate-install-btn:disabled{ opacity: 0.6; }

/* blocco istruzioni */
.gate-instructions{
  display: none;
  margin-top: 18px;
  background: rgba(255,255,255,0.07);
  border-radius: 14px;
  padding: 16px 18px 14px;
  text-align: left;
}
.gate-instructions-title{
  display: block;
  font-weight: 700;
  font-size: 15px;
  color: var(--cream);
  margin-bottom: 14px;
}
/* singolo step numerato */
.gate-step{
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}
.gate-step:last-of-type{ margin-bottom: 6px; }
.gate-step-num{
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--teal);
  color: #fff;
  font-weight: 800;
  font-size: 13px;
  line-height: 1;
  margin-top: 1px;
}
.gate-step-text{
  color: #d4d0c7;
  font-size: 13.5px;
  line-height: 1.5;
}
.gate-step-text strong{ color: var(--cream); }
.gate-ios-share-icon{
  display: inline-flex;
  vertical-align: middle;
  background: rgba(255,255,255,0.12);
  border-radius: 6px;
  padding: 3px 4px;
  margin: 0 2px;
}
.gate-ios-share-icon svg{ display: block; stroke: var(--teal); }
.gate-instructions-nota{
  display: block;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,0.1);
  color: #b0ab9f;
  font-size: 12px;
  line-height: 1.45;
}
.gate-reset-link{
  background: none;
  border: none;
  color: #83a25a;
  font-size: 13px;
  text-decoration: underline;
  margin-top: 8px;
  cursor: pointer;
  font-family: var(--font-body);
}

/* ---------- header ---------- */
.app-header{
  background: var(--ink);
  color: var(--cream);
  /* margini che si adattano alla larghezza dello schermo */
  padding: clamp(10px, 3.5vw, 18px) clamp(10px, 3vw, 16px);
  position: relative;
  overflow: hidden;
}
.app-header .brand{
  display: flex;
  align-items: center;
  gap: clamp(6px, 2vw, 10px);
  width: 100%;
  min-width: 0;   /* permette al logo di restringersi invece di sfondare */
}
/* icona Instagram nell'header, allineata a destra */
.header-instagram{
  margin-left: auto;
  flex: 0 0 auto;   /* non si restringe mai: lo spazio le è garantito */
  display: flex;
  align-items: center;
  justify-content: center;
  width: clamp(32px, 9vw, 38px);
  height: clamp(32px, 9vw, 38px);
  border-radius: 50%;
  color: var(--cream);
  background: rgba(255,255,255,0.15);
}
.header-instagram svg{
  width: clamp(17px, 5vw, 21px);
  height: clamp(17px, 5vw, 21px);
}
.header-instagram:active{ background: rgba(255,255,255,0.28); }

/* card "seguici su Instagram" in fondo alla fotogallery */
.ig-card{
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--paper);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  padding: 14px 16px;
  margin-top: 20px;
}
.ig-card-icona{
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px; height: 42px;
  border-radius: 12px;
  color: #fff;
  /* sfumatura tipica del marchio Instagram */
  background: linear-gradient(45deg, #F2B632, #C4234B 45%, #8E5BC4 75%, #3E9FB8);
}
.ig-card-icona svg{ width: 22px; height: 22px; }
.ig-card-testi{ flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ig-card-titolo{
  font-weight: 700;
  font-size: 14.5px;
  color: var(--ink);
  line-height: 1.2;
}
.ig-card-sub{
  font-size: 12.5px;
  color: #6b6660;
  margin-top: 2px;
  line-height: 1.3;
}
.ig-card-btn{
  flex-shrink: 0;
  background: var(--ink);
  color: var(--cream);
  font-weight: 700;
  font-size: 13px;
  padding: 9px 16px;
  border-radius: 999px;
  white-space: nowrap;
}
.ig-card:active{ opacity: 0.9; }

.app-header img.logo{
  /* usa esattamente l'altezza impostata da WordPress */
  height: var(--logo-height, 46px);
  width: auto;
  display: block;
  /* si restringe solo se davvero non ci sta, così non spinge mai
     l'icona Instagram fuori dallo schermo */
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100%;
  object-fit: contain;
  object-position: left center;
}
.app-header .tagline{
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--teal);
  margin-top: 6px;
}

/* firma: linea del fiume disegnata a mano, corre sotto l'header
   e riprende sulla pagina "Programma" per collegare le tappe */
.river-line{ display:block; width:100%; height:auto; }

/* ---------- tab bar ---------- */
.tab-bar{
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--paper);
  border-top: 1px solid rgba(0,0,0,0.08);
  display: flex;
  z-index: 50;
  padding-bottom: env(safe-area-inset-bottom, 0);
  /* iPhone: senza questo, durante lo scorrimento per inerzia Safari ridisegna
     la barra in ritardo e sembra staccarsi dal fondo dello schermo.
     Mettendola su un livello grafico proprio, resta incollata. */
  transform: translateZ(0);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}
.tab-btn{
  /* tutte le tab si dividono lo spazio in parti uguali, qualunque sia
     la larghezza dello schermo: niente più barra da scorrere */
  flex: 1 1 0;
  min-width: 0;
  border: none;
  background: none;
  padding: 9px 3px 7px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  color: #9a958c;
  font-weight: 600;
  font-family: var(--font-body);
  line-height: 1.15;
}
.tab-btn.active{ color: var(--red); }
.tab-btn svg{
  /* icona e testo si adattano alla larghezza del dispositivo */
  width: clamp(19px, 5.6vw, 23px);
  height: clamp(19px, 5.6vw, 23px);
  flex-shrink: 0;
}
.tab-label{
  display: block;
  width: 100%;
  text-align: center;
  font-size: clamp(9px, 2.7vw, 11px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- sections ---------- */
.view{ display:none; padding: 18px 16px 8px; }
.view.active{ display:block; }

.section-title{
  font-family: var(--font-display);
  font-size: 34px;
  line-height: 1;
  margin: 4px 0 2px;
  color: var(--ink);
}
.section-sub{
  font-family: var(--font-mono);
  font-size: 12px;
  color: #83a25a;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 18px;
}

/* ---------- timeline / tappe ---------- */
.timeline{
  position: relative;
  padding-left: 26px;
}
.timeline::before{
  content:'';
  position:absolute;
  left: 9px; top: 6px; bottom: 6px;
  width: 4px;
  background: var(--teal);
  border-radius: 4px;
  opacity: 0.35;
}
.tappa{
  position: relative;
  margin-bottom: 18px;
  /* le card (e i loro pallini) scendono di qualche pixel, mentre la linea
     verticale resta esattamente dov'è: usiamo transform, che non altera
     l'ingombro del contenitore e quindi non tocca la linea */
  transform: translateY(20px);
}
.tappa::before{
  content:'';
  position:absolute;
  left: -26px; top: 20px;
  width: 14px; height:14px;
  border-radius: 50%;
  background: var(--red);
  border: 3px solid var(--cream);
  box-shadow: 0 0 0 2px var(--teal);
  z-index: 1;
}
.tappa.stato-passata::before{ background:#b9b4a8; box-shadow:0 0 0 2px #b9b4a8; }
.tappa.stato-prossima::before{ background: var(--yellow); box-shadow:0 0 0 2px var(--yellow); }

.tappa-card{
  background: var(--paper);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  padding: 0;
  overflow: hidden;
}
.tappa-header{
  width: 100%;
  border: none;
  background: none;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  text-align: left;
  font-family: var(--font-body);
}
.tappa-chevron{
  width: 20px; height: 20px;
  color: #9a958c;
  flex-shrink: 0;
  margin-left: auto;
  transition: transform 0.2s ease;
}
.tappa-header.aperta .tappa-chevron{ transform: rotate(180deg); }
.tappa-body{
  padding: 0 16px 16px;
}
/* intestazione Programma: titolo + bottone piantina affiancati */
.programma-intestazione{
  display: flex;
  align-items: flex-end; /* si parte dal fondo del titolo... */
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.programma-intestazione .section-title{ margin: 0; }

/* bottone "Piantina del Festival"
   - altezza = altezza delle lettere minuscole di "Programma" (x-height)
   - bordo basso appoggiato sulla base della "P"
   - bordo destro allineato a quello delle card delle tappe */
.piantina-link{
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-shrink: 0;
  height: 24px;
  padding: 0 14px;
  margin: 0 0 0 0;   /* nessun margine a destra: si allinea alle card */
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  color: var(--teal);
  background: transparent;
  border: 1px solid var(--teal);
  border-radius: 999px;
  cursor: pointer;
}
.piantina-link:active{ background: rgba(62,159,184,0.1); }

.tappa-eyebrow{
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--teal);
  text-transform: uppercase;
  margin-bottom: 10px;
}
.tappa-title{
  display: block;
  font-family: var(--font-display);
  font-size: 24px;
  line-height: 1.15;
  color: #388fb5;
}
.tappa-meta{
  font-size: 13px;
  color: #6b6660;
  margin-bottom: 8px;
}
.tappa-meta strong{ color: var(--ink); }
.tappa-meta p{ margin: 0 0 8px; }
.tappa-meta p:last-child{ margin-bottom: 0; }
.badge-row{ display:flex; gap:6px; flex-wrap:wrap; margin-bottom:10px; }
.badge{
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 999px;
  font-weight: 700;
}
.badge.b-sport{ background: rgba(111,168,62,0.15); color:var(--green); }
.badge.b-cultura{ background: rgba(196,35,75,0.13); color:var(--red); }
.badge.b-natura{ background: rgba(62,159,184,0.15); color:var(--teal); }
.badge.b-musica{ background: rgba(242,182,50,0.22); color:#8a6210; }

.btn{
  display:inline-block;
  font-weight:700;
  font-size: 13px;
  padding: 9px 16px;
  border-radius: 999px;
  border: none;
  cursor:pointer;
}
.btn-primary{ background: var(--red); color:#fff; }
.btn-ghost{ background: transparent; color: var(--ink); border: 2px solid var(--ink); }

/* ---------- community ---------- */
.upload-cta{
  background: var(--ink);
  color: var(--cream);
  border-radius: var(--radius);
  padding: 16px;
  display:flex;
  align-items:center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.upload-cta p{ margin:0; font-size:13px; color:#c9c5ba; max-width: 60%; }
.upload-cta .btn-primary{ background: var(--yellow); color: var(--ink); }

.feed-filters{
  display:flex; gap:8px; overflow-x:auto; margin-bottom: 14px; padding-bottom:4px;
}
.chip{
  font-family: var(--font-mono);
  font-size: 12px;
  white-space:nowrap;
  padding: 6px 13px;
  border-radius: 999px;
  border: 2px solid var(--ink);
  background: transparent;
  color: var(--ink);
}
.chip.active{ background: var(--ink); color: var(--cream); }

.masonry{
  columns: 2;
  column-gap: 10px;
}
.photo-card{
  break-inside: avoid;
  margin-bottom: 10px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--paper);
  box-shadow: var(--shadow-soft);
}
.photo-card img{ width:100%; display:block; }
.photo-caption{
  padding: 8px 10px 10px;
  font-size: 12px;
}
.photo-caption .autore{ font-weight:700; }
.photo-caption .tappa-tag{
  font-family: var(--font-mono);
  color: var(--teal);
  font-size: 10px;
  text-transform:uppercase;
}
.pending-note{
  text-align:center;
  font-size: 12px;
  color: #9a958c;
  font-family: var(--font-mono);
  margin: 6px 0 20px;
}

/* ---------- install banner ---------- */
.install-banner{
  display:none;
  margin: 0 0 16px;
  background: var(--yellow);
  color: var(--ink);
  border-radius: var(--radius);
  padding: 12px 14px;
  align-items:center;
  justify-content: space-between;
  gap: 10px;
}
.install-banner.show{ display:flex; }
.install-banner span{ font-size: 13px; font-weight:600; }

/* ---------- empty / utility ---------- */
.empty-state{
  text-align:center;
  padding: 40px 20px;
  color:#9a958c;
  font-size:13px;
}

/* ---------- associazioni ---------- */
.assoc-list{
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.assoc-card{
  display: flex;
  align-items: stretch;   /* la colonna sinistra copre tutta l'altezza della card */
  gap: 14px;
  background: var(--paper);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  padding: 12px 14px;
}
/* colonna sinistra: logo in testa, zona in fondo */
.assoc-colonna{
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.assoc-zona{
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background: none;
  border: none;
  padding: 2px;
  cursor: pointer;
  font-family: var(--font-body);
}
.assoc-zona:active{ opacity: 0.6; }
.assoc-zona-cerchio{
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: #fff;
  border: 1.5px solid currentColor;
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 12px;
  line-height: 1;
}
.assoc-zona-testo{
  font-family: var(--font-mono);
  font-size: 8.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #9a958c;
  white-space: nowrap;
}
.assoc-logo{
  width: 56px; height: 56px;
  border-radius: 12px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--cream);
}
.assoc-logo-placeholder{
  display:flex; align-items:center; justify-content:center;
  font-family: var(--font-display);
  font-size: 26px;
  color: var(--teal);
  background: var(--cream);
}
.assoc-info{ flex:1; min-width:0; }
.assoc-nome{
  display:block;
  font-weight: 700;
  font-size: 15px;
  color: var(--ink);
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
a.assoc-nome:hover{ color: var(--red); }
.assoc-desc{
  font-size: 12.5px;
  color: #6b6660;
  margin: 0 0 8px;
  line-height: 1.4;
}
.assoc-cat-group{
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 12px;
}
.assoc-cat-heading{
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--teal);
  margin: 6px 0 0;
}
.assoc-cat-group:first-child .assoc-cat-heading{ margin-top: 0; }
.assoc-socials{ display:flex; gap:8px; }
.assoc-social-icon{
  width: 28px; height: 28px;
  display:flex; align-items:center; justify-content:center;
  border-radius: 50%;
  background: var(--cream);
  color: var(--ink);
}
.assoc-social-icon svg{ width:15px; height:15px; }
.assoc-social-icon:hover{ background: var(--teal); color:#fff; }

/* ---------- fascia "ora in corso" (solo nei giorni del festival) ---------- */
.oggi-banner{ display: none; }
.oggi-banner.visibile{
  display: block;
  position: sticky;
  top: 0;
  z-index: 45;
  background: var(--ink);
  color: var(--cream);
  /* margini negativi: annulla il padding della vista, così la fascia
     arriva ai bordi dello schermo e si "incolla" sotto l'header */
  margin: -18px -16px 18px;
  padding: 12px 20px 14px;
  border-bottom: 2px solid rgba(255,255,255,0.25);
}
.oggi-blocco{ padding: 2px 0 6px; }
.oggi-etichetta-riga{
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
}
.oggi-riga{
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  padding: 4px 0;
}
.oggi-riga-prossimo{
  border-top: 1px solid rgba(255,255,255,0.18);
  margin-top: 6px;
  padding-top: 10px;
}
.oggi-etichetta{
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: rgba(255,255,255,0.65);
  flex-shrink: 0;
}
.oggi-etichetta-riga .oggi-etichetta{ color: #86efac; }
.oggi-evento{
  font-weight: 700;
  font-size: 15px;
  color: var(--cream);
}
.oggi-pallino{
  width: 9px; height: 9px;
  border-radius: 50%;
  background: #4ade80;
  flex-shrink: 0;
  align-self: center;
  animation: pulsa 2s ease-in-out infinite;
}
@keyframes pulsa{
  0%, 100%{ opacity: 1; transform: scale(1); }
  50%{ opacity: 0.5; transform: scale(0.85); }
}

/* ---------- fotogallery ---------- */
.gallery-sezione{ margin-bottom: 26px; }
.gallery-sezione-titolo{
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--teal);
  margin: 0 0 10px;
}
.gallery-griglia{
  columns: 2;
  column-gap: 8px;
}
.gallery-thumb{
  width: 100%;
  display: block;
  break-inside: avoid;
  margin-bottom: 8px;
  border-radius: 10px;
  background: #e6e1d6;
  cursor: pointer;
}
.gallery-thumb:active{ opacity: 0.85; }

/* visualizzatore a schermo intero */
.lightbox{
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(12,12,11,0.96);
  align-items: center;
  justify-content: center;
  padding-top: env(safe-area-inset-top, 0);
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.lightbox.aperto{ display: flex; }
.lightbox-img{
  max-width: 100%;
  max-height: 82vh;
  object-fit: contain;
  user-select: none;
  -webkit-user-select: none;
}
.lightbox-close{
  position: absolute;
  top: calc(14px + env(safe-area-inset-top, 0));
  right: 14px;
  width: 40px; height: 40px;
  border: none;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  z-index: 2;
}
.lightbox-nav{
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px; height: 44px;
  border: none;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
}
.lightbox-prev{ left: 10px; }
.lightbox-next{ right: 10px; }
.lightbox-nav:disabled{ opacity: 0.25; }
.lightbox-contatore{
  position: absolute;
  bottom: calc(18px + env(safe-area-inset-bottom, 0));
  left: 0; right: 0;
  text-align: center;
  color: #c9c5ba;
  font-family: var(--font-mono);
  font-size: 12px;
}

/* ---------- banner fotogallery (fisso in fondo al Programma) ---------- */
/* il banner sta dentro #view-programma, quindi si nasconde da solo nelle altre tab */
#view-programma:not(.active) #gallery-banner{ display: none; }

#gallery-banner:not(:empty){
  position: fixed;
  left: 0; right: 0;
  bottom: var(--tabbar-height, 76px); /* misurata a runtime, si incolla alla tab bar */
  z-index: 40;
  /* stessa accortezza della tab bar, per lo scorrimento su iPhone */
  transform: translateZ(0);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}
.gallery-card{
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  background: var(--ink);
  padding: 9px 16px;
  box-shadow: 0 -4px 16px rgba(28,27,25,0.12);
}
.gallery-card-testi{
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.gallery-card-titolo{
  display: block;
  font-family: var(--font-display);
  font-size: 24px;
  color: var(--cream);
  line-height: 1;
}
.gallery-card-sub{
  display: block;
  font-size: 12.5px;
  color: rgba(255,255,255,0.8);
  margin-top: 3px;
  line-height: 1.2;
}
.gallery-card-btn{
  flex-shrink: 0;
  align-self: center;
  background: var(--yellow);
  color: var(--ink);
  font-weight: 700;
  font-size: 14px;
  padding: 11px 18px;
  border-radius: 999px;
  white-space: nowrap;
}
.gallery-card:active{ opacity: 0.9; }

/* spazio in fondo alla timeline, così l'ultima tappa non finisce sotto al banner */
#view-programma.con-banner .timeline{ padding-bottom: 100px; }

/* ---------- piantina interattiva del festival ---------- */

/* la tab "Dove siamo" occupa esattamente lo spazio tra header e tab bar:
   la mappa si allarga o si restringe da sola per riempire quel che avanza,
   così su qualsiasi proporzione di schermo restano visibili anche i bottoni */
#view-mappa.active{
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  height: calc(100dvh - var(--header-height, 90px) - var(--tabbar-height, 76px));
  overflow-y: auto;
}
@supports not (height: 100dvh){
  #view-mappa.active{
    height: calc(100vh - var(--header-height, 90px) - var(--tabbar-height, 76px));
  }
}

.piantina-mappa{
  flex: 1 1 auto;      /* si prende tutto lo spazio che avanza */
  min-height: 200px;   /* ...ma non scende sotto una soglia leggibile */
  width: 100%;
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  background: #e6e1d6;
}
.piantina-azioni{
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-shrink: 0;
}
.piantina-azioni .btn{
  flex: 1;
  padding: 10px 8px;
  font-size: 13px;
}
.piantina-indicazioni{
  display: block;
  width: 100%;
  text-align: center;
  margin-top: 8px;
  flex-shrink: 0;
}
/* nella tab mappa questi elementi non si comprimono: solo la mappa si adatta */
#view-mappa.active > .section-title,
#view-mappa.active > .section-sub,
#view-mappa.active > .piantina-filtri,
#view-mappa.active > .piantina-nota{ flex-shrink: 0; }

.piantina-filtri{
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 6px;
  margin-bottom: 10px;
}
.piantina-filtri::-webkit-scrollbar{ display: none; }
.piantina-chip{
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 999px;
  border: 2px solid #e6e1d6;
  background: var(--paper);
  color: #6b6660;
  cursor: pointer;
  font-family: var(--font-body);
}
.piantina-chip.active{
  border-color: currentColor;
  background: var(--paper);
}
.piantina-nota{
  font-size: 12px;
  color: #9a958c;
  text-align: center;
  margin-top: 8px;
  min-height: 1.2em;
}

/* segnaposto: cerchio colorato con emoji, oppure lettera per le aree */
.punto-marker{
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 3px solid #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.35);
  font-size: 15px;
  /* le lettere (A, B, C) devono risultare nette e centrate */
  font-family: var(--font-body);
  font-weight: 800;
  line-height: 1;
}
/* i cerchi chiari (le aree) avrebbero un bordo bianco invisibile:
   glielo scuriamo, così restano staccati dalla mappa */
.punto-marker.chiaro{
  border-color: #1C1B19;
  font-size: 16px;
}
.leaflet-popup-content{
  font-family: var(--font-body);
  margin: 12px 14px;
}
.punto-popup-nome{
  font-weight: 700;
  font-size: 14px;
  color: var(--ink);
  margin-bottom: 3px;
}
.punto-popup-desc{
  font-size: 12.5px;
  color: #6b6660;
  line-height: 1.4;
}
.punto-popup-orari{
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--teal);
  margin-top: 4px;
}

/* ---------- dove siamo (mappa) ---------- */
.mappa-embed{
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  margin-bottom: 14px;
}
.mappa-embed iframe{
  width: 100%;
  height: 260px;
  border: 0;
  display: block;
}
.mappa-indirizzo{
  font-size: 13px;
  color: #6b6660;
  margin: 10px 0 8px;
  text-align: center;
}
#mappa-link-btn{
  display: block;
  text-align: center;
}

/* ---------- corriamo per la pace ---------- */
.corriamo-content{
  background: var(--paper);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  padding: 16px 18px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink);
}
.corriamo-content h3{
  font-family: var(--font-display);
  font-size: 22px;
  margin: 20px 0 8px;
  color: var(--red);
}
.corriamo-content h3:first-child{ margin-top: 0; }
.corriamo-content ul{ margin: 0 0 12px; padding-left: 20px; }
.corriamo-content li{ margin-bottom: 4px; }
.corriamo-content p{ margin: 0 0 12px; }
.corriamo-content a{ color: var(--teal); text-decoration: underline; }

/* ---------- promo ---------- */
.promo-list{
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.promo-card{
  background: var(--paper);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}
.promo-img{
  width: 100%;
  max-height: 220px;
  object-fit: contain;
  background: var(--cream);
  border-radius: 10px;
  display: block;
  margin-bottom: 12px;
}
.promo-img-clickable{
  cursor: pointer;
}
.promo-img-clickable:active{ opacity: 0.85; }
.promo-body{ padding: 14px 16px; }
.promo-titolo{
  font-family: var(--font-display);
  font-size: 22px;
  margin: 0 0 6px;
  color: var(--ink);
}
.promo-desc{
  font-size: 13px;
  color: #6b6660;
  margin: 0 0 12px;
  line-height: 1.4;
}
.promo-azioni{ display:flex; gap:8px; flex-wrap:wrap; }
.promo-copy-btn{ font-family: var(--font-mono); letter-spacing: 0.02em; }

/* ---------- chi siamo (nascosta) ---------- */
.app-header img#header-logo{ cursor: pointer; }

.chisiamo-logo-wrap{
  display:flex;
  justify-content:center;
  margin-bottom: 18px;
}
.chisiamo-socials{
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.chisiamo-socials:empty{ display: none; }
.chisiamo-logo{
  height: var(--chisiamo-logo-height, 70px);
  max-width: 100%;
  width: auto;
}
.chisiamo-descrizione{
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink);
  margin-bottom: 8px;
}
.chisiamo-descrizione p{ margin: 0 0 10px; }

.chisiamo-label{
  font-size: 11px;
  font-family: var(--font-mono);
  text-transform: uppercase;
  color: #83a25a;
  margin: 14px 0 4px;
}
#chisiamo-form textarea.upload-input{
  resize: vertical;
  font-family: var(--font-body);
}
.chisiamo-esito{
  margin-top: 14px;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  min-height: 1.2em;
}
.chisiamo-esito.ok{ color: var(--green); }
.chisiamo-esito.errore{ color: var(--red); }

/* ---------- input di modulo (riusati anche in Chi Siamo) ---------- */
.upload-input{
  width:100%;
  padding: 11px 12px;
  border-radius: 10px;
  border: 2px solid #e6e1d6;
  font-family: var(--font-body);
  font-size: 14px;
  background: var(--cream);
}
.upload-input:focus{ outline: 2px solid var(--teal); border-color: var(--teal); }
.upload-error{
  color: var(--red);
  font-size: 13px;
  margin: 10px 0 0;
  min-height: 1em;
}

/* ---------- stati di caricamento ---------- */
.loading-note{
  text-align:center;
  padding: 30px 20px;
  color:#9a958c;
  font-family: var(--font-mono);
  font-size: 12px;
}

@media (min-width: 640px){
  .view{ max-width: 640px; margin:0 auto; padding-left:24px; padding-right:24px; }
  .app-header .brand{ max-width:640px; margin:0 auto; }
  /* su schermi larghi le tab non si spalmano su tutta la pagina:
     restano centrate come il resto del contenuto */
  .tab-bar{ justify-content: center; }
  .tab-btn{ flex: 0 1 128px; }
}
