/* ============================================================
   Ipogeo della Medusa — Sito statico accessibile
   WCAG 2.2 AA · Responsive · Sicuro
   ============================================================ */

/* --- Design tokens ----------------------------------------- */
:root {
  /* Palette – contrasto minimo 4.5:1 su sfondo */
  --color-bg:        #faf9f7;
  --color-surface:   #ffffff;
  --color-text:      #1a1a1a;
  --color-text-muted:#4a4a4a;
  --color-accent:    #8b4513;      /* terra di Siena */
  --color-accent-hover:#6d3410;
  --color-border:    #999;
  --color-focus:     #1a6fb5;
  --color-hero-bg:   #1a1a1a;
  --color-hero-text: #f5f0e8;
  --color-footer-bg: #2c2420;
  --color-footer-text:#e8e0d6;

  /* Tipografia */
  --font-body:  'Open Sans', system-ui, -apple-system, sans-serif;
  --font-heading: 'Elsie', Georgia, serif;
  --font-subheading: 'PT Serif', Georgia, serif;
  --line-height: 1.7;
  --max-width:   72rem;

  /* Spacing */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 2rem;
  --space-lg: 4rem;
  --space-xl: 6rem;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

body {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 300;
  line-height: var(--line-height);
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-text-size-adjust: 100%;
}

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

a {
  color: var(--color-accent);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}
a:hover,
a:active {
  color: var(--color-accent-hover);
}

/* --- Focus visibile (WCAG 2.4.7 / 2.4.12) ----------------- */
:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 3px;
  border-radius: 2px;
}
:focus:not(:focus-visible) {
  outline: none;
}

/* --- Skip link (WCAG 2.4.1) -------------------------------- */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-sm);
  background: var(--color-focus);
  color: #fff;
  padding: var(--space-xs) var(--space-sm);
  z-index: 1000;
  font-weight: 700;
  border-radius: 0 0 4px 4px;
  text-decoration: none;
}
.skip-link:focus {
  top: 0;
}

/* --- Header / Navigazione ---------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-xs) var(--space-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
}

.site-logo {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  text-decoration: none;
  color: var(--color-text);
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.2;
}
.site-logo img {
  height: 48px;
  width: auto;
}

/* Menu toggle (mobile) */
.menu-toggle {
  display: none;
  background: none;
  border: 2px solid var(--color-text);
  border-radius: 4px;
  padding: var(--space-xs);
  cursor: pointer;
  color: var(--color-text);
  line-height: 1;
  font-size: 1.5rem;
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
}

.main-nav ul {
  list-style: none;
  display: flex;
  gap: var(--space-xs);
  flex-wrap: wrap;
}

.main-nav a {
  display: inline-flex;
  padding: var(--space-xs) 0.75rem;
  text-decoration: none;
  color: var(--color-text);
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: 4px;
  transition: background 0.15s, color 0.15s;
  min-height: 44px;
  align-items: center;
}
.main-nav a:hover,
.main-nav a[aria-current="page"] {
  background: var(--color-accent);
  color: #fff;
}

/* --- Toolbar accessibilità --------------------------------- */
.a11y-toolbar {
  display: flex;
  gap: 0.25rem;
  align-items: center;
}
.a11y-btn {
  background: none;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  padding: 0.25rem 0.5rem;
  font-size: 0.8rem;
  font-family: var(--font-body);
  font-weight: 600;
  color: var(--color-text);
  cursor: pointer;
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
  line-height: 1;
  white-space: nowrap;
}
.a11y-btn:hover,
.a11y-btn:focus {
  background: var(--color-accent);
  color: #fff;
  border-color: var(--color-accent);
}
.a11y-btn[aria-pressed="true"] {
  background: var(--color-text);
  color: var(--color-bg);
  border-color: var(--color-text);
}

@media (max-width: 768px) {
  .a11y-toolbar {
    order: 3;
    width: 100%;
    justify-content: center;
    padding-top: 0.25rem;
  }
  .header-inner {
    flex-wrap: wrap;
  }
}

