/* =========================
   Itinerari della memoria 2.0
   CSS elegante - TEMA STORICO MARROME/TERRA
   ========================= */

:root {
  /* Colori eleganti per tema storico */
  --bg: #f9f7f3;
  /* Sfondo avorio antico */
  --text: #3c2f2f;
  /* Testo marrone scuro */
  --muted: #8b7355;
  /* Testo marrone medio */
  --border: #d4c4a8;
  /* Bordi color sabbia */
  --card: #fffef9;
  /* Sfondo card avorio */

  /* Accenti per tema storico */
  --primary: #5d4037;
  /* Marrone scuro - titoli */
  --link: #8d6e63;
  /* Marrone terracotta - link */
  --accent: #a0522d;
  /* Terra di Siena - accenti */
  --accent-light: #f5e9e1;
  /* Terra di Siena chiaro */

  /* Design moderno con tocco storico */
  --radius: 20px;
  --radius-sm: 12px;
  --radius-lg: 30px;
  --shadow: 0 10px 30px rgba(93, 64, 55, 0.08);
  --shadow-hover: 0 20px 40px rgba(93, 64, 55, 0.12);
  --glass: rgba(255, 254, 249, 0.9);

  /* Gradient per tema storico (marrone/terra) */
  --gradient: linear-gradient(135deg, #8d6e63 0%, #5d4037 100%);
  --gradient-subtle: linear-gradient(135deg, rgba(141, 110, 99, 0.1) 0%, rgba(93, 64, 55, 0.1) 100%);
  --gradient-dark: linear-gradient(135deg, #6d4c41 0%, #4e342e 100%);

  --max: 1200px;
  --pad: 24px;
  --lh: 1.8;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  scroll-padding-top: 90px;
}

body {
  font-family: 'Crimson Text', 'Georgia', 'Times New Roman', serif;
  background: var(--bg);
  color: var(--text);
  line-height: var(--lh);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-image:
    radial-gradient(circle at 15% 50%, rgba(141, 110, 99, 0.03) 0%, transparent 55%),
    radial-gradient(circle at 85% 30%, rgba(160, 82, 45, 0.02) 0%, transparent 45%);
  min-height: 100vh;
  font-size: 1.1rem;
}

@import url('https://fonts.googleapis.com/css2?family=Crimson+Text:ital,wght@0,400;0,600;0,700;1,400&display=swap');

img,
video {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius-sm);
  transition: transform 0.5s ease, box-shadow 0.5s ease;
  border: 1px solid var(--border);
}

img:hover {
  transform: scale(1.02);
  box-shadow: var(--shadow-hover);
}

a {
  color: var(--link);
  text-decoration: none;
  transition: var(--transition);
  position: relative;
  font-weight: 600;
}

a:hover {
  color: var(--accent);
}

a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--gradient);
  transition: width 0.3s ease;
}

a:hover::after {
  width: 100%;
}

.container {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--pad);
}

.site-header {
  background: var(--glass);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(212, 196, 168, 0.3);
  position: relative;
  z-index: 1000;
  box-shadow: 0 4px 20px rgba(93, 64, 55, 0.05);
}

.site-header .container {
  position: relative;
  padding-top: 24px;
  padding-bottom: 20px;
  display: block;
}

.header-title-wrapper {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 32px;
  padding: 8px 0;
  padding-right: 120px;
  max-width: 100%;
  box-sizing: border-box;
}

.lang-switch {
  position: absolute;
  top: 24px;
  right: 10px;
  font-size: 0.9rem;
  color: var(--muted);
  z-index: 10;
  background: rgba(255, 254, 249, 0.7);
  padding: 6px 12px;
  border-radius: 20px;
  backdrop-filter: blur(5px);
  border: 1px solid var(--border);
  font-family: 'Crimson Text', serif;
}

.lang-link {
  text-decoration: none;
  color: var(--link);
  transition: var(--transition);
}

.lang-link:hover {
  color: var(--accent);
}

.lang-active {
  font-weight: 600;
  color: var(--primary);
}

.hero-lang-switch {
  position: absolute;
  top: 24px;
  right: 24px;
  z-index: 5;
  pointer-events: auto;
  background: rgba(20, 16, 12, 0.32);
  border-color: rgba(255, 255, 255, 0.22);
  color: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
}

.hero-lang-switch .lang-link {
  color: #f3e8d6;
}

.hero-lang-switch .lang-link:hover {
  color: #ffffff;
}

