/* ==========================================================================
   PX Lightbox — Universele lightbox (video, afbeelding, HTML)
   JS API: pxLightbox.video() / .image() / .html() / .open()
   ========================================================================== */

/* ── Overlay ── */
.px-lightbox {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0);
  transition: background 0.3s ease;
}

.px-lightbox.is-open {
  background: rgba(0, 0, 0, 0.85);
}

/* ── Wrap ── */
.px-lightbox__wrap {
  position: relative;
  width: 90vw;
  max-width: 960px;
  opacity: 0;
  transform: scale(0.95);
  transition: opacity 0.3s ease, transform 0.3s ease;
  background-size: cover;
  background-position: center;
  border-radius: var(--R12);
  overflow: hidden;
}

.px-lightbox.is-open .px-lightbox__wrap {
  opacity: 1;
  transform: scale(1);
}

/* ── Content (iframe, img, div) ── */
.px-lightbox__content {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  border: 0;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.px-lightbox__wrap:not(.is-loading) .px-lightbox__content {
  opacity: 1;
}

/* Image content: auto-size within viewport */
.px-lightbox__content[src] {
  max-height: 85vh;
  width: auto;
  max-width: 100%;
  object-fit: contain;
}

/* ── Spinner ── */
.px-lightbox__spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 48px;
  height: 48px;
  margin: -24px 0 0 -24px;
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-top-color: #fff;
  border-radius: 50%;
  animation: px-lightbox-spin 0.8s linear infinite;
}

.px-lightbox__wrap:not(.is-loading) .px-lightbox__spinner {
  display: none;
}

@keyframes px-lightbox-spin {
  to { transform: rotate(360deg); }
}

/* ── Close button (fixed to overlay, not wrap) ── */
.px-lightbox__close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  z-index: 2;
  opacity: 0;
  transition: opacity 0.3s ease, background 0.2s;
}

.px-lightbox.is-open .px-lightbox__close {
  opacity: 1;
}

.px-lightbox__close:hover {
  background: rgba(255, 255, 255, 0.3);
}
