/* ==========================================
   Fotogalerie
   ========================================== */

.galerie {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin: 20px 0;
}

.galerie figure {
    flex: 0 0 calc(33.333% - 14px);
    margin: 0;
}

.galerie img {
    display: block;
    width: 100%;
    height: auto;
}

.galerie figcaption {
    text-align: center;
    margin-top: 6px;
}


/* Tablet */

@media (max-width: 800px) {

    .galerie figure {
        flex: 0 0 calc(50% - 10px);
    }

}


/* Smartphone */

@media (max-width: 500px) {

    .galerie figure {
        flex: 0 0 100%;
    }

}

/* ==========================================
   Lightbox Fotogalerie
   ========================================== */

#fg-overlay {
    position: fixed;
    inset: 0;

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

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

    z-index: 99999;

    opacity: 0;
    visibility: hidden;

    transition: opacity 0.2s ease;
}


/* Lightbox sichtbar */

#fg-overlay.fg-visible {
    opacity: 1;
    visibility: visible;
}

#fg-close {
    position: fixed;

    top: 20px;
    right: 25px;

    width: 40px;
    height: 40px;

    padding: 0;

    border: none;

    background: transparent;

    color: white;

    font-size: 32px;
    line-height: 40px;

    text-align: center;

    cursor: pointer;

    z-index: 100001;
}

/* Container für Bild und Bildunterschrift */

#fg-container {
    max-width: 92vw;
    max-height: 92vh;

    text-align: center;
}


/* Großes Bild */

#fg-image {
    display: block;

    max-width: 92vw;
    max-height: 85vh;

    width: auto;
    height: auto;

    border-radius: 6px;

    box-shadow: 0 0 30px rgba(0, 0, 0, 0.7);
}


/* Bildunterschrift */

#fg-caption {
    color: white;

    text-align: center;

    font-size: 1rem;

    margin-top: 12px;

    max-width: 92vw;
}
/* ==========================================
   Navigation der Fotogalerie-Lightbox
   ========================================== */

#fg-prev,
#fg-next {
    position: fixed;

    top: 50%;
    transform: translateY(-50%);

    width: 50px;
    height: 70px;

    border: none;
    border-radius: 4px;

    background: rgba(0, 0, 0, 0.45);
    color: white;

    font-size: 36px;
    line-height: 1;

    cursor: pointer;

    z-index: 3;
}


#fg-prev {
    left: 20px;
}


#fg-next {
    right: 20px;
}


#fg-prev:hover,
#fg-next:hover {
    background: rgba(0, 0, 0, 0.7);
}


/* Smartphone */

@media (max-width: 600px) {

    #fg-prev,
    #fg-next {
        width: 40px;
        height: 55px;

        font-size: 28px;
    }

    #fg-prev {
        left: 5px;
    }

    #fg-next {
        right: 5px;
    }

}
