/* Gallery Grid Container */
.werbeauf-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

/* Gallery Item */
.werbeauf-gallery-item {
    display: block;
    overflow: hidden;
    border-radius: 8px;
    position: relative;
    cursor: pointer;
    background: #f0f0f0;
    aspect-ratio: 1 / 1; /* Square thumbnails by default */
}

.werbeauf-gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    display: block;
}

.werbeauf-gallery-item:hover img {
    transform: scale(1.05);
}

/* Lightbox Overlay */
.werbeauf-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 99999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.werbeauf-lightbox.active {
    opacity: 1;
    visibility: visible;
}

.werbeauf-lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.werbeauf-lightbox-img {
    max-width: 100%;
    max-height: 90vh;
    display: block;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
    border-radius: 4px;
}

.werbeauf-lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    color: #fff;
    font-size: 30px;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    line-height: 1;
    z-index: 100;
}

.werbeauf-lightbox-close:hover {
    color: #ccc;
}

/* Navigation Buttons */
.werbeauf-lightbox-prev,
.werbeauf-lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.5);
    color: #fff;
    border: none;
    font-size: 30px;
    padding: 10px 15px;
    cursor: pointer;
    border-radius: 4px;
    z-index: 100;
    transition: background 0.3s ease;
    user-select: none;
}

.werbeauf-lightbox-prev:hover,
.werbeauf-lightbox-next:hover {
    background: rgba(0,0,0,0.8);
}

.werbeauf-lightbox-prev {
    left: -60px; /* Outside image */
}

.werbeauf-lightbox-next {
    right: -60px; /* Outside image */
}

/* Responsive Nav */
@media (max-width: 768px) {
    .werbeauf-lightbox-prev,
    .werbeauf-lightbox-next {
        position: fixed;
        top: 50%;
        padding: 15px;
        font-size: 24px;
    }

    .werbeauf-lightbox-prev {
        left: 10px;
    }

    .werbeauf-lightbox-next {
        right: 10px;
    }
    
    .werbeauf-lightbox-content {
        max-width: 100%; /* More width on mobile */
    }
    
    .werbeauf-lightbox-img {
        max-width: 95vw; /* Almost full width */
    }
}
