/* ==========================================================================
   Sistema condiviso — chrome (font, token, header/nav, footer) e tipografia
   di pagina, usati da tutte le pagine pubbliche (home esclusa per l'hero,
   che resta inline in index.html perché non riusata altrove).
   Header e footer sono comunque markup duplicato a mano in ogni pagina
   (nessun sistema di partial, per restare senza build): quando cambi
   .site-header, .site-nav, .lang-switch, .nav-panel o .site-footer qui,
   aggiorna lo stesso markup in TUTTE le 15 pagine pubbliche —
   italiano:  index.html, chi-siamo/, eventi/, contatti/, trasparenza/,
              statuto/, privacy.html, 404.html
   inglese:   en/, en/about/, en/events/, en/contact/, en/transparency/,
              en/statute/, en/privacy.html
   ========================================================================== */

@font-face {
  font-family: "Bricolage Grotesque";
  font-style: normal;
  font-weight: 400 800;
  font-stretch: 100%;
  font-display: swap;
  src: url("/assets/fonts/bricolage-grotesque-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Bricolage Grotesque";
  font-style: normal;
  font-weight: 400 800;
  font-stretch: 100%;
  font-display: swap;
  src: url("/assets/fonts/bricolage-grotesque-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --ink: oklch(16% 0.012 255);
  --ink-2: oklch(21% 0.014 255);
  --line: oklch(32% 0.015 255);
  --text: oklch(96% 0.004 250);
  --text-dim: oklch(76% 0.012 252);
  --accent: oklch(75% 0.115 235);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --pad: clamp(1.25rem, 4vw, 3rem);
  --z-slides: 1;
  --z-scrim: 2;
  --z-hero-ui: 3;
  --z-header: 10;
  --z-nav-panel: 50;
}

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

/* L'attributo hidden deve sempre vincere sulle regole display: grid/flex delle componenti. */
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  font-family: "Bricolage Grotesque", system-ui, sans-serif;
  background: var(--ink);
  color: var(--text);
  line-height: 1.6;
}

body.modal-open { overflow: hidden; }

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

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* Link "in prosa" su testo attenuato: l'underline li rende distinguibili
   anche senza affidarsi solo al colore (WCAG 1.4.1). */
.footer-grid a, .footer-bottom a, .events-empty a, .page a,
.event-modal-links a.event-link-text, noscript a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

::selection { background: var(--accent); color: var(--ink); }

.skip-link {
  position: absolute;
  left: -9999px;
  z-index: 100;
  background: var(--ink);
  color: var(--text);
  padding: 0.75rem 1.25rem;
  border-radius: 6px;
}
.skip-link:focus {
  left: 1rem;
  top: 1rem;
}

/* ---------- Header ---------- */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: clamp(1rem, 2.5vw, 1.75rem) var(--pad);
  border-bottom: 1px solid var(--line);
}

/* Variante home: overlay trasparente sopra il carosello, niente bordo */
.site-header--home {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-header);
  border-bottom: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  color: var(--text);
}
.brand:hover { text-decoration: none; }

.brand img {
  width: clamp(48px, 6vw, 62px);
  height: auto;
  filter: brightness(0) invert(1);
}
.site-header--home .brand img {
  /* resa "knockout" bianca del logo a china, come nel watermark ufficiale */
  filter: brightness(0) invert(1) drop-shadow(0 1px 8px oklch(10% 0.01 255 / 0.45));
}

.brand span {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.site-header--home .brand span {
  text-shadow: 0 1px 14px oklch(10% 0.01 255 / 0.6);
}

/* Gruppo di destra: nav + selettore di lingua + toggle mobile.
   Il gap è deliberatamente più ampio di quello fra le voci di .site-nav:
   è lo spazio, non un filo verticale, a separare la lingua dalla nav. */
.header-right {
  display: flex;
  align-items: center;
  gap: clamp(1.5rem, 3vw, 2.75rem);
}

/* ---------- Navigazione ---------- */

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(1.25rem, 2.5vw, 2.25rem);
}

