.ferienwohnung-galerie {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin: 1.5rem 0;
}

.ferienwohnung-galerie figure {
    margin: 0;
}

.ferienwohnung-galerie img {
    width: 100%;
    display: block;
    border-radius: 6px;
    cursor: pointer;
    transition: transform .2s;
}

.ferienwohnung-galerie img:hover {
    transform: scale(1.03);
}

.ferienwohnung-galerie figcaption {
    text-align: center;
    font-size: .9rem;
    margin-top: .4rem;
    color: #666;
}

@media (max-width:900px) {
    .ferienwohnung-galerie {
        grid-template-columns: repeat(2,1fr);
    }
}

@media (max-width:600px) {
    .ferienwohnung-galerie {
        grid-template-columns: 1fr;
    }
}

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

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

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

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

    z-index: 99999;
}

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

#fw-image {
    display: block;

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

    border-radius: 6px;
    box-shadow: 0 0 30px rgba(0,0,0,.7);
}

/* Bildunterschrift in der Lightbox */

#fw-caption {
    color: white;

    text-align: center;

    font-size: 1rem;

    margin-top: 12px;

    max-width: 92vw;
}

/* ==========================================
   Erweiterung der Lightbox
   ========================================== */

#fw-overlay {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease;
}

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


/* Bild und Beschriftung */

#fw-container {
    position: relative;
    z-index: 2;
}


/* Navigationspfeile */

#fw-prev,
#fw-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;
}

#fw-prev {
    left: 20px;
}

#fw-next {
    right: 20px;
}


/* Hover-Effekt */

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


/* Auf kleinen Bildschirmen etwas kleinere Pfeile */

@media (max-width: 600px) {

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

        font-size: 28px;
    }

    #fw-prev {
        left: 5px;
    }

    #fw-next {
        right: 5px;
    }

}

/* Schließen-Button */

#fw-close {
    position: fixed;

    top: 20px;
    right: 25px;

    width: 50px;
    height: 50px;

    border: none;
    border-radius: 50%;

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

    font-size: 38px;
    line-height: 45px;

    padding: 0;

    cursor: pointer;

    z-index: 4;
}

#fw-close:hover {
    background: rgba(0,0,0,0.75);
}


/* Smartphone */

@media (max-width: 600px) {

    #fw-close {
        top: 10px;
        right: 10px;

        width: 42px;
        height: 42px;

        font-size: 32px;
        line-height: 38px;
    }

}
