/* GLOBALNE STYLE */
*, ::after, ::before {
    box-sizing: border-box;
    font-family: Poppins;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
    background: linear-gradient(to bottom, #e4e6e9, #d2d8e0);
    color: #333;
    font-family: Poppins;
}

/* HEADER */
header {
    background: linear-gradient(to right, #212529, #343a40);
    color: #fff;
    text-align: center;
    padding: 40px 0 0;
    box-shadow: 0 4px 8px rgba(0,0,0,.2);
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.logo-container img {
    width: 200px;
    transition: transform .3s;
    float: left;
}

/* NAVBAR */
.navbar {
    width: 100%;
    padding: 10px 0;
    position: sticky;
    top: 0;
    background: #343a40;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.navbar-item {
    padding: 0 10px;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
    font-size: 15px;
    text-transform: uppercase;
    color: #fff;
}

.navbar-item.selected {
    color: #aaa;
}

/* MAIN CONTENT */
main {
    flex: 1;
    padding-bottom: 20px;
}

.row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    padding: 0 15px 40px;
}

.gallery-item {
    width: calc(25% - 15px);
    aspect-ratio: 1/1;
    border: 2px solid #b6b6b6;
    border-radius: 10px;
    cursor: pointer;
    overflow: hidden;
    transition: transform 0.3s;
}

.gallery-item:hover {
    transform: scale(1.03);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#imageContainer {
    /* Poprawione ograniczenia rozmiaru kontenera */
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: none;
    
    /* Zmiana dla lepszych marginesów */
    max-width: 90vw;   
    max-height: 90vh;  

    /* Reszta bez zmian */
    z-index: 1000;
    border-radius: 10px;
    border: 5px solid #212529;
    
    display: flex;
    align-items: center; 
    justify-content: center;
}

/* Reguła skalująca obrazek (pozostaje bez zmian, jest kluczowa!) */
#imageContainer img {
    max-width: 100%;   
    max-height: 80vh;  
    width: auto;       
    height: auto;      
    display: block;
    border-radius: 5px; 
}

/* KLUCZOWA ZMIANA: Powrót do position: absolute */
#imageContainer #exit {
    /* Wróć do pozycji absolutnej, dzięki czemu X będzie ukryty razem z rodzicem */
    position: absolute; 
    
    /* Pozycjonowanie X względem kontenera lightboksa */
    top: 20px;       
    right: 25px;     
    
    /* Upewnienie się, że X jest nad obrazkiem */
    z-index: 1001;      

    /* Pozostałe style */
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    background: rgba(0,0,0,0.5);
    padding: 5px 10px;
    border-radius: 50%;
}

/* FOOTER */
footer {
    background: #212529;
    color: #fff;
    text-align: center;
    padding: 15px 0;
    width: 100%;
    margin-top: auto;
}

footer span:not(#date) {
    color: #8c8c8c;
}

/* RESPONSYWNOŚĆ */
@media (max-width: 992px) {
    .gallery-item {
        width: calc(33.333% - 15px);
    }
}

@media (max-width: 768px) {
    .gallery-item {
        width: calc(50% - 15px);
    }
}

@media (max-width: 576px) {
    .gallery-item {
        width: 100%;
    }
}

/* KLASA DLA EFEKTU ROZMYCIA TŁA - Aplikowana do Header, Main i Footer */
.blur-page {
    /* Rozmycie (blur) */
    filter: blur(5px);
    
    /* Płynne przejście, by efekt był przyjemny dla oka */
    transition: filter 0.3s ease-in-out;
    
    /* Zapewnienie, że w trakcie rozmycia nie można klikać w tło */
    pointer-events: none;
    
    /* Upewnienie się, że elementy te są pod lightboxem (który ma z-index: 1000) */
    z-index: 1; 
}