/* ============================================================
   LIQUID GLASS SITE — palette dal logo
   azzurrino #8FE9F7 · blu #3B82D6 · viola #3D2B63 · navy #0A0E1E
   ============================================================ */

:root {
  --acc: 143, 233, 247; /* RGB accent: cambia col tema sezione */
  --cyan: rgb(var(--acc));
  --cyan-soft: rgba(var(--acc), 0.55);
  --cyan-faint: rgba(var(--acc), 0.18);
  --blue: #3B82D6;
  --violet: #3D2B63;
  --navy: #0A0E1E;
  --text: #EAF6FB;
  --text-dim: rgba(234, 246, 251, 0.55);

  /* spring/overshoot per i click, ease morbida per il resto */
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --spring-soft: cubic-bezier(0.3, 1.18, 0.45, 1); /* overshoot leggero, piu' smooth */
  --smooth: cubic-bezier(0.4, 0, 0.2, 1);
  --glass-radius: 28px;
}

/* temi per sezione: dentro sezione 1 = verde, 2 = marrone, 3 = giallo */
body[data-accent="verde"]   { --acc: 108, 236, 158; }
body[data-accent="marrone"] { --acc: 222, 168, 106; }
body[data-accent="giallo"]  { --acc: 250, 216, 92; }

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  height: 100%;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  overflow-x: clip; /* piu' forte di hidden: blocca anche il pan laterale */
}

/* niente barra di scorrimento visibile (lo scroll funziona lo stesso) */
html {
  scrollbar-width: none;      /* Firefox */
  -ms-overflow-style: none;   /* vecchio Edge */
}
html::-webkit-scrollbar,
body::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;              /* Chrome / Safari / Android */
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, sans-serif;
  background: var(--navy);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent; /* niente flash grigio al tap su mobile */
}

button {
  touch-action: manipulation; /* tap immediato, no zoom da doppio tap */
}

.media-card {
  touch-action: manipulation;
}

/* ============================================================
   SFONDO ANIMATO — deve muoversi bene per far vivere il glass
   ============================================================ */

.bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  /* altezza = viewport GRANDE (barra browser nascosta): non cambia mai
     durante lo scroll -> lo sfondo non viene piu' ridimensionato/scattoso */
  height: 100vh;
  height: 100lvh;
  z-index: 0;
  overflow: hidden;
  transform: translateZ(0); /* layer GPU dedicato: niente repaint durante lo scroll */
  /* lo sfondo vira sul colore della sezione aperta */
  transition: filter 1.3s var(--smooth);
}

body[data-accent="verde"] .bg {
  filter: hue-rotate(-58deg) saturate(1.05);
}

body[data-accent="marrone"] .bg {
  filter: hue-rotate(172deg) saturate(0.82) brightness(1.04);
}

body[data-accent="giallo"] .bg {
  filter: hue-rotate(-161deg) saturate(1.2) brightness(1.07);
}

