/* ============================================================
   PAGINA REGIONE — Hero + Testo + Media Gallery
   Versione semplificata
   ============================================================ */

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
[hidden] { display: none !important; }

:root {
  --bg: #000;
  --bg-2: #08080a;
  --bg-3: #0d0d10;
  --text: #f5f5f7;
  --muted: #86868b;
  --accent: #2997ff;
  --yellow: #ffcd00;
  --red: #ff3b30;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-apple: cubic-bezier(0.23, 1, 0.32, 1);
}

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
body {
  min-height: 100vh;
  letter-spacing: -0.01em;
  /* Cursore spiga di grano default su tutta la pagina */
  cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 32 32'><g transform='translate(16 16)'><line x1='0' y1='-11' x2='0' y2='9' stroke='%23ffcd00' stroke-width='1.4' stroke-linecap='round'/><ellipse cx='-2.6' cy='-8' rx='1.8' ry='2.8' fill='%23ffcd00' transform='rotate(-25 -2.6 -8)'/><ellipse cx='2.6' cy='-8' rx='1.8' ry='2.8' fill='%23ffcd00' transform='rotate(25 2.6 -8)'/><ellipse cx='-3.4' cy='-3' rx='1.9' ry='3' fill='%23ffcd00' transform='rotate(-25 -3.4 -3)'/><ellipse cx='3.4' cy='-3' rx='1.9' ry='3' fill='%23ffcd00' transform='rotate(25 3.4 -3)'/><ellipse cx='-4' cy='2' rx='2' ry='3.2' fill='%23ffcd00' transform='rotate(-25 -4 2)'/><ellipse cx='4' cy='2' rx='2' ry='3.2' fill='%23ffcd00' transform='rotate(25 4 2)'/></g></svg>") 16 16, auto;
}

/* Cursore "pointer" (link, bottoni, podcast bar): spiga più grande/luminosa */
a, button, [role="button"], .podcast-bar, .podcast-line, .person-tag, label[onclick], select, input[type="checkbox"], input[type="radio"] {
  cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='34' height='34' viewBox='0 0 32 32'><g transform='translate(16 16)'><line x1='0' y1='-12' x2='0' y2='10' stroke='%23ffe066' stroke-width='1.6' stroke-linecap='round'/><ellipse cx='-3' cy='-9' rx='2.1' ry='3.4' fill='%23ffe066' transform='rotate(-25 -3 -9)'/><ellipse cx='3' cy='-9' rx='2.1' ry='3.4' fill='%23ffe066' transform='rotate(25 3 -9)'/><ellipse cx='-4' cy='-4' rx='2.3' ry='3.6' fill='%23ffe066' transform='rotate(-25 -4 -4)'/><ellipse cx='4' cy='-4' rx='2.3' ry='3.6' fill='%23ffe066' transform='rotate(25 4 -4)'/><ellipse cx='-4.5' cy='1' rx='2.5' ry='3.9' fill='%23ffe066' transform='rotate(-25 -4.5 1)'/><ellipse cx='4.5' cy='1' rx='2.5' ry='3.9' fill='%23ffe066' transform='rotate(25 4.5 1)'/></g></svg>") 17 17, pointer;
}

/* Su input testuali invece torna il cursore "I-beam" classico (per scrivere) */
input[type="text"], input[type="email"], input[type="number"], input[type="search"], input[type="tel"], input[type="url"], input[type="password"], textarea {
  cursor: text;
}

/* Loading state */
.loader {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  transition: opacity 0.5s var(--ease), visibility 0s linear 0.5s;
}
.loader.hidden { opacity: 0; visibility: hidden; }
.spinner {
  width: 32px; height: 32px;
  border: 2px solid rgba(255,255,255,0.1);
  border-top-color: var(--yellow);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Page fade overlay */
.pagefade {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s var(--ease);
}
.pagefade.on { opacity: 1; pointer-events: all; }

/* Progress bar (scroll indicator) */
.progress-bar {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0;
  background: var(--yellow);
  z-index: 200;
  transition: width 0.05s linear;
}

/* Error screen */
.error-screen {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 998;
  display: flex;
  align-items: center;
  justify-content: center;
}
.error-inner {
  text-align: center;
  padding: 2rem;
  max-width: 520px;
}
.error-eyebrow {
  font-size: 0.78rem;
  color: var(--red);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}
.error-title {
  font-size: 2rem;
  font-weight: 600;
  margin-bottom: 1rem;
}
.error-text {
  color: var(--muted);
  margin-bottom: 2rem;
}
.error-back {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.95rem;
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
  transition: border-color 0.2s ease;
}
.error-back:hover { border-color: var(--accent); }

/* ============================================================
   NAVBAR PETRA
   ============================================================ */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 8px 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  transition: background 0.4s var(--ease), padding 0.3s var(--ease);
}
.nav.scrolled {
  background: rgba(0,0,0,0.85);
  padding: 6px 0;
}
.nav-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand { display: flex; align-items: center; }
.logo-link {
  display: block;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
.logo-container {
  position: relative;
  height: 36px;
  display: inline-block;
  cursor: pointer;
  transition: transform 0.4s cubic-bezier(0.2,0.8,0.2,1);
  overflow: hidden;
  border-radius: 4px;
}
.logo-container:hover { transform: scale(1.05); }
.logo-container:active { transform: scale(0.96); }
.brand-logo {
  height: 100%;
  width: auto;
  display: block;
  position: relative;
  z-index: 2;
}
.logo-glow {
  position: absolute;
  inset: -8px;
  background: radial-gradient(ellipse, rgba(255,205,0,0.25) 0%, transparent 70%);
  z-index: 0;
  animation: logoGlowPulse 3s ease-in-out infinite;
  pointer-events: none;
  filter: blur(10px);
}
@keyframes logoGlowPulse {
  0%, 100% { opacity: 0.4; transform: scale(1); }
  50%      { opacity: 0.8; transform: scale(1.1); }
}
.logo-shine {
  position: absolute;
  top: 0; left: -110%;
  width: 100%; height: 100%;
  background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,0.45) 50%, transparent 70%);
  z-index: 5;
  pointer-events: none;
  opacity: 0;
  transition: left 0.7s var(--ease), opacity 0.2s ease;
}
.logo-container:hover .logo-shine { opacity: 1; left: 110%; }

