/* ==========================================================================
   Chiesa Evangelica di Luino, foglio di stile
   Mobile-first · Palette Navy/Ciano su bianco · Animazioni scroll-reveal
   ========================================================================== */

/* ---------- Token di design ---------- */
:root {
  /* Palette: famiglia del blu */
  --navy:        #00205b;   /* titoli, testi forti, bottoni */
  --navy-deep:   #102244;   /* sezioni scure, footer, overlay */
  --blue:        #1c4f96;   /* link ed elementi interattivi */
  --powder:      #8cb4e7;   /* accento decorativo chiaro */
  --cyan:        #35b6d9;   /* accento brillante (decorativo) */
  --sky-soft:    #dce9f8;   /* azzurro tenue per badge */

  /* Neutri */
  --white:       #ffffff;
  --gray-bg:     #f4f6f9;   /* sfondi sezioni secondarie */
  --gray-line:   #e3e8ef;   /* separatori */
  --text:        #23304a;   /* testo principale */
  --text-muted:  #4a5670;   /* testo secondario (contrasto AA su bianco) */
  --text-on-dark: #eaf1fb;  /* testo chiaro su navy */

  /* Tipografia */
  --font-serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --font-sans: "Inter", -apple-system, "Segoe UI", Roboto, sans-serif;

  /* Ritmo */
  --container: 72rem;
  --gutter: clamp(1.25rem, 5vw, 3rem);
  --section-pad: clamp(4.5rem, 10vw, 8.5rem);

  /* Motion */
  --ease-expo: cubic-bezier(.19, 1, .22, 1);
  --ease-reveal: cubic-bezier(.785, .135, .15, .86);

  --header-h: 4.5rem;
}

/* ---------- Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; height: auto; }
ul[class] { list-style: none; }
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
address { font-style: normal; }

::selection { background: var(--powder); color: var(--navy-deep); }

/* Focus visibile per la navigazione da tastiera */
:focus-visible {
  outline: 3px solid var(--cyan);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 200;
  background: var(--navy);
  color: var(--white);
  padding: .75rem 1.25rem;
  border-radius: 0 0 .5rem .5rem;
  font-weight: 600;
  text-decoration: none;
  transition: top .25s ease;
}
.skip-link:focus { top: 0; }

/* ---------- Layout di base ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.container--narrow { max-width: 46rem; }

.section { padding-block: var(--section-pad); }
.section--gray { background: var(--gray-bg); }

/* Le card eventi entrano da fuori pagina (translateX ±110%): la traiettoria
   va ritagliata qui, sulla sezione a tutta larghezza. Senza questo il
   documento diventa più largo del viewport e su mobile la pagina scorre
   in orizzontale, portandosi via anche l'header con l'hamburger.
   `clip` invece di `hidden` per non creare un contenitore di scorrimento:
   l'ombra delle card resta libera di uscire in verticale. */
.section--clip { overflow-x: hidden; }
@supports (overflow-x: clip) {
  .section--clip { overflow-x: clip; }
}

/* Compensa l'header fisso nella navigazione ad ancore */
[id] { scroll-margin-top: calc(var(--header-h) + .5rem); }

/* ---------- Tipografia ---------- */
.eyebrow {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: .8125rem;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 1.25rem;
}
.eyebrow::before {
  content: "";
  width: 3.75rem; /* 60px */
  height: 1px;
  background: currentColor;
  opacity: .6;
  flex-shrink: 0;
}
.eyebrow--light { color: var(--powder); }

.section-title {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(2rem, 5.2vw, 3.1rem);
  line-height: 1.08;
  letter-spacing: -0.01em;
  color: var(--navy);
  margin-bottom: 1.5rem;
}

.section-intro {
  max-width: 40rem;
  color: var(--text-muted);
  font-size: 1.0625rem;
}

.prose p { margin-bottom: 1.15rem; color: var(--text); }
.prose p:last-child { margin-bottom: 0; }

.signature {
  margin-top: 2rem;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.3rem;
  color: var(--navy);
}

.text-link {
  color: var(--blue);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  text-decoration-color: rgba(28, 79, 150, .45);
  transition: text-decoration-color .3s ease, color .3s ease;
}
.text-link:hover { color: var(--navy); text-decoration-color: var(--cyan); }