.nav-link {
  position: relative;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 600;
  padding-bottom: 0.4rem;
}
.nav-link:hover { text-decoration: none; color: var(--accent); }
.nav-link[aria-current="page"] { color: var(--accent); }
.nav-link[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
}
.site-header--home .nav-link {
  text-shadow: 0 1px 14px oklch(10% 0.01 255 / 0.6);
}

/* ---------- Selettore di lingua ---------- */
/* Sempre visibile, a ogni larghezza: chi arriva da fuori deve poter cambiare
   lingua senza prima aprire il menu. La lingua corrente è uno <span> (non un
   link a sé stessa) in --text peso 700; l'altra è un link in --text-dim, senza
   sottolineatura: stesso trattamento di .nav-link, che nell'header sta accanto
   — lo stacco lo fanno colore e peso, e il colore cambia al hover. */

.lang-switch {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.03em;
}
/* 44px di area di tocco: la riga dell'header è già alta almeno tanto
   (logo 48-62px), quindi non allunga la barra. */
.lang-switch > * {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}
.lang-switch [aria-current="true"] { color: var(--text); font-weight: 700; }
.lang-switch .lang-sep { color: var(--line); font-weight: 400; }
.lang-switch a { color: var(--text-dim); }
/* text-decoration: none esplicito: altrimenti vince la regola globale a:hover */
.lang-switch a:hover { color: var(--text); text-decoration: none; }

.site-header--home .lang-switch [aria-current="true"],
.site-header--home .lang-switch a {
  text-shadow: 0 1px 14px oklch(10% 0.01 255 / 0.6);
}
/* Sopra la fotografia il grigio attenuato non regge: si alza la luminosità
   mantenendo comunque lo stacco con la lingua corrente (96%). */
.site-header--home .lang-switch a { color: oklch(90% 0.008 250); }
.site-header--home .lang-switch a:hover { color: var(--text); }
.site-header--home .lang-switch .lang-sep { color: oklch(100% 0 0 / 0.45); }

