
/* --- RESPONSIVES MASONRY GRID --- */
#masonry-gallery {
    column-width: 260px; /* Mindestbreite einer Spalte – passt sich flexibel an */
    column-count: 4;    /* Maximale Spaltenanzahl auf Desktop-Monitoren */
    column-gap: 15px;   /* Horizontaler Abstand zwischen den Spalten */
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px;
    box-sizing: border-box;
}

.gallery-item {
    background-color: #fff;
    margin-bottom: 15px; /* Vertikaler Abstand im Grid */
    break-inside: avoid; /* Verhindert hässliche Bildumbrüche mitten im Element */
    border-radius: 6px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 4px 6px rgba(0,0,0,0.03);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.gallery-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.gallery-item img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

/* Hover-Effekt (Lupe) auf den Bildern */
.gallery-popup-link {
    display: block;
    position: relative;
    cursor: pointer;
}

.gallery-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

.gallery-overlay i {
    color: #fff;
    font-size: 1.8rem;
}

/* Automatische responsive Anpassung über Media Queries */
@media (max-width: 992px) {
    #masonry-gallery { column-count: 3; }
}
@media (max-width: 768px) {
    #masonry-gallery { column-count: 2; }
}
@media (max-width: 480px) {
    #masonry-gallery { column-count: 1; }
}