.bg-gradient {
  position: absolute;
  inset: -20%;
  background:
    /* spotlight hero: luce che sale da dietro il contenuto */
    radial-gradient(ellipse 90% 55% at 50% -12%, rgba(var(--acc), 0.24), transparent 68%),
    /* nota azzurro chiaro in alto a sinistra */
    radial-gradient(ellipse 55% 45% at 8% 4%, rgba(120, 195, 255, 0.22), transparent 65%),
    /* nota blu chiaro grande in basso a destra */
    radial-gradient(ellipse 70% 55% at 90% 102%, rgba(96, 165, 240, 0.28), transparent 68%),
    /* azzurro tenue a meta' sinistra */
    radial-gradient(ellipse 45% 40% at -5% 58%, rgba(80, 150, 230, 0.14), transparent 65%),
    /* velo viola-blu profondo */
    radial-gradient(ellipse 70% 55% at 22% 14%, rgba(58, 60, 130, 0.30), transparent 62%),
    /* base navy spaziale, piu' chiara */
    linear-gradient(180deg, #0E1630 0%, #0A1226 55%, #081022 100%);
  animation: bgShift 44s ease-in-out infinite alternate;
}

@keyframes bgShift {
  0%   { transform: translate(0, 0) scale(1); }
  100% { transform: translate(-3%, -2%) scale(1.08); }
}

/* aurora: 3 blob oversized, blur statico, si muove SOLO transform */
.blob {
  position: absolute;
  filter: blur(90px) saturate(1.4);
  will-change: transform;
}

.blob-1 {
  width: 70vmax; height: 55vmax;
  top: -25%; left: -15%;
  border-radius: 58% 42% 47% 53% / 45% 58% 42% 55%;
  background: radial-gradient(closest-side, rgba(var(--acc), 0.34), transparent 70%);
  animation: drift1 42s ease-in-out infinite alternate;
}

.blob-2 {
  width: 60vmax; height: 60vmax;
  top: 20%; right: -22%;
  border-radius: 43% 57% 60% 40% / 55% 44% 56% 45%;
  background: radial-gradient(closest-side, rgba(70, 140, 220, 0.42), transparent 70%);
  animation: drift2 52s ease-in-out infinite alternate;
  mix-blend-mode: screen;
}

.blob-3 {
  width: 52vmax; height: 42vmax;
  bottom: -22%; left: 22%;
  border-radius: 52% 48% 41% 59% / 60% 43% 57% 40%;
  background: radial-gradient(closest-side, rgba(130, 190, 250, 0.26), transparent 70%);
  animation: drift3 34s ease-in-out infinite alternate;
  mix-blend-mode: screen;
}

@keyframes drift1 {
  from { transform: translate3d(-4%, -2%, 0) rotate(0deg) scale(1); }
  to   { transform: translate3d(6%, 5%, 0) rotate(9deg) scale(1.1); }
}
@keyframes drift2 {
  from { transform: translate3d(3%, -5%, 0) rotate(0deg) scale(1.06); }
  to   { transform: translate3d(-6%, 4%, 0) rotate(-7deg) scale(0.94); }
}
@keyframes drift3 {
  from { transform: translate3d(-4%, 3%, 0) rotate(-6deg) scale(1); }
  to   { transform: translate3d(5%, -4%, 0) rotate(5deg) scale(1.08); }
}

/* ============================================================
   GRIGLIA PROSPETTICA aqua (stile Spline/Webflow) — pavimento
   che sfuma in lontananza, scorrimento lento in avanti
   ============================================================ */

.bg-grid {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 44%;
  overflow: hidden;
  pointer-events: none;
  /* un'unica maschera radiale: dissolve in lontananza E ai lati = look infinito */
  -webkit-mask-image: radial-gradient(ellipse 115% 150% at 50% 108%, #fff 55%, transparent 96%);
  mask-image: radial-gradient(ellipse 115% 150% at 50% 108%, #fff 55%, transparent 96%);
  opacity: 0.6;
}

.bg-grid-plane {
  position: absolute;
  left: -260%;
  right: -260%;
  bottom: -34px;
  height: 520%; /* piu' lunga: sul telefono si vede bene fino all'orizzonte */
  background-image:
    linear-gradient(rgba(var(--acc), 0.26) 1px, transparent 1px),
    linear-gradient(90deg, rgba(var(--acc), 0.26) 1px, transparent 1px);
  background-size: 40px 40px;
  /* statica: ruota attorno al bordo vicino, il piano recede all'orizzonte */
  transform-origin: 50% 100%;
  transform: perspective(700px) rotateX(58deg);
}

/* grana pre-cotta (PNG tile): materia senza costo CPU */
.bg-grain {
  position: absolute;
  inset: 0;
  background: url("../assets/noise-128.png") repeat;
  background-size: 128px;
  opacity: 0.05;
  mix-blend-mode: soft-light;
}

/* vignettatura: bordi scuri, centro vivo (profondita' cinematografica) */
.bg-vignette {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 120% 90% at 50% 42%, transparent 62%, rgba(3, 6, 18, 0.20) 100%),
    linear-gradient(180deg, rgba(3, 6, 18, 0.10), transparent 14%, transparent 86%, rgba(3, 6, 18, 0.14));
  pointer-events: none;
}

/* icone che salgono in loop (al posto delle palline) */
.particles { position: absolute; inset: 0; }

.particle {
  position: absolute;
  bottom: -36px;
  opacity: 0;
  animation: rise linear infinite;
  will-change: transform;
  filter: brightness(1.25) saturate(1.15);
}

@keyframes rise {
  0%   { transform: translateY(0) translateX(0) rotate(0deg); opacity: 0; }
  10%  { opacity: var(--p-op, 0.4); }
  90%  { opacity: var(--p-op, 0.4); }
  100% { transform: translateY(-112vh) translateX(var(--p-sway, 30px)) rotate(var(--p-rot, 40deg)); opacity: 0; }
}

/* ============================================================
   GLASS — la ricetta base riutilizzata ovunque
   ============================================================ */

.glass-panel,
.section-bar,
.media-card {
  position: relative;
  isolation: isolate; /* contiene blend e backdrop root */
  border-radius: var(--glass-radius);
  border: none;
  /* tinta leggera (mai oltre ~0.18) + velo alto + sheen diagonale */
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.02) 38%, transparent 60%),
    linear-gradient(120deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.025) 30%, transparent 55%),
    linear-gradient(160deg, rgba(var(--acc), 0.07), rgba(255, 255, 255, 0.03) 40%, rgba(8, 12, 24, 0.14));
  /* FROST: il saturate e' cio' che separa il vetro vero dal blur slavato */
  -webkit-backdrop-filter: blur(14px) saturate(170%) brightness(1.08);
  backdrop-filter: blur(14px) saturate(170%) brightness(1.08);
  /* rim light coerente (luce da alto-sx) + inner glow + doppia ombra */
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.40),
    inset 0 -1px 1px rgba(var(--acc), 0.12),
    inset 1px 0 1px rgba(255, 255, 255, 0.10),
    inset -1px 0 1px rgba(255, 255, 255, 0.07),
    inset 0 0 26px rgba(var(--acc), 0.22),
    inset 0 -16px 30px rgba(4, 8, 24, 0.20),
    0 0 16px rgba(var(--acc), 0.15),
    0 12px 36px rgba(0, 0, 0, 0.5),
    0 1px 2px rgba(0, 0, 0, 0.4);
  overflow: hidden;
}

/* bordo GRADIENTE (mai solid piatto): luce forte alto-sx, ripresa accent basso-dx */
.glass-panel::before,
.section-bar::before,
.media-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.55),
    rgba(255, 255, 255, 0.06) 38%,
    rgba(var(--acc), 0.32) 82%,
    rgba(255, 255, 255, 0.28)
  );
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: destination-out;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  pointer-events: none;
  opacity: 0.9;
  transition: opacity 0.3s var(--smooth);
}

.section-bar:hover::before,
.media-card:hover::before { opacity: 1; }

/* light sweep stile CC Light Sweep: lama di luce diagonale che attraversa
   le barre periodicamente. MAI sul riquadro foto/video (.slot-media).
   Solo transform = economico anche su mobile; delay negativi scalati con --i
   così le barre sono subito "in corsa" e mai tutte insieme. */
.sweep {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  overflow: hidden;
  pointer-events: none;
  z-index: 1;
}

.sweep::before {
  content: "";
  position: absolute;
  top: -20%;
  bottom: -20%;
  left: -45%;
  width: 38%;
  background: linear-gradient(100deg,
    transparent,
    rgba(255, 255, 255, 0.09) 35%,
    rgba(var(--acc), 0.17) 50%,
    rgba(255, 255, 255, 0.09) 65%,
    transparent);
  transform: skewX(-16deg) translateX(0);
  animation: lightSweep 4.8s ease-in-out infinite;
  /* onda ordinata DALL'ALTO verso il basso: passo 0.6s = 4.8/8, così anche
     su liste lunghe il giro si riallinea pulito (mai ordine casuale);
     l'offset -9.6s (2 cicli) tiene i delay negativi = tutte già in corsa */
  animation-delay: calc(var(--i, 0) * 0.6s - 9.6s);
}

@keyframes lightSweep {
  0%, 58% { transform: skewX(-16deg) translateX(0); }
  90%, 100% { transform: skewX(-16deg) translateX(430%); }
}

/* flash azzurro alla pressione — feedback di click su tutti i rettangoli */
.section-bar::after,
.media-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(
    circle at 50% 50%,
    rgba(var(--acc), 0.30),
    rgba(var(--acc), 0.10) 75%
  );
  opacity: 0;
  transition: opacity 0.28s var(--smooth);
  pointer-events: none;
}

