
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    padding: 20px;
}

.gallery-grid img {
    width: 100%;
    height: 100%;
    aspect-ratio: 1.5 / 1;
    object-fit: cover;
    object-position: center;
    cursor: pointer;
    border-radius: 10px;
    transition: transform 0.3s;
}

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

.custom-lightbox {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.9);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 20px;
    box-sizing: border-box;
    flex-direction: column;
}

.custom-lightbox img {
    width: auto;
    height: auto;
    max-width: 90%;
    max-height: 80%;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 0 20px #000;
    transition: 0.3s ease-in-out;
}

.lightbox-close {
    position: absolute;
    top: 25px;
    right: 35px;
    font-size: 40px;
    color: white;
    cursor: pointer;
    transition: transform 0.2s ease;
    z-index: 1001;
}

.lightbox-close:hover {
    transform: scale(1.5);
    opacity: 1;
}

.lightbox-counter {
    color: white;
    margin-top: 10px;
    font-size: 18px;
}

.lightbox-btn {
    background: none;
    border: none;
    color: white;
    font-size: 3rem;
    cursor: pointer;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1001;
    transition: transform 0.2s ease, opacity 0.2s ease;
    opacity: 0.8;
    padding: 10px;
    user-select: none;
}

.lightbox-btn:focus {
    outline: none;
}

.lightbox-btn:hover {
    transform: translateY(-50%) scale(1.2);
    opacity: 1;
}

#prev-btn {
    left: 20px;
}

#next-btn {
    right: 20px;
}

@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr); /* 2 kolumny na tabletach */
    }
    
    .lightbox-nav {
        font-size: 2rem;
        padding: 10px;
    }
    
    .lightbox-counter {
        font-size: 1rem;
        bottom: 15px;
    }
}

@media (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: 1fr; /* 1 kolumna na małych ekranach */
    }
    
    .lightbox-nav {
        font-size: 1.8rem;
        padding: 8px;
    }
    
    .lightbox-counter {
        font-size: 0.9rem;
        bottom: 10px;
    }

}