.text-link--arrow::after {
  content: "→";
  margin-left: .5rem;
  display: inline-block;
  transition: transform .4s var(--ease-expo);
}
.text-link--arrow:hover::after { transform: translateX(.35rem); }

.section-head-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.25rem;
  margin-bottom: 3rem;
}
.section-head-row .section-title { margin-bottom: 0; }

/* ==========================================================================
   HEADER
   ========================================================================== */
.site-header {
  position: fixed;
  inset-inline: 0;
  top: 0;
  z-index: 140;
  color: var(--white);
  transition: background-color .6s var(--ease-expo), color .6s var(--ease-expo),
              box-shadow .6s var(--ease-expo);
}
.site-header.is-scrolled {
  background: rgba(255, 255, 255, .96);
  color: var(--navy);
  box-shadow: 0 1px 0 var(--gray-line), 0 .5rem 2rem rgba(16, 34, 68, .06);
}
/* Sulle pagine senza hero fotografico l'header parte già scuro */
body.no-hero .site-header { color: var(--navy); background: rgba(255,255,255,.96);
  box-shadow: 0 1px 0 var(--gray-line); }

/* Quando il menu mobile è aperto, l'header resta sopra il pannello navy:
   il pulsante hamburger diventa una X bianca e permette di richiuderlo */
body .site-header.menu-open {
  background: transparent;
  box-shadow: none;
  color: var(--white);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: var(--header-h);
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  text-decoration: none;
  font-weight: 600;
  letter-spacing: .01em;
  line-height: 1.2;
}
.brand-mark { flex-shrink: 0; }
.brand-text { font-size: .98rem; }
.brand-place {
  display: block;
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 500;
  font-size: .9em;
  opacity: .85;
}

.main-nav { display: none; }
.nav-list { display: flex; gap: 2.25rem; list-style: none; }
.nav-link {
  position: relative;
  font-size: .9375rem;
  font-weight: 500;
  text-decoration: none;
  padding-block: .35rem;
}
.nav-link::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2px;
  background: var(--cyan);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .5s var(--ease-expo);
}
.nav-link:hover::after,
.nav-link[aria-current="page"]::after { transform: scaleX(1); }

/* Hamburger: due linee che ruotano a X */
.menu-toggle {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  width: 2.75rem;
  height: 2.75rem;
  z-index: 130;
}
.menu-toggle { flex-shrink: 0; }
.menu-line { display: block; width: 1.75rem; height: 2px; overflow: visible; }
/* Finché l'header è trasparente le linee sono bianche e passano sopra la
   fotografia dell'hero: l'ombra ne garantisce il contrasto anche sui punti
   chiari o se l'immagine non è ancora stata caricata. */
.site-header:not(.is-scrolled) .menu-line-inner {
  filter: drop-shadow(0 1px 2px rgba(8, 20, 44, .55));
}
.menu-line-inner {
  display: block;
  width: 100%; height: 100%;
  background: currentColor;
  transition: transform .6s var(--ease-expo);
}
.menu-line:first-child .menu-line-inner { transform: translateY(-.3rem); }
.menu-line:last-child .menu-line-inner  { transform: translateY(.3rem); }
/* Le due linee sono item flex impilati, quindi i loro centri distano 2px:
   per una X simmetrica vanno prima riportate sullo stesso asse (±1px) e poi
   ruotate di 45° esatti; l'ordine conta, la traslazione va applicata prima. */
.menu-toggle[aria-expanded="true"] .menu-line:first-child .menu-line-inner {
  transform: translateY(1px) rotate(45deg);
}
.menu-toggle[aria-expanded="true"] .menu-line:last-child .menu-line-inner {
  transform: translateY(-1px) rotate(-45deg);
}
/* Quando il menu è aperto il pulsante resta leggibile sopra il pannello navy */
.menu-toggle[aria-expanded="true"] { color: var(--white); }

