/* ===== Gaglietole — design tokens ===== */
:root {
  --stone: #000000;
  --stone-dark: #161616;
  --surface: #111111;
  --ink: #ffffff;
  --ink-soft: #b8b8b8;
  --olive: #3a3a3a;
  --olive-dark: #1a1a1a;
  --gold: #ffffff;
  --white: #ffffff;
  --radius: 14px;
  --shadow: 0 16px 34px rgba(0, 0, 0, 0.55);
  --hairline: rgba(255, 255, 255, 0.12);
  --maxw: 1180px;
  --font-head: Georgia, "Times New Roman", serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--stone);
  line-height: 1.6;
}

img { max-width: 100%; display: block; }

a { color: inherit; text-decoration: none; }

.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

/* ===== Header / Nav ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.88);
  /* backdrop-filter rimosso: su Safari iOS causava repaint incoerenti del menu
     mobile (contenuto che appare/scompare in modo intermittente durante scroll
     e apertura/chiusura). Lo sfondo è già quasi opaco, l'effetto visivo perso è minimo. */
  border-bottom: 1px solid var(--hairline);
  transition: box-shadow 0.3s ease;
}

.site-header.scrolled {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  max-width: var(--maxw);
  margin: 0 auto;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-head);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--gold);
}

.brand-logo {
  height: 34px;
  width: auto;
}

.nav-links {
  display: flex;
  gap: 22px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  position: relative;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink-soft);
  transition: color 0.2s;
  white-space: nowrap;
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: -4px;
  height: 2px;
  background: var(--gold);
  transition: right 0.25s ease;
}

.nav-links a.active {
  color: var(--gold);
}

.nav-links a.active::after {
  right: 0;
}

/* Vedi nota più sotto sull'hover-toggle: su touch ":hover" resta agganciato dopo il tap
   (è quello che faceva restare la sottolineatura bianca accesa sotto una voce a caso) */
@media (hover: hover) and (pointer: fine) {
  .nav-links a:hover {
    color: var(--gold);
  }

  .nav-links a:hover::after {
    right: 0;
  }
}

.nav-links a.nav-shop {
  color: var(--gold);
  border: 1px solid var(--gold);
  border-radius: 999px;
  padding: 6px 16px;
}

.nav-links a.nav-shop::after { display: none; }

.nav-links a.nav-shop:hover {
  background: var(--gold);
  color: var(--stone);
}

.nav-item-dropdown { position: relative; }

.nav-dropdown-toggle {
  position: relative;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: inherit;
  color: var(--ink-soft);
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  transition: color 0.2s;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  text-align: left;
  /* Senza questo reset, iOS applica al <button> un suo stile/feedback nativo
     (appare più "acceso" delle voci normali e mostra un'animazione al tocco) */
  appearance: none;
  -webkit-appearance: none;
  -webkit-tap-highlight-color: transparent;
}

.nav-dropdown-toggle::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: -4px;
  height: 2px;
  background: var(--gold);
  transition: right 0.25s ease;
}

.nav-dropdown-toggle.active { color: var(--gold); }
.nav-dropdown-toggle.active::after { right: 0; }

/* L'effetto hover va acceso solo su dispositivi con un vero puntatore (mouse):
   su touch, ":hover" resta "agganciato" dopo il tocco e sembra un'animazione che parte da sola */
@media (hover: hover) and (pointer: fine) {
  .nav-dropdown-toggle:hover { color: var(--gold); }
  .nav-dropdown-toggle:hover::after { right: 0; }
}

.nav-arrow {
  /* Freccia disegnata via CSS (non un carattere di testo): un glifo unicode a volte
     viene reso troppo piccolo/chiaro dal font di sistema e diventa illeggibile su mobile */
  display: inline-block;
  width: 7px;
  height: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  font-size: 0;
  margin-top: -4px;
  transform: rotate(45deg);
  transition: transform 0.2s ease;
}