.nav-toggle {
  display: none;
  position: relative;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  background: none;
  border: 0;
  color: var(--text);
  cursor: pointer;
}
.nav-toggle span {
  position: absolute;
  left: 11px;
  width: 22px;
  height: 1.5px;
  border-radius: 1px;
  background: currentColor;
  transition: transform 0.3s var(--ease), top 0.3s var(--ease);
}
.nav-toggle span:first-child { top: calc(50% - 4px); }
.nav-toggle span:last-child { top: calc(50% + 4px); }
.nav-toggle[aria-expanded="true"] span:first-child { top: 50%; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:last-child { top: 50%; transform: rotate(-45deg); }

/* Pannello di navigazione mobile: overlay a tutto viewport */
.nav-panel {
  position: fixed;
  inset: 0;
  z-index: var(--z-nav-panel);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(2rem, 6vh, 3.5rem);
  padding: clamp(1.5rem, 6vw, 3rem);
  /* Con voci + lingua + contatti il contenuto può superare l'altezza su
     viewport molto bassi (telefono in orizzontale): meglio scrollabile
     che tagliato. */
  overflow-y: auto;
  background: oklch(14% 0.012 255 / 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.nav-panel-close {
  position: absolute;
  top: clamp(1rem, 3vw, 1.75rem);
  right: var(--pad);
  width: 2.6rem;
  height: 2.6rem;
  display: grid;
  place-items: center;
  font-size: 1.1rem;
  border-radius: 999px;
  border: 1px solid oklch(100% 0 0 / 0.25);
  background: oklch(15% 0.01 255 / 0.6);
  color: var(--text);
  cursor: pointer;
}
.nav-panel-close:hover { background: oklch(20% 0.01 255 / 0.9); }

.nav-panel-links {
  display: flex;
  flex-direction: column;
  gap: 0.35em;
}
.nav-panel-links a {
  color: var(--text);
  font-size: clamp(1.75rem, 8vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  animation: nav-panel-item-in 0.5s var(--ease) both;
}
.nav-panel-links a:hover { text-decoration: none; color: var(--accent); }
.nav-panel-links a[aria-current="page"] { color: var(--accent); }
.nav-panel-links a:nth-child(1) { animation-delay: 0.02s; }
.nav-panel-links a:nth-child(2) { animation-delay: 0.08s; }
.nav-panel-links a:nth-child(3) { animation-delay: 0.14s; }
.nav-panel-links a:nth-child(4) { animation-delay: 0.2s; }
@keyframes nav-panel-item-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Nel pannello c'è spazio per i nomi per esteso, ognuno scritto nella propria
   lingua (è la convenzione corretta per un selettore di lingua). */
.nav-panel-lang {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  font-size: 1.05rem;
  font-weight: 600;
}
.nav-panel-lang [aria-current="true"] { color: var(--accent); }
.nav-panel-lang a {
  color: var(--text-dim);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.nav-panel-lang a:hover { color: var(--text); }

.nav-panel-contact {
  padding-top: clamp(1.5rem, 4vh, 2.5rem);
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  font-size: 1rem;
  font-weight: 500;
}
.nav-panel-contact a { color: var(--text-dim); text-decoration: underline; text-underline-offset: 3px; }
.nav-panel-social { display: flex; gap: 1.25rem; }

@media (min-width: 760px) {
  .nav-toggle { display: none !important; }
  .nav-panel { display: none !important; }
}
@media (max-width: 759px) {
  .site-nav { display: none; }
  .nav-toggle { display: flex; }
}
/* Senza JS il toggle non funziona: la nav resta sempre visibile e va a capo. */
.no-js .nav-toggle { display: none !important; }
.no-js .site-nav { display: flex !important; flex-wrap: wrap; row-gap: 0.5rem; }

@media (prefers-reduced-motion: reduce) {
  .nav-panel-links a { animation: none; }
}

/* ---------- Banner fotografico di pagina (Chi siamo, Eventi) ---------- */
/* Foto singola e statica: niente carosello fuori dalla home. */

.page-hero {
  position: relative;
  height: 45svh;
  min-height: 320px;
  max-height: 560px;
  overflow: hidden;
  background: var(--ink-2);
}
.page-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  animation: page-hero-in 1.2s var(--ease) both;
}
.page-hero-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, oklch(10% 0.01 255 / 0.85), oklch(10% 0.01 255 / 0.2) 55%, transparent);
}
.page-hero-content {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0 var(--pad) clamp(1.5rem, 4vh, 2.5rem);
}
.page-hero-content h1 {
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.05;
  text-wrap: balance;
  text-shadow: 0 2px 28px oklch(10% 0.01 255 / 0.5);
}
.page-hero-content .page-hero-kicker {
  font-size: 0.95rem;
  font-weight: 600;
  color: oklch(94% 0.006 250);
  text-shadow: 0 1px 16px oklch(10% 0.01 255 / 0.6);
  margin-bottom: 0.5rem;
}
@keyframes page-hero-in {
  from { transform: scale(1.04); }
  to { transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .page-hero img { animation: none; }
}

/* ---------- Tipografia di pagina (prosa) ---------- */

.page {
  max-width: 70ch;
  margin: 0 auto;
  padding: clamp(2.5rem, 6vw, 4.5rem) var(--pad) clamp(3rem, 7vw, 5rem);
}
.page--wide { max-width: min(1040px, 100%); }

.page > h1 {
  font-size: clamp(1.9rem, 4.5vw, 2.75rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  text-wrap: balance;
}
.page .eyebrow {
  color: var(--text-dim);
  font-size: 0.9rem;
  font-weight: 600;
}
.page .updated {
  margin-top: 0.75rem;
  color: var(--text-dim);
  font-size: 0.9rem;
}

.page h2 {
  font-size: clamp(1.35rem, 2.4vw, 1.7rem);
  font-weight: 800;
  letter-spacing: -0.015em;
  margin: clamp(2.25rem, 5vw, 3rem) 0 1rem;
}
.page h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 1.75rem 0 0.6rem;
}
.page p, .page li { margin-top: 0.85rem; text-wrap: pretty; }
.page ul, .page ol { padding-left: 1.3rem; margin-top: 0.85rem; }
.page .lede {
  margin-top: 1.25rem;
  font-size: clamp(1.05rem, 1.6vw, 1.25rem);
  font-weight: 500;
  color: var(--text);
  max-width: 62ch;
}
.page section + section { margin-top: clamp(1rem, 3vw, 2rem); }

.page dl {
  display: grid;
  gap: 0.9rem;
  margin-top: 1.25rem;
  font-size: 1rem;
}
.page dt { color: var(--text-dim); font-size: 0.82rem; }
.page dd { font-weight: 500; margin-top: 0.1rem; }

.page address { font-style: normal; }

.notice {
  margin: 1.75rem 0;
  padding: 1.1rem 1.4rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--ink-2);
  font-size: 0.95rem;
  color: var(--text-dim);
}
.notice strong { color: var(--text); }

/* ---------- Statuto ---------- */

.statute-toc {
  margin: 2rem 0;
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--ink-2);
}
.statute-toc h2 {
  margin: 0 0 0.9rem;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
}
.statute-toc ol {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.55rem;
}
.statute-toc a { font-size: 0.95rem; font-weight: 500; }

@media (min-width: 1100px) {
  .statute-layout {
    display: grid;
    grid-template-columns: 250px minmax(0, 66ch);
    gap: 3rem;
    align-items: start;
  }
  .statute-toc {
    position: sticky;
    top: 1.5rem;
    margin: 0;
    max-height: calc(100vh - 3rem);
    overflow-y: auto;
  }
}

.statute-article {
  margin-top: clamp(2.5rem, 5vw, 3.5rem);
  scroll-margin-top: 1.5rem;
}
.statute-article:first-of-type { margin-top: clamp(1.5rem, 3vw, 2rem); }
.statute-article h2 {
  margin-top: 0;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--line);
  font-size: clamp(1.15rem, 2.2vw, 1.35rem);
}
.clause {
  margin-top: 0.9rem;
  padding-left: 3.2ch;
  text-indent: -3.2ch;
  line-height: 1.7;
}
.clause .num {
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
  margin-right: 0.4em;
}
.statute-note {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  font-style: italic;
  color: var(--text-dim);
}
.statute-signoff {
  margin-top: clamp(2.5rem, 5vw, 3.5rem);
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  color: var(--text-dim);
  font-size: 0.95rem;
}
.statute-footnote {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  font-size: 0.85rem;
  color: var(--text-dim);
}

