/* 1. Układ galerii w kafelki */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 30px;
    margin-bottom: 40px;
}

.gallery-item {
    overflow: hidden;
    border-radius: 8px;
    aspect-ratio: 1 / 1;
    cursor: pointer;
}

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

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

/* 2. Ciemny Lightbox */
.lightbox {
    display: none;
    position: fixed;
    z-index: 3000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    justify-content: center;
    align-items: center;
    cursor: zoom-out;
}

/* 3. Kontener wewnętrzny */
.lightbox-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 90%;
    max-height: 90vh;
}

.lightbox-content {
    max-width: 100%;
    max-height: 85vh;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    animation: zoomIn 0.3s ease;
}

/* 4. Przycisk Zamykania (X) */
.close-lightbox {
    position: absolute;
    top: -50px;
    right: 0;
    font-size: 40px;
    color: #fff;
    cursor: pointer;
    z-index: 3200;
}

/* 5. Strzałki nawigacyjne */
.lightbox-prev, .lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #fff;
    font-size: 50px;
    padding: 20px;
    cursor: pointer;
    z-index: 3100;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    transition: 0.3s;
}

.lightbox-prev { left: -60px; }
.lightbox-next { right: -60px; }

.lightbox-prev:hover, .lightbox-next:hover {
    color: #ccc;
    transform: translateY(-50%) scale(1.2);
}

/* Animacja */
@keyframes zoomIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* Responsywność dla urządzeń mobilnych */
@media (max-width: 768px) {
    .lightbox-prev, .lightbox-next { font-size: 30px; }
    .lightbox-prev { left: 0; }
    .lightbox-next { right: 0; }
}