.nav-dropdown-toggle[aria-expanded="true"] .nav-arrow { transform: rotate(225deg); }

/* Su touch, ":hover" resta "agganciato" dopo il tocco: se non scoperto solo al mouse,
   la freccia restava ruotata (aperta) anche dopo aver chiuso il menu */
@media (hover: hover) and (pointer: fine) {
  .nav-item-dropdown:hover .nav-arrow { transform: rotate(225deg); }
}

.nav-dropdown {
  position: absolute;
  top: calc(100% + 14px);
  left: 50%;
  transform: translateX(-50%) translateY(-6px);
  background: var(--stone-dark);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 8px;
  min-width: 210px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
  z-index: 10;
}

/* Specificità (3 classi) più alta della regola mobile che azzera position/transform:
   senza il guard hover-capable, un tap che innesca :hover su touch la sovrascriveva
   sempre, riportando il sottomenu fuori schermo anche dopo il fix mobile. */
@media (hover: hover) and (pointer: fine) {
  .nav-item-dropdown:hover .nav-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
  }
}

.nav-dropdown a {
  display: block;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.85rem;
}

.nav-dropdown a:hover, .nav-dropdown a.active { background: rgba(255, 255, 255, 0.08); }
.nav-dropdown a::after { display: none; }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}

.nav-toggle span {
  width: 26px;
  height: 2px;
  background: var(--ink);
  transition: transform 0.25s ease, opacity 0.2s ease;
}

.nav-toggle.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.active span:nth-child(2) { opacity: 0; }
.nav-toggle.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 1080px) and (min-width: 941px) {
  .nav-links { gap: 14px; }
  .nav-links a { font-size: 0.82rem; }
}

@media (max-width: 940px) {
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--stone);
    flex-direction: column;
    gap: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    border-bottom: 1px solid var(--hairline);
  }
  .nav-links.open {
    max-height: 80vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .nav-links li { border-top: 1px solid var(--hairline); }
  .nav-links a { display: block; padding: 16px 24px; }
  .nav-toggle { display: flex; }

  .nav-dropdown-toggle { display: flex; width: 100%; align-items: center; justify-content: space-between; padding: 16px 24px; }

  .nav-dropdown {
    /* Toggle più semplice possibile: nessuna transizione, nessun grid, nessun trucco GPU.
       Le versioni animate hanno dato problemi di repaint ricorrenti su Safari iOS. */
    display: none;
    position: static;
    left: auto;
    transform: none;
    /* La transition della versione desktop (per il fade on-hover) resta ereditata qui
       se non viene azzerata: su Safari, insieme al toggle display:none/block, può far
       "congelare" il repaint del contenuto finché un evento esterno non lo forza. */
    transition: none;
    opacity: 1;
    visibility: visible;
    background: none;
    border: none;
    box-shadow: none;
    border-radius: 0;
    padding: 0;
    min-width: 0;
  }
  .nav-dropdown.open { display: block; }
  .nav-dropdown a { padding: 14px 24px 14px 40px; font-size: 0.85rem; color: var(--ink-soft); }
}

/* ===== Hero ===== */
.hero {
  position: relative;
  min-height: 78vh;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  background: linear-gradient(160deg, var(--olive-dark), var(--stone) 120%);
}

.hero-media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.85;
}

.hero-storia { min-height: 55vh; }
.hero-festa { min-height: 55vh; }

.hero-media-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.55);
  font-size: 0.95rem;
  text-align: center;
  padding: 24px;
  border: 2px dashed rgba(255,255,255,0.25);
  margin: 12px;
  border-radius: var(--radius);
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.05) 0%, rgba(0,0,0,0.75) 100%);
}

.hero-content {
  position: relative;
  z-index: 2;
  padding: 60px 24px 64px;
  max-width: var(--maxw);
  margin: 0 auto;
  width: 100%;
  color: var(--white);
}


