/* CSOEC — stile condiviso */

:root {
  --ink: #0b0b0c;
  --ink-soft: #3b3b3f;
  --muted: #6b6b70;
  --line: #e4e4e6;
  --bg: #ffffff;
  --accent: #f97316;
  --ease: cubic-bezier(0.7, 0, 0.2, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --font: "Neue Montreal", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --nav-h: 64px;
  --gutter: 16px;
}

*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  min-height: 100svh;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

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

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 1000;
  padding: 0.6em 1em;
  background: var(--ink);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  transform: translateY(-200%);
}
.skip-link:focus {
  transform: none;
}

/* ── Navigazione ─────────────────────────────────────── */

nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  height: var(--nav-h);
  padding: 0 var(--gutter);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1em;
  background: rgba(255, 255, 255, 0.92);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s;
}
nav.is-scrolled {
  border-bottom-color: var(--line);
}

nav .logo a {
  display: inline-flex;
  align-items: center;
}
nav .logo-img {
  height: 46px;
  width: auto;
}

nav .nav-items {
  display: flex;
  align-items: center;
  gap: 1.6em;
}
nav .nav-items a,
nav .nav-link {
  font-size: 13.5px;
  font-weight: 500;
  position: relative;
  padding: 0.3em 0;
}
nav .nav-items a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s var(--ease-out);
}
nav .nav-items a:hover::after,
nav .nav-items a[aria-current="page"]::after {
  transform: scaleX(1);
}
nav .nav-nb {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
nav .nav-nb img {
  width: auto;
  height: 1em;
  flex-shrink: 0;
}

nav .contact {
  display: flex;
  justify-content: flex-end;
}
nav .contact .tag {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
}

.btn-comitato {
  display: inline-flex;
  align-items: center;
  padding: 0.6em 1.1em;
  border: 1.5px solid var(--ink);
  border-radius: 2px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: background 0.2s, color 0.2s;
}
.btn-comitato:hover {
  background: var(--ink);
  color: #fff;
}

/* ── Footer ──────────────────────────────────────────── */

.site-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4em 1.5em;
  padding: 14px var(--gutter) 18px;
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.site-foot a {
  color: var(--ink);
  font-weight: 500;
}
.site-foot a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ── Home ────────────────────────────────────────────── */

.home {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  padding-top: calc(var(--nav-h) + 6px);
}

.home-grid,
.home-title {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  padding: 0 var(--gutter);
}
.home-grid {
  flex: 1;
  min-height: 300px;
}

.card {
  position: relative;
  display: block;
  overflow: hidden;
  background: #111;
  color: #fff;
  isolation: isolate;
}
.card > picture,
.card > .card-media {
  position: absolute;
  inset: 0;
}
.card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.9s var(--ease-out);
}
.card--contain img {
  object-fit: contain;
}
.card:hover img {
  transform: scale(1.045);
}
.card-copy {
  position: absolute;
  inset: auto 0 0 0;
  z-index: 2;
  padding: 3em 0.9em 0.9em;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.62));
  display: flex;
  flex-direction: column;
  gap: 0.25em;
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.15;
  pointer-events: none;
}
.card-copy .now {
  color: #ffa25c;
}
.card--future {
  background: #121212;
}
.card--future .card-media {
  display: grid;
  place-items: center;
}
.card-qmark {
  font-size: clamp(5rem, 14vw, 14rem);
  font-weight: 300;
  line-height: 1;
  color: rgba(255, 255, 255, 0.14);
  transition: color 0.4s, transform 0.9s var(--ease-out);
}
.card--future:hover .card-qmark {
  color: rgba(255, 255, 255, 0.4);
  transform: scale(1.06);
}