.hero-lang-switch .lang-active {
  color: #ffffff;
}

.site-header h1 {
  margin: 0;
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1.2;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  letter-spacing: -0.5px;
  white-space: normal;
  word-break: break-word;
  font-family: 'Crimson Text', serif;
}

.subtitle {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 400;
  opacity: 0.9;
  font-style: italic;
  position: relative;
  top: 0;
  color: var(--muted);
  font-family: 'Crimson Text', serif;
}

.content {
  padding: 40px 0 60px;
  position: relative;
  z-index: 1;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px;
  margin: 24px 0;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--gradient);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.card:hover {
  box-shadow: var(--shadow-hover);
  border-color: var(--accent);
}

.card:hover::before {
  opacity: 1;
}

section {
  margin: 40px 0;
  position: relative;
}

h2 {
  margin: 0 0 24px 0;
  font-size: 2rem;
  font-weight: 600;
  color: var(--primary);
  position: relative;
  padding-bottom: 12px;
  font-family: 'Crimson Text', serif;
  border-bottom: 1px solid var(--border);
}

h2::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 60px;
  height: 4px;
  background: var(--gradient);
  border-radius: 2px;
  transition: width 0.3s ease;
}

h2:hover::after {
  width: 80px;
}

h3,
h4,
h5,
h6 {
  font-family: 'Crimson Text', serif;
  color: var(--primary);
}

p {
  margin: 0 0 20px 0;
  color: var(--text);
  font-size: 1.15rem;
  line-height: 1.8;
  text-align: justify;
}

ul {
  margin: 0 0 24px 0;
  padding-left: 24px;
  list-style: none;
}

li {
  margin: 12px 0;
  padding-left: 28px;
  position: relative;
  font-size: 1.1rem;
}

li::before {
  content: '◆';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-size: 0.9rem;
  transition: transform 0.2s ease;
}

li:hover::before {
  color: var(--primary);
}

figure {
  margin: 32px 0;
  border-radius: var(--radius);
  overflow: hidden;
  background: white;
  box-shadow: var(--shadow);
  transition: var(--transition);
  border: 2px solid var(--border);
  position: relative;
}

figure::before {
  content: '';
  position: absolute;
  top: 8px;
  left: 8px;
  right: 8px;
  bottom: 8px;
  border: 1px solid rgba(141, 110, 99, 0.1);
  pointer-events: none;
  border-radius: calc(var(--radius) - 4px);
}

figure:hover {
  transform: scale(1.01);
  box-shadow: var(--shadow-hover);
  border-color: var(--accent);
}

figure img,
figure video {
  width: 100%;
  height: auto;
  border-radius: 0;
  transition: transform 0.5s ease;
}

figure:hover img,
figure:hover video {
  transform: scale(1.05);
}

figcaption {
  padding: 20px;
  color: var(--muted);
  font-size: 1rem;
  font-style: italic;
  border-top: 1px solid var(--border);
  background: var(--card);
  font-family: 'Crimson Text', serif;
}

.note {
  padding: 28px 32px;
  background: var(--gradient-subtle);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 1.2rem;
  font-style: italic;
  position: relative;
  border-left: 5px solid var(--accent);
  margin: 32px 0;
  transition: var(--transition);
  font-family: 'Crimson Text', serif;
  background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-9-21c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM60 91c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM35 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 60c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z' fill='%238d6e63' fill-opacity='0.03' fill-rule='evenodd'/%3E%3C/svg%3E");
}

.note:hover {
  box-shadow: var(--shadow);
  background-color: var(--accent-light);
}

.note::before {
  content: '"';
  position: absolute;
  top: -20px;
  left: 20px;
  font-size: 4rem;
  color: var(--accent);
  opacity: 0.2;
  font-family: Georgia, serif;
}

.site-footer {
  background: var(--primary);
  color: white !important;
  padding: 60px 0 40px;
  margin-top: 60px;
  position: relative;
  overflow: hidden;
}

.site-footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--gradient);
}

.site-footer .container,
.site-footer p,
.site-footer .container p {
  color: white !important;
  text-align: center;
  font-family: 'Crimson Text', serif;
}

.site-footer p {
  margin: 0;
  font-size: 1rem;
  opacity: 0.9;
}

.site-footer a {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 24px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.1);
  color: white !important;
  text-decoration: none;
  transition: var(--transition);
  backdrop-filter: blur(10px);
  font-family: 'Crimson Text', serif;
}