.eyebrow {
  text-transform: uppercase;
  letter-spacing: 3px;
  font-size: 0.78rem;
  color: var(--gold);
  font-weight: 700;
}

.hero h1 {
  font-family: var(--font-head);
  font-size: clamp(2.4rem, 6vw, 4.2rem);
  margin: 10px 0 16px;
}

.hero p {
  max-width: 560px;
  font-size: 1.1rem;
  color: rgba(255,255,255,0.88);
}

.hero-content .btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 20px;
}

.btn {
  display: inline-block;
  padding: 14px 30px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.95rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.hero-content > .btn { margin-top: 20px; }

/* Hero home: testo ancorato al fondo con posizione assoluta, non dipende dal flex */
.hero-home .hero-content {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 32px;
  top: auto;
  padding: 0 24px;
}

.hero-storia .hero-content {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 28px;
  top: auto;
  padding: 0 24px;
}

.hero-festa .hero-content {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 44px;
  top: auto;
  padding: 0 24px;
}

.hero-festa .hero-content h1 { position: relative; top: 18px; margin-bottom: 28px; }
.hero-festa .hero-content p { position: relative; top: 18px; }

.hero-short .hero-content {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 20px;
  top: auto;
  padding: 0 24px;
}

.hero-contatti .hero-content { bottom: 0; }
.hero-contatti .hero-content h1 { margin-bottom: 0; }

@media (max-width: 640px) {
  .hero-content { padding: 20px 20px 32px; }
  .hero h1 { font-size: 2rem; margin: 6px 0 8px; }
  .hero-content .btn-row { gap: 10px; margin-top: 14px; }
  .hero-content .btn-row .btn { padding: 12px 20px; font-size: 0.85rem; }

  .hero-storia { min-height: 64vh; }
  .hero-festa { min-height: 64vh; }
  .hero-festa .hero-content > .btn { margin-top: 40px; }

  .hero-home .hero-content { bottom: 20px; padding: 0 20px; }
  .hero-home .hero-content p { display: none; }

  .hero-storia .hero-content { bottom: 20px; padding: 0 20px; }
  .hero-festa .hero-content { bottom: 32px; padding: 0 20px; }
  .hero-festa .hero-content h1 { top: 38px; margin-bottom: 20px; }
  .hero-festa .hero-content p { top: 38px; }
  .hero-short .hero-content { bottom: 14px; padding: 0 20px; }
  .hero-contatti .hero-content { bottom: 0; }
  .hero-contatti .hero-content h1 { margin-bottom: 0; }

  section + section { padding-top: 16px; }
  section:has(+ section) { padding-bottom: 16px; }
}

.btn:active { transform: translateY(0) scale(0.96); }

.btn-primary {
  background: var(--gold);
  color: var(--stone);
}

.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(255, 255, 255, 0.35); }

.btn-outline {
  border: 2px solid rgba(255,255,255,0.6);
  color: var(--white);
}

.btn-outline:hover {
  background: var(--white);
  color: var(--olive-dark);
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(0,0,0,0.2);
}

/* ===== Sections ===== */
section { padding: 56px 0; }
section[id] { scroll-margin-top: 90px; }

.hero + section { padding-top: 32px; }
section + section { padding-top: 32px; }
section:has(+ section) { padding-bottom: 32px; }

.section-head { max-width: 640px; margin: 0 auto 48px; text-align: center; }

.section-head .eyebrow { color: var(--gold); }

.section-head h2 {
  font-family: var(--font-head);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  color: var(--ink);
  margin: 8px 0 12px;
}

.section-head p { color: var(--ink-soft); }

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 28px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.card:hover {
  transform: translateY(-6px);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 22px 44px rgba(0, 0, 0, 0.6);
}

.card-media img {
  transition: transform 0.5s ease;
}

.card:hover .card-media img {
  transform: scale(1.08);
}