.home-title {
  padding-top: 10px;
}
.ttl-col {
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.ttl-letter {
  display: block;
  font-size: clamp(4rem, min(15vw, 24svh), 17rem);
  font-weight: 300;
  line-height: 0.92;
  letter-spacing: -0.02em;
}
.ttl-word {
  display: block;
  padding: 0.2em 0 0;
  font-size: clamp(10px, 0.95vw, 14px);
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

/* Intro (una sola sequenza, senza scambi di elementi) */

@keyframes clip-in {
  from { clip-path: inset(100% 0 0 0); }
  to   { clip-path: inset(0 0 0 0); }
}
@keyframes zoom-settle {
  from { transform: scale(1.18); }
  to   { transform: scale(1); }
}
@keyframes rise {
  from { transform: translateY(110%); }
  to   { transform: translateY(0); }
}
@keyframes fade-up {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

nav { animation: fade 0.7s 0.1s both; }

.home-grid .card {
  animation: clip-in 1s var(--ease) both;
  animation-delay: calc(0.15s + var(--i, 0) * 0.09s);
}
.home-grid .card .card-media > img,
.home-grid .card > picture img {
  animation: zoom-settle 1.6s var(--ease-out) both;
  animation-delay: calc(0.15s + var(--i, 0) * 0.09s);
}
.home-grid .card-copy {
  animation: fade-up 0.8s var(--ease-out) both;
  animation-delay: calc(0.75s + var(--i, 0) * 0.09s);
}
.ttl-letter {
  animation: rise 1s var(--ease) both;
  animation-delay: calc(0.7s + var(--i, 0) * 0.07s);
}
.ttl-word {
  animation: fade-up 0.8s var(--ease-out) both;
  animation-delay: calc(1.05s + var(--i, 0) * 0.07s);
}
.site-foot {
  animation: fade 0.8s 1.4s both;
}

/* ── Pagine interne ──────────────────────────────────── */

.page {
  padding-top: var(--nav-h);
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}
.page > main {
  flex: 1;
}

.page-head {
  position: relative;
  padding: 2.4em var(--gutter) 1.6em;
  border-bottom: 1px solid var(--line);
}
.page-head .kicker {
  margin-bottom: 0.6em;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.page-head h1 {
  font-size: clamp(2.2rem, 6vw, 5rem);
  font-weight: 300;
  line-height: 1;
  letter-spacing: -0.01em;
  max-width: 18ch;
  text-wrap: balance;
}
.page-head .sub {
  margin-top: 0.7em;
  font-size: 14px;
  color: var(--muted);
}

.back-link {
  position: absolute;
  right: var(--gutter);
  bottom: 1.6em;
  display: inline-flex;
  gap: 0.5em;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  opacity: 0.6;
  transition: opacity 0.2s;
}
.back-link::before {
  content: "←";
}
.back-link:hover {
  opacity: 1;
}

.page-head > *,
.event-copy p {
  animation: fade-up 0.9s var(--ease-out) both;
}
.page-head > :nth-child(2) { animation-delay: 0.08s; }
.page-head > :nth-child(3) { animation-delay: 0.16s; }
.page-head > :nth-child(4) { animation-delay: 0.24s; }

/* Indice stagione: card grandi */

.season-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr));
  gap: 6px;
  padding: 6px var(--gutter) 3em;
}
.season-grid .card {
  aspect-ratio: 4 / 3;
  max-height: 72vh;
  width: 100%;
  animation: clip-in 1s var(--ease) both;
  animation-delay: calc(0.2s + var(--i, 0) * 0.12s);
}

/* Pagine evento */

.event-body {
  padding: 2.2em var(--gutter) 4em;
}
.event-copy {
  max-width: 68ch;
  margin-bottom: 3em;
}
.event-copy p {
  font-size: clamp(1rem, 1.3vw, 1.12rem);
  line-height: 1.7;
  color: var(--ink-soft);
}
.event-copy p + p {
  margin-top: 1em;
}
.event-copy p:nth-child(1) { animation-delay: 0.3s; }
.event-copy p:nth-child(2) { animation-delay: 0.38s; }
.event-copy p:nth-child(3) { animation-delay: 0.46s; }

/* Pagine evento: testo a sinistra, galleria a destra */

.split {
  display: grid;
  grid-template-columns: minmax(260px, 25%) minmax(0, 1fr);
  gap: clamp(1.5em, 3vw, 3em);
  padding: 2em var(--gutter) 3em;
  align-items: start;
}
.split-text {
  position: sticky;
  top: calc(var(--nav-h) + 1.5em);
  max-height: calc(100svh - var(--nav-h) - 3em);
  overflow-y: auto;
  padding-right: 0.5em;
}
.split-text .kicker {
  margin-bottom: 0.7em;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  animation: fade-up 0.9s var(--ease-out) both;
}
.split-text h1 {
  font-size: clamp(2.2rem, 4.2vw, 4rem);
  font-weight: 300;
  line-height: 1;
  letter-spacing: -0.01em;
  text-wrap: balance;
  margin-bottom: 1em;
  animation: fade-up 0.9s 0.08s var(--ease-out) both;
}
.split-text .event-copy {
  margin-bottom: 1.6em;
}
.split-text .event-copy p {
  font-size: 0.98rem;
  line-height: 1.65;
}
.split-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1em;
  padding-top: 1em;
  border-top: 1px solid var(--line);
}
.split-meta .back-link {
  position: static;
}
.split-gallery .gallery {
  --rh: 230px;
}
.split-gallery .g-item {
  animation: fade-up 0.9s var(--ease-out) both;
}