/* --- Alto contrasto --------------------------------------- */
.high-contrast {
  --color-bg:        #000000;
  --color-surface:   #0a0a0a;
  --color-text:      #ffffff;
  --color-text-muted:#e0e0e0;
  --color-accent:    #ffdd00;
  --color-accent-hover:#ffee55;
  --color-border:    #666666;
  --color-focus:     #00ccff;
  --color-hero-bg:   #000000;
  --color-hero-text: #ffffff;
  --color-footer-bg: #000000;
  --color-footer-text:#ffffff;
}
.high-contrast img {
  filter: contrast(1.1);
}
.high-contrast .site-header {
  background: #000;
  border-bottom-color: #666;
}
.high-contrast .site-logo {
  color: #fff;
}
.high-contrast .main-nav a {
  color: #fff;
}
.high-contrast .main-nav a:hover,
.high-contrast .main-nav a[aria-current="page"] {
  background: #ffdd00;
  color: #000;
}
.high-contrast .a11y-btn {
  color: #fff;
  border-color: #666;
}
.high-contrast .a11y-btn:hover,
.high-contrast .a11y-btn:focus {
  background: #ffdd00;
  color: #000;
  border-color: #ffdd00;
}
.high-contrast .a11y-btn[aria-pressed="true"] {
  background: #ffdd00;
  color: #000;
}
.high-contrast .menu-toggle {
  color: #fff;
  border-color: #fff;
}
.high-contrast .section-reverse {
  border-top: 2px solid #666;
  border-bottom: 2px solid #666;
}
.high-contrast .section-alt {
  background: #0a0a0a;
}
.high-contrast .cta-btn,
.high-contrast .btn {
  background: #ffdd00;
  color: #000;
}
.high-contrast .cta-btn:hover,
.high-contrast .btn:hover {
  background: #ffee55;
  color: #000;
}
.high-contrast .gallery-item,
.high-contrast .game-card,
.high-contrast .sketchfab-item {
  border-color: #666;
  background: #111;
}
.high-contrast .game-card:hover {
  color: #fff;
}
.high-contrast .back-to-top {
  background: #ffdd00;
  color: #000;
}
.high-contrast a {
  color: #ffdd00;
}
.high-contrast a:hover {
  color: #ffee55;
}
.high-contrast .footer-section a {
  color: #ffdd00;
}

/* --- Responsive nav ---------------------------------------- */
@media (max-width: 768px) {
  .menu-toggle {
    display: flex;
  }
  .main-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-surface);
    border-bottom: 2px solid var(--color-border);
    box-shadow: 0 4px 8px rgba(0,0,0,.1);
    padding: var(--space-sm);
  }
  .main-nav.is-open {
    display: block;
  }
  .main-nav ul {
    flex-direction: column;
  }
  .main-nav a {
    padding: 0.75rem var(--space-sm);
    font-size: 1rem;
  }
}

/* --- Hero section ------------------------------------------ */
.hero {
  background: var(--color-hero-bg) url('../img/hero-bg.jpg') center/cover no-repeat;
  color: var(--color-hero-text);
  text-align: center;
  padding: var(--space-xl) var(--space-sm);
  position: relative;
  overflow: hidden;
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(26,26,26,.55), rgba(26,26,26,.75));
  z-index: 1;
}
.hero-content {
  position: relative;
  z-index: 2;
  max-width: 90%;
  margin: 0 auto;
}
.hero h1 {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 6vw, 3.5rem);
  margin-bottom: var(--space-sm);
  line-height: 1.2;
}
.hero-subtitle {
  font-family: var(--font-subheading);
  font-size: clamp(1.1rem, 3vw, 1.6rem);
  margin-bottom: var(--space-md);
  opacity: 0.9;
}
.hero .cta-btn {
  display: inline-block;
  background: var(--color-accent);
  color: #fff;
  padding: 0.85rem 2.5rem;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.05em;
  border-radius: 4px;
  border: 2px solid transparent;
  transition: background 0.2s, transform 0.15s;
  min-height: 44px;
}
.cta-btn:hover,
.cta-btn:active {
  background: var(--color-accent-hover);
  color: #fff;
  transform: translateY(-1px);
}
.hero-logo {
  margin-top: var(--space-lg);
}
.hero-logo img {
  margin: 0 auto;
  max-width: 200px;
  opacity: 0.9;
}

/* --- Sezioni generiche ------------------------------------- */
.section {
  padding: var(--space-lg) var(--space-sm);
}
.section-alt {
  background: var(--color-surface);
}
.section-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  width: 90%;
}

/* IMPORTANTE: i paragrafi fluiscono con il contenitore, NO max-width */
.section h2 {
  font-family: var(--font-heading);
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  color: var(--color-accent);
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-xs);
  border-bottom: 3px solid var(--color-accent);
  line-height: 1.3;
}
.section h3 {
  font-family: var(--font-subheading);
  font-size: 1.3rem;
  margin: var(--space-md) 0 var(--space-sm);
  color: var(--color-text);
}