.site-footer a:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.4);
  color: white !important;
}

.site-footer a::after {
  display: none;
}

/* Logo footer - stile personalizzato che sovrascrive gli stili generali delle immagini */
.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.footer-text {
  flex: 1;
  text-align: left;
}

.footer-logo {
  width: auto !important;
  height: 60px !important;
  border: none !important;
  box-shadow: none !important;
  transform: none !important;
  transition: none !important;
  display: block !important;
  margin: 0 !important;
  /* Rimuove il margine auto che avevamo prima */
}

/* Per mobile: impila il contenuto */
@media (max-width: 768px) {
  .footer-content {
    flex-direction: column;
    text-align: center;
  }

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

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin: 32px 0;
}

.btn {
  appearance: none;
  border: none;
  background: var(--gradient);
  color: white;
  padding: 16px 32px;
  border-radius: var(--radius-lg);
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  letter-spacing: 0.5px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(93, 64, 55, 0.2);
  font-family: 'Crimson Text', serif;
  font-size: 1.1rem;
}

.btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transform: translate(-50%, -50%); /* 👈 centra davvero il cerchio */
  transition: width 0.6s, height 0.6s;
}

.btn:hover {
  box-shadow: 0 10px 25px rgba(93, 64, 55, 0.3);
}

.btn:hover::before {
  width: 300px;
  height: 300px;
}

.card .audio-box {
  margin-top: 2rem;
  padding: 2rem;
  border-radius: var(--radius);
  background: var(--gradient-subtle);
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
  transition: var(--transition);
  font-family: 'Crimson Text', serif;
}

.card .audio-box:hover {
  box-shadow: var(--shadow);
  border-color: var(--accent);
}

.card .audio-box::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--gradient);
}

.audio-title {
  font-weight: 700;
  margin-bottom: 0.8rem;
  font-size: 1.3rem;
  color: var(--primary);
  font-family: 'Crimson Text', serif;
}

.audio-description {
  font-size: 1rem;
  color: var(--muted);
  margin-bottom: 1.2rem;
  line-height: 1.6;
  font-family: 'Crimson Text', serif;
}

/* Video in rapporto fisso ma contenuto nel box da 200px */
.video-container {
  position: relative;
  overflow: hidden;
}

.video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

#map {
  width: 100%;
  height: 400px;
  border-radius: var(--radius);
  margin: 2rem 0;
  background: var(--gradient-subtle);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  position: relative;
  z-index: 10;
}

.popup-trigger {
  position: relative;
  color: var(--link);
  font-weight: 600;
  padding: 2px 4px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  background: var(--gradient-subtle);
  border-bottom: 2px solid var(--link);
  font-family: 'Crimson Text', serif;
}

.popup-trigger:hover {
  background: rgba(141, 110, 99, 0.1);
}

/* Overlay senza tremolio */
.popup-box {
  display: flex;
  justify-content: center;
  align-items: center;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  /* leggermente più scuro */
  /* backdrop-filter: blur(5px);  <-- rimosso */
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  /* forza layer separato per evitare tremolio */
  will-change: opacity;
}

.popup-box.show {
  opacity: 1;
  pointer-events: all;
}

.popup-content {
  background: var(--card);
  border-radius: var(--radius);
  padding: 32px;
  max-width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  transform: scale(0.95);
  opacity: 0;
  transition: transform 0.25s ease, opacity 0.25s ease;
  position: relative;
  font-family: 'Crimson Text', serif;
  /* forza layer separato */
  will-change: transform, opacity;
}

.popup-box.show .popup-content {
  transform: scale(1);
  opacity: 1;
}

/* Titoli e pulsanti */
.popup-content h3 {
  color: var(--primary);
  margin-bottom: 16px;
  font-size: 1.5rem;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.popup-content button {
  display: block;
  margin: 24px auto 0;
  padding: 12px 24px;
  background: var(--gradient);
  color: white;
  border: none;
  border-radius: var(--radius-lg);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 15px rgba(93, 64, 55, 0.2);
}

.popup-content button:hover {
  box-shadow: 0 8px 25px rgba(93, 64, 55, 0.3);
}

.menu-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: var(--gradient);
  color: white !important;
  font-weight: 600;
  border-radius: var(--radius-sm);
  text-decoration: none;
  text-align: center;
  box-shadow: 0 4px 12px rgba(93, 64, 55, 0.3);
  transition: var(--transition);
  margin-top: 12px;
  border: none;
  cursor: pointer;
  font-family: 'Crimson Text', serif;
}

