/* ==========================================================================
   RESET & VARIABILI
   ========================================================================== */
*, *::before, *::after { 
  box-sizing: border-box; 
  margin: 0; 
  padding: 0; 
  -webkit-tap-highlight-color: transparent; 
}

:root {
  --gold: #c9a84c; --gold-light: #e8c97a; --gold-dark: #9a7a2e;
  --cream: #f5f0e8; --cream-dark: #ede5d4;
  --dark: #121212; --dark-mid: #1c1c1c; --dark-light: #2a2a2a;
  --white: #fdfaf4;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
}

/* Barra di scorrimento laterale personalizzata (globale per tutte le pagine ed elementi a scorrimento) */
html { 
  scroll-behavior: smooth; 
}

* {
  scrollbar-width: thin; 
  scrollbar-color: rgba(201, 168, 76, 0.4) rgba(18, 18, 18, 0.5); 
}

::-webkit-scrollbar { 
  width: 8px; 
  height: 8px; 
}

::-webkit-scrollbar-track { 
  background: rgba(18, 18, 18, 0.5); 
}

::-webkit-scrollbar-thumb { 
  background: rgba(201, 168, 76, 0.35); 
  border-radius: 10px; 
  border: 2px solid transparent; 
  background-clip: padding-box; 
}

::-webkit-scrollbar-thumb:hover { 
  background: rgba(201, 168, 76, 0.75); 
}

::-webkit-scrollbar-thumb:active { 
  background: var(--gold); 
}

::-webkit-scrollbar-corner { 
  background: transparent; 
}
body { 
  font-family: 'EB Garamond', Georgia, serif; 
  background: var(--dark); 
  color: var(--cream); 
  overflow-x: hidden; 
  line-height: 1.6; 
}
body.bio-page { line-height: 1.7; }

/* Blocca lo scorrimento della pagina quando è aperto il Menù o il Lightbox */
html.scroll-locked, body.scroll-locked {
  overflow: hidden !important;
  overscroll-behavior: none;
}

/* Web Components: prevengono sfarfallii di layout durante il caricamento */
site-nav, site-footer { display: block; }

/* --- EFFETTO SPLASH PAGE: Nasconde il menù iniziale nella Home Page e lo fa apparire allo scroll --- */
body.home-page site-nav nav {
  transform: translateY(-100%);
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
body.home-page.show-nav site-nav nav {
  transform: translateY(0);
}
body.home-page .hero { padding-top: 2rem; } /* Centra perfettamente il titolo visto che non c'è più l'ingombro del menù in alto */

body::before {
  content: ''; position: fixed; inset: 0;
  background-image: radial-gradient(ellipse at 20% 20%, rgba(201,168,76,0.06) 0%, transparent 50%), radial-gradient(ellipse at 80% 80%, rgba(201,168,76,0.04) 0%, transparent 50%);
  pointer-events: none; z-index: 0;
}
iframe { position: relative; z-index: 0 !important; }

/* ==========================================================================
   ANIMAZIONI FADE-IN ON SCROLL
   ========================================================================== */
.fade-in-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}
.fade-in-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.article-block.fade-in-on-scroll {
  transition-delay: var(--animation-delay, 0s);
}

/* ==========================================================================
   NAVIGAZIONE GLOBALE
   ========================================================================== */
nav { 
  position: fixed; top: 0; left: 0; right: 0; z-index: 9999; 
  background: rgba(18, 18, 18, 0.95); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(201,168,76,0.2); padding: 0 2rem; 
}
.nav-inner { max-width: 1200px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; height: 80px; }
.nav-logo { font-family: 'Cinzel', serif; font-size: 1.5rem; font-weight: 600; color: var(--gold); letter-spacing: 0.15em; text-decoration: none; display: flex; align-items: center; line-height: 1; margin-top: -2px; }
.nav-logo span { font-weight: 400; color: var(--cream); }

.nav-menu { display: flex; list-style: none; gap: 2.5rem; margin-left: auto; }
.nav-menu > li { position: relative; }
/* Stile applicato ai link classici e ai nuovi bottoni */
.nav-menu > li > a, .nav-menu > li > span, .nav-menu > li > button.main-artist-trigger { 
  position: relative; display: flex; align-items: center; padding: 0.5rem 1.2rem; font-family: 'Cormorant Garamond', serif; 
  font-size: 1.05rem; font-style: italic; color: var(--cream-dark); text-decoration: none; 
  cursor: pointer; transition: color 0.3s; letter-spacing: 0.05em;
  background: transparent; border: none; outline: none; /* Rimuove l'effetto "esplora file" */
}
.nav-menu > li > a::after, .nav-menu > li > span::after, .nav-menu > li > button.main-artist-trigger::after {
  content: ''; position: absolute; bottom: 2px; left: 50%; width: 0; height: 1px; background: var(--gold); transition: width 0.3s ease, left 0.3s ease;
}
@media (hover: hover) {
  .nav-menu > li:hover > a::after, .nav-menu > li:hover > span::after, .nav-menu > li:hover > button.main-artist-trigger::after {
    width: 50%; left: 25%;
  }
  .nav-menu > li > a:hover, .nav-menu > li > span:hover, .nav-menu > li > button.main-artist-trigger:hover { color: var(--gold); }
}

/* Freccia indicator per i menu */
.chevron { width: 18px; height: 18px; fill: currentColor; margin-left: 4px; transition: transform 0.3s ease; vertical-align: middle; }
.submenu.active > .submenu-toggle .chevron { transform: rotate(-90deg); }
@media (hover: hover) {
  .nav-menu li:hover > .mobile-trigger .chevron { transform: rotate(180deg); }
}

/* Stili per le Info Artista nel menù (su PC nascoste, la struttura resta testo semplice) */
.artist-menu-avatar, .artist-menu-role { display: none; }
.main-artist-trigger { display: flex; align-items: center; gap: 4px; }
.artist-menu-info { display: contents; }

/* Reset per le nuove liste semantiche */
.dropdown, .subdropdown, .hero-dropdown, .hero-subdropdown { list-style: none; margin: 0; padding: 0; }

.dropdown { 
  position: absolute; top: 100%; left: 0; min-width: 220px; 
  background: rgba(15, 15, 15, 0.95); backdrop-filter: blur(15px); -webkit-backdrop-filter: blur(15px);
  border: 1px solid rgba(201,168,76,0.15); border-radius: var(--radius-lg); 
  box-shadow: 0 15px 35px rgba(0,0,0,0.4); padding: 0.5rem 0;
  opacity: 0; pointer-events: none; 
  transform: translateY(15px) scale(0.98); 
  transition: opacity 0.4s ease 0.15s, transform 0.4s ease 0.15s; z-index: 200; 
}
@media (hover: hover) {
  .nav-menu > li:hover > .dropdown { opacity: 1; pointer-events: auto; transform: translateY(0) scale(1); transition-delay: 0s; }
}

.dropdown a, .submenu-toggle { 
  display: block; padding: 0.6rem 1.2rem; font-family: 'Cinzel', serif; 
  font-size: 0.8rem; letter-spacing: 0.15em; text-transform: uppercase; color: var(--cream-dark); text-decoration: none; 
  margin: 0.2rem 0.5rem; border-radius: var(--radius-md);
  transition: color 0.3s, transform 0.3s; cursor: pointer;
  background: transparent; border: none; text-align: left; width: calc(100% - 1rem); /* Reset bottone */
}
.dropdown a.active, .dropdown a.current-page, .submenu.active > .submenu-toggle, .submenu.current-section > .submenu-toggle { color: var(--gold-light); }
@media (hover: hover) {
  .dropdown a:hover, .submenu-toggle:hover { background: transparent; color: var(--gold); transform: translateX(5px); }
}

