.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(10, 10, 10, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.lightbox.open {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-stage {
  max-width: min(92vw, 1400px);
  max-height: 88vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
/* Zoom: la imagen pasa a su tamaño real (naturalWidth) y el contenedor gana
   scroll — permite recorrerla con el mouse (arrastrando) o con scroll táctil
   nativo en móvil, sin JS adicional para eso último. */
.lightbox-stage.zoomed {
  overflow: auto;
  align-items: flex-start;
  justify-content: flex-start;
}
.lightbox-stage.zoomed.dragging { cursor: grabbing; }

.lightbox-stage img,
.lightbox-stage video {
  max-width: 100%;
  max-height: 88vh;
  border-radius: 10px;
  display: block;
  transform: scale(0.97);
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
/* Imagen con transparencia: en la página flota sobre el fondo, pero vista
   en grande va sobre blanco para que se lea completa. */
.lightbox-stage img.is-alpha { background-color: #fff !important; }
.lightbox-stage img.lightbox-zoomable { cursor: zoom-in; }
/* También con texto (.has-note limita el alto a 66vh): sin esto la imagen
   ampliada quedaba a su ancho real pero con el alto recortado, o sea estirada. */
.lightbox-stage.zoomed img,
.lightbox.has-note .lightbox-stage.zoomed img { max-width: none; max-height: none; flex: none; }
.lightbox-stage.zoomed img.lightbox-zoomable { cursor: grab; }
.lightbox-stage.zoomed.dragging img.lightbox-zoomable { cursor: grabbing; }
.lightbox.open .lightbox-stage img,
.lightbox.open .lightbox-stage video {
  transform: scale(1);
  opacity: 1;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: fixed;
  background: rgba(255, 255, 255, 0.08);
  border: none;
  border-radius: 50%;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease;
}
.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover { background: rgba(255, 255, 255, 0.18); }

.lightbox-close {
  top: 24px; right: 24px;
  width: 42px; height: 42px;
}
.lightbox-close svg { width: 18px; height: 18px; }

.lightbox-prev,
.lightbox-next {
  top: 50%;
  transform: translateY(-50%);
  width: 48px; height: 48px;
}
.lightbox-prev { left: 24px; }
.lightbox-next { right: 24px; }
.lightbox-prev svg,
.lightbox-next svg { width: 20px; height: 20px; }

/* Con texto: la imagen se achica un poco y el texto va debajo, centrado. */
.lightbox.has-note { flex-direction: column; gap: 18px; }
.lightbox.has-note .lightbox-stage,
.lightbox.has-note .lightbox-stage img,
.lightbox.has-note .lightbox-stage video { max-height: 66vh; }
.lightbox-note {
  margin: 0;
  max-width: min(720px, 88vw);
  max-height: 16vh;
  overflow: auto;
  padding: 0 8px;
  color: rgba(255, 255, 255, 0.85);
  font-size: 14.5px;
  line-height: 1.7;
  text-align: center;
  white-space: pre-line;
}

/* Videos pequeños de la primera sección (js/film-zoom.js): una capa
   transparente sobre cada uno recibe el click y lo abre en grande. */
.film-thumb { position: relative; }
.film-expand {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
  transition: background 0.15s ease;
}
.film-expand:hover { background: rgba(255, 255, 255, 0.06); }
.film-expand:focus-visible { outline: 2px solid #fff; outline-offset: -2px; }
.film-zoom-frame {
  width: min(92vw, calc(86vh * 16 / 9));
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 10px;
  overflow: hidden;
}
.film-zoom-frame iframe { display: block; width: 100%; height: 100%; border: 0; }

.lightbox-counter {
  position: fixed;
  bottom: 24px; left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.7);
  font-size: 12.5px;
  letter-spacing: 0.4px;
}

@media (max-width: 640px) {
  .lightbox-prev, .lightbox-next { width: 40px; height: 40px; }
  .lightbox-prev { left: 8px; }
  .lightbox-next { right: 8px; }
  .lightbox-close { top: 12px; right: 12px; }
}