.nav-right {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  color: var(--muted);
}
.back-link {
  color: var(--text);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  transition: opacity 0.2s ease;
}
.back-link:hover { opacity: 0.7; }
.back-link .arrow {
  font-size: 1.05rem;
  transition: transform 0.25s var(--ease);
}
.back-link:hover .arrow { transform: translateX(-3px); }
.codice {
  color: var(--muted);
  font-family: "SF Mono", Menlo, monospace;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ============================================================
   PAGE — contenitore principale
   ============================================================ */
.page {
  position: relative;
  z-index: 1;
}

/* ============================================================
   HERO — Schermata iniziale (mappa BIG dietro, titolo+sub davanti)
   ============================================================ */
.hero {
  position: relative;
  height: 100vh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse 80% 70% at 50% 50%, rgba(255,205,0,0.10) 0%, transparent 70%),
    var(--bg);
  overflow: hidden;
}
.hero-inner {
  position: relative;
  z-index: 2;
  max-width: 900px;
  width: 100%;
  text-align: center;
  padding: 0 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  /* Inizialmente nascosto: viene rivelato quando si inizia a scrollare */
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s var(--ease-apple), transform 0.8s var(--ease-apple);
  pointer-events: none;
}
.hero-inner.in-view {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.hero-title {
  font-size: clamp(2rem, 4.5vw, 3.8rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  background: linear-gradient(180deg, #fff 0%, #c0c0c0 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-subtitle {
  font-size: clamp(1rem, 1.4vw, 1.25rem);
  color: var(--muted);
  line-height: 1.5;
  font-weight: 400;
}
.hero-subtitle:empty { display: none; }

/* Scroll hint */
.scroll-hint {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  animation: scrollHintBob 2s ease-in-out infinite;
  pointer-events: none;
  z-index: 3;
  opacity: 1;
  transition: opacity 0.4s ease;
}
.scroll-hint.hidden { opacity: 0; }
.scroll-arrow { font-size: 1.2rem; }
@keyframes scrollHintBob {
  0%, 100% { transform: translateX(-50%) translateY(0); opacity: 0.6; }
  50%      { transform: translateX(-50%) translateY(8px); opacity: 1; }
}

/* ============================================================
   FLOATING MAP — la mappa che si muove con lo scroll
   Posizionata in fixed, JS gestisce posizione + dimensione
   Contiene: mappa SVG + nome regione + coordinate (tutto si muove insieme)
   ============================================================ */
.floating-map {
  position: fixed;
  top: 0;
  left: 0;
  width: clamp(320px, 60vh, 640px);
  height: clamp(320px, 60vh, 640px);
  z-index: 1;
  pointer-events: none;
  transition: none;
  will-change: transform, width, height;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}
.floating-map .hero-map {
  flex: 1 1 auto;
  width: 100%;
  min-height: 0; /* permette al flex di shrinkare */
  display: flex;
  align-items: center;
  justify-content: center;
}
.floating-map svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}

/* Nome regione + coord: stanno dentro il floating-map, sotto la mappa */
.hero-region {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  text-align: center;
  flex: 0 0 auto;
}
.hero-region-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--yellow);
  text-transform: uppercase;
  letter-spacing: 0.3em;
}
.hero-region-coord {
  font-family: "SF Mono", Menlo, monospace;
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.1em;
}

/* Versione fixed delle coord usata SOLO su mobile. Default nascosta. */
.coord-sticky-m {
  display: none;
}

.hero-map .region-shape {
  fill: rgba(255,205,0,0.15);
  stroke: var(--yellow);
  stroke-width: 1.5;
  filter: drop-shadow(0 0 30px rgba(255,205,0,0.4))
          drop-shadow(0 0 80px rgba(255,205,0,0.25));
}
/* ============================================================
   HERO PIN — Spiga di grano nella mini-mappa della pagina regione
   ============================================================ */
.hero-pin-pos { /* solo wrapper di posizionamento */ }

.hero-pin-wheat {
  transform-origin: 0px 12px;
  animation: heroWheatSway 3.5s ease-in-out infinite;
}
@keyframes heroWheatSway {
  0%, 100% { transform: rotate(-3deg); }
  50%      { transform: rotate(3deg); }
}

.hero-wheat-stem {
  stroke: #d4a017;
  stroke-width: 1.6;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
  filter: drop-shadow(0 0 4px rgba(255, 205, 0, 0.6));
}