.submenu { position: relative; }
.subdropdown { 
  position: absolute; left: calc(100% + 5px); top: -0.5rem; min-width: 220px; 
  background: rgba(15, 15, 15, 0.95); backdrop-filter: blur(15px); -webkit-backdrop-filter: blur(15px);
  border: 1px solid rgba(201,168,76,0.15); border-radius: var(--radius-lg); 
  box-shadow: 0 15px 35px rgba(0,0,0,0.4); padding: 0.5rem 0;
  opacity: 0; pointer-events: none; transform: translateX(-10px); 
  transition: opacity 0.4s ease 0.15s, transform 0.4s ease 0.15s; z-index: 300; 
}
.subdropdown::before { content: ''; position: absolute; top: 0; left: -10px; width: 10px; height: 100%; }
/* Da PC, il sottomenù Opere si apre solo al click (classe .active) */
.submenu.active > .subdropdown { opacity: 1; pointer-events: auto; transform: translateX(0); transition-delay: 0s; }
@media (hover: hover) {
  .submenu:hover > .subdropdown { opacity: 1; pointer-events: auto; transform: translateX(0); transition-delay: 0s; }
}
.subdropdown a { display: block; padding: 0.6rem 1.2rem; font-family: 'Cinzel', serif; font-size: 0.75rem; letter-spacing: 0.15em; text-transform: uppercase; text-decoration: none; color: var(--cream-dark); margin: 0.2rem 0.5rem; border-radius: var(--radius-md); transition: color 0.3s, transform 0.3s;}
.subdropdown a.active, .subdropdown a.current-page { color: var(--gold-light); }
@media (hover: hover) {
  .subdropdown a:hover { background: transparent; color: var(--gold); transform: translateX(5px); }
}

.mobile-nav-actions { display: none; }
.hamburger { display: none; cursor: pointer; padding: 6px; background: transparent; border: none; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.hamburger img {
  width: 36px; height: 36px;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ==========================================================================
   INTESTAZIONI DELLE PAGINE (HERO)
   ========================================================================== */
.page-hero { position: relative; z-index: 1; padding: 180px 2rem 5rem; text-align: center; }
.page-tag { font-family: 'Cinzel', serif; font-size: 0.7rem; letter-spacing: 0.4em; color: var(--gold); display: block; margin-bottom: 1rem; text-transform: uppercase; }
.page-title { font-family: 'Cormorant Garamond', serif; font-size: clamp(3rem, 8vw, 5rem); font-weight: 400; font-style: italic; color: var(--white); margin-bottom: 1rem; line-height: 1.1; }
.page-rule { width: 40px; height: 1px; background: var(--gold); margin: 0 auto; }

/* Variabile Intestazione per le Biografie */
.bio-hero { position: relative; padding: 140px 2rem 5rem; text-align: center; background: linear-gradient(180deg, rgba(201,168,76,0.05) 0%, transparent 100%); border-bottom: 1px solid rgba(201,168,76,0.1); overflow: hidden; }
.bio-hero::before, .bio-hero::after { content: ''; position: absolute; width: 40vw; height: 40vw; max-width: 400px; max-height: 400px; background: radial-gradient(circle, rgba(201,168,76,0.08) 0%, transparent 70%); border-radius: 50%; pointer-events: none; z-index: 0; }
.bio-hero::before { top: -20%; left: -10%; }
.bio-hero::after  { bottom: -20%; right: -10%; }
.bio-hero > * { position: relative; z-index: 1; }

/* ==========================================================================
   SISTEMA DI GALLERIE (MASONRY GRID)
   ========================================================================== */
main { position: relative; z-index: 1; }
.gallery-grid {
  max-width: 1400px; margin: 0 auto; padding: 0 2rem 10rem;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  grid-auto-rows: 250px; gap: 25px;
}
/* Modificatori di altezza e larghezza per le varie sezioni d'arte */
.gallery-grid.masonry-200 { grid-auto-rows: 200px; }
.gallery-grid.masonry-300 { grid-auto-rows: 300px; }
.gallery-grid.masonry-murales { grid-auto-rows: 400px; grid-template-columns: repeat(auto-fill, minmax(350px, 1fr)); }

.art-item {
  position: relative; overflow: hidden; background: #111;
  border-radius: var(--radius-md);
  cursor: pointer;
}

/* Modificatori "Span" per l'occupazione delle righe */
.art-item.tall { grid-row: span 2; }
.art-item.medium { grid-row: span 1; }
.art-item.small { grid-row: span 1; }
.art-item.span-3 { grid-row: span 3; }
.art-item.span-2 { grid-row: span 2; }

/* Stile specifico per Sculture e Restauri */
.gallery-sculture .art-item { border: 1px solid rgba(201,168,76,0.1); }
.gallery-sculture .art-overlay { align-items: flex-start; }
.gallery-sculture .art-title { font-size: 1.1rem; text-shadow: 0 2px 4px rgba(0,0,0,0.8); margin-bottom: 0.4rem; }
.angle-badge { display: inline-block; background: rgba(18,18,18,0.8); border: 1px solid var(--gold); color: var(--cream); font-family: 'EB Garamond', serif; font-size: 0.75rem; padding: 0.2rem 0.6rem; border-radius: 20px; font-style: italic; box-shadow: 0 4px 10px rgba(0,0,0,0.5); }

.art-item img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 1.5s cubic-bezier(0.19, 1, 0.22, 1);
  filter: grayscale(0.1) brightness(0.9);
}
@media (hover: hover) {
  .art-item:hover img { transform: scale(1.05); filter: grayscale(0) brightness(1.1); }
  .gallery-grid.masonry-200 .art-item:hover img { transform: scale(1.08); }
}
/* Focus per accessibilità da tastiera */
.art-item:focus-visible { outline: 3px solid var(--gold); outline-offset: 4px; border-radius: var(--radius-md); }

.art-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(18,18,18,0.95) 0%, transparent 60%);
  display: flex; flex-direction: column; justify-content: flex-end; padding: 1.5rem;
  opacity: 0; transition: opacity 0.4s ease; pointer-events: none;
}
@media (hover: hover) {
  .art-item:hover .art-overlay { opacity: 1; }
}
.art-title { font-family: 'Cinzel', serif; font-size: 0.95rem; color: var(--gold); letter-spacing: 0.05em; margin-bottom: 0.2rem; }

/* ==========================================================================
   LIGHTBOX (Visualizzatore Immagini Ingrandite)
   ========================================================================== */
#lightbox {
  position: fixed; inset: 0; background: rgba(10,10,10,0.92); z-index: 10000;
  display: none; align-items: center; flex-direction: column; cursor: zoom-out;
  overflow-y: auto; padding: 3.5rem 1rem;
  overscroll-behavior: none;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  animation: lbFadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes lbFadeIn {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}
#lightbox-img-container { position: relative; max-width: 90%; max-height: 65vh; flex-shrink: 0; display: flex; align-items: center; justify-content: center; margin-top: auto; }
#lightbox img { 
  max-width: 100%; max-height: 65vh; 
  border: 1px solid rgba(201,168,76,0.35); 
  box-shadow: 0 25px 60px rgba(0,0,0,0.7), 0 0 30px rgba(201,168,76,0.12); 
  border-radius: var(--radius-sm);
  object-fit: contain; 
  transition: opacity 0.2s ease, transform 0.3s ease; 
  cursor: zoom-out; 
}

