/* ===== MODALE GENERICA ===== */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.85);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    overflow-y: auto;
  }
  .modal-overlay.show { display: flex; }
  
  .modal-box {
    background: #1a1a1a;
    color: var(--text-color);
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    border: 2px solid var(--accent-color);
    border-radius: 8px;
    padding: 2rem;
    position: relative;
    font-family: 'Cormorant Garamond', serif;
    box-shadow: 0 0 15px rgba(0,0,0,0.4);
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  .modal-close {
    position: sticky;
    top: 0;
    right: 0;
    align-self: flex-end;
    margin: -0.5rem -0.5rem 0.5rem 0;
    font-size: 2rem;
    color: var(--accent-color);
    cursor: pointer;
    transition: transform 0.2s;
    z-index: 10;
    background: rgba(26, 26, 26, 0.95);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--accent-color);
  }
  .modal-close:hover {
    transform: scale(1.2);
  }
  
  .modal-title {
    font-size: 1.5rem;
    color: var(--light-accent);
    font-weight: bold;
    margin-bottom: 1rem;
    text-align: center;
  }
  
  .modal-content {
    font-size: 1.08rem;
    line-height: 1.7;
    color: var(--text-color);
    overflow-y: auto;
    flex: 1;
    padding-right: 0.5rem;
  }

  /* Custom scrollbar per modal */
  .modal-content::-webkit-scrollbar {
    width: 8px;
  }
  .modal-content::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.05);
    border-radius: 4px;
  }
  .modal-content::-webkit-scrollbar-thumb {
    background: var(--accent-color);
    border-radius: 4px;
  }
  
  .modal-buttons {
    display: flex;
    justify-content: center;
    gap: 1.3rem;
    margin-top: 2rem;
  }
  .modal-buttons button,
  .modal-buttons .btn {
    background: var(--accent-color);
    color: #0f0f0f;
    border: none;
    padding: 0.7rem 1.6rem;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s;
    font-size: 1rem;
  }
  .modal-buttons button:hover,
  .modal-buttons .btn:hover {
    background: var(--light-accent);
    color: #0f0f0f;
  }
  
  /* === Scrollbar modale === */
  .modal-box::-webkit-scrollbar,
  .modal-content::-webkit-scrollbar {
    width: 8px;
    background: #2b2b2b;
  }
  .modal-box::-webkit-scrollbar-thumb,
  .modal-content::-webkit-scrollbar-thumb {
    background: var(--accent-color);
    border-radius: 4px;
  }
  
  /* === Fullscreen mode (opzionale) === */
  .modal-box.fullscreen {
    width: 97vw;
    max-width: 1000px;
    height: 95vh;
    max-height: none;
  }
  .modal-box.fullscreen .modal-content {
    max-height: calc(95vh - 120px);
    overflow-y: auto;
  }
  
  /* === Responsive === */
  @media (max-width: 768px) {
    .modal-box {
      padding: 1.2rem;
      max-width: 98vw;
    }
    .modal-title { font-size: 1.2rem; }
    .modal-content { font-size: 0.98rem; }
    .modal-close { font-size: 1.5rem; }
  }
/* ===== Concert Lightbox (scoped) ===== */
#concert_lightbox .modal-box {
  max-width: 980px;            /* più spazio per poster+testo */
}

#concert_lightbox .concert-lightbox-body {
  overflow-y: auto;
  flex: 1;
  padding-right: 0.5rem;
}

#concert_lightbox .concert-lightbox-body::-webkit-scrollbar {
  width: 8px;
}
#concert_lightbox .concert-lightbox-body::-webkit-scrollbar-track {
  background: rgba(255,255,255,0.05);
  border-radius: 4px;
}
#concert_lightbox .concert-lightbox-body::-webkit-scrollbar-thumb {
  background: var(--accent-color);
  border-radius: 4px;
}

/* Layout griglia: poster PICCOLO a sinistra (200px), dettagli a destra */
#concert_lightbox .concert-lightbox-poster-view {
  display: grid;
  grid-template-columns: 200px 1fr; /* poster piccolo | dettagli */
  gap: 1.5rem;
  align-items: start;
}

#concert_lightbox .concert-lightbox-img {
  margin: 0;
  padding: 0;
  position: sticky;
  top: 0;
  background: #0a0a0a;
  border-radius: 8px;
  overflow: hidden;
}

#concert_lightbox .concert-lightbox-info {
  margin: 0;
  padding: 0;
  overflow-y: auto;
  max-height: 70vh;
}

