/* Podstawowe style */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f4f7f6;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    background-color: #2c3e50;
    color: white;
    text-align: center;
    padding: 40px 0;
}

.back-link {
    color: #3498db;
    text-decoration: none;
    font-weight: bold;
}

/* Filtry */
.gallery-filters {
    text-align: center;
    margin: 30px 0;
}

.filter-btn {
    background: white;
    border: 2px solid #2c3e50;
    padding: 10px 25px;
    margin: 5px;
    cursor: pointer;
    border-radius: 25px;
    transition: 0.3s;
    font-weight: bold;
}

.filter-btn:hover, .filter-btn.active {
    background: #2c3e50;
    color: white;
}

/* Siatka galerii */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.gallery-item {
    position: relative;
    height: 250px;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    display: block; /* Domyślnie widoczne */
}

.gallery-item img {
    cursor: pointer;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.gallery-item:hover img {
    transform: scale(1.1);
}

/* Podpis po najechaniu */
.overlay {
    cursor: pointer;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(44, 62, 80, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    padding: 20px;
    text-align: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.gallery-item:hover .overlay {
    opacity: 1;
}

/* Klasa ukrywająca elementy przy filtrowaniu */
.hide {
    display: none;
}
/* --- STYLE DLA URZĄDZEŃ MOBILNYCH --- */

/* Dla tabletów i dużych telefonów (poniżej 768px) */
@media (max-width: 768px) {
    header h1 {
        font-size: 1.8rem; /* Nieco mniejszy tytuł, żeby się nie rozjechał */
    }

    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); /* Zdjęcia dopasują się parami */
        gap: 15px;
    }

    .filter-btn {
        padding: 8px 15px; /* Mniejsze przyciski, żeby zmieściły się w rzędzie */
        font-size: 14px;
    }
}

/* Dla małych telefonów (poniżej 480px) */
@media (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: 1fr; /* Jedno duże zdjęcie pod drugim - najwygodniejsze do klikania palcem */
    }

    .overlay {
        opacity: 1; /* Na telefonie nie ma najechania myszką (hover), więc podpisy mogą być widoczne od razu */
        background: rgba(44, 62, 80, 0.6);
        height: auto;
        bottom: 0;
        top: auto;
    }

    .gallery-item {
        height: 300px; /* Nieco wyższe zdjęcia na komórce lepiej wyglądają */
    }
}
/* Styl Lightboxa */
.lightbox {
    display: none; /* Domyślnie ukryty */
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    align-items: center;
    justify-content: center;
}

.lightbox-content {
    max-width: 85%;
    max-height: 80%;
    border-radius: 5px;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
}

.close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
}

.lightbox-nav {
    position: absolute;
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 20px;
    box-sizing: border-box;
}

.lightbox-nav button {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    font-size: 30px;
    padding: 10px 20px;
    cursor: pointer;
    border-radius: 5px;
    transition: 0.3s;
}

.lightbox-nav button:hover {
    background: rgba(255,255,255,0.4);
}

#caption {
    position: absolute;
    bottom: 50px;
    color: #ccc;
    font-size: 18px;
}