.section-bar:active::after,
.media-card:active::after {
  opacity: 1;
  transition-duration: 0.04s; /* si accende all'istante, si spegne morbido */
}

/* ============================================================
   VISTE + transizioni home <-> sezione
   ============================================================ */

.view {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  display: none;
  flex-direction: column;
  align-items: center;
  padding: clamp(20px, 4vw, 48px);
  /* safe area per notch e barra gesture */
  padding-left: max(clamp(20px, 4vw, 48px), env(safe-area-inset-left));
  padding-right: max(clamp(20px, 4vw, 48px), env(safe-area-inset-right));
  padding-bottom: max(clamp(20px, 4vw, 48px), env(safe-area-inset-bottom));
}

.view.is-active { display: flex; }

.view-home.is-active { animation: viewIn 0.42s var(--spring-soft) both; }
.view-section.is-active { animation: viewIn 0.42s var(--spring-soft) both; }

.view.is-leaving {
  display: flex;
  animation: viewOut 0.2s var(--smooth) both;
  pointer-events: none;
}

@keyframes viewIn {
  from { opacity: 0; transform: translateY(22px) scale(0.975); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes viewOut {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to   { opacity: 0; transform: translateY(-14px) scale(0.98); }
}

/* ============================================================
   TABS "HOME — INFO" + PAGER A TRASCINAMENTO
   ============================================================ */

/* lo swipe orizzontale è NOSTRO (pager): niente gesture-navigation
   del browser sui gesti orizzontali (Chrome/Edge/Android; su iOS
   Safari il back dal bordo resta e lo gestiamo via history).
   ⚠️ niente overflow-x:hidden qui: creerebbe uno scroll container
   che DISATTIVA l'overscroll-behavior (la gesture-back tornerebbe) */
html, body { overscroll-behavior-x: none; }

/* contenitore del pager: si mostra/nasconde come una vista qualsiasi
   (le animazioni viewIn/viewOut stanno QUI, mai sulla track che trasla).
   overflow-x clip (NON hidden: clip non crea scroll container):
   la pagina info affiancata non deve allargare il sito */
.pager {
  position: relative;
  z-index: 1;
  width: 100%;
  display: none;
  overflow-x: clip;
}
.pager.is-active {
  display: block;
  animation: viewIn 0.42s var(--spring-soft) both;
}
.pager.is-leaving {
  display: block;
  animation: viewOut 0.2s var(--smooth) both;
  pointer-events: none;
}

/* la track: home e info UNA ACCANTO all'altra, il dito la trascina.
   Un solo elemento animato con un solo transform = fluido su iPhone */
.pager-track {
  display: flex;
  align-items: flex-start;
  width: 100%;
  will-change: transform;
}
.pager-track > .view {
  display: flex !important; /* sempre renderizzate: a metà swipe si vedono entrambe */
  flex: 0 0 100%;
  min-width: 0;
  animation: none !important; /* niente viewIn sui pannelli: scorrono soltanto */
}

/* il pannello info è largo quanto la pagina (serve al pager per far
   coincidere translateX(-100%) con una schermata esatta); la colonna
   stretta da telefono sta CENTRATA dentro, come le altre viste */
.pager-track > .view-info {
  max-width: none;
  margin: 0;
  align-items: center;
}
.view-info .section-header { width: min(620px, 100%); }
.pager-track.is-settling {
  transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.3, 1);
}

.pager-tabs {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 12px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 32px;
  padding: 9px 24px;
  border-radius: 999px;
  border: 1px solid rgba(var(--acc), 0.28);
  background: rgba(8, 13, 30, 0.55);
  -webkit-backdrop-filter: blur(12px) saturate(150%);
  backdrop-filter: blur(12px) saturate(150%);
  box-shadow:
    0 0 16px rgba(var(--acc), 0.14),
    inset 0 0 12px rgba(var(--acc), 0.08);
}
.pager-tabs[hidden] { display: none; }

.pager-tab {
  position: relative;
  border: 0;
  background: none;
  cursor: pointer;
  font: inherit;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 2px 0;
  transition: color 0.25s;
}
.pager-tab.is-current {
  color: var(--text);
  text-shadow: 0 0 14px rgba(var(--acc), 0.65);
}
/* lineetta luminosa sotto la pagina attiva */
.pager-tab::after {
  content: "";
  position: absolute;
  left: 12%;
  right: 12%;
  bottom: -5px;
  height: 2px;
  border-radius: 2px;
  background: rgb(var(--acc));
  box-shadow: 0 0 8px rgba(var(--acc), 0.8);
  opacity: 0;
  transition: opacity 0.25s;
}
.pager-tab.is-current::after { opacity: 1; }

/* home e info lasciano spazio alle tabs fisse in alto */
.view-home,
.view-info { padding-top: calc(clamp(20px, 4vw, 48px) + 42px); }


/* ============================================================
   HOME — logo + 3 barre glass strette
   ============================================================ */

.home-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin: clamp(16px, 5vh, 56px) 0 clamp(28px, 5vh, 52px);
}

.logo-wrap {
  position: relative;
  width: clamp(150px, 22vw, 220px);
  aspect-ratio: 1;
  animation: logoFloat 6s ease-in-out infinite alternate;
}

@keyframes logoFloat {
  from { transform: translateY(0); }
  to   { transform: translateY(-12px); }
}

.logo-halo {
  position: absolute;
  inset: -18%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(var(--acc), 0.35), transparent 68%);
  filter: blur(18px);
  animation: haloPulse 3.4s ease-in-out infinite alternate;
}

@keyframes haloPulse {
  from { opacity: 0.55; transform: scale(0.96); }
  to   { opacity: 1;    transform: scale(1.06); }
}

.logo {
  position: relative;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 10px 26px rgba(10, 14, 30, 0.6));
  user-select: none;
}