.hero-wheat-grain {
  fill: #ffcd00;
  stroke: #d4a017;
  stroke-width: 0.5;
  vector-effect: non-scaling-stroke;
  filter: drop-shadow(0 0 5px rgba(255, 205, 0, 0.75));
  animation: heroGrainGlow 2.5s ease-in-out infinite;
}
@keyframes heroGrainGlow {
  0%, 100% {
    fill: #ffcd00;
    filter: drop-shadow(0 0 5px rgba(255, 205, 0, 0.75));
  }
  50% {
    fill: #ffe066;
    filter: drop-shadow(0 0 10px rgba(255, 205, 0, 1));
  }
}
.hero-wheat-tip { fill: #ffe066; }

.hero-wheat-glow {
  fill: rgba(255, 205, 0, 0.08);
  filter: blur(6px);
  animation: heroGlowPulse 2.5s ease-in-out infinite;
  transform-origin: 0px -2px;
}
@keyframes heroGlowPulse {
  0%, 100% { opacity: 0.6; transform: scale(1);   }
  50%      { opacity: 1;   transform: scale(1.2); }
}

/* ============================================================
   CONTENT GRID — Testo (sx) + Aside sticky (dx)
   ============================================================ */
.content-grid {
  position: relative;
  display: grid;
  grid-template-columns: 1fr clamp(360px, 38%, 520px);
  gap: 0;
  max-width: 1600px;
  margin: 0 auto;
  align-items: start;
}

.content-main {
  min-width: 0;
  padding: 6rem 0;
}

.content-aside {
  position: sticky;
  top: 0;
  height: 100vh;
}
.aside-inner {
  width: 100%;
  height: 100%;
}

/* ============================================================
   SECTION — base
   ============================================================ */
.section {
  position: relative;
  padding: 5rem 5vw;
  border-top: 1px solid rgba(255,255,255,0.05);
}
.section-inner {
  max-width: 720px;
  margin: 0 auto 0 0; /* alllineato a sinistra */
}

/* La prima section non ha border-top (è la prima dopo l'hero) */
.content-main > .section:first-child {
  border-top: none;
}

/* ============================================================
   SEZIONE TESTO (con HTML formattato)
   ============================================================ */
/* ============================================================
   READING PROGRESS — Linea gialla sottile in alto sopra la nav
   ============================================================ */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 2px;
  background: linear-gradient(90deg, #ffcd00 0%, #ffe66e 50%, #ffcd00 100%);
  z-index: 1000;
  pointer-events: none;
  box-shadow: 0 0 8px rgba(255, 205, 0, 0.6);
  transition: width 0.05s linear;
}
@media (max-width: 900px), (max-height: 500px) and (orientation: landscape), (max-width: 1366px) and (hover: none) and (pointer: coarse) {
  .reading-progress { height: 2px; }
}

/* ============================================================
   IMMAGINE INTERVISTA — Identico Apple iPhone 17 Pro
   Slide centrale grande, peek laterali, margini neri ai bordi
   ============================================================ */

/* ============================================================
   IMMAGINE INTERVISTA — REPLICA APPLE iPhone 17 Pro
   Pattern Apple: container full-width, slide centrale rettangolare,
   peek visibili ai lati, dots sotto + play/pause
   ============================================================ */

/* Sezione: full-width breakout per occupare tutta la viewport */
.section-intervista-img {
  position: relative;
  width: 100vw;
  /* Centra la sezione nel viewport considerando il content-grid (max-width 1600px centrato).
     Il padding-left della colonna grid sx è (100vw - 1600px) / 2 quando viewport > 1600px.
     Per portare la sezione a sx 0 viewport, serve margin-left negativo di quel valore. */
  margin-left: calc((min(100vw, 1600px) - 100vw) / 2);
  margin-right: calc((min(100vw, 1600px) - 100vw) / 2);
  padding: 4rem 0 5rem;
  border-top: none !important;
  z-index: 5;
  background: var(--bg, #000);
}

.section-intervista-img .section-inner {
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 0;
}

.intervista-img-figure {
  margin: 0;
  width: 100%;
  padding: 0;
  box-sizing: border-box;
}

/* Singola immagine */
.intervista-img-figure > img {
  display: block;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 22px;
  animation: intervistaImgFadeIn 0.6s cubic-bezier(0.4, 0, 0.2, 1) both;
}

@keyframes intervistaImgFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0);  }
}

/* ============================================================
   SLIDESHOW — Replica Apple: scroll-snap + grid orizzontale
   ============================================================ */
.intervista-slideshow {
  position: relative;
  width: 100%;
  outline: none;
  animation: intervistaImgFadeIn 0.6s cubic-bezier(0.4, 0, 0.2, 1) both;
}

/* Viewport: maschera che mostra solo la zona centrale + peek */
.intervista-slideshow-viewport {
  position: relative;
  width: 100%;
  overflow: hidden;
}

/* Track: contiene tutte le slide affiancate.
   La centratura della slide attiva è gestita via JS (transform) */
.intervista-slides {
  display: flex;
  gap: 16px;
  padding: 0;
  transition: transform 0.85s cubic-bezier(0.65, 0, 0.35, 1);
  will-change: transform;
}

/* Apple-style: ALTEZZA fissa, larghezza variabile in base all'aspect della foto.
   Foto verticali = card stretta. Foto orizzontali = card larga. Niente cropping. */
.intervista-slide {
  flex: 0 0 auto;
  height: 600px;
  border-radius: 22px;
  overflow: hidden;
  background: #0a0a0a;
  cursor: pointer;
  opacity: 1;
}
.intervista-slide.is-active {
  cursor: default;
}
.intervista-slide img {
  height: 100%;
  width: auto;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

/* ============================================================
   Controlli sotto: dots-progress + play/pause stile Apple
   ============================================================ */
.intervista-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin-top: 32px;
}

.intervista-dots {
  display: flex;
  align-items: center;
  gap: 10px;
}

.intervista-dot {
  position: relative;
  width: 8px;
  height: 8px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  cursor: pointer;
  overflow: hidden;
  transition: background 0.25s ease, width 0.4s cubic-bezier(0.4, 0, 0.2, 1), border-radius 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.intervista-dot:hover { background: rgba(255, 255, 255, 0.5); }

.intervista-dot.is-active {
  width: 56px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.3);
}

.intervista-dot-fill {
  position: absolute;
  inset: 0;
  width: 0%;
  background: rgba(255, 255, 255, 0.95);
  border-radius: inherit;
  pointer-events: none;
}

.intervista-playpause {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.18);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 0.2s ease, transform 0.2s ease;
  flex-shrink: 0;
}
.intervista-playpause:hover {
  background: rgba(255, 255, 255, 0.32);
  transform: scale(1.08);
}
.intervista-playpause:active { transform: scale(0.95); }
.intervista-playpause svg { width: 12px; height: 12px; fill: #fff; }

.intervista-img-caption {
  margin-top: 0.9rem;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.5);
  font-style: italic;
  line-height: 1.4;
  text-align: center;
}

/* Mobile: slide più piccola, peek minimo (Apple style) */
@media (max-width: 900px), (max-height: 500px) and (orientation: landscape), (max-width: 1366px) and (hover: none) and (pointer: coarse) {
  .section-intervista-img { padding: 2rem 0 3rem; }
  .intervista-img-figure > img,
  .intervista-slide { border-radius: 22px; }
  .intervista-slide {
    height: 70vw;       /* altezza fissa proporzionale al viewport */
    max-height: 480px;  /* cap su tablet larghi */
  }
  .intervista-slides {
    padding: 0;
    gap: 12px;
  }
  .intervista-img-figure > img { max-width: calc(100vw - 80px); }
  .intervista-controls { gap: 14px; margin-top: 24px; }
  .intervista-dot { width: 7px; height: 7px; }
  .intervista-dot.is-active { width: 42px; }
}


