.lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
}

.lightbox.hidden {
  display: none;
}

.lightbox-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
}

.lightbox-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  max-width: 100vw;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  touch-action: pan-y;
}

.lightbox-content img {
  max-width: 90vw;
  max-height: 80vh;
  width: auto;
  height: auto;
  object-fit: contain;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
  display: block;
}

#lightbox-caption {
  color: #ffffff;
  margin-top: 1rem;
  max-width: 80%;
  text-align: center;
  font-size: 0.95rem;
}

.lightbox-prev,
.lightbox-next,
.lightbox-close {
  position: absolute;
  background: none;
  color: #ffffff;
  font-size: 3rem;
  border: none;
  cursor: pointer;
  user-select: none;
  line-height: 1;
  padding: 0.25rem 0.5rem;
}

.lightbox-prev,
.lightbox-next {
  top: 50%;
  transform: translateY(-50%);
}

.lightbox-prev {
  left: 2rem;
}

.lightbox-next {
  right: 2rem;
}

.lightbox-close {
  top: 1rem;
  right: 2rem;
  font-size: 2.5rem;
}

@media (max-width: 768px) {
  .lightbox-content img {
    max-width: 100vw;
    max-height: 70vh;
  }

  .lightbox-prev,
  .lightbox-next {
    font-size: 2.5rem;
  }

  .lightbox-close {
    font-size: 2rem;
  }
}

/* Verkleinert das WordPress-Core-Lightbox-Symbol (gestricheltes Viereck),
   damit es das anklickbare Bild nicht überlagert. */
.wp-block-image svg[viewBox="0 0 12 12"] {
  width: 1px;
  height: 1px;
  pointer-events: none;
}