.site-name {
  font-size: clamp(1.7rem, 4vw, 2.6rem);
  font-weight: 800;
  letter-spacing: 0.04em;
  /* gradiente che SCORRE dentro le lettere (estremi uguali = loop invisibile) */
  background: linear-gradient(
    100deg,
    var(--blue) 0%,
    #FFFFFF 22%,
    var(--cyan) 42%,
    #EAFBFF 52%,
    var(--cyan) 62%,
    var(--blue) 100%
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-align: center;
  animation: textFlow 7s linear infinite;
  /* glow azzurro (drop-shadow: funziona anche col testo sfumato) */
  filter:
    drop-shadow(0 0 14px rgba(var(--acc), 0.4))
    drop-shadow(0 0 44px rgba(var(--acc), 0.22));
}

@keyframes textFlow {
  to { background-position: -200% center; }
}

.tagline {
  font-size: clamp(0.9rem, 1.6vw, 1.05rem);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-align: center;
  /* banda azzurra luminosa che scorre dentro le lettere */
  background: linear-gradient(
    100deg,
    rgba(234, 246, 251, 0.5) 0%,
    var(--cyan) 35%,
    #FFFFFF 50%,
    var(--cyan) 65%,
    rgba(234, 246, 251, 0.5) 100%
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--text-dim); /* fallback */
  animation: textFlow 7s linear infinite;
  filter: drop-shadow(0 0 12px rgba(var(--acc), 0.35));
}

/* in edit mode i testi sfumati tornano pieni (serve vedere il cursore) */
body.edit-mode .site-name,
body.edit-mode .tagline {
  background: none;
  -webkit-text-fill-color: var(--text);
  animation: none;
  filter: none;
}

.tagline:empty { display: none; }

/* --- le 3 barre strette --- */

.section-bars {
  display: flex;
  flex-direction: column;
  gap: clamp(16px, 2.6vh, 24px);
  width: min(560px, 92vw);
  padding-bottom: 6vh;
}

.section-bar {
  display: flex;
  align-items: center;
  gap: 18px;
  width: 100%;
  padding: 20px 26px;
  border-radius: 22px;
  cursor: pointer;
  font: inherit;
  color: var(--text);
  text-align: left;
  transition:
    transform 0.32s var(--spring-soft),
    border-color 0.3s var(--smooth);
  transform-origin: center;
}

.section-bar:hover {
  transform: translateY(-4px) scale(1.025);
}

.section-bar:active {
  transform: translateY(0) scale(0.955);
  transition-duration: 0.08s;
}

/* click: press breve e morbido, poi la vista cambia */
.section-bar.is-pressed {
  animation: barPress 0.2s var(--spring-soft) both;
}

@keyframes barPress {
  0%   { transform: scale(1); }
  45%  { transform: scale(0.965); }
  100% { transform: scale(1.02); }
}

/* --icon-acc: colore della SEZIONE (verde/marrone/giallo, settato dal JS
   sulla barra home) — colora SOLO il riquadro dell'icona, la barra resta blu */
.bar-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  border-radius: 14px;
  font-size: 1.25rem;
  color: var(--cyan);
  background: rgba(var(--icon-acc, var(--acc)), 0.12);
  border: 1.5px solid rgba(var(--icon-acc, var(--acc)), 0.65);
  text-shadow: 0 0 14px var(--cyan-soft);
  overflow: hidden;
  box-shadow:
    0 0 14px rgba(var(--icon-acc, var(--acc)), 0.4),
    inset 0 0 12px rgba(var(--icon-acc, var(--acc)), 0.22);
}

/* immagine dentro il riquadro-rombo (da media\icone\sezione-x.png) */
.bar-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

.bar-text { flex: 1; min-width: 0; }

.bar-title {
  display: block;
  font-size: 1.12rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.bar-subtitle {
  display: block;
  font-size: 0.84rem;
  color: var(--text-dim);
  margin-top: 2px;
}

.bar-arrow {
  /* stessa logica del riquadro icona: colore della sezione + glow morbido */
  color: rgb(var(--icon-acc, var(--acc)));
  filter: drop-shadow(0 0 8px rgba(var(--icon-acc, var(--acc)), 0.55));
  opacity: 0.85;
  transition: transform 0.4s var(--spring), opacity 0.3s;
}

.section-bar:hover .bar-arrow {
  transform: translateX(6px);
  opacity: 1;
}

/* ============================================================
   VISTA SEZIONE
   ============================================================ */

/* larghezza da telefono anche su desktop: colonna stretta come la home */
.view-section,
.view-item,
.view-reviews,
.view-info,
.view-info-item {
  align-items: stretch;
  gap: clamp(18px, 2.6vh, 26px);
  max-width: 620px;
  margin: 0 auto;
  width: 100%;
}

.view-item.is-active { animation: viewIn 0.42s var(--spring-soft) both; }
.view-reviews.is-active { animation: viewIn 0.42s var(--spring-soft) both; }
.view-info.is-active { animation: viewIn 0.42s var(--spring-soft) both; }
.view-info-item.is-active { animation: viewIn 0.42s var(--spring-soft) both; }

#item-content,
#info-item-content {
  display: flex;
  flex-direction: column;
  width: min(560px, 100%);
  align-self: center;
  padding-bottom: 4vh;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 16px 22px;
  border-radius: 22px;
}

.back-btn {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border-radius: 14px;
  border: 1px solid rgba(var(--acc), 0.3);
  background: rgba(var(--acc), 0.08);
  color: var(--cyan);
  cursor: pointer;
  transition: transform 0.32s var(--spring-soft), background 0.3s;
  box-shadow:
    0 0 12px rgba(var(--acc), 0.28),
    inset 0 0 12px rgba(var(--acc), 0.2);
}

.back-btn:hover { transform: scale(1.1); background: rgba(var(--acc), 0.18); }
.back-btn:active { transform: scale(0.9); transition-duration: 0.1s; }

.section-header-text {
  flex: 1;
  min-width: 0;
  text-align: center; /* nome sezione centrato tra back e logo */
}

.section-header-text h2 {
  font-size: clamp(1.25rem, 2.6vw, 1.7rem);
  font-weight: 800;
  letter-spacing: 0.03em;
  /* stesso gradiente che scorre del titolo home, ma nel colore della sezione */
  background: linear-gradient(
    100deg,
    rgba(var(--acc), 0.7) 0%,
    rgb(var(--acc)) 42%,
    #FFFFFF 52%,
    rgb(var(--acc)) 62%,
    rgba(var(--acc), 0.7) 100%
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--text); /* fallback */
  animation: textFlow 7s linear infinite;
  filter: drop-shadow(0 0 12px rgba(var(--acc), 0.4));
}

/* in edit mode il titolo torna pieno (serve vedere il cursore) */
body.edit-mode .section-header-text h2 {
  background: none;
  -webkit-text-fill-color: var(--text);
  animation: none;
  filter: none;
}