.section-text {
  background: transparent;
}
@keyframes intervistaImgFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0);  }
}

.intervista-img-caption {
  margin-top: 0.9rem;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.5);
  font-style: italic;
  line-height: 1.4;
  text-align: center;
}


/* ============================================================
   PODCAST BAR — Apple Liquid Glass (iOS 26 style)
   Architettura a 4 layer separati:
     0) effect: backdrop blur + SVG displacement (rifrazione)
     1) tint: colore semi-trasparente del vetro
     2) shine: riflessi (specular highlight + bordi)
     3) content: contenuto interattivo (sopra a tutto)
   ============================================================ */
.section-podcast {
  padding: 4rem 3rem 1rem;
}
.section-podcast .section-inner {
  max-width: 800px;
  margin: 0 auto;
}

/* Wrapper esterno: niente styling visivo, solo posizionamento */
.podcast-bar {
  position: relative;
  display: block;
  cursor: pointer;
  user-select: none;
  width: 100%;
  border-radius: 999px;
  overflow: hidden;
  isolation: isolate;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow:
    0 6px 20px rgba(0, 0, 0, 0.35),
    0 1px 2px rgba(0, 0, 0, 0.4);
}
.podcast-bar:active { transform: scale(0.99); }
.podcast-bar:hover {
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.45),
    0 2px 4px rgba(0, 0, 0, 0.4);
}

/* LAYER 0 — Refraction effect: blur background.
   NOTA: ho rimosso 'filter: url(#liquid-glass-podcast)' (feTurbulence + feSpecularLighting
   + feDisplacementMap) perché era estremamente pesante e causava lag in tutta la pagina.
   Tengo solo il backdrop-filter blur che è accelerato in GPU e leggero. */
.podcast-bar__effect {
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  pointer-events: none;
}

/* LAYER 1 — Tint: leggera tinta bianca trasparente */
.podcast-bar__tint {
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
  background: rgba(255, 255, 255, 0.08);
  pointer-events: none;
}

/* LAYER 2 — Shine: bordi con riflesso (specular highlight) */
.podcast-bar__shine {
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: inherit;
  pointer-events: none;
  /* Bordi interni che simulano la riflessione della luce */
  box-shadow:
    inset 1px 1px 1px 0 rgba(255, 255, 255, 0.45),
    inset -1px -1px 1px 1px rgba(255, 255, 255, 0.18),
    inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  /* Gradiente per il top-glow */
  background: linear-gradient(
    175deg,
    rgba(255, 255, 255, 0.12) 0%,
    rgba(255, 255, 255, 0.02) 30%,
    rgba(255, 255, 255, 0) 60%
  );
  transition: box-shadow 0.3s ease;
}
.podcast-bar:hover .podcast-bar__shine {
  box-shadow:
    inset 1px 1px 2px 0 rgba(255, 255, 255, 0.6),
    inset -1px -1px 1px 1px rgba(255, 255, 255, 0.25),
    inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}

/* LAYER 3 — Content: tutto ciò che è interattivo */
.podcast-bar__content {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 18px 10px 10px;
}