.card-media {
  aspect-ratio: 4 / 3;
  background: var(--stone-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-soft);
  font-size: 0.85rem;
  text-align: center;
  padding: 16px;
  border: 1px dashed rgba(255, 255, 255, 0.25);
}

.card-media.has-photo {
  padding: 0;
  border: none;
  display: block;
}

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card-body { padding: 22px; }

.card-body h3 {
  font-family: var(--font-head);
  margin: 0 0 8px;
  color: var(--gold);
}

.card-body p { color: var(--ink-soft); font-size: 0.95rem; margin: 0; }

/* Card grandi che si girano al tocco per mostrare il testo sul retro, impilate allo scroll */
.cards-flip {
  display: block;
  position: relative;
  width: 100%;
  padding: 6vh 0;
}

.card-wrapper {
  position: sticky;
  top: 90px;
  padding-bottom: 24px;
  will-change: transform;
  transition: filter 0.4s ease, opacity 0.4s ease;
}

/* Quando una card è aperta, le altre si sfocano e vanno sullo sfondo per farla risaltare */
.cards-flip.has-flipped .card-wrapper:not(.is-flipped) {
  filter: blur(4px);
  opacity: 0.4;
  pointer-events: none;
}

.card-wrapper.is-flipped { z-index: 5; }

/* Le gallerie a scorrimento continuo si fermano quando non sono a schermo, per alleggerire lo scroll da mobile */
.gallery-marquee.marquee-offscreen .image-line { animation-play-state: paused; }

.flip-card {
  position: relative;
  height: 70vh;
  min-height: 380px;
  max-height: 560px;
  perspective: 1600px;
  cursor: pointer;
  transition: height 0.35s ease;
}

.flip-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transform-style: preserve-3d;
}

.flip-card-face {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: var(--radius);
  backface-visibility: hidden;
  /* La faccia non visibile non deve intercettare tocchi/scroll: senza questo, il retro nascosto
     "ruba" lo scroll del dito quando la card viene richiusa (bug tipico del flip 3D su mobile) */
  pointer-events: none;
}

.flip-card[aria-pressed="false"] .flip-card-front,
.flip-card:not([aria-pressed]) .flip-card-front,
.flip-card[aria-pressed="true"] .flip-card-back {
  pointer-events: auto;
}

.flip-card-front { background: var(--stone-dark); }

.flip-card-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 6;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 0, 0, 0.6);
  color: var(--white);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.flip-card-close:hover { background: rgba(0, 0, 0, 0.8); }
.flip-card-close:active { transform: scale(0.94); }

@media (max-width: 640px) {
  .flip-card-close { top: 10px; right: 10px; padding: 7px 14px; font-size: 0.78rem; }
}

.flip-card-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  cursor: zoom-in;
}

.flip-card-photo-placeholder {
  background: var(--stone-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-soft);
  font-size: 0.85rem;
  text-align: center;
}

.flip-card-photo-placeholder::after { content: "Foto in arrivo"; }

.flip-card-front-info {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 24px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.35) 60%, transparent 100%);
}

.flip-card-front-info h3 {
  font-family: var(--font-head);
  color: var(--white);
  margin: 0 0 10px;
  font-size: 1.5rem;
}

.flip-card-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--gold);
  font-weight: 700;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.flip-card-back {
  background: var(--surface);
  border: 1px solid var(--hairline);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: 32px;
  overflow-y: auto;
  transform: rotateY(180deg);
}

.flip-card-back h3 {
  font-family: var(--font-head);
  color: var(--gold);
  margin: 0 0 14px;
}

.flip-card-back p {
  color: var(--ink-soft);
  font-size: 1.05rem;
  line-height: 1.6;
  margin: 0;
}

/* Retro della card diviso in due: testo a sinistra, foto a destra che scorrono in verticale */
.flip-card-back.flip-card-back-split {
  flex-direction: row;
  align-items: stretch;
  justify-content: flex-start;
  padding: 0;
}