.section-header-text span {
  font-size: 0.85rem;
  color: var(--text-dim);
}

/* sottotitolo vuoto = non occupa spazio (in edit mode riappare col placeholder) */
#section-subtitle:empty { display: none; }
body.edit-mode #section-subtitle { display: inline-block; min-width: 140px; min-height: 1.2em; }
body.edit-mode #section-subtitle:empty::before { content: "tocca per il sottotitolo"; opacity: 0.35; }

.section-mini-logo {
  width: 52px;
  height: 52px;
  object-fit: contain;
  filter: drop-shadow(0 4px 12px rgba(10, 14, 30, 0.5));
  transition: filter 0.8s var(--smooth);
}

/* logo tintato col colore della sezione (resta ben leggibile) */
body[data-accent="verde"] .section-mini-logo {
  filter: hue-rotate(-55deg) saturate(1.7) brightness(1.08)
          drop-shadow(0 0 10px rgba(108, 236, 158, 0.5));
}

body[data-accent="marrone"] .section-mini-logo {
  /* seppia piena + spinta verso il rosso + scurito = marrone caldo */
  filter: sepia(1) saturate(2.6) hue-rotate(-20deg) brightness(0.8) contrast(1.05)
          drop-shadow(0 0 10px rgba(190, 120, 70, 0.55));
}

body[data-accent="giallo"] .section-mini-logo {
  filter: sepia(1) saturate(3.0) hue-rotate(17deg) brightness(1.19)
          drop-shadow(0 0 10px rgba(250, 216, 92, 0.5));
}

/* --- barre numerate: rettangoli lunghi e stretti, uno sopra l'altro --- */

.cards-grid {
  display: flex;
  flex-direction: column;
  gap: clamp(14px, 2.2vh, 20px);
  width: min(560px, 100%);
  align-self: center;
  padding-bottom: 2vh;
}

.media-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  padding: 14px;
  cursor: pointer;
  border-radius: 22px; /* stessa roundness delle barre della home */
  transition: transform 0.32s var(--spring-soft), border-color 0.3s var(--smooth);
  /* entrata a cascata (leggera: transform+opacity) su tutti i device */
  animation: cardIn 0.45s var(--spring-soft) both;
  animation-delay: calc(var(--i, 0) * 55ms);
}

/* quadrato arrotondato per foto/video */
.slot-media {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 18px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: rgba(10, 14, 30, 0.35);
  border: 1px solid rgba(var(--acc), 0.2);
}

.slot-media img,
.slot-media video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* numero fantasma nel quadrato vuoto */
.slot-media .ph-num {
  font-size: clamp(2.2rem, 8vw, 3rem);
  font-weight: 800;
  letter-spacing: 0.04em;
  background: linear-gradient(160deg, rgba(255,255,255,0.6), var(--cyan) 60%, var(--blue));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  opacity: 0.4;
}


/* testo di descrizione sotto il quadrato */
.slot-desc {
  text-align: center;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--text);
  padding: 0 6px 4px;
  white-space: pre-line; /* rispetta gli a capo scritti dall'utente */
}

/* bandierine PNG inline al posto delle emoji 🇺🇸/🇲🇦 (Windows non le mostra) */
.flag-inline {
  display: inline-block;
  height: 1em;
  width: 1.38em;
  object-fit: contain;
  vertical-align: -0.12em;
}

/* in edit mode il quadrato diventa zona upload */
body.edit-mode .slot-media,
body.edit-mode .bar-icon {
  cursor: pointer;
  outline: 1.5px dashed rgba(var(--acc), 0.55);
  outline-offset: 3px;
}

body.edit-mode .slot-media::after {
  content: "＋ tocca per foto/video";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 8px;
  text-align: center;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--cyan);
  background: rgba(10, 14, 30, 0.68);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(18px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.media-card:hover {
  transform: translateY(-3px) scale(1.02);
}

.media-card:active { transform: scale(0.955); transition-duration: 0.08s; }

/* barra sotto-sezione: rettangolo lungo e stretto, testo centrato */
.media-card.is-bar {
  flex-direction: row;
  align-items: center;
  justify-content: center;
  min-height: 74px;
  padding: 16px 20px;
}

/* ✕ elimina sotto-sezione (solo in edit mode) */
.bar-del {
  display: none;
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid rgba(255, 120, 130, 0.55);
  background: rgba(255, 80, 90, 0.14);
  color: #FF97A0;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  z-index: 2;
  transition: transform 0.25s var(--spring-soft), background 0.2s;
}

body.edit-mode .bar-del { display: grid; place-items: center; }
.bar-del:hover { background: rgba(255, 80, 90, 0.3); transform: translateY(-50%) scale(1.12); }

/* barra "＋ Aggiungi" in fondo alla lista (solo in edit mode) */
.add-bar {
  display: none;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 64px;
  border-radius: 22px;
  border: 1.5px dashed rgba(var(--acc), 0.5);
  background: rgba(var(--acc), 0.05);
  color: var(--cyan);
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: transform 0.32s var(--spring-soft), background 0.25s;
}

body.edit-mode .add-bar { display: flex; }
/* sito pubblico: la barra "aggiungi" si vede SOLO nelle recensioni */
body.static-site #reviews-grid .add-bar { display: flex; }
body.edit-mode .sub-label { max-width: calc(100% - 56px); } /* spazio per la ✕ */
.add-bar:hover { background: rgba(var(--acc), 0.12); transform: scale(1.015); }
.add-bar:active { transform: scale(0.97); }

.sub-label {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--text);
  /* glow molto diffuso: niente "banda" chiara dietro le scritte lunghe */
  text-shadow: 0 0 34px rgba(var(--acc), 0.22);
  /* 'pre': il testo NON va mai a capo da solo, solo dove c'e' Invio */
  white-space: pre;
  text-align: center;
  max-width: 100%;
  overflow: hidden;
}

/* hint cartella sotto la griglia */
.folder-hint {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-dim);
  padding-bottom: 6vh;
}

.folder-hint code {
  color: var(--cyan);
  background: rgba(var(--acc), 0.08);
  padding: 2px 8px;
  border-radius: 8px;
}

/* ============================================================
   DESCRIZIONE PICCOLA sotto il nome delle 3 barre home
   ============================================================ */