/* Pulsante play/pause */
.podcast-icon {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #ffffff;
  color: #000000;
  transition: background 0.25s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.25s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
}
.podcast-bar:hover .podcast-icon {
  background: var(--accent, #ffcd00);
  box-shadow: 0 4px 20px rgba(255, 205, 0, 0.5);
  transform: scale(1.05);
}
.podcast-bar.is-playing .podcast-icon {
  background: var(--accent, #ffcd00);
}
.podcast-icon svg {
  width: 12px;
  height: 12px;
  display: block;
}
.podcast-icon .icon-play  { margin-left: 2px; }
.podcast-icon .icon-pause { display: none; }
.podcast-bar.is-playing .podcast-icon .icon-play  { display: none; }
.podcast-bar.is-playing .podcast-icon .icon-pause { display: block; }

/* Etichetta */
.podcast-label {
  color: rgba(255, 255, 255, 0.95);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.01em;
  white-space: nowrap;
  flex: 0 0 auto;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}
.podcast-label .label-default { display: inline; }
.podcast-label .label-playing { display: none; }
.podcast-bar.is-playing .label-default { display: none; }
.podcast-bar.is-playing .label-playing { display: inline; }

/* Freccia */
.podcast-arrow {
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
  flex: 0 0 auto;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              color 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.podcast-bar:hover .podcast-arrow { transform: translateX(3px); color: rgba(255,255,255,0.95); }
.podcast-bar.is-playing .podcast-arrow {
  opacity: 0;
  width: 0;
  margin: 0;
  overflow: hidden;
  display: none;
}

/* Tempo */
.podcast-time {
  display: none;
  font-size: 11px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.8);
  font-variant-numeric: tabular-nums;
  flex: 0 0 auto;
  white-space: nowrap;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}
.podcast-bar.is-playing .podcast-time { display: inline; }

/* Progress track */
.podcast-line {
  flex: 1 1 auto;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  position: relative;
  border-radius: 99px;
  cursor: pointer;
  overflow: hidden;
  box-shadow: inset 0 1px 1px rgba(0,0,0,0.2);
  transition: height 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.podcast-line:hover { height: 6px; }
.podcast-line .podcast-progress {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 0%;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 99px;
  box-shadow: 0 0 6px rgba(255,255,255,0.4);
  transition: width 0.1s linear;
}
.podcast-bar.is-playing .podcast-line .podcast-progress {
  background: var(--accent, #ffcd00);
  box-shadow: 0 0 8px rgba(255, 205, 0, 0.55);
}

.podcast-audio { display: none; }

@media (max-width: 900px), (max-height: 500px) and (orientation: landscape), (max-width: 1366px) and (hover: none) and (pointer: coarse) {
  .section-podcast { padding: 2.5rem 1.5rem 0.5rem; }
  .podcast-bar__content { gap: 10px; padding: 8px 14px 8px 8px; }
  .podcast-icon { width: 32px; height: 32px; }
  .podcast-label { font-size: 12px; }
  .podcast-time { font-size: 10px; }
}
.section-text .lead {
  font-size: clamp(1.05rem, 1.4vw, 1.35rem);
  color: var(--text);
  line-height: 1.5;
  font-weight: 400;
  max-width: 800px;
  margin: 0 auto;
}
.section-text .lead:empty { display: none; }

/* Stili per il contenuto HTML che arriva dal Google Sheet */
.section-text .lead b,
.section-text .lead strong {
  color: var(--yellow);
  font-weight: 600;
}
.section-text .lead i,
.section-text .lead em {
  font-style: italic;
  color: var(--text);
}
.section-text .lead a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(41,151,255,0.3);
  transition: border-color 0.2s ease;
}
.section-text .lead a:hover { border-bottom-color: var(--accent); }
.section-text .lead p,
.section-text .lead div {
  margin-top: 0;
  margin-bottom: 0.6em;
}
.section-text .lead p:last-child,
.section-text .lead div:last-child {
  margin-bottom: 0;
}
.section-text .lead > *:first-child {
  margin-top: 0 !important;
}

/* Spazio prima delle domande (marcate dal JS) */
.section-text .lead .is-question {
  margin-top: 2.5em;
  margin-bottom: 0.9em;
}
.section-text .lead .is-question:first-child {
  margin-top: 0;
}

/* Paragrafi/div vuoti: nessuno spazio */
.section-text .lead p:empty,
.section-text .lead div:empty {
  display: none !important;
  margin: 0 !important;
  padding: 0 !important;
  height: 0 !important;
}
/* Paragrafi/div che contengono solo &nbsp; o <br> o whitespace */
.section-text .lead p:has(> br:only-child),
.section-text .lead div:has(> br:only-child) {
  display: none !important;
}

/* <br> consecutivi: comprimi */
.section-text .lead br {
  line-height: 0.3;
}
.section-text .lead br + br {
  display: none;
}
.section-text .lead ul,
.section-text .lead ol {
  margin: 1em 0 1em 1.5em;
}
.section-text .lead li {
  margin-bottom: 0.4em;
}
.section-text .lead blockquote {
  border-left: 3px solid var(--yellow);
  padding-left: 1.2rem;
  margin: 1.5em 0;
  font-style: italic;
  color: var(--muted);
}

/* ============================================================
   SEZIONE MEDIA — Galleria foto + video
   ============================================================ */
.section-media {
  background: var(--bg);
}
.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 1.5rem;
}
.media-grid:has(> :only-child) {
  grid-template-columns: 1fr;
  max-width: 900px;
  margin: 0 auto;
}

.media-item {
  position: relative;
  width: 100%;
  border-radius: 16px;
  overflow: hidden;
  background: var(--bg-3);
  aspect-ratio: 16 / 10;
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease);
}
.media-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 60px rgba(255,205,0,0.15);
}

.media-item img,
.media-item video,
.media-item iframe {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border: 0;
}

.media-item.is-video::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 60%, rgba(0,0,0,0.5) 100%);
  pointer-events: none;
  z-index: 2;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.media-item.is-video:hover::before { opacity: 1; }

.media-caption {
  margin-top: 2rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
  font-style: italic;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}
.media-caption:empty { display: none; }

/* ============================================================
   SEZIONE QR CODE — Stampabile / condivisibile
   ============================================================ */
/* ============================================================
   SCHEDA DEL CAMPO — dati agroclimatici, impaginati come una
   scheda tecnica: etichetta · filetto punteggiato · valore.
   ============================================================ */
.scheda-section {
  padding: 4rem 4rem 3rem;
  border-top: 1px solid rgba(255,255,255,0.05);
  display: flex;
  justify-content: center;
  position: relative;
  z-index: 3; /* sopra la floating-map mentre sfuma */
}
.scheda-inner { max-width: 900px; width: 100%; }