.lb-nav { 
  position: absolute; top: 50%; transform: translateY(-50%); 
  color: var(--gold); font-size: 2.2rem; cursor: pointer; user-select: none; 
  width: 52px; height: 52px; display: flex; align-items: center; justify-content: center;
  background: rgba(18,18,18,0.65); border: 1px solid rgba(201,168,76,0.25); border-radius: 50%;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  z-index: 1002; transition: all 0.3s ease; opacity: 0.85; 
}
@media (hover: hover) {
  .lb-nav:hover { color: #fff; opacity: 1; border-color: var(--gold); background: rgba(201,168,76,0.25); transform: translateY(-50%) scale(1.08); }
}
#lb-prev { left: -65px; }
#lb-next { right: -65px; }
@media (max-width: 768px) {
  #lb-prev { left: 4px; width: 44px; height: 44px; font-size: 1.8rem; }
  #lb-next { right: 4px; width: 44px; height: 44px; font-size: 1.8rem; }
}
.lb-counter { 
  position: absolute; bottom: -32px; left: 50%; transform: translateX(-50%); 
  font-family: 'Cinzel', serif; font-size: 0.85rem; color: var(--gold-light); letter-spacing: 2px;
  background: rgba(15,15,15,0.7); padding: 0.2rem 0.8rem; border-radius: 20px; border: 1px solid rgba(201,168,76,0.2);
}

#lightbox-info { margin-top: 1.5rem; text-align: center; max-width: 800px; padding: 0 1rem 2rem; flex-shrink: 0; margin-bottom: auto; cursor: default; }
#lb-title { font-family: 'Cinzel', serif; font-size: 1.3rem; color: var(--gold); margin-bottom: 0.5rem; display: block; }
#lb-desc { font-family: 'Cormorant Garamond', serif; font-size: 1.15rem; color: var(--cream); font-style: italic; line-height: 1.45; }
.close-btn { 
  position: absolute; top: 25px; right: 30px; 
  background: rgba(18,18,18,0.65); border: 1px solid rgba(201,168,76,0.3); border-radius: 25px;
  padding: 0.45rem 1.1rem;
  color: var(--gold); font-family: 'Cinzel', serif; font-size: 0.85rem; cursor: pointer; letter-spacing: 2px; z-index: 1001; 
  transition: all 0.3s ease; 
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
@media (hover: hover) {
  .close-btn:hover { color: var(--gold-light); border-color: var(--gold); background: rgba(201,168,76,0.2); transform: translateY(-2px); }
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
footer { background: #0a0a0a; padding: 3rem 2rem; text-align: center; border-top: 1px solid rgba(201,168,76,0.1); position: relative; z-index: 2; }
.footer-logo { font-family: 'Cinzel', serif; font-size: 1.5rem; color: var(--gold); letter-spacing: 0.2em; margin-bottom: 1rem; }
.footer-copy { font-family: 'EB Garamond', serif; font-size: 0.9rem; color: rgba(245,240,232,0.5); }
.social-links { margin-top: 1rem; }
.social-links a { color: var(--gold); text-decoration: none; margin: 0 10px; font-family: 'Cinzel', serif; letter-spacing: 0.1em; }
.social-row { display: flex; align-items: center; justify-content: center; gap: 1.5rem; margin-top: 1rem; }
.social-link { display: inline-flex; align-items: center; gap: 0.6rem; padding: 0.5rem 1.4rem; border: 1px solid rgba(201,168,76,0.3); color: var(--cream-dark); text-decoration: none; font-family: 'Cinzel', serif; font-size: 0.65rem; letter-spacing: 0.2em; transition: all 0.3s; }
.social-link svg { width: 14px; height: 14px; fill: currentColor; }
@media (hover: hover) {
  .social-link:hover { color: var(--gold); border-color: var(--gold); background: rgba(201,168,76,0.07); }
}

/* ==========================================================================
   HOME PAGE (index.html)
   ========================================================================== */
.hero { position: relative; z-index: 10; min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 100px 2rem 4rem; }
.hero-bg { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(18,18,18,0.3) 0%, rgba(18,18,18,0.7) 60%, var(--dark) 100%); z-index: 1; }
.hero-content { position: relative; z-index: 3; }
.hero-eyebrow { font-family: 'Cinzel', serif; font-size: 0.7rem; letter-spacing: 0.4em; color: var(--gold); margin-bottom: 1.5rem; text-transform: uppercase; }
.hero-title { font-family: 'Cormorant Garamond', serif; font-size: clamp(3.5rem, 10vw, 8rem); font-weight: 400; font-style: italic; color: var(--white); line-height: 0.9; margin-bottom: 1rem; }
.hero-title em { font-style: normal; color: var(--gold); }
.hero-subtitle { font-family: 'EB Garamond', serif; font-size: 1.1rem; font-style: italic; color: rgba(245,240,232,0.65); letter-spacing: 0.08em; margin-bottom: 3rem; }
.hero-divider { width: 60px; height: 1px; background: var(--gold); margin: 0 auto 3rem; }
.hero-artists { display: flex; gap: 3rem; justify-content: center; align-items: flex-start; }
.hero-artist-link { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; font-family: 'Cinzel', serif; font-size: 1rem; letter-spacing: 0.25em; color: var(--cream-dark); text-decoration: none; padding: 1rem 3rem; border: 1px solid rgba(201,168,76,0.4); border-radius: 40px; background: rgba(18,18,18,0.6); backdrop-filter: blur(8px); box-shadow: 0 10px 30px rgba(0,0,0,0.3); cursor: pointer; user-select: none; transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1); }
.hero-menu-wrapper.active > .hero-artist-link { color: var(--white); border-color: var(--gold); background: rgba(201,168,76,0.3); transform: translateY(-5px); box-shadow: 0 15px 40px rgba(201,168,76,0.4); }
@media (hover: hover) {
  .hero-artist-link:hover { color: var(--white); border-color: var(--gold); background: rgba(201,168,76,0.3); transform: translateY(-5px); box-shadow: 0 15px 40px rgba(201,168,76,0.4); }
}

/* --- Menu a tendina per i bottoni della Home --- */
.hero-menu-wrapper { position: relative; text-align: left; }
.hero-dropdown {
  position: absolute; top: 100%; left: 50%; min-width: 220px;
  background: rgba(15, 15, 15, 0.95); backdrop-filter: blur(15px); -webkit-backdrop-filter: blur(15px);
  border: 1px solid rgba(201,168,76,0.15); border-radius: var(--radius-lg);
  box-shadow: 0 15px 35px rgba(0,0,0,0.4); padding: 0.5rem 0; margin-top: 1rem;
  opacity: 0; pointer-events: none; transform: translateX(-50%) translateY(15px) scale(0.98); 
  transition: opacity 0.4s ease 0.15s, transform 0.4s ease 0.15s; z-index: 200;
}
.hero-dropdown::before { content: ''; position: absolute; top: -1.5rem; left: 0; width: 100%; height: 1.5rem; }
.hero-menu-wrapper.active > .hero-dropdown { 
  opacity: 1; pointer-events: auto; transform: translateX(-50%) translateY(0) scale(1); 
  transition-delay: 0s;
}
@media (hover: hover) {
  .hero-menu-wrapper:hover > .hero-dropdown { opacity: 1; pointer-events: auto; transform: translateX(-50%) translateY(0) scale(1); transition-delay: 0s; }
}
.hero-dropdown a, .hero-submenu-toggle {
  display: block; padding: 0.6rem 1.2rem; font-family: 'Cinzel', serif; font-size: 0.8rem; letter-spacing: 0.15em; text-transform: uppercase; color: var(--cream-dark); text-decoration: none; margin: 0.2rem 0.5rem; border-radius: var(--radius-sm); transition: color 0.3s, transform 0.3s; cursor: pointer;
  background: transparent; border: none; text-align: left; width: calc(100% - 1rem); /* Reset bottone */
}
.hero-submenu.active > .hero-submenu-toggle { color: var(--gold-light); }
@media (hover: hover) {
  .hero-dropdown a:hover, .hero-submenu-toggle:hover { background: transparent; color: var(--gold); transform: translateX(5px); }
}
.hero-submenu-toggle { display: flex; justify-content: space-between; align-items: center; }
.hero-submenu { position: relative; }
.hero-subdropdown {
  position: absolute; left: calc(100% + 5px); top: -0.5rem; min-width: 220px; background: rgba(15, 15, 15, 0.95); backdrop-filter: blur(15px); -webkit-backdrop-filter: blur(15px); border: 1px solid rgba(201,168,76,0.15); border-radius: var(--radius-lg); box-shadow: 0 15px 35px rgba(0,0,0,0.4); padding: 0.5rem 0; opacity: 0; pointer-events: none; transform: translateX(-10px); 
  transition: opacity 0.4s ease 0.15s, transform 0.4s ease 0.15s; z-index: 300;
}
.hero-subdropdown::before { content: ''; position: absolute; top: 0; left: -10px; width: 10px; height: 100%; }
.hero-submenu.active > .hero-subdropdown { opacity: 1; pointer-events: auto; transform: translateX(0); transition-delay: 0s; }
@media (hover: hover) {
  .hero-subdropdown a:hover { color: var(--gold); background: transparent; transform: translateX(5px); }
}
.hero-subdropdown a { display: block; padding: 0.6rem 1.2rem; font-family: 'Cinzel', serif; font-size: 0.75rem; letter-spacing: 0.15em; text-transform: uppercase; text-decoration: none; color: var(--cream-dark); margin: 0.2rem 0.5rem; border-radius: var(--radius-md); transition: color 0.3s, transform 0.3s;}
.hero-menu-wrapper.active > .mobile-trigger .chevron { transform: rotate(180deg); }
.hero-submenu.active > .hero-submenu-toggle .chevron { transform: rotate(-90deg); }
@media (hover: hover) {
  .hero-menu-wrapper:hover > .mobile-trigger .chevron { transform: rotate(180deg); }
}

/* Animazione "Scorri" Home Page */
.scroll-indicator {
  margin-top: 4rem;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  z-index: 20; cursor: pointer; opacity: 0.7; transition: opacity 0.3s;
}
@media (hover: hover) {
  .scroll-indicator:hover { opacity: 1; }
}
.scroll-indicator span {
  font-family: 'Cinzel', serif; font-size: 0.65rem; letter-spacing: 0.3em;
  color: var(--gold); text-transform: uppercase;
}
.scroll-indicator .line {
  width: 1px; height: 50px; background: rgba(201,168,76,0.2); position: relative; overflow: hidden;
}
.scroll-indicator .line::after {
  content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 50%; background: var(--gold);
  animation: scrollLine 2s cubic-bezier(0.77, 0, 0.175, 1) infinite;
}
@keyframes scrollLine { 0% { transform: translateY(-100%); } 100% { transform: translateY(200%); } }

/* Classe aggiunta dinamicamente per far svanire l'indicatore */
.scroll-indicator.hidden {
  opacity: 0 !important;
  pointer-events: none;
}

.slider-section { position: relative; background: var(--dark-mid); padding: 4rem 2rem; border-top: 1px solid rgba(201,168,76,0.15); border-bottom: 1px solid rgba(201,168,76,0.15); }
.slider-wrapper { position: relative; max-width: 1100px; height: 600px; margin: 0 auto; overflow: hidden; border-radius: var(--radius-lg); border: 1px solid rgba(201,168,76,0.3); box-shadow: 0 20px 40px rgba(0,0,0,0.5); background: #000; cursor: pointer; user-select: none; }
.slide { position: absolute; inset: 0; opacity: 0; transition: opacity 1.5s ease-in-out; display: flex; align-items: center; justify-content: center; }
.slide.active { opacity: 1; }
.slide img { width: 100%; height: 100%; object-fit: contain; }

.artists-section { padding: 6rem 2rem 4rem; max-width: 1200px; margin: 0 auto; text-align: center; position: relative; z-index: 2; }
.section-tag { font-family: 'Cinzel', serif; font-size: 0.8rem; color: var(--gold); letter-spacing: 0.2em; text-transform: uppercase; display: block; margin-bottom: 1rem; }
.section-title { font-family: 'Cormorant Garamond', serif; font-size: 2.5rem; font-weight: 400; font-style: italic; color: var(--white); margin-bottom: 2rem; }
.news-header .section-title { position: relative; padding-bottom: 1.5rem; margin-bottom: 0; }
.news-header .section-title::after { content: ''; position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); width: 60px; height: 2px; background: var(--gold); opacity: 0.5; }
.artists-grid { display: flex; flex-direction: row; justify-content: center; gap: 60px; margin-top: 2rem; position: relative; align-items: center; }
.artists-grid::after { content: ''; position: absolute; top: 10%; bottom: 10%; left: calc(50% - 1px); width: 2px; background: var(--gold); opacity: 0.5; pointer-events: none; }
.artist-card { 
  display: block;
  text-decoration: none;
  color: inherit;
  position: relative; width: 320px; height: 320px; flex: 0 0 320px;
  margin: 0; background: var(--dark-mid); 
  box-shadow: 0 15px 35px rgba(0,0,0,0.3); 
  border: 2px solid rgba(201,168,76,0.2); cursor: pointer; 
  
  /* BORDATURA PERFETTA IOS */
  border-radius: 50%; overflow: hidden;
  -webkit-mask-image: -webkit-radial-gradient(white, black);
  mask-image: radial-gradient(white, black);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  transform: translateZ(0);
}

.artist-card img { position: absolute; top: 0; left: 0; display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s ease; }
.artist-card-overlay { position: absolute; inset: 0; background: rgba(18,18,18,0.45); display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 2rem; text-align: center; transition: background 0.4s ease; }
@media (hover: hover) {
  .artist-card:hover img { transform: scale(1.05); }
  .artist-card:hover .artist-card-overlay { background: rgba(18,18,18,0.65); }
}
.artist-name { font-family: 'Cormorant Garamond', serif; font-size: 2.2rem; font-style: italic; color: var(--white); margin-bottom: 0.4rem; }
.artist-role { font-family: 'Cinzel', serif; font-size: 0.7rem; letter-spacing: 0.3em; color: var(--gold); margin-bottom: 1rem; }

.news-wrapper { background: var(--dark-mid); padding: 4rem 2rem; border-top: 1px solid rgba(201,168,76,0.15); position: relative; z-index: 2; }
.news-header { text-align: center; margin-bottom: 4rem; }
.news-wrapper .event-item { display: flex; flex-direction: column; gap: 2rem; margin-bottom: 6rem; align-items: center; max-width: 1100px; margin-left: auto; margin-right: auto; }
.news-wrapper .event-content { flex: 1; padding: 2.5rem; background: rgba(15, 15, 15, 0.6); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border: 1px solid rgba(201,168,76,0.15); border-left: 3px solid var(--gold); border-radius: var(--radius-lg); box-shadow: 0 15px 35px rgba(0,0,0,0.2); }
.news-wrapper .event-content h3 { font-family: 'Cormorant Garamond', serif; font-size: 2.2rem; color: var(--gold-light); margin-bottom: 1rem; font-style: italic; }
.news-wrapper .event-content p, .news-wrapper .event-content span { font-size: 1.1rem; line-height: 1.6; font-family: 'EB Garamond', serif; color: var(--cream-dark); margin-bottom: 1rem; display: block; font-style: normal; }
.news-wrapper .event-item:last-of-type .event-content h3 { position: relative; padding-bottom: 1.5rem; }
.news-wrapper .event-item:last-of-type .event-content h3::after { content: ''; position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); width: 60px; height: 2px; background: var(--gold); opacity: 0.5; }
.news-wrapper .event-media { flex: 1.2; width: 100%; border-radius: var(--radius-lg); overflow: hidden; border: 1px solid rgba(201,168,76,0.2); box-shadow: 0 15px 35px rgba(0,0,0,0.3); background: #000; }
.news-wrapper .event-media img { width: 100%; height: auto; max-height: 580px; object-fit: contain; display: block; margin: 0 auto; }

/* --- FIX IFRAME YOUTUBE MOBILE (Intrinsic Ratio 16:9) --- */
.video-wrapper { position: relative; width: 100%; padding-bottom: 56.25%; height: 0; overflow: hidden; display: block; }
.video-wrapper iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0; z-index: 1 !important; }

.contact-form { display: flex; flex-direction: column; gap: 1.5rem; text-align: left; }
.form-group input, .form-group textarea { width: 100%; padding: 1rem; background: rgba(18,18,18,0.6); border-radius: var(--radius-md); border: 1px solid rgba(201,168,76,0.3); color: var(--cream); font-family: 'EB Garamond', serif; font-size: 1.1rem; outline: none; transition: border-color 0.3s, box-shadow 0.3s; appearance: none; -webkit-appearance: none; }
.form-group input:focus, .form-group textarea:focus { border-color: var(--gold); box-shadow: 0 0 10px rgba(201,168,76,0.2); }
.form-group input::placeholder, .form-group textarea::placeholder { color: rgba(245,240,232,0.4); font-style: italic; }
.submit-btn { background: transparent; color: var(--gold); border-radius: var(--radius-md); border: 1px solid var(--gold); padding: 1rem 2rem; font-family: 'Cinzel', serif; font-size: 0.9rem; letter-spacing: 0.2em; cursor: pointer; transition: all 0.3s; align-self: center; margin-top: 0.5rem; }
@media (hover: hover) {
  .submit-btn:hover { background: rgba(201,168,76,0.1); color: var(--gold-light); box-shadow: 0 4px 15px rgba(201,168,76,0.2); transform: translateY(-2px); }
}
.form-status { margin-top: 1rem; font-family: 'EB Garamond', serif; font-size: 1.1rem; display: none; padding: 1rem; border-radius: 4px; text-align: center; }
.form-status.success { display: block; color: var(--dark); background: var(--gold-light); border: 1px solid var(--gold); font-weight: 500; }
.form-status.error { display: block; color: var(--white); background: rgba(220, 53, 69, 0.8); }

@media (min-width: 992px) {
  .news-wrapper .event-item { flex-direction: row; }
  .news-wrapper .event-item:nth-child(even) { flex-direction: row-reverse; }
  .news-wrapper .event-item:nth-child(even) .event-content { border-left: 1px solid rgba(201,168,76,0.15); border-right: 3px solid var(--gold); text-align: right; }
}

/* ==========================================================================
   BIOGRAFIA
   ========================================================================== */
.bio-section { padding: 5rem 2rem; }
.bio-inner { max-width: 1100px; margin: 0 auto; display: grid; grid-template-columns: 1fr 1fr; gap: 5rem; align-items: center; }
.bio-name { font-family: 'Cinzel', serif; font-size: 0.65rem; letter-spacing: 0.4em; color: var(--gold); display: block; margin-bottom: 2rem; }
.bio-text p { font-size: 1.15rem; line-height: 1.9; color: rgba(245,240,232,0.9); margin-bottom: 1.5rem; font-weight: 400; }
.bio-text p strong { color: var(--white); font-weight: 500; font-style: normal; }
.bio-divider { width: 40px; height: 1px; background: rgba(201,168,76,0.4); margin: 2rem 0; }
.bio-image-wrap { position: relative; padding: 15px; border-radius: var(--radius-lg); border: 1px solid rgba(201,168,76,0.15); background: rgba(18,18,18,0.3); box-shadow: 0 20px 40px rgba(0,0,0,0.4); }
.bio-image-wrap img { position: relative; z-index: 1; width: 100%; height: auto; display: block; border-radius: var(--radius-md); transition: all 0.5s ease; }
@media (hover: hover) {
  .bio-image-wrap:hover img { transform: scale(1.02); }
}

/* --- FIX SENSIBILITÀ TAP SU IOS E TABLET --- */
.mobile-trigger, .hamburger, .hero-artist-link,
.art-item, .doc-item, .slider-wrapper, .lb-nav, .close-btn {
  touch-action: manipulation !important;
}
/* Impedisce ad avatar, testi e freccette interne di intercettare il tocco al posto del bottone */
.mobile-trigger * {
  pointer-events: none;
}

/* ==========================================================================
   RESPONSIVITÀ MOBILE (Layout generico)
   ========================================================================== */
@media (max-width: 1024px) {
  /* Blocca lo scorrimento della pagina quando il menù mobile è aperto */
  body.menu-open { overflow: hidden; }

  nav { padding: 0 1.5rem; z-index: 2147483646; }
  .nav-inner { height: 72px; }
  .nav-menu { 
    position: fixed; top: 72px; left: 0; width: 100%; height: calc(100vh - 72px); 
    height: calc(100svh - 72px); /* Supporto nativo per barra url a comparsa di iOS e Chrome */
    background: rgba(10, 10, 10, 0.95); backdrop-filter: blur(15px); -webkit-backdrop-filter: blur(15px);
    border-right: 1px solid rgba(201,168,76,0.2); -webkit-overflow-scrolling: touch;
    flex-direction: column; padding: 2rem; overflow-y: auto; 
    transform: none; opacity: 0; pointer-events: none; 
    transition: opacity 0.5s;
    z-index: 2147483647; display: flex;
    gap: 0;
    overscroll-behavior: none;
  }
  .mobile-nav-actions { display: flex; align-items: center; }
  .hamburger { display: flex; z-index: 2147483648; }

  .nav-menu.open { transform: none; opacity: 1; pointer-events: auto; }
  .nav-menu > li { 
    width: 100%; border-bottom: 1px solid rgba(201,168,76,0.1); 
    opacity: 0; transform: translateX(40px);
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  }
  .nav-menu.open > li {
    opacity: 1;
    transform: translateX(0);
  }
  .nav-menu.open > li:nth-child(1) { transition-delay: 0.15s; }
  .nav-menu.open > li:nth-child(2) { transition-delay: 0.25s; }

  /* --- NUOVO DESIGN CARD ARTISTI MOBILE --- */
  .nav-menu > li { width: 100%; border-bottom: none; margin-bottom: 1.5rem; }
  .nav-menu > li:last-child { margin-bottom: 0; }
  
  .nav-menu .main-artist-trigger { display: flex; align-items: center; justify-content: flex-start; gap: 1.2rem; width: 100%; padding: 1.2rem; background: rgba(30, 30, 30, 0.8); border-radius: var(--radius-md); border: 1px solid rgba(201,168,76,0.3); transition: border-color 0.4s ease, background-color 0.4s ease; }
  .nav-menu li.active > .main-artist-trigger, .nav-menu li.current-section > .main-artist-trigger { border-color: var(--gold); background: rgba(201,168,76,0.15); }
  
.artist-menu-avatar { display: block; width: 55px; height: 55px; flex-shrink: 0; border-radius: 50%; object-fit: cover; border: 2px solid var(--gold); box-shadow: 0 5px 15px rgba(0,0,0,0.5); }
  .artist-menu-info { display: flex; flex-direction: column; align-items: flex-start; flex: 1; }
  .artist-menu-name { font-family: 'Cormorant Garamond', serif; font-size: 1.6rem; font-style: italic; color: var(--gold-light); line-height: 1.1; }
  .artist-menu-role { display: block; font-family: 'Cinzel', serif; font-size: 0.65rem; letter-spacing: 0.2em; color: var(--cream); text-transform: uppercase; margin-top: 5px; }
  .main-artist-trigger .chevron { margin-left: auto; width: 24px; height: 24px; color: var(--gold); }

  .nav-menu .submenu-toggle { display: flex; justify-content: space-between; align-items: center; width: 100%; font-size: 1.1rem; padding: 0.8rem 1rem; color: var(--white); }

  /* Rimosso Grid: causava il blocco del rendering (freeze) su iOS Safari al tocco */
  .nav-menu > li, .nav-menu .has-subdropdown {
    display: block;
  }
  
  /* Sostituiamo l'animazione max-height con un semplice display:none per la massima reattività su iOS */
  .nav-menu .dropdown, .nav-menu .subdropdown {
    position: static; transform: none !important; box-shadow: none; border: none; margin: 0; background: transparent;
    display: none;
    padding: 0.5rem 0 0.5rem 1rem;
    margin-top: 0.5rem;
    transition: none !important; /* Fix vitale per iOS: impedisce al menù di rimanere invisibile al primo tap */
  }
  .nav-menu .has-subdropdown .subdropdown {
    margin-top: 0.2rem;
  }
  .nav-menu li.active > .dropdown,
  .nav-menu .has-subdropdown.active > .subdropdown {
    display: block;
    opacity: 1;
    pointer-events: auto;
  }
  
  .nav-menu li.active > .mobile-trigger .chevron, .nav-menu li.current-section > .mobile-trigger .chevron { transform: rotate(180deg); color: var(--gold-light); }

  .nav-menu .dropdown a, .nav-menu .submenu-toggle { position: relative; margin: 0; padding: 0.8rem 1.2rem; font-size: 0.95rem; color: var(--cream); letter-spacing: 0.05em; border-radius: var(--radius-sm); transition: all 0.3s ease; width: 100%; }
  .nav-menu .subdropdown a { position: relative; margin: 0; padding: 0.75rem 1.2rem; font-size: 0.85rem; color: rgba(245,240,232,0.6); width: 100%; }
  
  /* Effetto linea animata al passaggio del mouse (Ispirato al tuo codice) */
  .nav-menu .dropdown a::after, .nav-menu .submenu-toggle::after, .nav-menu .subdropdown a::after { content: ''; position: absolute; bottom: 8px; left: 1.2rem; width: 0; height: 1px; background-color: var(--gold); transition: width 0.3s ease; }

  /* Stato Attivo (es. FIGURATIVO) - Bordo laterale netto */
  .nav-menu .dropdown a.active, .nav-menu .subdropdown a.active,
  .nav-menu .dropdown a.current-page, .nav-menu .subdropdown a.current-page { 
    color: var(--gold); background: rgba(201,168,76,0.1); 
    border-left: 3px solid var(--gold); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; padding-left: calc(1.2rem - 3px); 
  }

  .hamburger.open img {
    transform: rotate(90deg) scale(0.95);
  }

  .art-overlay { opacity: 1; background: linear-gradient(to top, rgba(18,18,18,0.95) 0%, transparent 60%); padding: 1rem; }
  
  /* Sposta le frecce del lightbox all'interno su schermi piccoli per evitare che escano dallo schermo */
  #lightbox-img-container { max-width: 100%; }
  #lb-prev { left: 10px; font-size: 2.5rem; text-shadow: 0 2px 4px rgba(0,0,0,0.8); }
  #lb-next { right: 10px; font-size: 2.5rem; text-shadow: 0 2px 4px rgba(0,0,0,0.8); }

  .hero-artists { flex-direction: column; gap: 1.5rem; align-items: center; width: 100%; }
  .hero-menu-wrapper { width: 100%; max-width: 350px; display: block; }
  /* Riduciamo il padding e blocchiamo il testo su una sola riga */
  .hero-artist-link { width: 100%; padding: 1rem 1.5rem; white-space: nowrap; font-size: 0.95rem; }

  /* Spazio extra a fondo pagina per non accavallare l'indicatore di scorrimento ai bottoni */
  .hero { padding-bottom: 4rem; }
  .scroll-indicator { margin-top: 2rem; }
  .scroll-indicator .line { height: 40px; }

  /* MENU HERO MOBILE: usiamo display:none per la massima reattività */
  .hero-dropdown, .hero-subdropdown { 
    position: static; transform: none !important; box-shadow: none; border: none; margin: 0; background: transparent; display: none;
    transition: none !important; /* Previene il blocco visivo al primo tap */
  }
  .hero-menu-wrapper.active > .hero-dropdown,
  .hero-submenu.active > .hero-subdropdown { 
    display: block;
  }
  .hero-dropdown { padding: 0.5rem 0 0 0.5rem; margin-top: 0.5rem; border-left: 2px solid rgba(201,168,76,0.3); border-radius: 0; }
  .hero-subdropdown { padding: 0.5rem 0 0 0.5rem; }
  
  .hero-menu-wrapper.active > .mobile-trigger .chevron { transform: rotate(180deg); }
  .hero-submenu.active > .hero-submenu-toggle .chevron { transform: rotate(180deg); }

  .hero-dropdown a, .hero-submenu-toggle, .hero-subdropdown a { margin: 0; width: 100%; }

  .artists-grid { flex-direction: column; gap: 40px; }
  .artist-card { width: 280px; height: 280px; flex: 0 0 280px; }
  .artists-grid::after { top: calc(50% - 1px); left: 10%; right: 10%; height: 2px; width: auto; bottom: auto; }
  .slider-wrapper { height: 400px; }
  .artist-card-overlay { padding: 1.5rem; }

  .bio-inner { grid-template-columns: 1fr; gap: 3rem; text-align: center; }
}

/* =========================================
   FIX DEFINITIVO DOPPIO TAP IOS E TABLET
   ========================================= */
@media (max-width: 1024px) {
  /* 1. Annulla qualsiasi transizione sui bottoni che confonde l'iPhone */
  .mobile-trigger, .hero-artist-link {
    transition: background-color 0.1s, border-color 0.1s !important;
    touch-action: manipulation !important;
    -webkit-tap-highlight-color: transparent !important;
  }
  
  /* 2. Disattiva le animazioni di opacità sui menù a tendina mobile */
  .nav-menu .dropdown, 
  .nav-menu .subdropdown,
  .hero-dropdown, 
  .hero-subdropdown {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    transform: none !important;
    transition: none !important;
    display: none !important; /* Nasconde il menù brutalmente */
  }

  /* 3. Apre il menù istantaneamente al primo tocco */
  .nav-menu li.active > .dropdown,
  .nav-menu .has-subdropdown.active > .subdropdown,
  .hero-menu-wrapper.active > .hero-dropdown,
  .hero-submenu.active > .hero-subdropdown {
    display: block !important;
  }
}

@media (max-width: 1024px) and (hover: hover) {
  /* Apre i menù a tendina (fisarmonica) al passaggio del mouse anche a finestra ristretta su PC */
  .nav-menu li:hover > .dropdown,
  .hero-menu-wrapper:hover > .hero-dropdown {
    display: block !important;
  }
  
  /* Evidenzia il bottone principale "Sandra / Giuseppe" nel menù laterale */
  .nav-menu li:hover > .main-artist-trigger { 
    border-color: var(--gold); background: rgba(201,168,76,0.15); 
  }

  /* Ruota la freccia verso l'alto per indicare l'apertura */
  .nav-menu li:hover > .mobile-trigger .chevron,
  .hero-menu-wrapper:hover > .mobile-trigger .chevron {
    transform: rotate(180deg) !important; color: var(--gold-light);
  }
}

@media (max-width: 480px) {
  .hero-title { font-size: 3.5rem; }
  .slider-wrapper { height: 300px; }
}

@media (hover: none) {
  /* Disattiva completamente gli effetti che causano il doppio tap */
  
  .nav-menu > li > a::after,
  .nav-menu > li > span::after,
  .nav-menu .dropdown a::after,
  .nav-menu .submenu-toggle::after,
  .nav-menu .subdropdown a::after,
  .nav-menu > li > button.main-artist-trigger::after {
    display: none !important;
  }

  /* Rimuove qualsiasi comportamento "hover-like" */
  .nav-menu a,
  .nav-menu span {
    transition: none !important;
  }
}

/* ==========================================================================
   CRITICHE (Layout Editoriale)
   ========================================================================== */
.editorial-container { max-width: 1000px; margin: 0 auto; padding-bottom: 7rem; }
.article-block { margin-bottom: 8rem; padding-bottom: 6rem; border-bottom: 1px solid rgba(201,168,76,0.1); position: relative; }
.article-block:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 3rem; }
.article-header { text-align: center; margin-bottom: 4rem; position: relative; }
.article-header::after { content: '❖'; color: rgba(201,168,76,0.3); font-size: 1.2rem; display: block; margin-top: 1.5rem; }
.article-title { font-family: 'Cormorant Garamond', serif; font-size: 2.2rem; font-weight: 400; font-style: italic; color: var(--gold-light); margin-bottom: 1rem; line-height: 1.2; }
.author-name { display: block; font-family: 'Cinzel', serif; font-size: 0.85rem; letter-spacing: 0.25em; color: var(--gold); margin-bottom: 0.3rem; }
.author-context { display: block; font-family: 'EB Garamond', serif; font-size: 0.95rem; font-style: italic; color: rgba(245,240,232,0.5); }
.article-body { display: flex; gap: 4rem; align-items: flex-start; }
.article-block:nth-child(even) .article-body { flex-direction: row-reverse; }
.article-body.no-images { max-width: 780px; margin: 0 auto; display: block; }
.article-images { flex: 0 0 45%; display: flex; flex-direction: column; gap: 1.5rem; position: sticky; top: 100px; }
.article-images img { width: 100%; height: auto; border: 1px solid rgba(201,168,76,0.2); border-radius: var(--radius-md); box-shadow: 0 15px 35px rgba(0,0,0,0.4); transition: filter 0.4s ease, transform 0.4s ease; }
@media (hover: hover) {
  .article-images img:hover { transform: scale(1.02); }
}
.article-content { flex: 1; font-size: 1.15rem; line-height: 1.85; color: rgba(245,240,232,0.85); text-align: justify; }
.drop-cap p:first-of-type::first-letter { font-family: 'Cinzel', serif; font-size: 4.5rem; color: var(--gold); float: left; line-height: 0.8; margin-right: 0.8rem; margin-top: 0.2rem; text-shadow: 2px 2px 4px rgba(0,0,0,0.5); }
.article-content p { margin-bottom: 1.8rem; }
.article-content p:last-child { margin-bottom: 0; }
.article-content strong, .article-content b { color: var(--white); font-weight: 500; letter-spacing: 0.02em; }
.article-content i, .article-content em { color: var(--cream-dark); }

