/* ===== Lightbox Grundlayout ===== */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 99999;

  display: flex;
  align-items: center;
  justify-content: center;

  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.lightbox.is-open {
  opacity: 1;
  pointer-events: auto;
}

/* ===== Hintergrund ===== */
.lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);

  opacity: 0;
  transition: opacity 0.25s ease;
}

.lightbox.is-open .lightbox__backdrop {
  opacity: 1;
}

/* ===== Panel ===== */
.lightbox__panel {
  position: relative;
  z-index: 1;

  max-width: min(900px, calc(100% - 48px));
  max-height: calc(100% - 64px);

  background: #fff;
  border-radius: 12px;
  padding: 16px;

  display: flex;
  flex-direction: column;
  gap: 12px;

  /* Animation */
  opacity: 0;
  transform: translateY(12px) scale(0.98);
  transition:
    opacity 0.25s ease,
    transform 0.25s ease;
}

.lightbox.is-open .lightbox__panel {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* ===== Bild ===== */
.lightbox__img {
  width: 100%;
  height: auto;
  max-height: 75vh;
  object-fit: contain;
  display: block;
}

/* ===== Caption ===== */
.lightbox__caption {
  font-family: "NeueHaasUnicaPro-Regular";
  font-size: 14px;
  line-height: 1.4;
  color: #28282b;
  text-align: center;
}

/* ===== Close Button: oberhalb der Box ===== */
.lightbox__close {
  position: absolute;
  top: -56px;
  right: 0;

  width: 48px;
  height: 48px;

  border: 0;
  background: none;
  padding: 0;

  color: #fff;
  font-size: 40px;
  line-height: 1;
  font-weight: 300;

  cursor: pointer;
  opacity: 0.9;
  transition: opacity 0.2s ease;
}

.lightbox__close:hover {
  opacity: 1;
}

/* Touch-Geräte */
@media (pointer: coarse) {
  .lightbox__close {
    width: 56px;
    height: 56px;
    font-size: 44px;
    top: -64px;
  }
}

/* ===== Motion-Respect ===== */
@media (prefers-reduced-motion: reduce) {
  .lightbox,
  .lightbox__backdrop,
  .lightbox__panel,
  .lightbox__close {
    transition: none !important;
  }
}
