/* ==========================================================================
Lightbox: vergrößerte Ansicht für Bilder aus der .screenshots-Galerie
(css/screenshots.css). Ein Klick auf ein Vorschaubild öffnet das Bild
großformatig in einem Overlay; Vor/Zurück blättert innerhalb derselben
Galerie, Escape/Klick auf den Hintergrund schließt.

Markup wird von js/lightbox.js erzeugt und an body angehängt:
  <div class="lightbox">
    <button class="lightbox-close">…</button>
    <button class="lightbox-prev">…</button>
    <div class="lightbox-content">
      <img class="lightbox-image" src="…" alt="…" />
      <p class="lightbox-caption">…</p>
    </div>
    <button class="lightbox-next">…</button>
  </div>

Die Bildunterschrift wird 1:1 aus dem alt-Text des jeweiligen Vorschaubilds
übernommen (js/lightbox.js); ist das Bild dekorativ und alt="" leer, bleibt
.lightbox-caption leer und wird über :empty ausgeblendet.
========================================================================== */

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

    display: flex;
    align-items: center;
    justify-content: center;

    background: rgba(0, 0, 0, 0.85);

    opacity: 0;
    visibility: hidden;
    transition: opacity 200ms ease;

    &.is-open {
        opacity: 1;
        visibility: visible;
    }
}

.lightbox-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;

    max-width: 100%;
    max-height: 100%;
}

.lightbox-image {
    max-width: 100%;
    max-height: calc(100vh - 4em);
    border-radius: 0.4em;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.lightbox-caption {
    margin: 0.5em 0;
    max-width: 100ch;
    color: var(--white);
    font-size: 0.95rem;
    text-align: center;

    &:empty {
        display: none;
    }
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;

    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.4);
    color: var(--white);
    cursor: pointer;
    transition: background 200ms ease;

    &:hover {
        background: var(--accent);
        border-color: var(--accent);
    }
}

.lightbox-close {
    top: 1.5rem;
    right: 1.5rem;
    width: 2.5rem;
    height: 2.5rem;
    font-size: 1.4rem;
}

.lightbox-prev,
.lightbox-next {
    top: 50%;
    width: 3rem;
    height: 3rem;
    font-size: 1.8rem;
    transform: translateY(-50%);
}

.lightbox-prev {
    left: 1.5rem;
}

.lightbox-next {
    right: 1.5rem;
}