/* ==========================================================================
   CONTENUTI ESPANDIBILI (Leggi tutto / Approfondisci)
   ========================================================================== */
.expandable-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.5s ease-in-out, opacity 0.5s ease-in-out;
  opacity: 0;
}

.is-expanded .expandable-content {
  opacity: 1;
}

.read-more-btn {
  display: inline-block;
  margin-top: 1.5rem;
  margin-bottom: 2rem;
  font-family: 'Cinzel', serif;
  font-size: 0.8rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold);
  background: transparent;
  border: 1px solid rgba(201,168,76,0.4);
  padding: 0.5rem 1.2rem;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.3s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
@media (hover: hover) {
  .read-more-btn:hover {
    background: rgba(201,168,76,0.1);
    border-color: var(--gold);
    color: var(--gold-light);
    transform: translateY(-2px);
  }
}

/* ==========================================================================
   ATTIVITÀ SVOLTE E DOCUMENTI
   ========================================================================== */
.timeline-section { padding: 5rem 2rem; }
.timeline-inner { max-width: 900px; margin: 0 auto; }
.timeline-intro { font-family: 'Cormorant Garamond', serif; font-size: 1.2rem; font-style: italic; color: rgba(245,240,232,0.7); text-align: center; margin-bottom: 4rem; letter-spacing: 0.03em; }
.year-block { margin-bottom: 3rem; display: grid; grid-template-columns: 100px 1fr; gap: 0 2.5rem; align-items: start; }
.year-label { font-family: 'Cinzel', serif; font-size: 1.1rem; color: var(--gold); letter-spacing: 0.1em; padding-top: 0.1rem; text-align: right; position: relative; }
.year-label::after { content: ''; position: absolute; top: 0.6rem; right: -1.5rem; width: 1px; height: calc(100% + 3rem); background: rgba(201,168,76,0.15); }
.year-label::before { content: ''; position: absolute; top: 0.55rem; right: -1.75rem; width: 12px; height: 12px; border: 2px solid var(--gold); background: var(--dark); border-radius: 50%; box-shadow: 0 0 10px rgba(201,168,76,0.5); transform: translateX(3px); }
.year-events { padding-left: 1rem; }
.year-events .event-item { font-size: 1rem; line-height: 1.75; color: rgba(245,240,232,0.8); margin-bottom: 0.8rem; padding-bottom: 0.8rem; border-bottom: 1px solid rgba(201,168,76,0.08); font-style: italic; }
.year-events .event-item:last-child { border-bottom: none; margin-bottom: 0; }
.year-events .event-item strong { color: var(--gold-light); font-weight: 500; font-style: normal; }
.year-events .event-item .quote { display: block; margin-top: 0.4rem; font-size: 0.9rem; color: rgba(245,240,232,0.5); border-left: 1px solid var(--gold); padding-left: 1rem; }