.section p {
  margin-bottom: var(--space-sm);
}

.section ul {
  padding-left: var(--space-md);
  margin-bottom: var(--space-sm);
}
.section ul li {
  margin-bottom: var(--space-xs);
}

/* --- Sezione reverse (sfondo scuro, testo chiaro) ---------- */
.section-reverse {
  background: var(--color-hero-bg);
  color: var(--color-hero-text);
}
.section-reverse h2 {
  color: #fff;
  border-bottom-color: rgba(255,255,255,.3);
}
.section-reverse h3 {
  color: #e8e0d6;
}
.section-reverse p,
.section-reverse li,
.section-reverse address {
  color: rgba(255,255,255,.85);
}
.section-reverse a {
  color: #d4a574;
}
.section-reverse a:hover {
  color: #e8c4a0;
}

/* --- Section dark (giochi) --------------------------------- */
.section-dark {
  background: #2a2520;
  color: var(--color-hero-text);
}
.section-dark h2 {
  color: #fff;
  border-bottom-color: rgba(255,255,255,.3);
}
.section-dark h3 {
  color: #e8e0d6;
}
.section-dark p {
  color: rgba(255,255,255,.85);
}

/* --- Section intro (testo centrato grande) ----------------- */
.section-intro {
  text-align: center;
  font-family: var(--font-heading);
  font-size: clamp(1.1rem, 2.5vw, 1.5rem);
  margin-bottom: var(--space-md);
  opacity: 0.9;
}

/* --- Photo row + caption ----------------------------------- */
.photo-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-sm);
  margin: var(--space-md) 0 var(--space-sm);
}
.photo-row figure {
  margin: 0;
  overflow: hidden;
  border-radius: 6px;
}
.photo-row img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 6px;
}
@media (max-width: 600px) {
  .photo-row {
    grid-template-columns: 1fr;
  }
}
.photo-caption {
  text-align: center;
  margin-bottom: var(--space-lg);
  color: var(--color-text-muted);
}
.photo-caption p {
  margin-bottom: 0.25rem;
}

/* --- 3-column grid (cronistoria, etc.) --------------------- */
.col3-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
  margin: var(--space-md) 0;
}
.col3-item {
  padding: var(--space-md);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
}
.year-label {
  font-size: 1.5rem;
  color: var(--color-accent);
  font-family: var(--font-heading);
}
@media (max-width: 768px) {
  .col3-grid {
    grid-template-columns: 1fr;
  }
}

/* --- Fullwidth image --------------------------------------- */
.fullwidth-image {
  width: 100%;
  margin-bottom: var(--space-md);
}
.fullwidth-image img {
  width: 100%;
  height: auto;
  display: block;
}

/* --- Figure wide (pianta, rendering) ----------------------- */
.figure-wide {
  margin: var(--space-md) 0;
}
.figure-wide img {
  width: 100%;
  border-radius: 6px;
}

/* --- VR CTA ------------------------------------------------ */
.vr-cta {
  max-width: 36rem;
  margin: var(--space-lg) auto;
  padding: var(--space-lg) var(--space-md);
  text-align: center;
  background: var(--color-hero-bg);
  color: var(--color-hero-text);
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}
.vr-cta-icon {
  font-family: var(--font-heading);
  font-size: 3rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-sm);
  opacity: 0.85;
}
.vr-cta-text {
  font-size: 1.2rem;
  line-height: 1.7;
  margin-bottom: var(--space-md);
  opacity: 0.9;
}
.vr-cta-btn {
  font-size: 1.15rem;
  padding: 0.9rem 2.5rem;
}

/* --- Video embed ------------------------------------------- */
.video-embed {
  position: relative;
  width: 100%;
  max-width: 900px;
  aspect-ratio: 16/9;
  margin: var(--space-md) auto;
  border-radius: 8px;
  overflow: hidden;
  background: #000;
}
.video-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.a11y-notice {
  font-size: 0.85rem;
  font-style: italic;
  text-align: center;
  opacity: 0.8;
  margin-bottom: var(--space-sm);
}

.video-alt {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  text-align: center;
  font-style: italic;
  max-width: 800px;
  margin: var(--space-xs) auto var(--space-md);
}