.bar-subtitle:empty { display: none; }
body.edit-mode .bar-subtitle { display: block; min-height: 1.1em; }
body.edit-mode .bar-subtitle:empty::before { content: "tocca per la descrizione"; opacity: 0.35; }

/* ============================================================
   RECENSIONI — feed foto/video (swipe orizzontale dalla home)
   ============================================================ */

/* sottotitolo header: stesse regole della vista sezione */
#reviews-subtitle:empty { display: none; }
body.edit-mode #reviews-subtitle { display: inline-block; min-width: 140px; min-height: 1.2em; }
body.edit-mode #reviews-subtitle:empty::before { content: "tocca per il sottotitolo"; opacity: 0.35; }

/* riga pill + cerchi: pill recensioni da sola, centrata tra i due cerchi */
.pill-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(14px, 3.5vw, 22px);
  width: min(560px, 92vw);
  margin: -1.5vh 0 5vh;
}

/* la pill non si stringe: si stringono i cerchi */
.pill-row .reviews-pill { flex: none; }

.pill-circle {
  /* diametro poco più grande della pill; su schermi stretti si
     restringe da solo così la riga resta larga come le barre sopra */
  flex: 0 1 72px;
  min-width: 46px;
  width: auto;
  height: auto;
  aspect-ratio: 1 / 1;
  position: relative;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(var(--acc), 0.38);
  background: rgba(var(--acc), 0.07);
  color: var(--cyan);
  font-size: 1.25rem;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow:
    0 0 14px rgba(var(--acc), 0.22),
    inset 0 0 10px rgba(var(--acc), 0.12);
  transition: transform 0.32s var(--spring-soft), background 0.25s;
}
.pill-circle:hover { transform: translateY(-3px) scale(1.06); background: rgba(var(--acc), 0.14); }
.pill-circle:active { transform: scale(0.92); transition-duration: 0.08s; }
/* senza foto (vista normale): invisibile ma occupa spazio, pill centrata */
.pill-circle.is-empty { visibility: hidden; pointer-events: none; }

.pill-circle img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}
.pill-circle .pc-plus { opacity: 0.7; }

/* badge 🔗 per impostare il link: solo in edit mode */
.pill-circle .pc-link {
  display: none;
  position: absolute;
  right: -7px;
  bottom: -7px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(10, 16, 34, 0.92);
  border: 1px solid rgba(var(--acc), 0.5);
  font-size: 0.7rem;
  align-items: center;
  justify-content: center;
}
body.edit-mode .pill-circle .pc-link { display: flex; }
body.edit-mode .pill-circle {
  outline: 1.5px dashed rgba(var(--acc), 0.55);
  outline-offset: 3px;
}

/* pill in home sotto le 3 barre (si apre anche con lo swipe) */
.reviews-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 11px 22px;
  border-radius: 999px;
  border: 1px solid rgba(var(--acc), 0.38);
  background: rgba(var(--acc), 0.07);
  color: var(--text);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  cursor: pointer;
  box-shadow:
    0 0 14px rgba(var(--acc), 0.22),
    inset 0 0 10px rgba(var(--acc), 0.12);
  transition: transform 0.32s var(--spring-soft), background 0.25s;
}
.reviews-pill:hover { transform: translateY(-3px) scale(1.04); background: rgba(var(--acc), 0.14); }
.reviews-pill:active { transform: scale(0.94); transition-duration: 0.08s; }
.reviews-pill[hidden] { display: none; }
.reviews-pill svg { color: rgb(var(--acc)); filter: drop-shadow(0 0 8px rgba(var(--acc), 0.55)); }

/* da telefono pill e cerchi si stringono un filo (non devono toccare i bordi) */
@media (max-width: 480px) {
  .pill-row { gap: 10px; }
  .pill-circle { font-size: 1.05rem; }
  .reviews-pill { padding: 9px 16px; font-size: 0.8rem; gap: 8px; }
  .reviews-pill .review-stars { font-size: 0.68rem; letter-spacing: 1.5px; }
}

.review-stars {
  color: #FFD666;
  font-size: 0.78rem;
  letter-spacing: 2px;
  white-space: nowrap;
  text-shadow: 0 0 10px rgba(255, 214, 102, 0.5);
}

/* card recensione: nome + stelle sopra la foto, testo sotto */
.review-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 2px 6px 0;
}

.review-name {
  flex: 1;
  min-width: 0;
  font-size: 0.98rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-align: left;
  overflow: hidden;
  white-space: pre;
  text-overflow: ellipsis;
  text-shadow: 0 0 24px rgba(var(--acc), 0.25);
}

.media-card.is-review { cursor: default; }
.media-card.is-review .slot-media { cursor: pointer; }

/* la ✕ sta nell'intestazione, non fluttua a metà card */
.media-card.is-review .bar-del {
  position: static;
  transform: none;
  flex: 0 0 30px;
}
.media-card.is-review .bar-del:hover { transform: scale(1.12); }

/* ---------- griglia recensioni: 2 colonne di card compatte ---------- */

#reviews-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(10px, 2vw, 16px);
}
#reviews-grid .add-bar,
#reviews-grid .reviews-empty { grid-column: 1 / -1; }

#reviews-grid .media-card.is-review {
  padding: 10px;
  gap: 8px;
  border-radius: 18px;
  cursor: pointer;
}
#reviews-grid .is-review .review-head { padding: 0 2px; gap: 6px; }
#reviews-grid .is-review .review-name { font-size: 0.8rem; }
#reviews-grid .is-review .review-stars { font-size: 0.58rem; letter-spacing: 1px; }
#reviews-grid .is-review .slot-media .ph-num { font-size: 1.7rem; }
/* titolo della recensione (sotto la foto) */
.review-title {
  text-align: center;
  font-size: 0.98rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  color: var(--text);
  text-shadow: 0 0 24px rgba(var(--acc), 0.25);
  white-space: pre-line;
  padding: 0 4px;
}
.review-title:empty { display: none; }
body.edit-mode .review-title:empty { display: block; min-height: 1.2em; }
body.edit-mode .review-title:empty::before { content: "tocca per il titolo"; opacity: 0.35; }

#reviews-grid .is-review .review-title {
  font-size: 0.82rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
#reviews-grid .is-review .review-title:empty { display: none; }
body.edit-mode #reviews-grid .is-review .review-title:empty { display: block; }