.docs-section { padding: 4rem 2rem 8rem; background: var(--dark-mid); border-top: 1px solid rgba(201,168,76,0.15); }
.docs-header { text-align: center; margin-bottom: 5rem; }
.docs-title { font-family: 'Cormorant Garamond', serif; font-size: 2.5rem; font-style: italic; color: var(--gold-light); margin-bottom: 1.5rem; }
.docs-rule { width: 50px; height: 1px; background: var(--gold); margin: 0 auto; }
.docs-grid { max-width: 1200px; margin: 0 auto; column-count: 4; column-gap: 24px; row-gap: 24px; }
.doc-item { position: relative; cursor: pointer; border: 1px solid rgba(201,168,76,0.3); border-radius: var(--radius-md); overflow: hidden; margin-bottom: 24px; box-shadow: 0 4px 12px rgba(0,0,0,0.3); transition: transform 0.4s ease, box-shadow 0.4s ease; background: rgba(18,18,18,0.5); break-inside: avoid; }
.doc-item img { width: 100%; height: auto; display: block; object-fit: contain; filter: grayscale(10%) contrast(105%); transition: filter 0.4s ease, transform 0.4s ease; }
.doc-overlay { position: absolute; inset: 0; background: linear-gradient(135deg, rgba(201,168,76,0.3) 0%, rgba(18,18,18,0.9) 100%); opacity: 0; display: flex; align-items: center; justify-content: center; transition: opacity 0.3s ease-out; }
.doc-overlay .overlay-btn { font-family: 'Cinzel', serif; color: var(--gold); border: 1px solid var(--gold); border-radius: 30px; padding: 0.7rem 1.4rem; font-size: 0.8rem; background: rgba(18,18,18,0.9); letter-spacing: 0.15em; display: inline-flex; align-items: center; gap: 0.6rem; transition: transform 0.3s ease; }
@media (hover: hover) {
  .doc-item:hover { transform: translateY(-8px); box-shadow: 0 12px 28px rgba(0,0,0,0.5); border-color: var(--gold); }
  .doc-item:hover img { filter: grayscale(0%) contrast(110%); transform: scale(1.02); }
  .doc-item:hover .doc-overlay { opacity: 1; }
  .doc-item:hover .doc-overlay .overlay-btn { transform: scale(1.05); }
}
.doc-item:focus-visible { outline: 3px solid var(--gold); outline-offset: 4px; border-radius: var(--radius-md); }
.doc-overlay .overlay-btn svg { width: 14px; height: 14px; fill: currentColor; }