/* ---------- Menu mobile a schermo intero ---------- */
.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: var(--navy-deep);
  color: var(--text-on-dark);
  display: flex;
  align-items: center;
  padding: var(--gutter);
  visibility: hidden;
  opacity: 0;
  transition: opacity .5s var(--ease-expo), visibility 0s .5s;
}
.mobile-menu.is-open {
  visibility: visible;
  opacity: 1;
  transition: opacity .5s var(--ease-expo), visibility 0s 0s;
}
.mobile-nav-list { list-style: none; }
.mobile-nav-list li {
  overflow: hidden;
}
.mobile-nav-link {
  display: inline-block;
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(2rem, 9vw, 3rem);
  line-height: 1.25;
  color: var(--white);
  text-decoration: none;
  transform: translateY(110%);
  transition: transform .8s var(--ease-expo), color .3s ease;
}
.mobile-menu.is-open .mobile-nav-link { transform: translateY(0); }
.mobile-menu.is-open li:nth-child(1) .mobile-nav-link { transition-delay: .08s; }
.mobile-menu.is-open li:nth-child(2) .mobile-nav-link { transition-delay: .14s; }
.mobile-menu.is-open li:nth-child(3) .mobile-nav-link { transition-delay: .2s; }
.mobile-menu.is-open li:nth-child(4) .mobile-nav-link { transition-delay: .26s; }
.mobile-menu.is-open li:nth-child(5) .mobile-nav-link { transition-delay: .32s; }
.mobile-nav-link:hover { color: var(--cyan); }

.mobile-menu-note {
  margin-top: 2.5rem;
  font-size: .9rem;
  color: var(--powder);
  opacity: 0;
  transition: opacity .8s ease .45s;
}
.mobile-menu.is-open .mobile-menu-note { opacity: 1; }

/* ==========================================================================
   BOTTONI, pill con reveal in clip-path
   ========================================================================== */
.btn {
  position: relative;
  display: inline-block;
  overflow: hidden;
  border-radius: 3.2rem;
  padding: 1rem 1.9rem;
  font-size: .9375rem;
  font-weight: 600;
  text-decoration: none;
  line-height: 1;
  transition: box-shadow .4s ease;
}
.btn-content { position: relative; z-index: 1; display: inline-block; }
.btn-mask {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  clip-path: inset(100% 0 0 0);
  transition: clip-path .8s var(--ease-reveal);
}
.btn:hover .btn-mask,
.btn:focus-visible .btn-mask { clip-path: inset(0 0 0 0); }

/* Variante chiara (su hero scuro) */
.btn--light { background: var(--white); color: var(--navy); }
.btn--light .btn-mask { background: var(--navy); color: var(--white); }

/* Variante fantasma con bordo */
.btn--ghost { box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .65); color: var(--white); }
.btn--ghost .btn-mask { background: var(--white); color: var(--navy); }

/* Variante navy (su fondo chiaro) */
.btn--navy { background: var(--navy); color: var(--white); }
.btn--navy .btn-mask { background: var(--blue); color: var(--white); }

/* ==========================================================================
   HERO
   ========================================================================== */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: flex-end;
  color: var(--white);
  isolation: isolate;
}
.hero-media { position: absolute; inset: 0; z-index: -1; }
.hero-media img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(8, 20, 44, .82) 0%, rgba(8, 20, 44, .48) 52%, rgba(8, 20, 44, .1) 82%),
    linear-gradient(180deg, rgba(16, 34, 68, .5) 0%, rgba(16, 34, 68, 0) 35%),
    linear-gradient(180deg, rgba(16, 34, 68, 0) 38%, rgba(8, 20, 44, .92) 100%);
}

.hero-content {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
  padding-bottom: clamp(6rem, 14vh, 9rem);
  padding-top: calc(var(--header-h) + 3rem);
}
.hero-title {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(2.6rem, 8vw, 5.2rem);
  line-height: 1.02;
  letter-spacing: -0.015em;
  margin-bottom: 1.5rem;
  max-width: 15ch;
}
.hero-title em {
  font-style: italic;
  color: var(--powder);
}
.hero-sub {
  max-width: 34rem;
  font-size: clamp(1rem, 2.4vw, 1.125rem);
  line-height: 1.65;
  color: var(--text-on-dark);
  margin-bottom: 2.5rem;
}