/* nella griglia si vede solo il titolo: la descrizione appare aprendo
   la recensione (in edit mode resta visibile per poterla modificare) */
#reviews-grid .is-review .slot-desc { display: none; }
body.edit-mode #reviews-grid .is-review .slot-desc {
  font-size: 0.78rem;
  padding: 0 2px 2px;
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---------- dettaglio recensione: card grande in overlay ---------- */

.review-detail {
  position: fixed;
  inset: 0;
  z-index: 45; /* sotto il lightbox: lo zoom del media resta sopra */
  display: grid;
  place-items: center;
  padding: clamp(16px, 4vw, 48px);
  background: rgba(6, 9, 22, 0.72);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s var(--smooth);
}
.review-detail.is-open { opacity: 1; pointer-events: auto; }

.review-detail-card {
  width: min(520px, 94vw);
  max-height: 86vh;
  overflow-y: auto;
  transform: scale(0.9);
  transition: transform 0.45s var(--spring);
}
.review-detail.is-open .review-detail-card { transform: scale(1); }
.review-detail-card .slot-media { cursor: pointer; }

/* ---------- card info: solo titolo + testo, niente foto ---------- */

.info-card {
  cursor: default;
  gap: 12px;
  padding: 24px 20px;
}

.info-card-text {
  font-weight: 500;
  line-height: 1.55;
}

body.edit-mode .info-card-text { min-height: 1.3em; }
body.edit-mode .info-card-text:empty::before { content: "tocca per scrivere il testo"; opacity: 0.35; }

.reviews-empty {
  text-align: center;
  color: var(--text-dim);
  font-size: 0.95rem;
  padding: 4vh 0;
}
body.edit-mode .reviews-empty { display: none; }

.card-badge {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--navy);
  background: var(--cyan);
  box-shadow: 0 0 16px var(--cyan-soft);
}

/* --- stato vuoto --- */

.empty-state {
  align-self: center;
  text-align: center;
  padding: clamp(28px, 6vw, 48px) clamp(24px, 7vw, 56px);
  margin-top: 4vh;
  max-width: min(440px, 100%);
}

.empty-icon { font-size: 2.6rem; margin-bottom: 14px; }

.empty-state p { font-size: 1.05rem; font-weight: 600; }

.empty-hint {
  margin-top: 10px;
  font-size: 0.88rem !important;
  font-weight: 400 !important;
  color: var(--text-dim);
  line-height: 1.7;
}

.empty-hint code {
  color: var(--cyan);
  background: rgba(var(--acc), 0.08);
  padding: 2px 8px;
  border-radius: 8px;
  font-size: 0.85em;
}

/* ============================================================
   LIGHTBOX
   ============================================================ */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: clamp(16px, 4vw, 48px);
  background: rgba(6, 9, 22, 0.72);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s var(--smooth);
}

.lightbox.is-open { opacity: 1; pointer-events: auto; }

.lightbox-content {
  max-width: min(1100px, 94vw);
  max-height: 88vh;
  padding: 14px;
  transform: scale(0.9);
  transition: transform 0.45s var(--spring);
}

.lightbox.is-open .lightbox-content { transform: scale(1); }

.lightbox-content img,
.lightbox-content video {
  display: block;
  max-width: 100%;
  max-height: calc(88vh - 28px);
  border-radius: calc(var(--glass-radius) - 12px);
}

.lightbox-close {
  position: absolute;
  top: clamp(14px, 3vw, 30px);
  right: clamp(14px, 3vw, 30px);
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: var(--text);
  font-size: 1.1rem;
  cursor: pointer;
  transition: transform 0.4s var(--spring), background 0.3s;
  z-index: 3; /* sopra il media fullscreen (senza, da telefono finiva sotto il video) */
}

.lightbox-close:hover { transform: scale(1.12) rotate(90deg); background: rgba(var(--acc), 0.2); }

/* su telefono: media a TUTTO schermo, senza cornice */
@media (max-width: 700px) {
  .lightbox { padding: 0; }

  .lightbox-content {
    max-width: 100vw;
    max-height: 100dvh;
    width: 100vw;
    padding: 0;
    border-radius: 0;
    background: #000;
    border: none;
    box-shadow: none;
  }

  .lightbox-content::before { display: none; }

  .lightbox-content img,
  .lightbox-content video {
    width: 100vw;
    max-width: 100vw;
    max-height: 100dvh;
    object-fit: contain;
    border-radius: 0;
  }

  /* ✕ ben visibile sopra il media fullscreen, fuori da notch/isola */
  .lightbox-close {
    top: max(14px, env(safe-area-inset-top));
    right: max(14px, env(safe-area-inset-right));
    background: rgba(10, 14, 30, 0.55);
    border-color: rgba(255, 255, 255, 0.35);
  }
}

/* ============================================================
   MODALITÀ MODIFICA — tocca i testi e riscrivili
   ============================================================ */

.edit-fab {
  position: fixed;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 60;
  display: flex;
  gap: 10px;
  align-items: center;
}

.edit-fab button {
  display: grid;
  place-items: center;
  min-width: 50px;
  height: 50px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid rgba(var(--acc), 0.3);
  background: rgba(20, 28, 52, 0.65);
  -webkit-backdrop-filter: blur(16px) saturate(1.5);
  backdrop-filter: blur(16px) saturate(1.5);
  color: var(--cyan);
  font: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 26px rgba(4, 8, 24, 0.5), inset 0 0 16px rgba(var(--acc), 0.12);
  transition: transform 0.32s var(--spring-soft), background 0.25s;
}

.edit-fab button[hidden] { display: none; }

/* sul sito pubblicato (statico) la modifica non esiste: matita nascosta,
   e niente suggerimenti tecnici (come caricare foto) ai visitatori */
body.static-site .edit-fab { display: none; }
body.static-site .folder-hint { display: none; }

.edit-fab button:hover { transform: scale(1.08); background: rgba(var(--acc), 0.16); }
.edit-fab button:active { transform: scale(0.94); transition-duration: 0.1s; }