@media (max-width: 1024px) {
  .article-body, .article-block:nth-child(even) .article-body { flex-direction: column; gap: 2.5rem; }
  .article-images { flex: auto; position: relative; top: 0; width: 100%; max-width: 500px; margin: 0 auto; }
  .article-header { margin-bottom: 2.5rem; }
  .article-title { font-size: 1.8rem; line-height: 1.3;}
  .docs-grid { column-count: 2; column-gap: 16px; }
  .doc-item { margin-bottom: 16px; }
  .doc-overlay { opacity: 1; background: linear-gradient(135deg, rgba(201,168,76,0.1) 0%, rgba(18,18,18,0.8) 100%); }
}
@media (max-width: 768px) {
  .docs-grid { column-count: 1; column-gap: 0; }
}

/* ==========================================================================
   FOOTER GLOBALE (PULITO ED ESSENZIALE)
   ========================================================================== */
footer {
  background: #0d0d0d;
  border-top: 1px solid rgba(201, 168, 76, 0.2);
  padding: 3.5rem 2rem 3rem;
  text-align: center;
  position: relative;
  z-index: 2;
}

.footer-logo {
  font-family: 'Cinzel', serif;
  font-size: 1.6rem;
  letter-spacing: 0.2em;
  color: var(--gold);
  margin-bottom: 0.5rem;
}

