#galeria {
    background-image: linear-gradient(rgba(224, 224, 224, 0.5), rgba(224, 224, 224, 0.5));
    background-size: cover;
    background-position: center center;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 16px;
    margin-top: 32px;
}

.gallery-element {
    position: relative;
    width: 100%;
    max-width: 400px;
    height: auto;
    aspect-ratio: 16/9;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    object-fit: cover;
    transition: transform 0.2s;
}

.gallery-element:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.gallery-tile {
    width: 100%;
    height: auto;
    aspect-ratio: 16/9;
    object-fit: cover;
    display: block;
}

.gallery-caption {
    position: absolute;
    bottom: 0;
    width: 100%;
    padding: 6px 12px;
    background: rgba(0,0,0,0.5);
    color: white;
    font-size: 14px;
    opacity: 0;
    transition: opacity 0.3s ease;
    box-sizing: border-box;
    pointer-events: none;
    z-index: 1;
}

.gallery-element:hover .gallery-caption {
    opacity: 1;
}

#lightbox {
    position: fixed;
    top: 0; left: 0; bottom: 0; right: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 100001;
    box-sizing: border-box;

    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease;
    display: flex;
}

/* Pokazujemy lightbox dodając klasę .visible */
#lightbox.visible {
    opacity: 1;
    visibility: visible;
}

#lightbox img {
    max-width: 90%;
    max-height: 90%;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}