:root {
  --bg: #0b0c10;
  --card: #12141b;
  --card-soft: #181b25;
  --text: #f2f3f5;
  --muted: #b7bcc7;
  --border: rgba(255, 255, 255, 0.12);
  --radius: 20px;
  --max: 1400px;

  /* Palette illustrazioni hero di galleria — tratta dai colori reali
     usati nei dipinti, adattata per leggersi su fondo scuro. */
  --ink: #f3ecd9;
  --ink-soft: #b7bcc7;
  --leaf: #8caf72;
  --leaf-dark: #5f8a52;
  --fruit: #e8ad4f;
  --fruit-dark: #c98a2e;
  --bloom: #d98aa3;
  --bloom-center: #eccf6d;
  --fur: #c9a06b;
  --fur-dark: #8a6a45;
  --dawn: #e8b25c;
  --peak-far: #6f6a60;
  --peak-near: #4d493f;
  --tonic: #4f8fe0;
  --tonic-dark: #2f5fa8;
  --cherry: #c94f4f;
  --brass: #c9784f;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

img {
  max-width: 100%;
  -webkit-user-drag: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

/* Le immagini non ricevono eventi: click destro e trascinamento
   colpiscono il contenitore, non il file immagine. */
.thumb img,
.gallery-image .thumb img,
.about-image img,
.lightbox__img {
  pointer-events: none;
}

a {
  color: inherit;
  text-decoration: none;
  opacity: 0.95;
}

a:hover {
  opacity: 1;
  text-decoration: none;
}

.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 28px 32px;
}

.header {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
  border-bottom: 1px solid var(--border);
}

.header-left {
  display: grid;
  gap: 4px;
}

.header-right {
  display: grid;
  gap: 14px;
  justify-items: end;
}

h1 {
  margin: 0;
  font-size: clamp(34px, 5vw, 62px);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 18px;
}

.nav {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav a {
  color: var(--muted);
  font-size: 17px;
  transition: color 0.2s ease, opacity 0.2s ease;
}

.nav a:hover {
  color: var(--text);
}

.lang-switch {
  display: flex;
  gap: 8px;
}

.lang-btn {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  padding: 8px 12px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s ease;
}

.lang-btn:hover {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.24);
}

body[data-lang="it"] .lang-btn[data-set-lang="it"],
body[data-lang="en"] .lang-btn[data-set-lang="en"] {
  background: var(--card);
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.22);
}

.section {
  padding: 38px 0;
}

h2 {
  margin: 0 0 14px;
  font-size: 18px;
  color: var(--muted);
  font-weight: 600;
}

.hero {
  padding: 44px 0 18px;
  max-width: 850px;
}

.hero-kicker {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero h2 {
  margin: 0 0 16px;
  font-size: clamp(36px, 5vw, 64px);
  line-height: 1.05;
  color: var(--text);
  font-weight: 700;
  letter-spacing: -0.04em;
}

.hero-text {
  margin: 0;
  color: var(--muted);
  font-size: 18px;
  max-width: 720px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
  gap: 28px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.4);
  border-color: rgba(255, 255, 255, 0.2);
}

.thumb {
  width: 100%;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  display: block;
  color: inherit;
  font: inherit;
}

.thumb img {
  width: 100%;
  height: 460px;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
  background: var(--card-soft);
}

.thumb:hover img {
  transform: scale(1.04);
}

figcaption {
  padding: 16px 16px 18px;
  display: grid;
  gap: 6px;
}

figcaption strong {
  font-size: 20px;
}

figcaption span {
  font-size: 15px;
  color: var(--muted);
}

.gallery-image {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.gallery-image:hover {
  transform: translateY(-6px);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.4);
  border-color: rgba(255, 255, 255, 0.2);
}

.gallery-image .thumb img {
  width: 100%;
  height: 460px;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
  background: var(--card-soft);
}

.gallery-image .thumb:hover img {
  transform: scale(1.04);
}

.about-page {
  padding-top: 50px;
}

.about-layout {
  display: grid;
  grid-template-columns: minmax(260px, 420px) minmax(0, 1fr);
  gap: 46px;
  align-items: start;
}

.about-image img {
  width: 100%;
  display: block;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--card);
}

.about-content {
  max-width: 820px;
}

.about-content h2 {
  color: var(--text);
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1.05;
  letter-spacing: -0.04em;
  margin-bottom: 20px;
}

.about-content p {
  color: var(--muted);
  font-size: 18px;
}

