/* Ersetzt lity. Uebernommen aus archiv/_css/lity.css und
   animated-masonry-gallery.css: Ueberlagerung rgba(20,20,20,0.9),
   Aufziehen von 0.8 auf 1 in 0,3 s, Schliessknopf 35px weiss oben rechts,
   Bildunterschrift weiss 13px mit 2px Sperrung, buendig zur linken
   Bildkante.

   NICHT uebernommen: der Bestand rendert jedes Bild mit fester Hoehe und
   object-fit:fill und verzerrt es dadurch um 10 bis 23 Prozent. Hier
   bleiben die Proportionen erhalten. */

.lightbox {
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  padding: 0;
  border: 0;
  overflow: hidden;
  background: transparent;
}
/* dialog ist ohne [open] per UA-Stylesheet display:none — das muss beim
   Umstellen auf flex erhalten bleiben. */
.lightbox[open] {
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox::backdrop { background: rgb(20 20 20 / 0.9); }

/* Schrumpft auf die Bildbreite, damit die Bildunterschrift buendig zur
   linken Bildkante sitzt — wie im Bestand. */
.lightbox__figur {
  width: fit-content;
  max-width: calc(100% - 80px);
  margin: 0;
  transform: scale(1);
  transition: transform 0.3s ease;
}
.lightbox--laedt .lightbox__figur { transform: scale(0.8); }

.lightbox__bild {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  /* vh zuerst als Rueckfall: dvh kennt Safari erst ab 15.4. */
  max-height: calc(100vh - 140px);
  max-height: calc(100dvh - 140px);
  object-fit: contain;
}

.lightbox__caption {
  margin-top: 14px;
  color: var(--farbe-weiss);
  font-size: 13px;
  letter-spacing: 2px;
}

.lightbox__schliessen {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9994;
  width: 35px;
  height: 35px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--farbe-weiss);
  cursor: pointer;
  font-size: 35px;
  line-height: 1;
}

.lightbox__blaettern {
  position: fixed;
  top: 50%;
  z-index: 9994;
  width: 60px;
  height: 60px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--farbe-weiss);
  cursor: pointer;
  font-size: 48px;
  line-height: 1;
  opacity: 0.6;
  transform: translateY(-50%);
  transition: opacity var(--uebergang-kurz);
}
@media (hover: hover) {
  .lightbox__blaettern:hover { opacity: 1; }
}
.lightbox__blaettern[disabled] { opacity: 0.15; cursor: default; }
.lightbox__blaettern--zurueck { left: 20px; }
.lightbox__blaettern--vor { right: 20px; }

@media (max-width: 1024px) {
  .lightbox__figur { max-width: calc(100% - 32px); }
  .lightbox__bild {
    max-height: calc(100vh - 110px);
    max-height: calc(100dvh - 110px);
  }
  .lightbox__blaettern { display: none; }   /* stattdessen Wischgeste */
}