.menu-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(93, 64, 55, 0.4);
  color: white !important;
}

.menu-btn:visited,
.menu-btn:active,
.menu-btn:focus {
  color: white !important;
}

.leaflet-popup-content .menu-btn {
  display: inline-block;
  /* inline-flex può dare problemi */
  padding: 6px 12px;
  /* riduci un po’ il padding */
  background: var(--gradient);
  color: white !important;
  font-weight: 600;
  border-radius: 6px;
  text-decoration: none;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  cursor: pointer;
  font-family: 'Crimson Text', serif;
}

.leaflet-popup-content .menu-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  background: var(--gradient);
  /* cambia gradient in hover */
  color: white !important;
}

/* ===================== MENU A TENDINA ===================== */

.punti-menu-container {
  margin: 50px 0 60px;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

.punti-description {
  text-align: center;
  color: var(--muted);
  margin-bottom: 40px;
  font-size: 1.2rem;
  line-height: 1.8;
  padding: 20px 30px;
  font-style: italic;
  background: var(--gradient-subtle);
  border-radius: var(--radius);
  border-left: 4px solid var(--accent);
  position: relative;
  font-family: 'Crimson Text', serif;
}

.punti-description::before {
  position: absolute;
  left: 30px;
  top: 50%;
  font-size: 1.5rem;
}

.punti-menu-wrapper {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(93, 64, 55, 0.1);
  margin: 40px 0;
}

.menu-toggle {
  width: 100%;
  padding: 26px 35px;
  background: var(--gradient);
  color: white;
  border: none;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  font-size: 1.5rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 10px 30px rgba(93, 64, 55, 0.2);
  position: relative;
  overflow: hidden;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  font-family: 'Crimson Text', serif;
  outline: none;
  border-bottom: none;
  z-index: 2;
}

.menu-toggle::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0));
  pointer-events: none;
  z-index: 1;
}

.menu-toggle span {
  position: relative;
  z-index: 2;
}

.menu-toggle:hover {
  background: var(--gradient);
  box-shadow: 0 15px 35px rgba(93, 64, 55, 0.3);
}

.menu-toggle.active {
  box-shadow: 0 10px 30px rgba(93, 64, 55, 0.2);
  border-bottom: none;
}

.menu-toggle.active .icon {
  transform: rotate(180deg);
}

.menu-toggle.active:hover {
  transform: none;
}

.menu-toggle.active:hover::before {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.05));
}

.punti-dropdown {
  display: none;
  background: var(--card);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  box-shadow: 0 20px 50px rgba(93, 64, 55, 0.1);
  margin-top: -1px;
  padding: 50px 60px 30px 60px;
  position: relative;
  overflow: hidden;
  border: 2px solid var(--border);
  border-top: none;
  z-index: 1;
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  max-height: 0;
  opacity: 0;
}

.punti-dropdown::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gradient);
  opacity: 0.3;
}

.punti-dropdown.active {
  display: block;
  max-height: 5000px !important;
  opacity: 1;
}

.punti-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 35px 50px;
  column-gap: 80px;
  position: relative;
  counter-reset: punto-counter;
  grid-auto-rows: minmax(110px, auto);
  align-items: start;
}

.punti-grid::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
  background: linear-gradient(to bottom,
      transparent 0%,
      var(--border) 20%,
      var(--border) 80%,
      transparent 100%);
  opacity: 0.5;
}

.punto-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  color: var(--text);
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  position: relative;
  overflow: visible;
  min-height: auto;
  counter-increment: punto-counter;
  box-shadow: none;
  margin-bottom: 25px;
  font-family: 'Crimson Text', serif;
  min-height: 90px;
  padding-top: 5px;
}

.punto-btn::before {
  content: counter(punto-counter, decimal-leading-zero);
  position: relative;
  top: -10px;
  right: auto;
  left: 0;
  font-size: 3.5rem;
  font-weight: 900;
  color: var(--primary);
  opacity: 0.15;
  background: none;
  width: auto;
  height: auto;
  border-radius: 0;
  display: block;
  margin-bottom: -30px;
  margin-left: -8px;
  font-family: 'Crimson Text', serif;
  line-height: 0.9;
  z-index: 1;
  transition: all 0.3s ease;
}

.punto-btn::after {
  display: none;
}

.titolo-principale {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.3;
  margin-bottom: 8px;
  position: relative;
  z-index: 2;
  display: block;
  transition: all 0.3s ease;
  padding-right: 10px;
  font-family: 'Crimson Text', serif;
}

