/* =========================================
   ALBUM ZDJĘĆ: UKŁAD MASONRY I LIGHTBOX
   ========================================= */

/* --- NAGŁÓWEK GALERII --- */
.album-header {
    text-align: center;
    padding: 40px;
    padding-top: 0px;
    padding-bottom: 20px;
}
.album-title {
    font-size: 40px;
    color: #111;
    margin: 0 0 10px 0;
}
.album-subtitle {
    color: #666;
    font-size: 16px;
}
.back-btn {
    display: inline-block;
    margin-top: 20px;
    padding: 10px 20px;
    background: #f1f1f1;
    color: #333;
    border-radius: 30px;
    text-decoration: none;
    font-weight: bold;
    transition: background 0.3s;
}
.back-btn:hover { background: #e2e2e2; }

/* --- UKŁAD MASONRY (Fizyczne Kolumny) --- */
.masonry-grid {
    display: flex;
    align-items: flex-start; /* BLOKUJE rozciąganie elementów na siłę */
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto 60px auto;
    padding: 0 20px;
}

.masonry-column {
    display: flex;
    flex-direction: column;
    gap: 20px;
    flex: 1; /* Każda kolumna zajmuje dokładnie tyle samo miejsca (33%) */
}

/* Kafelki zyskują całkowity spokój */
.masonry-item {
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    
    background-color: #eee;
    animation: pulse 1.5s infinite ease-in-out; 
    min-height: 200px; 
}

.masonry-item.loaded {
    animation: none;
    background-color: transparent;
}

.masonry-item img {
    width: 100%;
    height: auto;
    display: block;
    opacity: 0; 
    transition: opacity 0.5s ease, filter 0.3s ease;
}

.masonry-item.loaded img {
    opacity: 1;
}

.masonry-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

.masonry-item:hover img {
    filter: brightness(0.85);
}

/* --- KOMUNIKAT O BRAKU ZDJĘĆ --- */
.empty-gallery-msg {
    width: 100%; /* Wymusza rozciągnięcie na całą szerokość kontenera */
    text-align: center;
    padding: 80px 20px;
    color: #666;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.empty-gallery-msg h3 {
    font-size: 24px;
    color: #111;
    margin-bottom: 10px;
}

/* --- LIGHTBOX (Pełny ekran) --- */
.lightbox {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    display: none; /* Domyślnie ukryte */
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Klasa .active dodawana przez JavaScript po kliknięciu! */
.lightbox.active {
    display: flex;
    opacity: 1;
}

.lightbox-img {
    max-width: 90%;
    max-height: 90vh;
    border-radius: 5px;
    box-shadow: 0 0 30px rgba(0,0,0,0.5);
}

.lightbox-close, .lightbox-prev, .lightbox-next {
    position: absolute;
    background: none;
    border: none;
    color: white;
    font-size: 40px;
    cursor: pointer;
    transition: transform 0.2s;
}

.lightbox-close:hover, .lightbox-prev:hover, .lightbox-next:hover {
    transform: scale(1.2);
}

.lightbox-close { top: 20px; right: 30px; }
.lightbox-prev { left: 20px; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 20px; top: 50%; transform: translateY(-50%); }

/* Responsywność dla Masonry */
@media (max-width: 900px) { .masonry-grid { column-count: 2; } }
@media (max-width: 600px) { .masonry-grid { column-count: 1; } }

/* --- LICZNIK W LIGHTBOXIE --- */
.lightbox-counter {
    position: absolute;
    top: 25px;
    left: 30px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 18px;
    font-weight: bold;
    letter-spacing: 2px;
    z-index: 10000;
    font-family: 'Montserrat', sans-serif;
}

/* --- KÓŁKO ŁADOWANIA NA DOLE STRONY --- */
.loading-sentinel {
    text-align: center;
    padding: 40px;
    color: #777;
    font-size: 18px;
    width: 100%;
}
.loading-sentinel i {
    margin-right: 10px;
}