.footer-copy {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.05rem;
  font-style: italic;
  color: rgba(245, 240, 232, 0.6);
  margin-bottom: 0;
}

/* ==========================================================================
   PALLINA FLUTTUANTE CHAT DIRETTA (FLOATING ACTION WIDGET)
   ========================================================================== */
.floating-chat-container {
  position: fixed;
  bottom: 26px;
  right: 26px;
  z-index: 9990;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  pointer-events: none;
}

.floating-chat-btn {
  pointer-events: auto;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #221c10 0%, #121212 100%);
  border: 2px solid var(--gold);
  color: var(--gold);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.6), 0 0 20px rgba(201, 168, 76, 0.35);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease, border-color 0.3s ease, color 0.3s ease;
  -webkit-tap-highlight-color: transparent;
  outline: none;
}

.floating-chat-icons {
  position: relative;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.floating-chat-icons .icon-chat,
.floating-chat-icons .icon-close {
  position: absolute;
  inset: 0;
  margin: auto;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
}

.floating-chat-icons .icon-close {
  opacity: 0;
  transform: rotate(-90deg) scale(0.6);
}

.floating-chat-container.active .floating-chat-icons .icon-chat {
  opacity: 0;
  transform: rotate(90deg) scale(0.6);
}

.floating-chat-container.active .floating-chat-icons .icon-close {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

/* Pulsazione continua e discreta per catturare l'attenzione */
.floating-chat-pulse {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid var(--gold);
  opacity: 0;
  animation: pulseFloatingChat 2.8s infinite cubic-bezier(0.25, 0.1, 0.25, 1);
  pointer-events: none;
}

@keyframes pulseFloatingChat {
  0% { transform: scale(0.92); opacity: 0.8; }
  50% { transform: scale(1.35); opacity: 0; }
  100% { transform: scale(1.35); opacity: 0; }
}

.floating-chat-container.active .floating-chat-pulse {
  animation: none;
  display: none;
}

/* Tooltip a comparsa al passaggio del mouse su desktop */
.floating-chat-tooltip {
  position: absolute;
  right: calc(100% + 14px);
  top: 50%;
  transform: translateY(-50%) translateX(6px);
  background: rgba(18, 18, 18, 0.95);
  border: 1px solid rgba(201, 168, 76, 0.4);
  color: var(--gold-light);
  font-family: 'Cinzel', serif;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.45rem 0.9rem;
  border-radius: 20px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

@media (hover: hover) {
  .floating-chat-btn:hover {
    transform: scale(1.08);
    border-color: var(--gold-light);
    color: var(--gold-light);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.7), 0 0 28px rgba(201, 168, 76, 0.55);
  }
  .floating-chat-btn:hover .floating-chat-tooltip {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
  }
}

.floating-chat-container.active .floating-chat-tooltip {
  display: none;
}

/* Popup / Menu a tendina dei contatti */
.floating-chat-popup {
  pointer-events: none;
  opacity: 0;
  transform: scale(0.9) translateY(15px);
  transform-origin: bottom right;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
  background: rgba(18, 18, 18, 0.96);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(201, 168, 76, 0.35);
  border-radius: var(--radius-md);
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.6), 0 0 30px rgba(201, 168, 76, 0.15);
  width: 320px;
  padding: 1.6rem;
  margin-bottom: 1rem;
  position: relative;
}

.floating-chat-container.active .floating-chat-popup {
  pointer-events: auto;
  opacity: 1;
  transform: scale(1) translateY(0);
}

.floating-chat-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.8rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid rgba(201, 168, 76, 0.18);
}