.flip-card-back-split .back-text {
  flex: 1 1 56%;
  overflow-y: auto;
  padding: 28px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 10px;
}

.flip-card-back-split .back-text p { margin: 0 0 6px; }
.flip-card-back-split .back-text p:last-child { margin-bottom: 0; }

.flip-card-back-split .back-text a {
  color: #4da3ff;
  text-decoration: underline;
  font-weight: 600;
}
.flip-card-back-split .back-text a:hover { color: #7cbbff; }

.flip-card-back-split .back-gallery {
  flex: 0 0 44%;
  overflow: hidden;
  position: relative;
}

.back-gallery-track {
  position: relative;
  width: 100%;
  height: 100%;
}

.back-gallery-track img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: zoom-in;
  display: block;
  opacity: 0;
  transform: scale(1.06);
  transition: opacity 0.8s ease, transform 1.6s ease;
}

.back-gallery-track img { pointer-events: none; }
.back-gallery-track img.is-active { opacity: 1; transform: scale(1); pointer-events: auto; }

@media (max-width: 640px) {
  .flip-card-back.flip-card-back-split { flex-direction: column; }
  .flip-card-back-split .back-text { padding: 20px; }
  .flip-card-back-split .back-gallery { flex: 0 0 165px; }

  /* Quando la card si apre da mobile, cresce un po' per dare più spazio al testo */
  .card-wrapper.is-flipped .flip-card.flip-card-compact {
    height: 74vh;
    max-height: 620px;
  }
}

.cards-flip + .cards-flip { padding-top: 0; }

.flip-card.flip-card-tall {
  height: auto;
  aspect-ratio: 1130 / 1040;
  max-width: 780px;
  margin: 0 auto;
}

@media (max-width: 640px) {
  .flip-card.flip-card-tall {
    aspect-ratio: 1130 / 1600;
    max-width: 100%;
  }
}

.flip-card.flip-card-compact {
  height: 60vh;
  min-height: 320px;
  max-height: 460px;
}

.cards-flip.cards-flip-single { grid-template-columns: 1fr; padding: 0; }

/* Cronologia storica: linea verticale con pallini, si riempie scorrendo */
.timeline {
  position: relative;
  margin: 0 auto;
  max-width: 720px;
  padding-left: 32px;
}

.timeline-track {
  position: absolute;
  left: 5px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: var(--hairline);
}

.timeline-fill {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 0%;
  background: var(--gold);
}

.timeline-list {
  position: relative;
  list-style: none;
  margin: 0;
  padding: 0;
}

.timeline-list li {
  position: relative;
  display: flex;
  gap: 24px;
  padding: 16px 0;
  border-bottom: 1px solid var(--hairline);
  color: var(--ink-soft);
  line-height: 1.5;
}

.timeline-list li::before {
  content: "";
  position: absolute;
  left: -32px;
  top: 22px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--stone);
  border: 2px solid var(--gold);
}

.timeline-list li:last-child { border-bottom: none; }

.timeline-year {
  flex: 0 0 110px;
  font-family: var(--font-head);
  color: var(--gold);
  font-weight: 700;
}

@media (max-width: 640px) {
  .timeline-list li { flex-direction: column; gap: 4px; padding: 14px 0; }
  .timeline-year { flex: none; }
}

/* Griglia loghi sponsor */
.sponsor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}

.sponsor-logo {
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--hairline);
  overflow: hidden;
}

.sponsor-logo img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  cursor: zoom-in;
}

@media (max-width: 640px) {
  .sponsor-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .sponsor-logo { height: 100px; padding: 10px; }
}

