/*
 * Bild-Lightbox für verlinkte Bilddateien.
 * Absichtlich komplett gekapselt, damit das bestehende Feuerwehr-Layout
 * nicht verändert wird.
 */
html.feuerwehr-lightbox-open,
body.feuerwehr-lightbox-open {
    overflow: hidden !important;
}

.feuerwehr-lightbox {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    box-sizing: border-box;
    background: rgba(0, 0, 0, 0.90);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.18s ease, visibility 0.18s ease;
    cursor: zoom-out;
}

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

.feuerwehr-lightbox__inner {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 96vw;
    max-height: 94vh;
    cursor: default;
}

.feuerwehr-lightbox__image {
    display: block;
    width: auto;
    height: auto;
    max-width: 96vw;
    max-height: 86vh;
    margin: 0;
    padding: 0;
    border: 0;
    box-shadow: 0 8px 34px rgba(0, 0, 0, 0.55);
    object-fit: contain;
}

.feuerwehr-lightbox__close {
    position: absolute;
    top: -18px;
    right: -18px;
    z-index: 2;
    width: 46px;
    height: 46px;
    padding: 0;
    border: 2px solid rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    background: #7a0000;
    color: #fff;
    font: 700 34px/38px Arial, sans-serif;
    text-align: center;
    cursor: pointer;
    box-shadow: 0 3px 14px rgba(0, 0, 0, 0.5);
}

.feuerwehr-lightbox__close:hover,
.feuerwehr-lightbox__close:focus {
    background: #b00000;
    outline: 2px solid #ffc600;
    outline-offset: 2px;
}

.feuerwehr-lightbox__caption {
    max-width: 900px;
    margin-top: 10px;
    padding: 6px 12px;
    color: #fff;
    background: rgba(0, 0, 0, 0.5);
    font-size: 16px;
    line-height: 1.35;
    text-align: center;
}

/* Zeigt bei passenden Bildlinks dezent an, dass eine Vergrößerung möglich ist. */
a[href$=".jpg"] img,
a[href$=".jpeg"] img,
a[href$=".png"] img,
a[href$=".gif"] img,
a[href$=".webp"] img,
a[href$=".avif"] img {
    cursor: zoom-in;
}

@media (max-width: 700px) {
    .feuerwehr-lightbox {
        padding: 12px;
    }

    .feuerwehr-lightbox__image {
        max-width: 96vw;
        max-height: 82vh;
    }

    .feuerwehr-lightbox__close {
        top: 8px;
        right: 8px;
        width: 42px;
        height: 42px;
        border-width: 1px;
        font-size: 30px;
        line-height: 35px;
    }
}