#concert_lightbox #concert_poster,
#concert_lightbox .concert-lightbox-img img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 4px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.35);
}

#concert_lightbox .concert-title,
#concert_lightbox .lightbox-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.6rem;
  line-height: 1.2;
  color: var(--light-accent);
  margin: 0 0 .5rem 0;
}

#concert_lightbox .concert-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem 1rem;
  opacity: .9;
  margin-bottom: 1rem;
}

#concert_lightbox .concert-program { 
  white-space: pre-wrap; 
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 4px;
  padding: .75rem .9rem;
  margin: .75rem 0 1rem 0;
}

#concert_lightbox .concert-facts {
  list-style: none;
  padding: 0;
  margin: .5rem 0 0 0;
}
#concert_lightbox .concert-facts li { 
  margin: .35rem 0; 
  line-height: 1.5; 
}
#concert_lightbox .concert-facts li strong { 
  color: var(--light-accent); 
}

#concert_lightbox .modal-buttons { 
  justify-content: flex-start; 
}

/* Responsive: poster sopra, testo sotto */
@media (max-width: 900px) {
  #concert_lightbox .concert-lightbox-poster-view {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .modal-box {
    max-height: 95vh;
    padding: 1.5rem;
  }

  #concert_lightbox .concert-lightbox-poster-view {
    gap: 1rem;
  }
}

/* ===== Concert Lightbox - Iframe Mode (LP Preview) ===== */
#concert_lightbox .concert-lightbox-iframe {
  display: none;
  width: 100%;
  height: 80vh;
  min-height: 600px;
}

#concert_lightbox.iframe-mode .modal-box {
  max-width: 95vw;
  max-height: 90vh;
  padding: 0;
  overflow: hidden;
}

#concert_lightbox.iframe-mode .concert-lightbox-close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: rgba(0, 0, 0, 0.8);
  color: var(--accent-color);
  border: 1px solid var(--accent-color);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

#concert_lightbox.iframe-mode .concert-lightbox-body {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

#concert_lightbox .concert-lightbox-iframe iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* ===== Year Archive Modal (below concert lightbox) ===== */
#year_modal.modal-overlay {
  z-index: 9990; /* sotto alla lightbox dei singoli concerti */
}
#year_modal .modal-box {
  max-width: 1200px;
}
#year_modal .modal-content {
  max-height: 80vh;
  overflow-y: auto;
}

/* Layout griglia per concerti nell'archivio anno */
#year_modal .concerts-year-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

#year_modal .concert-item {
  background: rgba(26, 26, 26, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  overflow: hidden;
}

#year_modal .concert-block {
  display: flex;
  flex-direction: column;
  background: transparent;
  border: none;
  padding: 0;
}

/* Top section: poster sx + info dx */
#year_modal .concert-top-section {
  display: grid;
  grid-template-columns: 40% 1fr;
  gap: 1rem;
  padding: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

#year_modal .concert-thumb-link {
  display: block;
  border-radius: 8px;
  overflow: hidden;
  background: #0a0a0a;
  aspect-ratio: 3/4;
}

#year_modal .concert-poster {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

#year_modal .concert-info {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  justify-content: center;
}

#year_modal .concert-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: #d4af37;
  margin: 0;
  line-height: 1.3;
}

#year_modal .concert-date,
#year_modal .concert-place {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.7);
  margin: 0;
}

/* Bottom section: programma a tutta larghezza */
#year_modal .concert-bottom-section {
  padding: 1rem;
  padding-top: 0.75rem;
}

#year_modal .concert-details {
  display: block !important;
  margin: 0;
}

#year_modal .concert-details[open] {
  display: block !important;
}

#year_modal .concert-details summary {
  display: none !important; /* Nascondi il pulsante "Mostra di più" */
}

#year_modal .concert-extra {
  display: block !important;
  margin: 0;
  padding: 0;
}

#year_modal .concert-program {
  font-size: 0.85rem;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.75);
  margin: 0.5rem 0;
}

#year_modal .concert-program pre {
  margin: 0;
  white-space: pre-wrap;
  font-family: inherit;
}

#year_modal .concert-facts {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 0 0;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.7);
}

#year_modal .concert-facts li {
  margin: 0.25rem 0;
}

#year_modal .concert-facts strong {
  color: #d4af37;
}

#year_modal .concert-actions {
  margin-top: 0.5rem;
}