/* Indice stagione: card a tutta altezza accanto al testo */
.split-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  grid-auto-flow: column;
  gap: 6px;
  height: calc(100svh - var(--nav-h) - 2em - 3em - 40px);
  min-height: 380px;
}
.split-cards .card {
  height: 100%;
  animation: clip-in 1s var(--ease) both;
  animation-delay: calc(0.2s + var(--i, 0) * 0.12s);
}
@media (max-width: 900px) {
  .split-cards { grid-auto-flow: row; grid-template-columns: 1fr; height: auto; min-height: 0; }
  .split-cards .card { height: auto; aspect-ratio: 16 / 11; }
}

/* Galleria "a misura di schermo" (calcolata da site.js) */
.gallery.is-fit::after { display: none; }
.gallery.is-fit .g-item { flex: none; }
.gallery.is-fit .g-item a { height: 100%; aspect-ratio: auto; }

/* ── Galleria ────────────────────────────────────────── */

.gallery-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1em;
  padding-bottom: 0.9em;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.gallery-head h2 {
  font-size: clamp(1.05rem, 2vw, 1.4rem);
  font-weight: 400;
}
.gallery-count {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
}

.gallery {
  --rh: 250px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.gallery::after {
  content: "";
  flex: 999 1 0;
}
.g-item {
  flex: calc(var(--ar) * 100) 1 calc(var(--ar) * var(--rh));
  min-width: 0;
  background: #ececee;
  overflow: hidden;
}
.g-item a {
  display: block;
  aspect-ratio: var(--ar);
  cursor: zoom-in;
  overflow: hidden;
}
.g-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s var(--ease-out), opacity 0.5s;
}
.g-item a:hover img {
  transform: scale(1.035);
}
.js .g-item img {
  opacity: 0;
}
.js .g-item img.is-loaded {
  opacity: 1;
}

.reveal {
  opacity: 1;
}
.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
}
.js .reveal.in {
  opacity: 1;
  transform: none;
}

/* Lightbox */

.lb {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgba(8, 8, 10, 0.96);
  color: #fff;
  overflow: hidden;
}
.lb::backdrop {
  background: rgba(8, 8, 10, 0.96);
}
.lb:not([open]) {
  display: none;
}
.lb-stage {
  position: absolute;
  inset: 56px 64px 64px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lb-stage img {
  max-width: 100%;
  max-height: 100%;
  min-height: 0;
  width: auto;
  height: auto;
  flex: 0 1 auto;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
  transition: opacity 0.25s;
}
.lb-stage img.is-loading {
  opacity: 0.25;
}
.lb-btn {
  position: absolute;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font: inherit;
  font-size: 20px;
  cursor: pointer;
  transition: background 0.2s;
}
.lb-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}
.lb-btn:focus-visible {
  outline-color: #fff;
}
.lb-close { top: 8px; right: 8px; }
.lb-prev  { left: 10px; top: 50%; transform: translateY(-50%); }
.lb-next  { right: 10px; top: 50%; transform: translateY(-50%); }
.lb-cap {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0 1em 1.1em;
  text-align: center;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
}
.lb-count {
  position: absolute;
  top: 18px;
  left: 18px;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.7);
}

/* ── Contatti ────────────────────────────────────────── */