/* --- Rilievo grid (3 colonne) ------------------------------ */
.rilievo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-sm);
  margin: var(--space-md) 0;
}
.rilievo-grid figure {
  margin: 0;
}
.rilievo-grid img {
  width: 100%;
  border-radius: 6px;
  border: 1px solid var(--color-border);
}
.rilievo-grid figcaption {
  text-align: center;
  font-size: 0.85rem;
  color: var(--color-text-muted);
  padding: var(--space-xs) 0;
}
@media (max-width: 768px) {
  .rilievo-grid {
    grid-template-columns: 1fr;
  }
}

/* --- Sketchfab 3D models (4 colonne) ----------------------- */
.sketchfab-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-md);
  margin: var(--space-md) 0;
}
.sketchfab-item {
  margin: 0;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  overflow: hidden;
}
.sketchfab-item h3 {
  font-size: 0.8rem;
  font-family: var(--font-subheading);
  padding: var(--space-xs) var(--space-sm);
  margin: 0;
  color: var(--color-text-muted);
  line-height: 1.4;
}
.sketchfab-embed {
  position: relative;
  width: 100%;
  aspect-ratio: 4/3;
  background: #f0f0f0;
}
.sketchfab-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}
@media (max-width: 1024px) {
  .sketchfab-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 600px) {
  .sketchfab-grid {
    grid-template-columns: 1fr;
  }
}

/* --- Gallery / Grid reperti (4 colonne, circolari) ---------- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-sm);
  margin: var(--space-md) 0;
}
.gallery-item {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  overflow: hidden;
  transition: box-shadow 0.2s;
  text-align: center;
}
.gallery-item:hover,
.gallery-item:focus-within {
  box-shadow: 0 4px 12px rgba(0,0,0,.12);
}
.gallery-item img {
  width: 80%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 50%;
  margin: var(--space-sm) auto 0;
}
.gallery-item figcaption {
  padding: var(--space-xs) var(--space-sm);
  font-size: 0.85rem;
  text-align: center;
  color: var(--color-text-muted);
}
@media (max-width: 1024px) {
  .gallery-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (max-width: 768px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 480px) {
  .gallery-grid {
    grid-template-columns: 1fr;
  }
}

/* --- Ganimede images --------------------------------------- */
.ganimede-images {
  margin: var(--space-md) 0;
}
.ganimede-images figure {
  margin: 0 0 var(--space-sm) 0;
}
.ganimede-images img {
  width: 100%;
  border-radius: 6px;
}

/* --- Games section ----------------------------------------- */
.games-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
  margin: var(--space-md) 0;
}
.game-card {
  display: block;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: var(--space-md);
  text-align: center;
  color: var(--color-text);
  text-decoration: none;
  transition: box-shadow 0.2s, transform 0.15s;
}
.game-card:hover,
.game-card:focus {
  box-shadow: 0 6px 20px rgba(0,0,0,.15);
  transform: translateY(-2px);
  color: var(--color-text);
}
.game-card h3 {
  margin-top: 0;
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 1.1rem;
  letter-spacing: 0.05em;
}
.game-card img {
  border-radius: 6px;
  margin: var(--space-sm) auto 0;
  width: 100%;
}
@media (max-width: 768px) {
  .games-grid {
    grid-template-columns: 1fr;
  }
}

/* --- Memory Game ------------------------------------------- */
.memory-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-sm);
  max-width: 600px;
  margin: var(--space-md) auto;
}
.memory-card {
  aspect-ratio: 1;
  perspective: 600px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  min-height: 44px;
}
.memory-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.4s;
  transform-style: preserve-3d;
  border-radius: 8px;
}
.memory-card.flipped .memory-card-inner {
  transform: rotateY(180deg);
}
.memory-card.matched .memory-card-inner {
  box-shadow: 0 0 0 3px #2d8b4e;
}
.memory-card-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-xs);
  font-size: 0.85rem;
  text-align: center;
  border: 2px solid var(--color-border);
}
.memory-card-back {
  background: var(--color-accent);
  color: #fff;
  font-size: 2rem;
}
.memory-card-front {
  background: var(--color-surface);
  transform: rotateY(180deg);
}
.memory-card-front img {
  max-height: 70%;
  object-fit: contain;
  margin: 0 auto;
}

/* --- Puzzle Game ------------------------------------------- */
.puzzle-container {
  max-width: 500px;
  margin: var(--space-md) auto;
  position: relative;
}
.puzzle-board {
  display: grid;
  gap: 2px;
  background: var(--color-border);
  border: 2px solid var(--color-border);
  border-radius: 4px;
}
.puzzle-tile {
  aspect-ratio: 1;
  background-size: cover;
  background-position: center;
  cursor: pointer;
  border: none;
  padding: 0;
  transition: transform 0.15s;
  min-height: 44px;
}
.puzzle-tile:hover {
  transform: scale(1.02);
}
.puzzle-tile.empty {
  background: var(--color-bg) !important;
  cursor: default;
}
.puzzle-tile:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: -3px;
  z-index: 1;
}