.sottotitolo {
  font-size: 1.1rem;
  font-weight: 400;
  color: var(--muted);
  line-height: 1.4;
  font-style: italic;
  margin-bottom: 5px;
  z-index: 2;
  transition: all 0.3s ease;
  display: block;
  font-family: 'Crimson Text', serif;
}

.etichetta-punto {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 5px;
  position: relative;
  z-index: 2;
  transition: all 0.3s ease;
  display: block;
  font-family: 'Crimson Text', serif;
}

.icona-emoji {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 2.5rem;
  opacity: 0.2;
  z-index: 1;
  transition: all 0.3s ease;
  transform-origin: center;
}

.punto-btn:hover .titolo-principale {
  color: var(--accent);
  text-shadow: 0 2px 10px rgba(160, 82, 45, 0.1);
}

.punto-btn:hover .sottotitolo {
  color: var(--text);
}

.punto-btn:hover .etichetta-punto {
  color: var(--link);
}

.punto-btn:hover .icona-emoji {
  opacity: 0.4;
  transform: scale(1.2) rotate(5deg);
}

.punto-btn:hover::before {
  opacity: 0.25;
  transform: scale(1.05);
}

.punto-btn.current {
  padding-left: 15px;
  border-left: 4px solid var(--accent);
}

.punto-btn.current::before {
  opacity: 0.3;
  color: var(--accent);
}

.punto-btn.current .titolo-principale {
  color: var(--accent);
}

.punto-btn.current .etichetta-punto {
  color: var(--accent);
  font-weight: 700;
}

/* ===================== STILI PER DISTANZE GPS ===================== */

.distanza-punto {
  display: inline-block;
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 600;
  margin-top: 8px;
  padding: 3px 10px;
  background: var(--gradient-subtle);
  border-radius: 12px;
  border: 1px solid var(--border);
  transition: all 0.3s ease;
  font-family: 'Crimson Text', serif;
}

.punto-btn:hover .distanza-punto {
  background: var(--gradient);
  color: white;
  box-shadow: 0 4px 12px rgba(93, 64, 55, 0.2);
}

.punto-btn.punto-vicino {
  background: rgba(160, 82, 45, 0.05);
  border-left: 4px solid var(--accent);
  padding-left: 15px;
  margin-left: -15px;
}

.punto-btn.punto-vicino .distanza-punto {
  background: var(--gradient);
  color: white;
  font-weight: 700;
  border-color: var(--accent);
}

.piu-vicino-indicator {
  position: absolute;
  top: -8px;
  right: -8px;
  background: var(--accent);
  color: white;
  font-size: 0.7rem;
  padding: 3px 8px;
  border-radius: 12px;
  font-weight: bold;
  z-index: 10;
  box-shadow: 0 2px 8px rgba(160, 82, 45, 0.3);
}

/* ===================== RESPONSIVE ===================== */

@media (max-width: 1100px) {
  .punti-grid {
    gap: 30px 40px;
    column-gap: 60px;
    grid-auto-rows: minmax(100px, auto);
  }

  .titolo-principale {
    font-size: 1.5rem;
  }

  .punto-btn::before {
    font-size: 3rem;
  }

  .punti-dropdown {
    padding: 40px 50px 25px 50px;
  }

  .punto-btn {
    min-height: 85px;
    margin-bottom: 20px;
  }

  .distanza-punto {
    font-size: 0.85rem;
    padding: 2px 9px;
  }
}

@media (max-width: 900px) {
  .punti-grid {
    grid-template-columns: 1fr;
    gap: 25px;
    grid-auto-rows: minmax(95px, auto);
  }

  .punti-grid::before {
    display: none;
  }

  .punti-dropdown {
    padding: 35px 40px 20px 40px;
  }

  .menu-toggle {
    padding: 22px 30px;
    font-size: 1.4rem;
  }

  .titolo-principale {
    font-size: 1.4rem;
  }

  .icona-emoji {
    font-size: 2.2rem;
  }

  .punto-btn {
    min-height: 80px;
    margin-bottom: 18px;
  }

  .punto-btn::before {
    margin-bottom: -22px;
  }

  body {
    font-size: 1.05rem;
  }
}