/* Leggibilità del testo sopra la fotografia dell'hero */
.hero .eyebrow--light {
  color: #d9e7fa;
  text-shadow: 0 .0625rem .75rem rgba(8, 20, 44, .7);
}
.hero-title { text-shadow: 0 .125rem 2rem rgba(8, 20, 44, .55); }
.hero-sub { text-shadow: 0 .0625rem 1rem rgba(8, 20, 44, .6); }
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

/* Indicatore di scroll */
.hero-scroll {
  position: absolute;
  right: var(--gutter);
  bottom: 2.5rem;
  display: none;
  align-items: center;
  gap: .85rem;
  color: var(--text-on-dark);
  text-decoration: none;
  font-size: .75rem;
  letter-spacing: .22em;
  text-transform: uppercase;
}
.hero-scroll-line {
  width: 1px;
  height: 4rem;
  background: rgba(255, 255, 255, .5);
  overflow: hidden;
  position: relative;
}
.hero-scroll-line::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--cyan);
  animation: scroll-hint 2.4s var(--ease-expo) infinite;
}
@keyframes scroll-hint {
  0%   { transform: translateY(-100%); }
  60%  { transform: translateY(0); }
  100% { transform: translateY(100%); }
}
.hero-scroll-text { writing-mode: vertical-rl; }

/* ==========================================================================
   SEZIONI A DUE COLONNE (split)
   ========================================================================== */
.split {
  display: grid;
  gap: 2.75rem;
  align-items: center;
}
.split-media {
  overflow: hidden;
  border-radius: .35rem;
  aspect-ratio: 4 / 3;
  box-shadow: 0 1.5rem 3.5rem rgba(16, 34, 68, .12);
}
.split-media img {
  width: 100%; height: 100%;
  object-fit: cover;
}

.values { margin-top: 2.25rem; }
.value {
  padding-block: 1.35rem;
  border-top: 1px solid var(--gray-line);
}
.value:last-child { border-bottom: 1px solid var(--gray-line); }
.value h3 {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.45rem;
  color: var(--navy);
  margin-bottom: .3rem;
}
.value p { color: var(--text-muted); font-size: .98rem; }

/* ==========================================================================
   ORARI
   ========================================================================== */
.orari-head {
  max-width: 44rem;
  margin-bottom: 3rem;
}

.schedule {
  background: var(--white);
  border: 1px solid var(--gray-line);
  border-radius: .5rem;
  overflow: hidden;
  box-shadow: 0 1.25rem 3rem rgba(16, 34, 68, .07);
}
.schedule-row {
  display: grid;
  gap: .35rem;
  padding: 1.5rem var(--gutter);
  border-top: 1px solid var(--gray-line);
  transition: background-color .35s ease;
}
.schedule-row:first-child { border-top: 0; }
.schedule-row:hover { background: var(--gray-bg); }

.schedule-day { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.schedule-weekday {
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--blue);
}
.schedule-time {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.7rem;
  line-height: 1;
  color: var(--navy);
  white-space: nowrap;
}
.schedule-info h3 {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.35rem;
  color: var(--navy);
  margin-bottom: .25rem;
}
.schedule-info p { color: var(--text-muted); font-size: .95rem; }

.orari-note {
  margin-top: 2rem;
  color: var(--text-muted);
  font-size: .98rem;
}

/* ==========================================================================
   VERSO BIBLICO (sezione scura a tutto schermo)
   ========================================================================== */
.verse {
  position: relative;
  padding-block: clamp(6rem, 16vw, 11rem);
  background: var(--navy-deep);
  color: var(--white);
  isolation: isolate;
  overflow: hidden;
}
.verse-media { position: absolute; inset: 0; z-index: -1; }
.verse-media img {
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: .28;
}
.verse-content {
  max-width: 52rem;
  margin-inline: auto;
  padding-inline: var(--gutter);
  text-align: center;
}
.verse-text {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(1.7rem, 4.6vw, 2.9rem);
  line-height: 1.25;
  margin-bottom: 1.75rem;
}
.verse-ref {
  display: inline-flex;
  align-items: center;
  gap: 1rem;
  font-family: var(--font-sans);
  font-style: normal;
  font-size: .8125rem;
  font-weight: 600;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--powder);
}
.verse-ref::before, .verse-ref::after {
  content: "";
  width: 2.5rem; height: 1px;
  background: currentColor;
  opacity: .55;
}

