/* ============================================================
   SFIZIO v2 — landing. Sections are self-standing blocks:
   #gateway · #dove-siamo (wayfinder) · #recensioni (rating)
   · #tortona (history carousel) · #contatti (cta-contact).
   Edit one block without touching the others.
   ============================================================ */

/* ================= #gateway ================= */
.gateway {
  height: 100dvh;
  display: flex; flex-direction: column;
  position: relative;
  overflow: clip;
}
.gateway__panel {
  position: relative;
  flex: 1 1 0;
  min-height: 0;
  display: flex; align-items: flex-end;
  overflow: clip;
  transition: flex-grow 0.55s var(--ease);   /* fallback when GSAP is absent */
  -webkit-tap-highlight-color: transparent;
}
/* diagonal seams between stacked panels */
.gateway__panel + .gateway__panel { margin-top: -4.5dvh; }
.gateway__panel--pizza { clip-path: polygon(0 4.5dvh, 100% 0, 100% 100%, 0 100%); }
.gateway__panel--ristorante { clip-path: polygon(0 0, 100% 4.5dvh, 100% 100%, 0 100%); }

.gateway__bg {
  position: absolute; inset: -12% 0;
  background-size: cover; background-position: center;
  filter: saturate(0.9) brightness(0.72);
  transition: transform 0.8s var(--ease), filter 0.5s var(--ease);
}
.gateway__panel::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 20%, var(--scrim) 82%);
}
.gateway__content {
  position: relative; z-index: 1;
  padding: var(--sp-4) var(--gutter);
  /* seam-safe: the NEXT panel overlaps this one's bottom by 4.5dvh —
     keep title + hours above the diagonal, always */
  padding-bottom: calc(var(--sp-4) + 5.5dvh);
  display: grid; gap: var(--sp-1);
  width: 100%;
}
.gateway__panel:last-child .gateway__content { padding-bottom: calc(var(--sp-4) + var(--sp-5)); }

/* TITLE + HOURS are always readable — every state, every panel */
.gateway__title {
  font-size: clamp(1.6rem, 1.1rem + 3.2vw, 3.6rem);
  line-height: 0.98;
  transition: font-size 0.45s var(--ease);
}
.gateway__panel.is-muted .gateway__title { font-size: clamp(1.1rem, 0.9rem + 1.6vw, 1.9rem); }
.gateway__content .kicker { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; }
.gateway__content .soon { font-size: 0.58rem; padding: 0.16rem 0.55rem; letter-spacing: 0.14em; }
.gateway__panel.is-muted .kicker { display: none; }   /* squeezed panels: title + hours only */

.gateway__hours {
  font-weight: 700; font-variant-numeric: tabular-nums;
  font-size: var(--fs-xs);
  transition: font-size 0.45s var(--ease);
}
.gateway__panel.is-active .gateway__hours { font-size: var(--fs-sm); }

/* expandable info: takes NO layout space until the panel is active
   (visibility alone still reserves height and pushed titles out of the
   clipped panel on squeezed states) — and stays unclickable while hidden,
   so the first click can never land on the invisible "Entra" pill */
.gateway__more {
  display: grid; gap: var(--sp-1);
  max-height: 0; overflow: clip;
  transition: max-height 0.5s var(--ease);
}
.gateway__panel.is-active .gateway__more { max-height: 14rem; }
.gateway__line, .gateway__enter {
  opacity: 0; transform: translateY(10px);
  visibility: hidden; pointer-events: none;
  transition: opacity var(--dur-2) var(--ease), transform var(--dur-2) var(--ease),
              visibility 0s linear var(--dur-2);
}
.gateway__line { margin-top: var(--sp-2); }
.gateway__enter { justify-self: start; margin-top: var(--sp-2); margin-bottom: 2px; border-color: var(--line-strong); }

.gateway__panel.is-active .gateway__bg { transform: scale(1.06); filter: saturate(1.05) brightness(0.85); }
.gateway__panel.is-active :is(.gateway__line, .gateway__enter) {
  opacity: 1; transform: none;
  visibility: visible; pointer-events: auto;
  transition-delay: 60ms;
}
.gateway__panel.is-active .gateway__enter { transition-delay: 160ms; }
.gateway__panel.is-muted .gateway__bg { filter: saturate(0.5) brightness(0.5); }

/* concept accents */
.gateway__panel--panini.is-active .gateway__title { color: var(--street); }
.gateway__panel--panini .soon, .gateway__panel--panini .gateway__hours { color: var(--street); }
.gateway__panel--pizza.is-active .gateway__title { color: var(--pizza); }
.gateway__panel--pizza .gateway__hours { color: var(--pizza); }
.gateway__panel--ristorante.is-active .gateway__title { color: var(--dining); }
.gateway__panel--ristorante .soon, .gateway__panel--ristorante .gateway__hours { color: var(--dining); }

.gateway__hint {
  position: absolute; z-index: 2;
  left: 50%; bottom: calc(var(--sp-3) + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-size: var(--fs-xs); letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--ink); opacity: 0.75;
  animation: hint-bob 2.2s var(--ease) infinite;
  pointer-events: none;
}
@keyframes hint-bob { 50% { transform: translateX(-50%) translateY(6px); } }

@media (min-width: 800px) {
  .gateway { flex-direction: row; }
  .gateway__panel + .gateway__panel { margin-top: 0; margin-left: -3.5vw; }
  .gateway__panel--pizza, .gateway__panel--ristorante { clip-path: polygon(3.5vw 0, 100% 0, 100% 100%, 0 100%); }
  /* desktop seams are horizontal: pad the RIGHT of overlapped panels instead */
  .gateway__content, .gateway__panel:last-child .gateway__content { padding-bottom: var(--sp-7); }
  .gateway__panel:not(:last-child) .gateway__content { padding-right: calc(var(--gutter) + 4vw); }
}

/* ================= #dove-siamo (wayfinder skin) ================= */
.wayf { background: var(--bg-2); }
.wayf em { color: var(--pizza); }

/* ================= #tortona ================= */
.tortona em { color: var(--dining); }

@media (prefers-reduced-motion: reduce) {
  .gateway__hint { animation: none; }
  .gateway__more { max-height: none; overflow: visible; transition: none; }
  .gateway__line, .gateway__enter {
    opacity: 1; transform: none; visibility: visible; pointer-events: auto;
  }
}