/* card con più foto: scorrimento orizzontale con snap, una foto alla volta */
.flip-card-photo-scroll {
  display: flex;
  width: 100%;
  height: 100%;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.flip-card-photo-scroll::-webkit-scrollbar { display: none; }

.flip-card-photo-scroll .flip-card-photo {
  flex: 0 0 100%;
  scroll-snap-align: start;
}

/* photo gallery a marquee verticale: colonne che scorrono all'infinito, alcune su alcune giu' */
.gallery.gallery-marquee {
  position: relative;
  display: flex;
  gap: 12px;
  height: 65vh;
  overflow: clip;
  border-radius: var(--radius);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 15%, black 85%, transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0%, black 15%, black 85%, transparent 100%);
}

.gallery.gallery-marquee.gallery-marquee-full {
  height: 100vh;
}

/* galleria a piena larghezza: niente container, niente angoli arrotondati (come la galleria Home) */
.gallery-fullbleed .gallery.gallery-marquee {
  border-radius: 0;
}

/* Home: 2 colonne su mobile (paesaggio | festa+cibo), 3 su desktop (gaglietole, festa, cibo separati) */
.gallery.gallery-marquee.gallery-marquee-desktop-only { display: none; }

@media (min-width: 900px) {
  .gallery.gallery-marquee.gallery-marquee-mobile-only { display: none; }
  .gallery.gallery-marquee.gallery-marquee-desktop-only { display: flex; }
}


.image-marquee {
  flex: 1 1 0;
  min-width: 0;
  overflow: hidden;
}

.image-line {
  display: flex;
  flex-direction: column;
}

/* margine (non gap) cosi' lo spazio resta identico anche nella giunzione col blocco duplicato */
.gallery .ph {
  aspect-ratio: 1;
  background: var(--stone-dark);
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
  margin-bottom: 12px;
}

.gallery .ph img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  cursor: zoom-in;
}

/* pausa lo scroll della galleria mentre una foto e' aperta nel lightbox */
.gallery-marquee.gallery-paused .image-line { animation-play-state: paused; }

/* lightbox: la foto della galleria a schermo intero al tocco */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.92);
  padding: 32px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.lightbox.open { opacity: 1; pointer-events: auto; }

.lightbox-img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 8px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.15);
  color: var(--white);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}

.lightbox-close:hover { background: rgba(255, 255, 255, 0.28); }

/* avviso "tocca una foto per ingrandirla" */
.zoom-hint {
  position: fixed;
  left: 50%;
  top: 84px;
  transform: translateX(-50%);
  z-index: 900;
  display: flex;
  align-items: center;
  gap: 18px;
  background: var(--stone-dark);
  border-left: 3px solid var(--white);
  color: var(--ink-soft);
  border-radius: 8px;
  padding: 14px 14px 14px 18px;
  font-size: 0.88rem;
  box-shadow: var(--shadow);
  max-width: calc(100vw - 32px);
}

.zoom-hint-close {
  flex-shrink: 0;
  border: none;
  background: transparent;
  color: var(--ink-soft);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.zoom-hint-close:hover { color: var(--white); }

@media (prefers-reduced-motion: no-preference) {
  .image-marquee.to-top .image-line { animation: gallery-scroll-down 70s linear infinite; }
  .image-marquee.to-bottom .image-line { animation: gallery-scroll-up 70s linear infinite; }
}

@keyframes gallery-scroll-up {
  0% { transform: translateY(0); }
  100% { transform: translateY(-100%); }
}
@keyframes gallery-scroll-down {
  0% { transform: translateY(-100%); }
  100% { transform: translateY(0); }
}

.menu-item {
  transition: background 0.25s ease, padding-left 0.25s ease;
}

.menu-item:hover {
  background: rgba(255, 255, 255, 0.08);
  padding-left: 12px;
  border-radius: 8px;
}

.program-day {
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.program-day:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.6);
}

@media (max-width: 700px) {
  .gallery.gallery-marquee { height: 55vh; }
  .gallery.gallery-marquee.gallery-marquee-full { height: 85vh; }
}