@media (max-width: 767px) {
  .punti-menu-wrapper {
    margin: 30px 0;
    border-radius: var(--radius-sm);
  }

  .menu-toggle {
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    padding: 18px 24px;
    font-size: 1.1rem;
  }

  .punti-dropdown {
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    padding: 24px;
  }

  .punti-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .punto-btn {
    padding: 14px 8px;
    font-size: 0.95rem;
    min-height: 75px;
    margin-bottom: 20px;
  }

  .punto-btn::before {
    font-size: 2.5rem;
    margin-bottom: -18px;
  }

  .titolo-principale {
    font-size: 1.3rem;
    line-height: 1.25;
  }

  .sottotitolo {
    font-size: 1rem;
    margin-bottom: 3px;
  }

  .icona-emoji {
    font-size: 2rem;
    top: 8px;
    right: 8px;
  }

  .distanza-punto {
    font-size: 0.8rem;
    padding: 2px 8px;
    margin-top: 6px;
  }

  .piu-vicino-indicator {
    font-size: 0.6rem;
    padding: 2px 6px;
    top: -5px;
    right: -5px;
  }

  .punto-btn .etichetta-punto,
  .punto-btn .sottotitolo {
    margin-bottom: 2px;
  }

  .card {
    padding: 24px;
  }

  .card .audio-box {
    margin-top: 1.5rem !important;
    padding: 1.25rem !important;
    margin-left: -12px !important;
    margin-right: -12px !important;
    width: calc(100% + 24px) !important;
    border-radius: calc(var(--radius) - 4px) !important;
    overflow: visible !important;
    position: relative;
    left: -4px;
  }
}

@media (max-width: 400px) {
  .punto-btn::before {
    font-size: 2.2rem;
    margin-bottom: -16px;
  }

  .titolo-principale {
    font-size: 1.2rem;
    line-height: 1.2;
  }

  .menu-toggle {
    font-size: 1.2rem;
    padding: 18px 20px;
  }

  .menu-toggle .icon {
    font-size: 1.6rem;
  }

  .punto-btn {
    min-height: 70px;
    margin-bottom: 16px;
  }

  .distanza-punto {
    font-size: 0.75rem;
    padding: 1px 6px;
  }
}

/* ===================== ALTRI STILI ===================== */

.page-nav-simple {
  display: flex;
  justify-content: space-between;
  margin: 30px 0;
  gap: 10px;
  font-family: 'Crimson Text', serif;
}

.nav-simple {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: var(--gradient-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-weight: 500;
  font-size: 0.95rem;
  text-decoration: none;
  transition: var(--transition);
  font-family: 'Crimson Text', serif;
}

.nav-simple:hover {
  background: var(--gradient);
  color: white !important;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(93, 64, 55, 0.2);
}

.nav-simple .icon {
  font-size: 0.9rem;
  font-weight: bold;
}

.nav-simple.disabled {
  opacity: 0.4;
  pointer-events: none;
  cursor: default;
}

.card.collapsed .card-content {
  display: none;
}

/* ===================== ANIMAZIONI ===================== */

@keyframes fadeInUpItem {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.punto-btn {
  animation: fadeInUpItem 0.6s ease forwards;
  animation-delay: calc(var(--item-index, 0) * 0.05s);
  opacity: 0;
}

.punto-btn:nth-child(even) {
  --item-index: 1;
}

.punto-btn:nth-child(odd) {
  --item-index: 2;
}

.fade-in {
  opacity: 0;
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in.visible {
  opacity: 1;
}

/* ===================== HERO SECTION ===================== */

.hero-section {
  text-align: center;
  padding: 8rem 1rem;
  width: 100%;
  height: 100vh;
  margin: 0;
  background-image: linear-gradient(to bottom,
      rgba(0, 0, 0, 0.2),
      rgba(0, 0, 0, 0.4)), url('../sfondo.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.hero-section::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 150px;
  background: linear-gradient(to bottom,
      transparent,
      rgba(255, 255, 255, 0.8));
  z-index: 1;
  pointer-events: none;
}

.hero-section .container {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 800px;
}

.hero-subtitle {
  font-size: 1.2rem;
  color: #a0a0a0;
  margin-bottom: 0.5rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  font-weight: 400;
}

.hero-title {
  font-size: 4rem;
  font-weight: 300;
  margin: 0 0 1.5rem 0;
  line-height: 1.1;
  color: #ffffff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.hero-description {
  font-size: 1.3rem;
  color: #d4d4d4;
  margin-bottom: 3rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.hero-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 2.5rem;
}

.hero-btn {
  background: transparent;
  color: #f5f5f5;
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 1rem 2.5rem;
  font-size: 1rem;
  text-decoration: none;
  border-radius: 0;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.hero-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.6);
}

.scroll-down-btn {
  position: absolute;
  bottom: 40px;
  left: 50%;
  width: 50px;
  height: 50px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  animation: pulse 2s infinite;
}

.scroll-down-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: white;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.4);
  }

  70% {
    box-shadow: 0 0 0 15px rgba(255, 255, 255, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
  }
}

/* ===================== ACCESSIBILITY & UTILITY ===================== */

::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb {
  background: var(--gradient);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, #7d5c4c 0%, #4e342e 100%);
}

.leaflet-tile {
  border: none;
  image-rendering: crisp-edges;
}

.leaflet-marker-icon {
  border: none !important;
  box-shadow: none !important;
}

.gps-control {
  margin-top: 1.5rem;
  text-align: center;
  padding: 1rem;
  background-color: #f8f9fa;
  border-radius: 8px;
}

.gps-status {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: #666;
  min-height: 1.2rem;
}

.gps-status.active {
  color: #28a745;
  font-weight: 500;
}

.user-marker {
  color: #28a745;
  font-size: 20px;
  text-align: center;
  font-weight: bold;
}

.nearest-marker {
  filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.5));
}