/* --- Contatti section -------------------------------------- */
.section-contatti {
  background: var(--color-hero-bg) url('../img/Fondo-medusa2.jpg') center/cover no-repeat;
  background-attachment: fixed;
  color: var(--color-hero-text);
  position: relative;
}
.section-contatti::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(26,26,26,.8);
  z-index: 0;
}
.section-contatti .section-inner {
  position: relative;
  z-index: 1;
}
.section-contatti h2 {
  color: #fff;
  border-bottom-color: rgba(255,255,255,.3);
}
.section-contatti a {
  color: #d4a574;
}
.section-contatti a:hover {
  color: #e8c4a0;
}

.contatti-info {
  text-align: center;
  margin-bottom: var(--space-md);
}
.contatti-info address {
  font-style: normal;
  line-height: 2;
  margin-bottom: var(--space-sm);
  color: rgba(255,255,255,.85);
}
.contatti-info p {
  color: rgba(255,255,255,.85);
}

.contatti-icons {
  display: flex;
  justify-content: center;
  gap: var(--space-lg);
  flex-wrap: wrap;
  margin-top: var(--space-md);
}
.contact-icon-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
  text-decoration: none;
  color: var(--color-hero-text);
  min-width: 44px;
  min-height: 44px;
  font-size: 0.9rem;
}
.contact-icon-link:hover {
  color: #d4a574;
}
.contact-icon {
  font-size: 2rem;
}

/* --- Mappa fullwidth --------------------------------------- */
.section-map {
  width: 100%;
  line-height: 0;
}
.section-map img {
  width: 100%;
  height: auto;
}

/* --- Social icons ------------------------------------------ */
.social-icons {
  display: flex;
  justify-content: center;
  gap: var(--space-md);
  flex-wrap: wrap;
  margin: var(--space-sm) 0;
}
.social-icon-item {
  font-family: var(--font-subheading);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--color-text-muted);
}

/* --- Footer ------------------------------------------------ */
.site-footer {
  background: var(--color-footer-bg);
  color: var(--color-footer-text);
  padding: var(--space-lg) var(--space-sm) var(--space-md);
}
.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--space-md);
}
.footer-section h3 {
  color: #fff;
  font-size: 1rem;
  font-family: var(--font-body);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-sm);
}
.footer-section p {
  margin-bottom: var(--space-xs);
  font-size: 0.9rem;
}
.footer-section a {
  color: var(--color-footer-text);
}
.footer-section a:hover {
  color: #fff;
}
.footer-section ul {
  list-style: none;
}
.footer-section li {
  margin-bottom: var(--space-xs);
}
.footer-section address {
  font-style: normal;
  line-height: 1.8;
}
.footer-bottom {
  max-width: var(--max-width);
  margin: var(--space-md) auto 0;
  padding-top: var(--space-sm);
  border-top: 1px solid rgba(255,255,255,.15);
  font-size: 0.85rem;
  text-align: center;
  color: rgba(255,255,255,.6);
}

/* --- Disclaimer footer ------------------------------------- */
.footer-disclaimer {
  margin: var(--space-md) auto 0;
  padding: var(--space-md);
  border-top: 1px solid rgba(255,255,255,.15);
  font-size: 0.8rem;
  line-height: 1.8;
  color: rgba(255,255,255,.7);
  text-align: justify;
}
.footer-disclaimer p {
  max-width: var(--max-width);
  margin: 0 auto;
}
.footer-disclaimer a {
  color: rgba(255,255,255,.85);
  text-decoration: underline;
}
.footer-disclaimer a:hover {
  color: #fff;
}
.footer-disclaimer em {
  font-style: italic;
}