/* ===== Menu / eventi ===== */
.menu-item {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 0;
  border-bottom: 1px solid var(--stone-dark);
}

.menu-item h4 { margin: 0 0 4px; font-family: var(--font-head); color: var(--ink); text-transform: uppercase; }
.menu-item p { margin: 0; color: var(--ink-soft); font-size: 0.9rem; }
.menu-item .price { font-weight: 700; color: var(--gold); white-space: nowrap; }

/* ===== Menu pagina preordini: layout a due colonne (menù + pannello preordina) ===== */
.menu-accordion-frame {
  position: relative;
  max-width: 780px;
  margin: 0 auto;
  background: var(--stone-dark);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 44px 20px 20px;
}

.menu-accordion-label {
  position: absolute;
  top: -15px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--stone);
  font-family: var(--font-head);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-size: 0.8rem;
  padding: 8px 24px;
  border-radius: 999px;
  box-shadow: var(--shadow);
  white-space: nowrap;
}

.menu-accordion { display: flex; flex-direction: column; gap: 16px; }

.menu-cat {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.menu-cat:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.55);
}

.menu-cat-summary {
  width: 100%;
  background: none;
  border: none;
  cursor: pointer;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-family: var(--font-head);
  color: var(--ink);
  font-size: 1.1rem;
  letter-spacing: 0.3px;
  text-align: left;
}

.menu-cat-arrow {
  transition: transform 0.3s ease;
  color: var(--gold);
  font-size: 0.9rem;
  flex-shrink: 0;
}

.menu-cat.is-open .menu-cat-arrow { transform: rotate(180deg); }

.menu-cat-body { height: 0; overflow: hidden; }
.menu-cat.is-open .menu-cat-body { height: auto; }

.menu-cat-body .menu-item { padding: 14px 24px; }
.menu-cat-body .menu-item:last-child { border-bottom: none; }

.menu-listino-status { text-align: center; color: var(--ink-soft); padding: 20px 0; }

.queue-counter {
  max-width: 780px;
  margin: 0 auto 32px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 28px;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  text-align: center;
}

.queue-counter-text {
  font-family: var(--font-head);
  color: var(--ink-soft);
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.queue-counter-number {
  font-family: var(--font-head);
  color: var(--gold);
  font-weight: 700;
  font-size: 1.9rem;
  min-width: 1.5ch;
}

.specialita-oggi {
  position: relative;
  max-width: 780px;
  margin: 0 auto 32px;
  background: var(--surface);
  border: 1px solid var(--gold);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 30px 24px 12px;
}

.specialita-oggi-label {
  position: absolute;
  top: -15px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--gold);
  color: var(--stone);
  font-family: var(--font-head);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-size: 0.8rem;
  padding: 8px 24px;
  border-radius: 999px;
  box-shadow: var(--shadow);
  white-space: nowrap;
}

.specialita-oggi-items .menu-item:last-child { border-bottom: none; }

.menu-item-badge, .preorder-item-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--gold);
  color: var(--stone);
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  vertical-align: middle;
}

.menu-preorder-banner {
  max-width: 780px;
  margin: 0 auto 64px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 40px 44px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 24px 36px;
}

.menu-preorder-banner-text { flex: 1 1 240px; text-align: center; }

.menu-preorder-banner-text h3 {
  font-family: var(--font-head);
  color: var(--ink);
  margin: 0 0 10px;
  font-size: 1.75rem;
}

.menu-preorder-banner-text p {
  color: var(--ink-soft);
  margin: 0;
  font-size: 1.05rem;
}

.menu-steps-inline {
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 2 1 360px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.menu-steps-inline li {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink-soft);
  font-size: 1.05rem;
}

.menu-step-num {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--hairline);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-head);
  color: var(--gold);
  font-size: 1rem;
}