/* ==========================================================================
   CARD EVENTI
   ========================================================================== */
.cards-grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: 1fr;
}
.cards-grid > li { min-width: 0; }

.event-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--white);
  border: 1px solid var(--gray-line);
  border-radius: .35rem;
  overflow: hidden;
  cursor: pointer;
  transition: transform .6s var(--ease-expo), box-shadow .6s var(--ease-expo);
}
.event-card:hover,
.event-card:focus-visible {
  transform: translateY(-.4rem);
  box-shadow: 0 1.5rem 3rem rgba(16, 34, 68, .12);
}
.event-card:focus-visible { outline-offset: 6px; }

.event-card-media {
  position: relative;
  aspect-ratio: 3 / 2;
  overflow: hidden;
}
.event-card-media img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .8s var(--ease-expo);
}
.event-card:hover .event-card-media img,
.event-card:focus-visible .event-card-media img { transform: scale(1.045); }

.event-date {
  position: absolute;
  left: 1rem;
  bottom: 1rem;
  background: rgba(0, 32, 91, .88);
  color: var(--white);
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: .45rem .9rem;
  border-radius: 3.2rem;
  backdrop-filter: blur(4px);
}

.event-card-body { padding: 1.4rem 1.5rem 1.6rem; }
.event-card-title {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.5rem;
  line-height: 1.2;
  color: var(--navy);
  margin-bottom: .5rem;
}
.event-card-hint {
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--blue);
  display: inline-flex;
  align-items: center;
  gap: .5rem;
}
.event-card-hint::after {
  content: "→";
  transition: transform .4s var(--ease-expo);
}
.event-card:hover .event-card-hint::after { transform: translateX(.3rem); }

.events-note {
  margin-top: 3rem;
  text-align: center;
  color: var(--text-muted);
}

/* ==========================================================================
   HERO DELLE PAGINE INTERNE
   ========================================================================== */