.floating-chat-tag {
  font-family: 'Cinzel', serif;
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  color: var(--gold);
  text-transform: uppercase;
  display: block;
  margin-bottom: 0.2rem;
}

.floating-chat-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.35rem;
  font-style: italic;
  color: var(--white);
  line-height: 1.15;
}

.floating-chat-close-btn {
  background: transparent;
  border: none;
  color: rgba(245, 240, 232, 0.6);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 0.2rem;
  transition: color 0.25s ease;
}

.floating-chat-close-btn:hover {
  color: var(--gold);
}

.floating-chat-desc {
  font-family: 'EB Garamond', serif;
  font-size: 0.95rem;
  line-height: 1.45;
  color: rgba(245, 240, 232, 0.72);
  margin-bottom: 1.2rem;
}

.floating-chat-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.floating-chat-item {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.75rem 0.9rem;
  border-radius: var(--radius-sm);
  background: rgba(30, 30, 30, 0.6);
  border: 1px solid rgba(201, 168, 76, 0.18);
  text-decoration: none;
  color: var(--cream);
  transition: all 0.25s ease;
}

.floating-item-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(201, 168, 76, 0.1);
  border: 1px solid rgba(201, 168, 76, 0.25);
  color: var(--gold-light);
  flex-shrink: 0;
  transition: transform 0.25s ease, background 0.25s ease;
}

.floating-item-body {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.floating-item-name {
  font-family: 'Cinzel', serif;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  color: var(--white);
  line-height: 1.2;
}

.floating-item-hint {
  font-family: 'EB Garamond', serif;
  font-size: 0.82rem;
  color: rgba(245, 240, 232, 0.6);
}

.floating-item-arrow {
  color: rgba(201, 168, 76, 0.5);
  transition: transform 0.25s ease, color 0.25s ease;
}

@media (hover: hover) {
  .floating-chat-item:hover {
    background: rgba(201, 168, 76, 0.15);
    border-color: var(--gold);
    transform: translateX(3px);
  }
  .floating-chat-item:hover .floating-item-icon {
    transform: scale(1.08);
    background: rgba(201, 168, 76, 0.25);
    color: var(--gold);
  }
  .floating-chat-item:hover .floating-item-arrow {
    transform: translateX(3px);
    color: var(--gold);
  }
}

button.floating-chat-item {
  width: 100%;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}

/* Header vista scrittura */
.floating-back-btn {
  background: transparent;
  border: none;
  color: var(--gold);
  font-family: 'Cinzel', serif;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  padding: 0.2rem 0;
  transition: color 0.25s ease, transform 0.25s ease;
}

.floating-back-btn:hover {
  color: var(--gold-light);
  transform: translateX(-3px);
}

.floating-composer-header-text {
  margin-bottom: 0.8rem;
}

/* Modulo di Scrittura */
.floating-composer-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.floating-field-group {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.floating-label {
  font-family: 'Cinzel', serif;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  color: var(--gold);
  text-transform: uppercase;
}

.floating-input,
.floating-textarea {
  width: 100%;
  background: rgba(30, 30, 30, 0.7);
  border: 1px solid rgba(201, 168, 76, 0.25);
  border-radius: var(--radius-sm);
  color: var(--cream);
  font-family: 'EB Garamond', serif;
  font-size: 0.95rem;
  padding: 0.55rem 0.75rem;
  box-sizing: border-box;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.floating-textarea {
  resize: vertical;
  min-height: 80px;
  line-height: 1.4;
}

.floating-input:focus,
.floating-textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 12px rgba(201, 168, 76, 0.25);
  background: rgba(35, 35, 35, 0.9);
}

.floating-input::placeholder,
.floating-textarea::placeholder {
  color: rgba(245, 240, 232, 0.4);
  font-style: italic;
}

.floating-submit-btn {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
  color: #121212;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.7rem 1rem;
  font-family: 'Cinzel', serif;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  cursor: pointer;
  margin-top: 0.3rem;
  transition: transform 0.25s ease, box-shadow 0.25s ease, filter 0.25s ease;
}

.floating-submit-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(201, 168, 76, 0.35);
  filter: brightness(1.1);
}

.floating-submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Spinner di caricamento */
.btn-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(18, 18, 18, 0.3);
  border-top-color: #121212;
  border-radius: 50%;
  animation: spinSpinner 0.8s linear infinite;
  display: inline-block;
}

@keyframes spinSpinner {
  to { transform: rotate(360deg); }
}

/* Scheda di Successo */
.floating-success-card {
  text-align: center;
  padding: 1.2rem 0.5rem;
}

.status-icon.success-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 0.8rem auto;
  border-radius: 50%;
  background: rgba(201, 168, 76, 0.15);
  border: 1.5px solid var(--gold);
  color: var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
}

.floating-success-card h5 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.35rem;
  font-style: italic;
  color: var(--gold-light);
  margin-bottom: 0.5rem;
}

.floating-success-card p {
  font-family: 'EB Garamond', serif;
  font-size: 0.92rem;
  line-height: 1.45;
  color: rgba(245, 240, 232, 0.8);
  margin-bottom: 1.2rem;
}

.floating-reset-btn {
  background: transparent;
  border: 1px solid rgba(201, 168, 76, 0.35);
  border-radius: var(--radius-sm);
  color: var(--gold-light);
  font-family: 'Cinzel', serif;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.55rem 1rem;
  cursor: pointer;
  transition: all 0.25s ease;
}

.floating-reset-btn:hover {
  background: rgba(201, 168, 76, 0.15);
  border-color: var(--gold);
}

/* ==========================================================================
   SELETTORE CURATORIALE: OPERE IN EVIDENZA / ARCHIVIO STORICO
   ========================================================================== */
.gallery-filter-container {
  max-width: 900px;
  margin: 0 auto 2.5rem auto;
  text-align: center;
  padding: 0 1rem;
}

.gallery-filter-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.35rem;
  background: rgba(18, 18, 18, 0.75);
  border: 1px solid rgba(201, 168, 76, 0.25);
  border-radius: 30px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

.gallery-tab-btn {
  border: 1px solid transparent;
  background: transparent;
  color: rgba(245, 240, 232, 0.75);
  font-family: 'Cinzel', serif;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  padding: 0.65rem 1.4rem;
  border-radius: 24px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  user-select: none;
}

.gallery-tab-btn:hover {
  color: var(--gold-light);
  background: rgba(201, 168, 76, 0.08);
}

.gallery-tab-btn.active {
  background: linear-gradient(135deg, rgba(201, 168, 76, 0.28) 0%, rgba(201, 168, 76, 0.12) 100%);
  border-color: var(--gold);
  color: var(--gold-light);
  box-shadow: 0 4px 15px rgba(201, 168, 76, 0.2);
}

.tab-badge {
  font-size: 0.7rem;
  background: rgba(201, 168, 76, 0.2);
  padding: 0.15rem 0.45rem;
  border-radius: 10px;
  color: var(--gold-light);
  border: 1px solid rgba(201, 168, 76, 0.3);
}

.gallery-tab-caption {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 1.05rem;
  color: rgba(245, 240, 232, 0.65);
  margin-top: 1rem;
  line-height: 1.45;
}

@media (max-width: 600px) {
  .gallery-filter-tabs {
    border-radius: 20px;
    width: 100%;
  }
  .gallery-tab-btn {
    width: 100%;
    justify-content: center;
    font-size: 0.75rem;
    padding: 0.6rem 1rem;
  }
}

@media (max-width: 768px) {
  .floating-chat-tooltip {
    display: none !important;
  }
}

@media (max-width: 480px) {
  .floating-chat-container {
    bottom: 20px;
    right: 20px;
  }
  .floating-chat-btn {
    width: 54px;
    height: 54px;
  }
  .floating-chat-popup {
    width: calc(100vw - 40px);
    max-width: 330px;
  }
}