@media (max-width: 700px) {
  .menu-preorder-banner { flex-direction: column; align-items: stretch; text-align: center; padding: 26px 24px; gap: 18px; }
  .menu-preorder-banner-text { flex: none; text-align: center; }
  .menu-preorder-banner-text h3 { font-size: 1.2rem; }
  .menu-preorder-banner-text p { font-size: 0.92rem; }
  .menu-steps-inline {
    flex: none;
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    margin: 0 auto;
    width: fit-content;
  }
  .menu-steps-inline li { font-size: 0.95rem; }
  .menu-preorder-banner .btn { align-self: center; }
}

.program-day {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 22px 26px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}

.program-day .date { color: var(--gold); font-weight: 700; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 1px; }
.program-day h4 { font-family: var(--font-head); margin: 6px 0; }

.notice {
  background: var(--stone-dark);
  border-left: 4px solid var(--gold);
  padding: 16px 20px;
  border-radius: 8px;
  color: var(--ink-soft);
  font-size: 0.9rem;
  margin: 24px 0;
}

/* ===== Programma serate: elenco filtrabile per giorno ===== */
.day-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-bottom: 32px;
}

.day-filter {
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid var(--hairline);
  background: transparent;
  color: var(--ink);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.day-filter:hover { background: rgba(255, 255, 255, 0.08); }

.day-filter.active { background: var(--white); color: #000000; }

.day-list { display: flex; flex-direction: column; }

.day-row {
  display: grid;
  grid-template-columns: 64px 150px 1.4fr 1.2fr 1.2fr;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--hairline);
  align-items: center;
}

.day-row-photo {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
}

.day-row-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  display: block;
  cursor: zoom-in;
}

.day-row-date { font-family: var(--font-head); color: var(--white); }
.day-row-dish, .day-row-music, .day-row-match { color: var(--ink-soft); font-size: 0.92rem; }

.day-row.is-hidden { display: none; }

.container-wide { max-width: 1500px; }

@media (min-width: 900px) {
  .container-wide .day-filter { padding: 12px 22px; font-size: 0.95rem; }
  .container-wide .day-row {
    grid-template-columns: 92px 190px 1.4fr 1.2fr 1.2fr;
    gap: 24px;
    padding: 22px 24px;
  }
  .container-wide .day-row-photo { width: 92px; height: 92px; }
  .container-wide .day-row-date { font-size: 1.15rem; }
  .container-wide .day-row-dish,
  .container-wide .day-row-music,
  .container-wide .day-row-match { font-size: 1.05rem; }
}

@media (max-width: 700px) {
  .day-row {
    grid-template-columns: 64px 1fr;
    grid-template-areas:
      "photo date"
      "photo dish"
      "photo music"
      "photo match";
    gap: 4px 16px;
    padding: 16px 0;
  }
  .day-row-photo { grid-area: photo; width: 64px; height: 64px; }
  .day-row-date { grid-area: date; }
  .day-row-dish { grid-area: dish; }
  .day-row-music { grid-area: music; }
  .day-row-match { grid-area: match; }
}

/* ===== Footer ===== */
.site-footer {
  background: #000000;
  color: rgba(255,255,255,0.75);
  padding: 48px 0 24px;
  border-top: 1px solid var(--hairline);
}

.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
  justify-content: space-between;
}

.site-footer h4 { color: var(--white); font-family: var(--font-head); margin: 0 0 12px; }
.site-footer a { color: rgba(255,255,255,0.75); }
.site-footer a:hover { color: var(--gold); }

.footer-bottom {
  text-align: center;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.45);
  margin-top: 36px;
}

.footer-credits {
  text-align: center;
  font-size: 0.75rem;
  color: rgba(255,255,255,0.35);
  margin-top: 6px;
}
.footer-credits a { color: rgba(255,255,255,0.55); }
.footer-credits a:hover { color: var(--gold); }

.bg-olive { background: var(--olive); color: var(--white); }
.bg-olive .section-head h2, .bg-olive .section-head p { color: var(--white); }