/* ===================== FIX PER MOBILE ===================== */

@media (max-width: 767px) {
  html {
    scroll-padding-top: 70px;
  }

  .header-title-wrapper {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    margin-top: 48px !important;
    padding-top: 8px !important;
  }

  .subtitle {
    top: 0;
    font-size: 1rem;
  }

  .site-header h1 {
    font-size: 2rem;
    white-space: normal;
    padding-right: 60px !important;
    max-width: 100% !important;
  }

  .lang-switch {
    top: 16px !important;
    right: 16px !important;
    padding: 4px 10px !important;
    font-size: 0.8rem !important;
    background: rgba(255, 254, 249, 0.85) !important;
  }

  .content {
    padding: 32px 0 48px;
  }

  .card {
    padding: 24px;
  }

  #map {
    height: 300px;
    margin: 1.5rem 0;
  }

  .note {
    padding: 20px 24px;
    font-size: 1.1rem;
  }

  .note::before {
    font-size: 3rem;
    left: 15px;
    top: -15px;
  }

  .btn {
    padding: 14px 24px;
    font-size: 1rem;
  }

  .btn-row {
    gap: 12px;
    margin: 24px 0;
  }

  .menu-btn {
    padding: 8px 16px;
    font-size: 0.9rem;
  }

  .container {
    padding: 0 16px !important;
  }

  .hero-section {
    height: 85vh;
    min-height: 600px;
    padding: 4rem 1rem 6rem;
    background-position: center center;
    background-attachment: scroll;
  }

  .hero-section::after {
    height: 180px;
    background: linear-gradient(to bottom,
        transparent,
        rgba(255, 255, 255, 0.9) 90%);
  }

  .hero-title {
    font-size: 2.2rem !important;
    line-height: 1.15 !important;
    margin: 0.5rem 0 1.2rem 0 !important;
    padding: 0 10px;
  }

  .hero-subtitle {
    font-size: 0.9rem !important;
  }

  .hero-description {
    font-size: 1rem !important;
    padding: 0 15px;
  }

  .hero-buttons {
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
    padding: 0 20px;
  }

  .hero-btn {
    width: 100% !important;
    max-width: 280px;
    padding: 0.9rem 1.5rem;
    font-size: 0.95rem;
  }

  .scroll-down-btn {
    bottom: 25px;
    width: 42px;
    height: 42px;
    font-size: 1.2rem;
  }
}

@media (max-width: 375px) {
  .container {
    padding: 0 12px !important;
  }

  .card {
    padding: 18px 14px !important;
    margin-left: -6px !important;
    margin-right: -6px !important;
    width: calc(100% + 12px) !important;
  }

  .lang-switch {
    right: 12px !important;
    font-size: 0.75rem !important;
    padding: 3px 8px !important;
  }

  .site-header h1 {
    font-size: 1.6rem !important;
    padding-right: 50px !important;
  }

  .subtitle {
    font-size: 0.95rem !important;
  }

  h2 {
    font-size: 1.4rem !important;
  }

  .note {
    padding: 16px 20px !important;
    font-size: 1rem !important;
  }

  .note::before {
    font-size: 2.5rem !important;
    left: 12px !important;
  }

  .hero-section {
    height: 80vh;
    min-height: 550px;
    padding: 3rem 0.8rem 5rem;
  }

  .hero-title {
    font-size: 1.9rem !important;
    padding: 0 8px;
  }

  .hero-description {
    font-size: 0.95rem !important;
    padding: 0 10px;
  }

  .hero-btn {
    max-width: 250px;
    padding: 0.8rem 1.2rem;
    font-size: 0.9rem;
  }

  .scroll-down-btn {
    width: 38px;
    height: 38px;
    bottom: 20px;
  }
}