.page-hero {
  background:
    radial-gradient(60rem 28rem at 85% -10%, rgba(53, 182, 217, .16), rgba(53, 182, 217, 0) 60%),
    linear-gradient(160deg, var(--navy-deep) 0%, var(--navy) 70%, #0b3a78 100%);
  color: var(--white);
  padding-top: calc(var(--header-h) + clamp(3.5rem, 9vw, 6.5rem));
  padding-bottom: clamp(3.5rem, 9vw, 6.5rem);
}
.page-title {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(2.8rem, 8vw, 5rem);
  line-height: 1.02;
  letter-spacing: -0.015em;
  margin-bottom: 1.25rem;
}
.page-intro {
  max-width: 38rem;
  color: var(--text-on-dark);
  font-size: 1.0625rem;
}

/* ==========================================================================
   CONTATTI
   ========================================================================== */
.contact-list { margin-top: 2rem; }
.contact-item {
  padding-block: 1.15rem;
  border-top: 1px solid var(--gray-line);
  color: var(--text);
}
.contact-item:last-child { border-bottom: 1px solid var(--gray-line); }
.contact-label {
  display: block;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: .3rem;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.site-footer {
  background: var(--navy-deep);
  color: var(--text-on-dark);
  padding-top: clamp(3.5rem, 8vw, 6rem);
}
.footer-grid {
  display: grid;
  gap: 2.5rem;
  padding-bottom: 3rem;
}
.footer-name {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.6rem;
  color: var(--white);
  margin-bottom: .75rem;
}
.footer-verse {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.05rem;
  line-height: 1.55;
  color: var(--powder);
  max-width: 26rem;
}
.footer-heading {
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 1rem;
}
.footer-nav ul { list-style: none; display: grid; gap: .55rem; }
.footer-link {
  color: var(--text-on-dark);
  text-decoration: none;
  font-size: .95rem;
  transition: color .3s ease;
}
.footer-link:hover { color: var(--cyan); text-decoration: underline; text-underline-offset: 4px; }
.footer-info p { font-size: .95rem; line-height: 1.8; }

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .75rem;
  border-top: 1px solid rgba(140, 180, 231, .22);
  padding-block: 1.5rem;
  font-size: .85rem;
  color: rgba(234, 241, 251, .75);
}

.footer-legal {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.25rem;
}
.footer-legal .footer-link { font-size: .85rem; }
.footer-legal [aria-current="page"] { color: var(--cyan); }
/* Il pulsante delle preferenze deve sembrare un link come i suoi vicini */
.footer-link--button {
  font: inherit;
  font-size: .85rem;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

/* ==========================================================================
   PAGINE LEGALI (privacy, cookie)
   ========================================================================== */
.legal-prose { color: var(--text); }
.legal-prose h2 {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(1.4rem, 3.2vw, 1.8rem);
  line-height: 1.2;
  color: var(--navy);
  margin-top: 3rem;
  margin-bottom: .9rem;
}
.legal-prose h2:first-of-type { margin-top: 0; }
.legal-prose p { margin-bottom: 1.15rem; }
.legal-prose ul {
  list-style: none;
  margin-bottom: 1.5rem;
  display: grid;
  gap: .75rem;
}
.legal-prose li {
  position: relative;
  padding-left: 1.5rem;
}
.legal-prose li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .7em;
  width: .5rem;
  height: 1px;
  background: var(--powder);
}
.legal-updated {
  font-size: .875rem;
  color: var(--text-muted);
  padding-bottom: 1.5rem;
  margin-bottom: 2.5rem;
  border-bottom: 1px solid var(--gray-line);
}

/* Segnaposto da sostituire prima della pubblicazione: evidenziati apposta,
   perché un dato fittizio dimenticato in un documento legale è un problema.
   Eliminando questa regola scompare anche l'evidenziazione. */
.da-completare {
  background: #fff3cd;
  box-shadow: 0 0 0 .15rem #fff3cd;
  border-radius: 2px;
}
.legal-draft {
  background: #fff8e6;
  border: 1px solid #f0d38a;
  border-left: .25rem solid #d9a300;
  border-radius: .35rem;
  padding: 1.15rem 1.35rem;
  margin-bottom: 3rem;
  font-size: .95rem;
}
.legal-draft p { margin: 0; }

.table-wrap { overflow-x: auto; margin-bottom: 1.75rem; }
.legal-table {
  width: 100%;
  min-width: 34rem;
  border-collapse: collapse;
  font-size: .9rem;
}
.legal-table th,
.legal-table td {
  text-align: left;
  padding: .75rem .9rem;
  border-bottom: 1px solid var(--gray-line);
  vertical-align: top;
}
.legal-table thead th {
  background: var(--gray-bg);
  color: var(--navy);
  font-weight: 600;
  white-space: nowrap;
}
.legal-table code {
  font-size: .85em;
  background: var(--gray-bg);
  padding: .1rem .35rem;
  border-radius: 3px;
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ==========================================================================
   BANNER CONSENSO COOKIE
   ========================================================================== */
.cookie-banner {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 150;
  padding: var(--gutter);
  background: var(--navy-deep);
  color: var(--text-on-dark);
  box-shadow: 0 -.5rem 2.5rem rgba(8, 20, 44, .28);
  transform: translateY(110%);
  visibility: hidden;
  transition: transform .6s var(--ease-expo), visibility 0s .6s;
}
.cookie-banner.is-open {
  transform: translateY(0);
  visibility: visible;
  transition: transform .6s var(--ease-expo), visibility 0s 0s;
}
.cookie-banner-inner {
  max-width: var(--container);
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.cookie-banner-titolo {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.25rem;
  color: var(--white);
  margin-bottom: .35rem;
}
.cookie-banner-testo p { font-size: .92rem; line-height: 1.65; }
.cookie-banner-testo a {
  color: var(--white);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(255, 255, 255, .45);
}
.cookie-banner-testo a:hover { text-decoration-color: var(--cyan); }

.cookie-banner-azioni {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
}
/* Rifiutare deve costare quanto accettare: stessa dimensione, stesso peso
   visivo, un solo clic. È un requisito, non una scelta estetica. */
.cookie-btn {
  flex: 1 1 auto;
  min-width: 9rem;
  padding: .8rem 1.75rem;
  border-radius: 3.2rem;
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color .35s ease, color .35s ease, border-color .35s ease;
}
.cookie-btn--solido {
  background: var(--white);
  color: var(--navy);
  border: 1px solid var(--white);
}
.cookie-btn--solido:hover { background: var(--sky-soft); border-color: var(--sky-soft); }
.cookie-btn--ghost {
  background: transparent;
  color: var(--white);
  border: 1px solid rgba(234, 241, 251, .5);
}
.cookie-btn--ghost:hover { border-color: var(--white); background: rgba(255, 255, 255, .08); }

@media (min-width: 46rem) {
  .cookie-banner-inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 2.5rem;
  }
  .cookie-banner-testo { max-width: 46rem; }
  .cookie-banner-azioni { flex: 0 0 auto; }
  .cookie-btn { flex: 0 0 auto; }
}

/* ==========================================================================
   MODALE EVENTO
   ========================================================================== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  visibility: hidden;
  pointer-events: none;
  /* In chiusura resta visibile per la durata dell'animazione inversa */
  transition: visibility 0s .55s;
}
.modal.is-open {
  visibility: visible;
  pointer-events: auto;
  transition-delay: 0s;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(16, 34, 68, .45);
  backdrop-filter: blur(14px) saturate(1.05);
  -webkit-backdrop-filter: blur(14px) saturate(1.05);
  opacity: 0;
  transition: opacity .45s ease;
}
.modal.is-open .modal-backdrop { opacity: 1; }

.modal-card {
  position: relative;
  width: 100%;
  max-width: 40rem;
  max-height: calc(100svh - 2.5rem);
  overflow-y: auto;
  background: var(--white);
  border-radius: 1.25rem;
  box-shadow: 0 2.5rem 6rem rgba(0, 16, 45, .35);
  opacity: 0;
  transform: translateY(1.75rem) scale(.97);
  transition: opacity .5s var(--ease-expo), transform .5s var(--ease-expo);
}
.modal.is-open .modal-card {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.modal-media {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 1.2rem 1.2rem 0 0;
}
.modal-media img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.event-date--modal {
  left: 1.25rem;
  bottom: 1.25rem;
  background: var(--navy);
}

.modal-body { padding: 1.75rem var(--gutter) 2.25rem; }
.modal-title {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(1.6rem, 4.5vw, 2.1rem);
  line-height: 1.15;
  color: var(--navy);
  margin-bottom: .65rem;
}
.modal-meta {
  font-size: .9rem;
  font-weight: 600;
  color: var(--blue);
  margin-bottom: 1.1rem;
}
.modal-desc {
  color: var(--text);
  margin-bottom: 1.75rem;
  white-space: pre-line;
}

/* Pulsante di chiusura: X disegnata con due linee ruotate */
.modal-close {
  position: absolute;
  top: .85rem;
  right: .85rem;
  z-index: 2;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 .5rem 1.25rem rgba(16, 34, 68, .2);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .4s var(--ease-expo), background-color .3s ease;
}
.modal-close:hover { transform: rotate(90deg); background: var(--white); }
.modal-close span {
  position: absolute;
  width: 1.15rem;
  height: 2px;
  background: var(--navy);
}
.modal-close span:first-child { transform: rotate(45deg); }
.modal-close span:last-child  { transform: rotate(-45deg); }

/* ==========================================================================
   ANIMAZIONI SCROLL-REVEAL
   ========================================================================== */
/* Lo stato nascosto si applica solo se JavaScript è attivo:
   senza JS i contenuti restano comunque visibili */
html.js [data-reveal],
html.js [data-reveal-stagger] > * {
  opacity: 0;
  transform: translateY(2rem);
  transition: opacity 1s var(--ease-expo), transform 1s var(--ease-expo);
  will-change: opacity, transform;
}
html.js [data-reveal].is-visible,
html.js [data-reveal-stagger].is-visible > * {
  opacity: 1;
  transform: translateY(0);
}
/* Ritardi in cascata */
[data-delay="1"] { transition-delay: .12s; }
[data-delay="2"] { transition-delay: .22s; }
[data-delay="3"] { transition-delay: .32s; }
[data-reveal-stagger].is-visible > *:nth-child(1) { transition-delay: .05s; }
[data-reveal-stagger].is-visible > *:nth-child(2) { transition-delay: .15s; }
[data-reveal-stagger].is-visible > *:nth-child(3) { transition-delay: .25s; }
[data-reveal-stagger].is-visible > *:nth-child(4) { transition-delay: .35s; }
[data-reveal-stagger].is-visible > *:nth-child(5) { transition-delay: .45s; }
[data-reveal-stagger].is-visible > *:nth-child(6) { transition-delay: .55s; }

/* Blocca lo scroll quando modale o menu sono aperti */
body.is-locked { overflow: hidden; }

/* Card eventi: entrata laterale alternata da fuori pagina, reversibile.
   Le card dispari arrivano da sinistra, quelle pari da destra.

   Tre ruoli separati, ed è importante che restino separati:
   · <li>  resta fermo nel flusso, è l'elemento osservato da IntersectionObserver.
           Se lo spostassimo, il ritaglio della sezione (.section--clip) lo
           porterebbe fuori dall'area visibile e non risulterebbe MAI
           intersecante: le card non comparirebbero più.
   · .card-reveal porta l'animazione di entrata.
   · .event-card conserva il proprio transform di hover, senza conflitti. */
.card-reveal { height: 100%; }

html.js [data-reveal-cards] .card-reveal {
  opacity: 0;
  transform: translate(var(--slide-x, -110%), var(--slide-y, 0));
  transition: opacity .9s var(--ease-expo), transform .9s var(--ease-expo);
  transition-delay: var(--reveal-delay, 0s);
  will-change: opacity, transform;
}
html.js [data-reveal-cards] > *:nth-child(even) { --slide-x: 110%; }
html.js [data-reveal-cards] > *.is-visible .card-reveal {
  opacity: 1;
  transform: translate(0, 0);
}

/* ==========================================================================
   BREAKPOINTS (mobile-first)
   ========================================================================== */
@media (min-width: 46rem) {
  .cards-grid { grid-template-columns: repeat(2, 1fr); }
  .schedule-row {
    grid-template-columns: 13rem 1fr;
    gap: 2rem;
    align-items: baseline;
  }
  .schedule-day { display: block; }
  .schedule-weekday { display: block; margin-bottom: .35rem; }
  .schedule-time { font-size: 2rem; }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-scroll { display: flex; }
}

@media (min-width: 62rem) {
  .main-nav { display: block; }
  .menu-toggle { display: none; }
  .mobile-menu { display: none; }

  .split { grid-template-columns: 1.05fr 1fr; gap: clamp(3rem, 6vw, 6rem); }
  .split--reverse .split-text { order: 2; }
  .split--reverse .split-media { order: 1; }

  .cards-grid--full { grid-template-columns: repeat(3, 1fr); }
  #eventi .cards-grid { grid-template-columns: repeat(3, 1fr); }

  /* A 3 colonne la direzione segue la colonna, non l'ordine assoluto:
     prima colonna da sinistra, ultima da destra, quella centrale sale.
     Il ritardo riparte a ogni riga, così ogni riga entra insieme. */
  html.js [data-reveal-cards].cards-grid--full > *:nth-child(3n+1),
  html.js #eventi [data-reveal-cards] > *:nth-child(3n+1) {
    --slide-x: -110%;
    --slide-y: 0;
    --reveal-delay: 0s;
  }
  html.js [data-reveal-cards].cards-grid--full > *:nth-child(3n+2),
  html.js #eventi [data-reveal-cards] > *:nth-child(3n+2) {
    --slide-x: 0;
    --slide-y: 2.5rem;
    --reveal-delay: .08s;
  }
  html.js [data-reveal-cards].cards-grid--full > *:nth-child(3n),
  html.js #eventi [data-reveal-cards] > *:nth-child(3n) {
    --slide-x: 110%;
    --slide-y: 0;
    --reveal-delay: .16s;
  }

  .footer-grid { grid-template-columns: 1.4fr .8fr 1fr 1.1fr; gap: 3rem; }

  .modal-body { padding: 2.25rem 2.75rem 2.75rem; }
}

/* ==========================================================================
   ACCESSIBILITÀ, movimento ridotto
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    transition-delay: 0s !important;
  }
  [data-reveal],
  [data-reveal-stagger] > *,
  [data-reveal-cards] .card-reveal {
    opacity: 1;
    transform: none;
  }
}