/* --- Banner finale (endcap) -------------------------------- */
.site-endcap {
  background: var(--color-bg);
  text-align: center;
  padding: var(--space-lg) var(--space-sm) var(--space-md);
  position: relative;
}
.site-endcap img {
  margin: 0 auto var(--space-sm);
  opacity: 0.85;
}
.site-endcap p {
  font-family: var(--font-heading);
  font-size: 1rem;
  color: var(--color-text-muted);
  margin: 0;
  line-height: 1.6;
}
.site-endcap .endcap-copy {
  font-family: var(--font-body);
  font-size: 0.8rem;
  color: #666;
}
.endcap-credit {
  font-family: var(--font-body);
  font-size: 0.75rem;
  color: #666;
  margin-top: var(--space-xs);
}
.back-to-top {
  position: absolute;
  right: var(--space-md);
  bottom: var(--space-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: var(--color-accent);
  color: #fff;
  text-decoration: none;
  border-radius: 50%;
  font-size: 1.4rem;
  line-height: 1;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
  transition: background 0.15s;
}
.back-to-top:hover {
  background: var(--color-accent-hover);
  color: #fff;
}

/* --- Pagine interne ---------------------------------------- */
.page-header {
  background: var(--color-hero-bg);
  color: var(--color-hero-text);
  padding: var(--space-lg) var(--space-sm);
  text-align: center;
}
.page-header h1 {
  font-family: var(--font-heading);
  font-size: clamp(1.6rem, 4vw, 2.5rem);
}
.page-content {
  max-width: 50rem;
  margin: 0 auto;
  padding: var(--space-lg) var(--space-sm);
}
.page-content p {
  margin-bottom: var(--space-sm);
}
.page-content ul,
.page-content ol {
  margin-bottom: var(--space-sm);
  padding-left: var(--space-md);
}

/* --- Link list (link-utili) -------------------------------- */
.link-list {
  list-style: none;
  padding: 0;
}
.link-list li {
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--color-border);
}
.link-list a {
  font-weight: 600;
  font-size: 1.05rem;
}

/* --- Utility classes --------------------------------------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

.text-center { text-align: center; }

.btn {
  display: inline-block;
  padding: 0.65rem 1.5rem;
  background: var(--color-accent);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  border: 2px solid transparent;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1rem;
  min-height: 44px;
  transition: background 0.2s;
}
.btn:hover {
  background: var(--color-accent-hover);
  color: #fff;
}

.btn-outline {
  background: transparent;
  color: var(--color-accent);
  border-color: var(--color-accent);
}
.btn-outline:hover {
  background: var(--color-accent);
  color: #fff;
}

.game-status {
  text-align: center;
  padding: var(--space-sm);
  font-weight: 600;
  font-size: 1.1rem;
  min-height: 2.5rem;
}

/* --- Reduced motion ---------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .section-contatti {
    background-attachment: scroll;
  }
}

/* --- Lightbox ---------------------------------------------- */
.lb-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0, 0, 0, 0.92);
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.lb-toolbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2010;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 1rem;
  background: rgba(0, 0, 0, 0.6);
}
.lb-caption {
  color: #fff;
  font-size: 0.9rem;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lb-buttons {
  display: flex;
  gap: 0.3rem;
}
.lb-btn {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 4px;
  font-size: 1.2rem;
  min-width: 44px;
  min-height: 44px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  padding: 0 0.5rem;
  line-height: 1;
}
.lb-btn:hover,
.lb-btn:focus {
  background: rgba(255, 255, 255, 0.3);
}
.lb-btn:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 2px;
}
.lb-close {
  font-size: 1.8rem;
  font-weight: 300;
}
.lb-nav {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  z-index: 2010;
  display: flex;
  justify-content: space-between;
  padding: 0 0.5rem;
  transform: translateY(-50%);
  pointer-events: none;
}
.lb-prev,
.lb-next {
  font-size: 2.5rem;
  pointer-events: auto;
  background: rgba(0, 0, 0, 0.4);
}
.lb-img-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  overflow: hidden;
  padding: 3.5rem 0.5rem 0.5rem;
}
.lb-img {
  max-width: 95%;
  max-height: 90vh;
  object-fit: contain;
  transition: transform 0.15s ease;
  user-select: none;
  -webkit-user-select: none;
}

/* Trigger styling */
.lightbox-trigger {
  display: block;
  position: relative;
  cursor: zoom-in;
}
.lightbox-trigger::after {
  content: '\1F50D';
  position: absolute;
  bottom: 0.5rem;
  right: 0.5rem;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 0.9rem;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}
.lightbox-trigger:hover::after,
.lightbox-trigger:focus::after {
  opacity: 1;
}

/* --- Print ------------------------------------------------- */
@media print {
  .site-header,
  .menu-toggle,
  .skip-link,
  .cta-btn,
  .vr-cta,
  .video-embed,
  .sketchfab-grid,
  .games-grid,
  .site-footer {
    display: none;
  }
  body {
    font-size: 12pt;
    color: #000;
    background: #fff;
  }
}