.fab-save { color: #0A0E1E !important; background: var(--cyan) !important; box-shadow: 0 0 24px var(--cyan-soft) !important; }
.fab-cancel { width: 50px; padding: 0 !important; }

.fab-publish { font-size: 0.88rem; }
.fab-publish.is-busy {
  cursor: default;
  opacity: 0.75;
  animation: publish-pulse 1.6s ease-in-out infinite;
}
@keyframes publish-pulse {
  0%, 100% { box-shadow: 0 8px 26px rgba(4, 8, 24, 0.5), inset 0 0 16px rgba(var(--acc), 0.12); }
  50% { box-shadow: 0 8px 26px rgba(4, 8, 24, 0.5), 0 0 28px rgba(var(--acc), 0.45), inset 0 0 16px rgba(var(--acc), 0.2); }
}

/* ---------- form recensione dei visitatori (sito pubblico) ---------- */

.review-form-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(3, 6, 18, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.review-form-overlay[hidden] { display: none; }

.review-form {
  width: min(440px, 100%);
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 26px 22px;
  border-radius: 26px;
}

.review-form h3 {
  text-align: center;
  font-size: 1.15rem;
  letter-spacing: 0.04em;
  color: var(--text);
}

.review-form input[type="text"],
.review-form textarea {
  font: inherit;
  color: var(--text);
  background: rgba(var(--acc), 0.06);
  border: 1.5px solid rgba(var(--acc), 0.3);
  border-radius: 14px;
  padding: 12px 14px;
  outline: none;
  resize: none;
}
.review-form input[type="text"]:focus,
.review-form textarea:focus {
  border-color: var(--cyan);
  background: rgba(var(--acc), 0.1);
}

/* honeypot anti-bot: fuori schermo, mai display:none (i bot lo saltano) */
#rf-website {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.rf-file-label {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 8px;
  border-radius: 14px;
  border: 1.5px dashed rgba(var(--acc), 0.45);
  color: var(--cyan);
  font-size: 0.92rem;
  text-align: center;
  cursor: pointer;
}
.rf-file-label:hover { background: rgba(var(--acc), 0.08); }

.rf-actions { display: flex; gap: 10px; }
.rf-actions button {
  flex: 1;
  min-height: 48px;
  border: none;
  border-radius: 16px;
  font: inherit;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
}
.rf-cancel { background: rgba(255, 255, 255, 0.07); color: var(--text-dim); }
.rf-send {
  background: rgba(var(--acc), 0.2);
  color: var(--cyan);
  border: 1.5px solid rgba(var(--acc), 0.5);
}
.rf-send:disabled { opacity: 0.5; cursor: default; }

/* testi editabili evidenziati */
body.edit-mode [data-edit] {
  outline: 1.5px dashed rgba(var(--acc), 0.55);
  outline-offset: 4px;
  border-radius: 6px;
  cursor: text;
  min-width: 30px;
}

body.edit-mode [data-edit]:focus {
  outline-style: solid;
  outline-color: var(--cyan);
  background: rgba(var(--acc), 0.07);
}

/* in edit mode la tagline vuota si vede, con placeholder */
body.edit-mode .tagline { display: block !important; min-height: 1.3em; min-width: 180px; }
body.edit-mode .tagline:empty::before { content: "tocca per scrivere la tagline"; opacity: 0.35; }

/* in edit mode le barre non navigano: si naviga solo con la freccia */
body.edit-mode .section-bar { cursor: default; }
body.edit-mode .section-bar .bar-arrow { cursor: pointer; opacity: 1; }

/* pill recensioni: dentro un <button> serve user-select per il cursore di testo */
body.edit-mode .reviews-pill [data-edit] {
  -webkit-user-select: text;
  user-select: text;
  cursor: text;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: max(88px, calc(env(safe-area-inset-bottom) + 88px));
  transform: translateX(-50%) translateY(20px);
  z-index: 70;
  padding: 12px 22px;
  border-radius: 999px;
  border: 1px solid rgba(var(--acc), 0.35);
  background: rgba(20, 28, 52, 0.85);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s var(--smooth), transform 0.4s var(--spring-soft);
}

.toast.is-visible { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ============================================================
   MOBILE
   ============================================================ */

@media (max-width: 560px) {
  .section-bar { padding: 16px 18px; }
  .bar-icon { width: 40px; height: 40px; flex-basis: 40px; }
  .cards-grid { grid-template-columns: 1fr 1fr; }
  .media-card img, .media-card video { aspect-ratio: 1; }
}

/* ============================================================
   PERFORMANCE MOBILE — meno blur, meno layer, zero scatti
   ============================================================ */

@media (max-width: 700px) {
  /* blur ridotto (il costo cresce col quadrato del raggio) */
  .glass-panel,
  .section-bar {
    -webkit-backdrop-filter: blur(9px) saturate(150%) brightness(1.06);
    backdrop-filter: blur(9px) saturate(150%) brightness(1.06);
  }

  /* liste lunghe: NIENTE backdrop-filter (max 3-5 superfici blur su mobile).
     Il vetro e' simulato con fondo semi-opaco + stessi rim/bordi: identico a occhio.
     Stessa cosa per TUTTO ciò che sta nel pager home/info: il backdrop-blur
     ricampionato a ogni frame è ciò che fa laggare lo swipe su iPhone. */
  .media-card,
  .pager .glass-panel,
  .pager .section-bar {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.02) 38%, transparent 60%),
      linear-gradient(120deg, rgba(255, 255, 255, 0.10), rgba(255, 255, 255, 0.02) 30%, transparent 55%),
      linear-gradient(160deg, rgba(var(--acc), 0.10), rgba(20, 28, 52, 0.62) 45%, rgba(10, 15, 30, 0.72));
  }

  /* aurora: 2 blob, blur minore */
  .blob { filter: blur(64px) saturate(1.3); }
  .blob-3 { display: none; }
}

/* foto/video/icone appaiono con dissolvenza, mai di colpo */
.slot-media img,
.slot-media video,
.bar-icon img {
  opacity: 0;
  transition: opacity 0.45s var(--smooth);
}

/* il video vive su un layer GPU proprio: il glass sopra non lo ricalcola */
.slot-media video { transform: translateZ(0); }

.slot-media img.is-ready,
.slot-media video.is-ready,
.bar-icon img.is-ready {
  opacity: 1;
}

/* titolo della sotto-sezione: centrato, max 2 righe bilanciate */
.view-item .section-mini-logo { display: none; }

.view-item .section-header-text {
  text-align: center;
  padding-right: 44px; /* bilancia otticamente il tasto back a sinistra */
}

#item-title {
  font-size: 1.25rem; /* il JS la riduce finché il nome sta in UNA riga */
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  max-width: 100%;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