.contact-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: clamp(2em, 6vw, 5em);
  max-width: 1040px;
  padding: 3em var(--gutter) 5em;
}
.contact-intro p {
  font-size: clamp(0.98rem, 1.3vw, 1.08rem);
  line-height: 1.7;
  color: var(--ink-soft);
}
.contact-intro p + p {
  margin-top: 1em;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.3em;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2em;
}
.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.35em;
  min-width: 0;
}
.form-field label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #55555a;
}
.form-field input,
.form-field textarea {
  width: 100%;
  padding: 0.6em 0;
  border: 0;
  border-bottom: 1.5px solid #cfcfd3;
  border-radius: 0;
  background: transparent;
  font: inherit;
  font-size: 16px; /* evita lo zoom su iOS */
  font-weight: 500;
  color: var(--ink);
  outline: none;
  transition: border-color 0.2s;
}
.form-field textarea {
  min-height: 130px;
  resize: vertical;
}
.form-field input:focus,
.form-field textarea:focus {
  border-bottom-color: var(--ink);
}
.form-field input::placeholder,
.form-field textarea::placeholder {
  color: #a4a4aa;
  font-weight: 400;
}
.form-field input:user-invalid,
.form-field textarea:user-invalid {
  border-bottom-color: #c62828;
}
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.btn-submit {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  padding: 0.9em 2em;
  border: 0;
  border-radius: 2px;
  background: var(--ink);
  color: #fff;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s, opacity 0.2s;
}
.btn-submit:hover {
  background: #2a2a2d;
}
.btn-submit[disabled] {
  opacity: 0.55;
  cursor: progress;
}
.form-note {
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
}
.form-status {
  display: none;
  padding: 1em 1.2em;
  border: 1px solid var(--ink);
  font-size: 14px;
  line-height: 1.55;
}
.form-status.is-visible {
  display: block;
}
.form-status.is-error {
  border-color: #c62828;
  color: #8e1c1c;
}

/* ── Responsive ──────────────────────────────────────── */

@media (max-width: 900px) {
  .gallery { --rh: 190px; }
}

@media (max-width: 900px) {
  .split { grid-template-columns: 1fr; gap: 1.4em; padding-top: 1.6em; }
  .split-text { position: static; max-height: none; overflow: visible; padding: 0; }
  .split-text h1 { margin-bottom: 0.6em; }
  .split-gallery .gallery { --rh: 170px; }
}

@media (max-width: 768px) {
  :root { --nav-h: 56px; --gutter: 14px; }

  nav { grid-template-columns: auto 1fr auto; }
  nav .logo-img { height: 40px; }
  nav .nav-items { justify-content: center; gap: 1.1em; }
  nav .nav-items .nav-home { display: none; }
  .btn-comitato { padding: 0.55em 0.8em; font-size: 11px; letter-spacing: 0.05em; }

  .home-title {
    order: -1;
    display: block;
    padding-top: 1.4em;
    padding-bottom: 1em;
  }
  .ttl-col { display: inline; }
  .ttl-letter { display: none; }
  .ttl-word {
    display: inline;
    font-size: clamp(1.45rem, 7.4vw, 2.2rem);
    font-weight: 300;
    letter-spacing: 0.04em;
    line-height: 1.12;
    padding: 0;
    margin-right: 0.28em;
  }
  .home-grid {
    flex: none;
    grid-template-columns: 1fr 1fr;
    min-height: 0;
    padding-bottom: 1.5em;
  }
  .home-grid .card { aspect-ratio: 4 / 5; }
  .home-grid .card:last-child { grid-column: 1 / -1; aspect-ratio: 16 / 9; }
  .card-copy { font-size: 12.5px; padding: 2.4em 0.7em 0.7em; }

  .page-head { padding: 1.8em var(--gutter) 1.4em; }
  .back-link { position: static; margin-top: 1.1em; }
  .season-grid .card { aspect-ratio: 16 / 11; }

  .contact-wrap { grid-template-columns: 1fr; padding-top: 2em; }
  .form-row { grid-template-columns: 1fr; }

  .lb-stage { inset: 56px 0 72px; }
  .lb-prev, .lb-next { top: auto; bottom: 14px; transform: none; }
  .lb-prev { left: calc(50% - 56px); }
  .lb-next { right: calc(50% - 56px); }
  .lb-cap { display: none; }
}

@media (max-width: 480px) {
  .gallery { --rh: 150px; }
  .site-foot { flex-direction: column; align-items: flex-start; }
}

@media (max-height: 560px) and (min-width: 769px) {
  .ttl-letter { font-size: 22svh; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation: none !important;
    transition-duration: 0.01ms !important;
  }
  .js .reveal,
  .js .g-item img {
    opacity: 1;
    transform: none;
  }
}
