* { box-sizing: border-box; margin: 0; padding: 0; }
.demo a { display: inline-block; margin: 0.5rem; padding: 0.6rem 1.2rem; background: #1a1a2e; color: #fff; text-decoration: none; border-radius: 6px; font-size: 0.95rem; }
.demo a:hover { background: #16213e; }

.lightbox {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s, visibility 0.25s;
  padding: 1.5rem;
}
.lightbox.active { opacity: 1; visibility: visible; }

.lightbox-content {
  position: relative;
  max-width: 95vw;
  max-height: 95vh;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
  transform: scale(0.95);
  transition: transform 0.25s;
  overflow: hidden;
}
.lightbox.active .lightbox-content { transform: scale(1); }

.lightbox-close {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  background: rgba(255,255,255,0.9);
  color: #222;
  border: none;
  border-radius: 50%;
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
  z-index: 10000;
  transition: background 0.2s, transform 0.2s;
}
.lightbox-close:hover { background: #fff; transform: scale(1.08); }

.lightbox-content iframe {
  width: 80vw;
  height: 70vh;
  border: none;
  border-radius: 10px;
  display: block;
}
.lightbox-content audio {
  display: block;
  width: 90%;
  margin: 2rem auto;
}

@media (max-width: 640px) {
  .lightbox-content iframe { width: 90vw; height: 60vh; }
  .lightbox-close { top: 10px; right: 10px; width: 38px; height: 38px; font-size: 1.4rem; }
}

/* Contenitore quando mostra un audio */
.lightbox-content.audio-mode {
    min-width: 400px;
    padding: 2rem;
    background: #fff;
    border-radius: 10px;
}

.lightbox-content.audio-mode .audio-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #222;
    text-align: center;
}

.lightbox-content.audio-mode audio {
    width: 100%;
    display: block;
}

/* Mobile: riduci le dimensioni minime */
@media (max-width: 640px) {
    .lightbox-content.audio-mode {
        min-width: 280px;
        padding: 1.5rem;
    }
}