.about-events {
  margin-top: 54px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}

.about-events h3 {
  margin: 0 0 22px;
  font-size: 28px;
}

.about-events .event + .event {
  margin-top: 28px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}

.about-events .event {
  display: grid;
  grid-template-columns: minmax(220px, 360px) minmax(0, 1fr);
  column-gap: 28px;
  align-items: start;
}

.event-image-frame {
  width: min(100%, 180px);
  height: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
}

.about-events h4 {
  margin: 0 0 6px;
  font-size: 20px;
}

.event-image {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
}

.about-events p {
  color: var(--muted);
  font-size: 18px;
}

.about-events .event-meta {
  margin: 0 0 14px;
  color: var(--text);
  font-size: 15px;
}

.about-events .event-link {
  margin-top: 16px;
}

@media (max-width: 560px) {
  .about-events .event {
    grid-template-columns: 1fr;
    row-gap: 18px;
  }
}

.about-box {
  margin-top: 24px;
  padding: 22px;
  width: fit-content;
  max-width: 100%;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.about-box h3 {
  margin: 0 0 12px;
  font-size: 20px;
}

.about-box p {
  margin: 8px 0;
}

.contact-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
}

.contact-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  color: var(--muted);
  transition: color 0.2s ease;
}

.contact-link:hover {
  color: var(--text);
}

.contact-icon {
  width: 21px;
  height: 21px;
  flex: 0 0 21px;
}

.about-back {
  margin-top: 28px;
}

.about-back a {
  color: var(--text);
}

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  display: none;
  place-items: center;
  padding: 18px;
  z-index: 999;
}

.lightbox.is-open {
  display: grid;
}

.lightbox__img {
  max-width: min(1300px, 92vw);
  max-height: 88vh;
  border-radius: 16px;
  border: 1px solid var(--border);
  object-fit: contain;
}

.lightbox__close {
  position: fixed;
  top: 14px;
  right: 16px;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(18, 20, 27, 0.85);
  color: var(--text);
  font-size: 26px;
  cursor: pointer;
}

.lightbox__nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 54px;
  height: 54px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(18, 20, 27, 0.9);
  color: var(--text);
  font-size: 30px;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.lightbox__nav--prev {
  left: 20px;
}

.lightbox__nav--next {
  right: 20px;
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-top: 18px;
  padding-bottom: 40px;
  color: var(--muted);
  border-top: 1px solid var(--border);
  margin-top: 20px;
}

.footer p {
  margin: 0;
  font-size: 14px;
}

.footer-contact {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  font-size: 14px;
}

.footer-contact-group {
  display: grid;
  gap: 6px;
}

.footer-contact-title {
  font-weight: 600;
}

.footer-contact a {
  color: var(--muted);
}

.footer-contact a:hover {
  color: var(--text);
}

.lang-it,
.lang-en {
  display: none;
}

body[data-lang="it"] .lang-it {
  display: inline;
}

body[data-lang="en"] .lang-en {
  display: inline;
}

@media (max-width: 900px) {
  .grid {
    grid-template-columns: 1fr;
  }

  .thumb img,
  .gallery-image .thumb img {
    height: 320px;
  }

  .about-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .header {
    flex-direction: column;
    align-items: flex-start;
  }

  .header-right {
    justify-items: start;
  }

  .nav {
    justify-content: flex-start;
    gap: 12px;
  }
}

@media (max-width: 560px) {
  .container {
    padding: 22px 18px;
  }

  .hero h2 {
    font-size: 32px;
  }

  .hero-text {
    font-size: 16px;
  }

  .thumb img,
  .gallery-image .thumb img {
    height: 280px;
  }

  .lightbox__nav {
    width: 44px;
    height: 44px;
  }

  .lightbox__nav--prev {
    left: 10px;
  }

  .lightbox__nav--next {
    right: 10px;
  }
}

/* ============================================================
   Animazione hero di galleria — illustrazione vettoriale
   originale disegnata per ciascuna categoria, animata via GSAP
   (vedi js/anim-<categoria>.js). Questo blocco fornisce solo il
   contenitore: colori, forme e movimento vivono nell'SVG e nel
   relativo script della singola pagina.
   ============================================================ */

.gallery-anim {
  display: none;
}

.anim-stage {
  width: 100%;
  max-width: 640px;
  aspect-ratio: 480 / 200;
  overflow: visible;
}

@media (max-width: 700px) {
  .gallery-anim {
    padding: 18px 18px 0;
  }
}