@media (min-width: 768px) {
  :root {
    --pad: 40px;
  }

  html {
    scroll-padding-top: 90px;
  }

  .lang-switch {
    top: 28px;
  }

  .site-header h1 {
    font-size: 2.5rem;
  }

  .subtitle {
    font-size: 1.3rem;
  }

  h2 {
    font-size: 2.2rem;
  }

  .card {
    padding: 40px;
  }

  .btn-row {
    justify-content: flex-start;
  }

  .note {
    padding: 40px;
    margin: 40px auto;
    max-width: 90%;
  }

  .punti-menu-wrapper {
    margin: 50px 0;
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .lang-switch {
    top: 20px !important;
    right: 20px !important;
  }

  .header-title-wrapper {
    margin-top: 40px !important;
    padding-right: 80px !important;
  }

  .card .audio-box {
    padding: 1.75rem !important;
    margin-left: -16px !important;
    margin-right: -16px !important;
    width: calc(100% + 32px) !important;
  }

  .hero-section {
    height: 90vh;
    min-height: 700px;
    padding: 6rem 2rem;
  }

  .hero-title {
    font-size: 3rem !important;
    line-height: 1.2;
  }

  .hero-description {
    font-size: 1.2rem !important;
    max-width: 80%;
  }

  .hero-buttons {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
  }

  .hero-btn {
    min-width: 180px;
  }
}

@media (min-width: 1024px) {
  .site-header h1 {
    font-size: 3rem;
  }

  .card {
    padding: 48px;
  }

  .content {
    padding: 60px 0 80px;
  }

  section {
    margin: 60px 0;
  }

  .punti-grid {
    gap: 40px 60px;
  }

  body {
    font-size: 1.15rem;
  }

  p {
    font-size: 1.2rem;
  }
}


/* Galleria immagini */
.media-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.gallery-item {
  margin: 0;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  overflow: hidden;
}

/* Contenitore comune per immagine e video — stessa altezza */
.gallery-item img,
.gallery-item .video-container {
  width: 100%;
  height: 200px;
  display: block;
  flex-shrink: 0;
}

.gallery-item img {
  object-fit: cover;
  transition: transform 0.3s ease;
}

.gallery-item:hover img {
  transform: scale(1.05);
}

.gallery-item figcaption {
  font-size: 0.85rem;
  padding: 10px;
  font-style: italic;
  color: #555;
  flex-grow: 1;
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.lightbox img {
  max-width: 90%;
  max-height: 90%;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.6);
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 30px;
  font-size: 36px;
  color: white;
  cursor: pointer;
}


.site-footer {
  background: var(--primary);
  /* marrone scuro tema storico */
  color: var(--accent-light);
  /* testo chiaro per contrasto */
  padding: 40px 0;
  font-family: 'Crimson Text', serif;
  /* coerente col menu */
}

.site-footer a {
  color: var(--accent-light);
  /* link chiaro, visibile sul marrone */
  text-decoration: underline;
}

.footer-content {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 20px;
}

.footer-text {
  flex: 1;
  min-width: 200px;
}

.footer-section-title {
  font-weight: bold;
  border-bottom: 2px solid var(--accent-light);
  /* riga visibile chiara */
  padding-bottom: 5px;
  margin-bottom: 10px;
}

/* link solo testuale, niente pulsante */
.site-footer a.text-link {
  display: inline;
  /* non inline-flex */
  padding: 0;
  /* niente spazio extra */
  border: none;
  /* niente bordo */
  border-radius: 0;
  /* niente arrotondamento */
  background: none;
  /* niente sfondo */
  color: var(--accent-light);
  /* colore coerente col footer */
  text-decoration: underline;
  /* solo sottolineatura */
  font-family: 'Crimson Text', serif;
}

.lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.lightbox-content {
  width: 80%;
  max-width: 900px;
}

.lightbox video {
  width: 100%;
  border-radius: 10px;
}