/* Großansicht eines Bildes. Das HTML dazu erzeugt js/lightbox.js.
   Aufbau von oben nach unten: Zähler und Schließen, Bild, Text, Zurück/Weiter. */

.has-lightbox {
  overflow: hidden;   /* Seite dahinter scrollt nicht mit */
}

.lightbox {
  width: 100vw;
  max-width: none;
  height: 100vh;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: var(--color-night-deep);
  color: #fff;
  --color-focus: var(--color-focus-light);
}

.lightbox[open] {
  display: flex;
  flex-direction: column;
}

.lightbox__top,
.lightbox__nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem var(--gutter);
}

.lightbox__counter {
  margin: 0;
}

/* Das Bild füllt den freien Platz und wird nie beschnitten. */
.lightbox__stage {
  position: relative;
  flex: 1;
  min-height: 0;
}

.lightbox__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: var(--image-filter);
}

.lightbox__caption {
  max-width: var(--width-text);
  margin: 0 auto;
  padding: 0.75rem var(--gutter) 0;
  text-align: center;
}

.lightbox__title {
  display: block;
  font-size: 1.25rem;
  font-weight: 700;
}

.lightbox__description {
  display: block;
}

.lightbox__description:empty {
  display: none;
}

.lightbox__nav {
  justify-content: center;
}

.lightbox__nav .button {
  flex: 1;
  max-width: 14rem;
}