.scheda-head { text-align: center; margin-bottom: 2.75rem; }
.scheda-eyebrow {
  font-size: 0.65rem;
  color: var(--accent, #ffcd00);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-weight: 600;
  margin-bottom: 0.6rem;
}
.scheda-title {
  font-size: 1.6rem;
  font-weight: 300;
  letter-spacing: -0.01em;
  color: var(--fg, #f5f5f7);
  margin: 0 0 0.5rem;
}
.scheda-title span { color: var(--accent, #ffcd00); font-weight: 400; }
.scheda-sub {
  font-size: 0.85rem;
  color: var(--muted, #86868b);
  line-height: 1.45;
  margin: 0;
}

.scheda-body {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2.5rem 3.5rem;
}
.scheda-block-title {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-weight: 600;
  color: var(--accent, #ffcd00);
  margin: 0 0 1rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid rgba(255, 205, 0, 0.18);
}

.scheda-row {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  padding: 0.5rem 0;
}
.scheda-row + .scheda-row { border-top: 1px solid rgba(255,255,255,0.04); }

.scheda-label {
  font-size: 0.85rem;
  color: var(--muted, #86868b);
  white-space: nowrap;
}
.scheda-hint {
  font-size: 0.65rem;
  color: rgba(134,134,139,0.6);
  margin-left: 0.45rem;
  letter-spacing: 0.04em;
}
/* Filetto punteggiato che collega etichetta e valore */
.scheda-dots {
  flex: 1;
  height: 1px;
  min-width: 12px;
  background-image: radial-gradient(circle, rgba(255,255,255,0.18) 1px, transparent 1px);
  background-size: 5px 1px;
  background-repeat: repeat-x;
  background-position: 0 100%;
  transform: translateY(-3px);
}
.scheda-value {
  font-size: 1rem;
  font-weight: 600;
  color: var(--fg, #f5f5f7);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.scheda-unit {
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--muted, #86868b);
}

/* --- Le compagne del grano: elenco specie con barra proporzionale --- */
.scheda-flora {
  margin-top: 3rem;
  padding-top: 2.25rem;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.scheda-flora .scheda-block-title { margin-bottom: 0.9rem; }

.flora-intro {
  font-size: 0.78rem;
  line-height: 1.55;
  color: var(--muted, #86868b);
  max-width: 620px;
  margin: 0 0 1.75rem;
}

.flora-list { display: flex; flex-direction: column; gap: 0.15rem; }

.flora-row {
  display: grid;
  grid-template-columns: minmax(160px, 240px) 1fr auto;
  align-items: center;
  gap: 1.25rem;
  padding: 0.55rem 0;
}
.flora-row + .flora-row { border-top: 1px solid rgba(255,255,255,0.04); }

.flora-names { display: flex; flex-direction: column; gap: 0.1rem; min-width: 0; }
.flora-nome {
  font-size: 0.88rem;
  color: var(--fg, #f5f5f7);
  font-weight: 500;
}
.flora-latino {
  font-size: 0.68rem;
  font-style: italic;
  color: rgba(134,134,139,0.75);
  letter-spacing: 0.01em;
}

.flora-bar {
  height: 4px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  overflow: hidden;
}
.flora-bar-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255,205,0,0.35), var(--accent, #ffcd00));
  transform-origin: left center;
  animation: floraGrow 0.9s var(--ease, cubic-bezier(0.4,0,0.2,1)) both;
}
@keyframes floraGrow {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}

.flora-count {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted, #86868b);
  font-variant-numeric: tabular-nums;
  min-width: 3.5em;
  text-align: right;
}

@media (prefers-reduced-motion: reduce) {
  .flora-bar-fill { animation: none; }
}

.scheda-fonti {
  margin: 2.75rem 0 0;
  text-align: center;
  font-size: 0.65rem;
  line-height: 1.6;
  color: rgba(134,134,139,0.7);
  letter-spacing: 0.02em;
}

@media (max-width: 900px), (max-height: 500px) and (orientation: landscape), (max-width: 1366px) and (hover: none) and (pointer: coarse) {
  .scheda-section { padding: 2.75rem 1.5rem 2rem; }
  .scheda-body { grid-template-columns: 1fr; gap: 2rem; }
  .scheda-head { margin-bottom: 2rem; }
  .scheda-title { font-size: 1.3rem; }
  .scheda-label { font-size: 0.8rem; white-space: normal; }
  .scheda-value { font-size: 0.95rem; }
  .scheda-flora { margin-top: 2.25rem; padding-top: 1.75rem; }
  .flora-row {
    grid-template-columns: 1fr auto;
    gap: 0.5rem 0.9rem;
  }
  .flora-bar { grid-column: 1 / -1; order: 3; }
}

.qr-section {
  padding: 3rem 4rem 2.5rem;
  border-top: 1px solid rgba(255,255,255,0.05);
  display: flex;
  justify-content: center;
}
.qr-inner {
  max-width: 400px;
  width: 100%;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.9rem;
}
.qr-eyebrow {
  font-size: 0.65rem;
  color: var(--accent, #ffcd00);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-weight: 600;
}
.qr-title {
  font-size: 1.25rem;
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--fg, #f5f5f7);
  margin: 0;
}
.qr-text {
  font-size: 0.85rem;
  color: var(--muted, #86868b);
  line-height: 1.45;
  margin: 0;
  max-width: 320px;
}
.qr-code-wrap {
  margin-top: 0.4rem;
  padding: 12px;
  background: #ffffff;
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.35);
  display: inline-block;
  line-height: 0; /* elimina spazio sotto il canvas */
}
.qr-code { display: inline-block; }
.qr-code canvas,
.qr-code img {
  display: block;
  width: 150px !important;
  height: 150px !important;
}
.qr-download {
  margin-top: 0.25rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--accent, #ffcd00);
  color: #000;
  border: none;
  border-radius: 999px;
  padding: 0.65rem 1.35rem;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: transform 0.2s var(--ease, ease), box-shadow 0.2s var(--ease, ease), opacity 0.2s var(--ease, ease);
  font-family: inherit;
}
.qr-download:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(255, 205, 0, 0.35);
}
.qr-download:active { transform: translateY(0); }
.qr-download:disabled { opacity: 0.5; cursor: default; transform: none; box-shadow: none; }
.qr-download-arrow { font-size: 0.95rem; line-height: 1; }

@media (max-width: 640px) {
  .qr-section { padding: 2.25rem 1.5rem 1.75rem; }
  .qr-title { font-size: 1.1rem; }
  .qr-code canvas,
  .qr-code img { width: 140px !important; height: 140px !important; }
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  padding: 3rem 4rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid rgba(255,255,255,0.05);
  font-size: 0.85rem;
  color: var(--muted);
}
.coord-mini {
  font-family: "SF Mono", Menlo, monospace;
  font-size: 0.78rem;
  letter-spacing: 0.05em;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

/* TV / 4K */
@media (min-width: 2200px) {
  .nav-inner { max-width: 1800px; padding: 0 60px; }
  .logo-container { height: 52px; }
  .nav-right { font-size: 1rem; gap: 32px; }
  .hero { padding: 160px 8rem 6rem; gap: 6rem; }
  .hero-content { max-width: 800px; }
  .hero-title { font-size: 7rem; }
  .hero-subtitle { font-size: 1.6rem; }
  .section { padding: 12rem 8rem; }
  .section-inner { max-width: 1700px; }
  .section-text .lead { font-size: 1.7rem; max-width: 1100px; }
  .media-grid { grid-template-columns: repeat(auto-fit, minmax(500px, 1fr)); gap: 2rem; }
}

/* Tablet */
@media (max-width: 1024px) {
  .hero { padding: 100px 2rem 3rem; gap: 2rem; }
  .section { padding: 6rem 2rem; }
}

/* ============================================================
   MOBILE (≤ 900px) — Layout verticale con mappa sticky in alto
   ============================================================ */
@media (max-width: 900px), (max-height: 500px) and (orientation: landscape), (max-width: 1366px) and (hover: none) and (pointer: coarse) {

  /* MAPPA in alto, scrolla via con la pagina (niente sticky, niente fixed) */
  .floating-map {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    margin: 0 auto !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    transform: none !important;
    transition: none !important;
    background: transparent;
    padding: 1.5rem 0 1.5rem;
    z-index: 1;
    pointer-events: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    order: -1; /* la mappa appare per prima */
  }
  .floating-map .hero-map {
    width: clamp(200px, 55vw, 320px);
    height: clamp(200px, 55vw, 320px);
    flex: 0 0 auto;
  }

  /* Per fare in modo che order:-1 funzioni, .page deve essere flex column */
  .page {
    display: flex;
    flex-direction: column;
  }

  /* Nome regione + coord: in linea sotto la mappa */
  .hero-region {
    flex-direction: row;
    gap: 0.8rem;
    align-items: baseline;
    flex-wrap: wrap;
    justify-content: center;
  }
  .hero-region-name { font-size: 0.8rem; letter-spacing: 0.25em; }
  .hero-region-coord { font-size: 0.72rem; }

  /* Body: niente padding-top mobile (la mappa è in flusso normale) */
  body {
    padding-top: 0;
  }

  /* Coord SEMPRE fisse in alto su mobile mentre si scorre la pagina.
     Stesso stile delle coord originali — NON sovrascrivo font-size, eredita la size
     impostata via stile.json/dev tools. */
  .coord-sticky-m {
    display: block;
    position: fixed;
    top: 44px;
    left: 0;
    right: 0;
    z-index: 50;
    text-align: center;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    padding: 10px 12px 12px;
    pointer-events: none;
  }
  /* Nascondo l'originale dentro la mappa: la versione fixed è sufficiente */
  .floating-map .hero-region-coord {
    display: none;
  }
  /* MAPPA spostata GIU' con margin-top forte per non finire sotto le coord fixed */
  .floating-map {
    margin-top: 140px !important;
  }

  /* Hero: sotto la mappa, padding-top normale per la navbar */
  .hero {
    height: auto;
    min-height: auto;
    padding: 1rem 1.5rem 3rem;
    order: 0;
  }
  .hero-inner {
    opacity: 1 !important;
    transform: none !important;
    pointer-events: auto;
    padding: 0;
    gap: 1rem;
  }
  .hero-title { font-size: clamp(1.6rem, 7vw, 2.4rem); }
  .hero-subtitle { font-size: 1rem; }
  .scroll-hint { display: none; }

  /* Grid → singola colonna, niente aside sticky */
  .content-grid {
    grid-template-columns: 1fr;
    order: 1;
  }
  .content-aside {
    display: none;
  }
  .content-main {
    padding: 0;
  }

  /* Sezioni */
  .section { padding: 3rem 1.5rem; }
  .section-inner { margin: 0 auto; max-width: 100%; }
  .section-text .lead { font-size: 1rem; line-height: 1.65; }

  /* Media */
  .media-grid { grid-template-columns: 1fr; gap: 1rem; }

  /* Scheda del campo: dopo il testo, prima del QR.
     Senza order esplicito finirebbe a 0 e risalirebbe davanti alla griglia. */
  .scheda-section {
    order: 2;
  }

  /* QR section: dopo tutti i contenuti, prima del footer */
  .qr-section {
    order: 3;
  }

  /* Footer */
  .footer {
    padding: 2rem 1.5rem;
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
    font-size: 0.75rem;
    order: 4;
  }
}

/* Mobile (≤ 768px) — solo navbar/dimensioni piccole */
@media (max-width: 768px) {
  .nav { padding: 6px 0; }
  /* padding-right extra: lascia spazio ai widget fissi (lingua + accessibilità) */
  .nav-inner { padding: 0 56px 0 14px; gap: 10px; }
  .logo-container { height: 30px; }
  .nav-right { font-size: 0.65rem; gap: 10px; }
  .nav-right .back-link {
    font-size: 0.78rem;
    padding: 0;
    background: transparent;
    border: none;
  }
  .nav-right .back-link span:not(.arrow) { display: none; }
  .nav-right .codice { font-size: 0.65rem; }
}

/* Mobile piccolo (≤ 480px) */
@media (max-width: 480px) {
  .nav-inner { padding: 0 52px 0 12px; gap: 8px; }
  .logo-container { height: 26px; }
  .nav-right { font-size: 0.6rem; gap: 8px; }

  .hero { padding: 80px 1.2rem 2rem; }
  .hero-title { font-size: 1.7rem; }
  .hero-subtitle { font-size: 0.9rem; }

  .floating-map {
    top: auto !important;
    padding: 1rem 0 1rem;
  }
  .floating-map .hero-map {
    width: clamp(150px, 45vw, 220px);
    height: clamp(150px, 45vw, 220px);
  }
  .hero-region-name { font-size: 0.72rem; }
  .hero-region-coord { font-size: 0.65rem; }

  .section { padding: 2.5rem 1.2rem; }
  .section-text .lead { font-size: 0.95rem; }
}

/* Ultra small (≤ 360px) */
@media (max-width: 360px) {
  .hero-title { font-size: 1.8rem; }
  .section-text .lead { font-size: 0.9rem; }
}

/* Touch devices: niente hover */
@media (hover: none) and (pointer: coarse) {
  .media-item:hover {
    transform: none;
    box-shadow: none;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* iPhone notch */
@supports (padding: env(safe-area-inset-top)) {
  .nav-inner {
    padding-left: max(28px, env(safe-area-inset-left));
    padding-right: max(28px, env(safe-area-inset-right));
  }
  .footer {
    padding-bottom: max(2rem, calc(2rem + env(safe-area-inset-bottom)));
  }
  @media (max-width: 768px) {
    .nav-inner {
      padding-left: max(14px, env(safe-area-inset-left));
      /* 56px: spazio riservato ai widget fissi (lingua + accessibilità) */
      padding-right: max(56px, calc(56px + env(safe-area-inset-right)));
    }
  }
}
/* ============================================================
   FOOTER — logo Petra + ragione sociale
   Aggiunto in coda al file: cosi' non serve alzare la specificita'
   contro le media query del footer definite piu' sopra.
   ============================================================ */
.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
}

.footer-logo-link {
  display: block;
  flex: 0 0 auto;
  line-height: 0;
}

.footer-logo {
  display: block;
  height: 34px;
  width: auto;
  border-radius: 4px;
}

.footer-legal {
  font-size: 0.8rem;
  line-height: 1.3;
  /* Colore esplicito: la navbar centralizzata sovrascrive --text su :root,
     quindi non mi affido all'ereditarieta'. */
  color: var(--muted);
}

/* Logo + dicitura centrati nella pagina. La coordinata resta a destra,
   sfilata dal flusso cosi' non sposta il centro del blocco. */
.footer {
  position: relative;
  justify-content: center;
}
.footer .coord-mini {
  position: absolute;
  right: 4rem;
  top: 50%;
  transform: translateY(-50%);
}

@media (max-width: 900px), (max-height: 500px) and (orientation: landscape), (max-width: 1366px) and (hover: none) and (pointer: coarse) {
  /* Qui il footer e' gia' a colonna e centrato: la coord torna nel flusso. */
  .footer .coord-mini {
    position: static;
    transform: none;
  }
  .footer-brand {
    flex-direction: column;
    gap: 0.6rem;
    text-align: center;
  }
  .footer-logo { height: 30px; }
  .footer-legal { font-size: 0.72rem; }
}
/* ============================================================
   FOTO AGRICOLTORE — sostituisce la sagoma della regione
   Solo sulle pagine con tipo = "agricoltore" e solo se il file
   esiste. Il contenitore .hero-map resta quadrato (desktop:
   ridimensionato dal JS a ogni frame di scroll; mobile: clamp
   fisso): la foto 4:5 si adatta in ALTEZZA e resta centrata,
   quindi non serve toccare nulla della logica di scroll.
   Nome regione e coordinate restano invariati.
   Niente filter/drop-shadow qui: il contenitore cambia
   dimensione a 60fps durante lo scroll e il filtro
   costringerebbe la GPU a ri-rasterizzare ogni frame.
   ============================================================ */
.hero-map .hero-foto {
  height: 100%;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  display: block;
  border-radius: 4px;
}

/* Mobile/tablet: il riquadro è fisso via CSS (il JS non lo tocca),
   quindi qui la crescita del 50% la applico a mano, mantenendo
   le stesse proporzioni del clamp originale. */
@media (max-width: 900px), (max-height: 500px) and (orientation: landscape), (max-width: 1366px) and (hover: none) and (pointer: coarse) {
  .floating-map .hero-map.has-foto {
    width: clamp(300px, 82vw, 480px);
    height: clamp(300px, 82vw, 480px);
  }
}

/* ============================================================
   MOBILE — nome regione e coordinate tornano SOTTO la foto,
   incolonnati come su desktop. Prima le coordinate erano una
   barra fissa in alto: finiva sopra il pulsante "Mappa Italia"
   e spezzava l'ordine di lettura rispetto al desktop.
   ============================================================ */
@media (max-width: 900px), (max-height: 500px) and (orientation: landscape), (max-width: 1366px) and (hover: none) and (pointer: coarse) {
  .coord-sticky-m {
    display: none !important;
  }
  .floating-map .hero-region-coord {
    display: block;
  }
  .hero-region {
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: nowrap;
    max-width: 100%;
  }
  .hero-region-coord {
    line-height: 1.25;
    overflow-wrap: anywhere;
  }
}

/* ============================================================
   MOBILE — prima schermata piena: foto/cartina + regione +
   coordinate occupano tutto il viewport. Il titolo e il resto
   della pagina cominciano sotto la piega, allo scroll.
   svh invece di vh: non salta quando la barra URL si ritrae.
   ============================================================ */
@media (max-width: 900px), (max-height: 500px) and (orientation: landscape), (max-width: 1366px) and (hover: none) and (pointer: coarse) {
  .floating-map {
    margin-top: 0 !important;
    padding: 130px 0 2.5rem;
    min-height: 100vh;
    min-height: 100svh;
    justify-content: center;
  }
}

/* ============================================================
   MOBILE — riquadro foto un filo più grande, con tetto in
   altezza: non deve mai mangiarsi tutto il primo schermo.
   Origine del transform in alto: l'effetto di scorrimento
   fa rimpicciolire il blocco verso l'alto, non verso il centro.
   ============================================================ */
@media (max-width: 900px), (max-height: 500px) and (orientation: landscape), (max-width: 1366px) and (hover: none) and (pointer: coarse) {
  .floating-map .hero-map.has-foto {
    width: min(92vw, 52vh);
    height: min(92vw, 52vh);
    width: min(92vw, 52svh);
    height: min(92vw, 52svh);
  }
  .floating-map {
    transform-origin: 50% 30%;
    will-change: transform, opacity;
  }
}

/* ============================================================
   PAGINE AGRICOLTORE — testi più leggibili.
   Le foto sono in bianco e nero: il grigio del sottotitolo e del
   corpo testo ci si confonde. Qui passano a bianco pieno.
   La classe .tipo-agricoltore la mette regione.js solo quando
   tipo = "agricoltore": gli adottanti non sono toccati.
   Serve !important perché stile.json inietta il colore con
   !important; il selettore su body ha specificità maggiore.
   ============================================================ */
body.tipo-agricoltore .hero-subtitle,
body.tipo-agricoltore .section-text .lead {
  color: #ffffff !important;
}

/* ============================================================
   ADATTIVITÀ — il riquadro mappa/foto diventa un "container",
   così nome regione e coordinate possono dimensionarsi rispetto
   allo spazio che hanno DAVVERO (cqw), non rispetto al viewport.
   Serve alle regole min(...px, ...cqw) generate da regione.js:
   i valori di stile.json restano il massimo, ma il testo si
   restringe da solo quando il riquadro è stretto invece di
   uscire dal bordo dello schermo.
   Rete di sicurezza: niente può sporgere dal riquadro.
   ============================================================ */
.floating-map {
  container-type: inline-size;
}
.hero-region,
.hero-region-name,
.hero-region-coord {
  max-width: 100%;
}
.hero-region-coord {
  overflow-wrap: anywhere;
}