/* ---------- Footer ---------- */

.site-footer {
  background: var(--ink);
  padding: clamp(3rem, 7vw, 5rem) var(--pad) 0;
}

.footer-head {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding-bottom: clamp(2rem, 4vw, 3rem);
}

.footer-head img {
  width: 76px;
  height: auto;
  filter: brightness(0) invert(1);
  opacity: 0.92;
}

.footer-head .name {
  font-size: clamp(1.25rem, 2.4vw, 1.6rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.2;
  text-wrap: balance;
}

.footer-head .sub {
  margin-top: 0.3rem;
  color: var(--text-dim);
  font-size: 0.95rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
  gap: 2rem 3rem;
  padding: clamp(2rem, 4vw, 3rem) 0;
  border-top: 1px solid var(--line);
}

.footer-grid h2 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.footer-grid dl {
  display: grid;
  gap: 0.85rem;
  font-size: 0.95rem;
}

.footer-grid dt {
  color: var(--text-dim);
  font-size: 0.82rem;
}

.footer-grid dd { font-weight: 500; }

.footer-grid address {
  font-style: normal;
  font-weight: 500;
  font-size: 0.95rem;
}
.footer-grid address .muted {
  display: block;
  margin-top: 0.85rem;
  color: var(--text-dim);
  font-size: 0.82rem;
  font-weight: 400;
}

.footer-grid nav ul {
  list-style: none;
  display: grid;
  gap: 0.85rem;
  font-size: 0.95rem;
  font-weight: 500;
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 2rem;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  padding: 1.5rem 0 2rem;
  color: var(--text-dim);
  font-size: 0.85rem;
}

/* ---------- Mobile ---------- */

@media (max-width: 680px) {
  .site-header--home .brand span { display: none; }
  .footer-head { flex-direction: column; align-items: flex-start; gap: 1rem; }
}
