/* ==========================================================================
   OGÓLNE STYLE STRONY
   ========================================================================== */
body {
    font-family: sans-serif;
    margin: 0;
    padding: 0;
    display: flex;
    min-height: 100vh;
    background-color: #f4f4f4;
}

.sidebar {
    width: 250px;
    background: #333;
    color: #fff;
    padding: 20px;
    flex-shrink: 0;
    height: 100vh;
    box-sizing: border-box;
    overflow-y: auto;
}

.sidebar h2 {
    font-size: 1.2em;
    border-bottom: 1px solid #555;
    padding-bottom: 5px;
    margin-top: 0;
}

.sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0 0 20px 0;
}

.sidebar li {
    margin-bottom: 10px;
}

.sidebar a {
    color: #ddd;
    text-decoration: none;
    display: block;
    padding: 5px 0;
}

.sidebar a:hover {
    color: #fff;
    text-decoration: underline;
}

.content {
    flex-grow: 1;
    padding: 30px;
    background: #fff;
    overflow-y: auto;
    box-sizing: border-box;
}

/* ==========================================================================
   GALERIA I SKALOWANIE MINIATUR
   ========================================================================== */
.galeria {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 20px;
}

.zdjecie-item {
    width: calc(33.333% - 14px);
    box-sizing: border-box;
    background: #f9f9f9;
    padding: 10px;
    border-radius: 6px;
    border: 1px solid #eee;
}

.media-item {
    width: 100% !important;
    height: 200px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    display: block;
}

/* ==========================================================================
   POPRAWIONY LIGHTBOX (PODGLĄD PEŁNOEKRANOWY)
   ========================================================================== */
.lightbox {
    display: none;
    position: fixed;
    z-index: 2000;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

/* Zdjecie/Wideo wewnątrz lightboxa dopasowane do okna, bez rozciągania ponad oryginał */
.lightbox-content {
    max-width: 85%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 4px;
}

/* Przycisk zamknięcia (X) */
.lightbox .close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 2010;
}

.lightbox .close:hover {
    color: #bbb;
}

/* Przyciski nawigacyjne (poprzedni / następny) */
.lightbox .prev, .lightbox .next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    padding: 15px;
    user-select: none;
    z-index: 2010;
    background: rgba(0,0,0,0.3);
    border-radius: 4px;
}

.lightbox .prev { left: 20px; }
.lightbox .next { right: 20px; }

.lightbox .prev:hover, .lightbox .next:hover {
    background: rgba(0,0,0,0.6);
}

/* Przycisk automatycznego pokazu slajdów (Play / Pause) */
#play-btn {
    position: absolute;
    top: 20px;
    left: 20px;
    cursor: pointer;
    background: rgba(0,0,0,0.4);
    border: 1px solid #fff;
    color: white;
    font-size: 1.2em;
    padding: 5px 12px;
    border-radius: 4px;
    z-index: 2010;
}

#play-btn:hover {
    background: rgba(255,255,255,0.2);
}

/* ==========================================================================
   RESPONSYWNOŚĆ DLA URZĄDZEŃ MOBILNYCH (Maksymalnie 900px)
   ========================================================================== */
.menu-toggle {
    display: none;
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 1100;
    background: #333;
    color: #fff;
    border: none;
    padding: 10px 15px;
    font-size: 1em;
    border-radius: 4px;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

@media screen and (max-width: 900px) {
    .menu-toggle {
        display: block; 
    }
    
    .sidebar {
        position: fixed;
        left: -280px; 
        top: 0;
        height: 100vh;
        z-index: 1050;
        transition: left 0.3s ease;
        width: 250px;
        box-shadow: 2px 0 10px rgba(0,0,0,0.3);
    }

    .sidebar.active {
        left: 0; 
    }

    .content {
        padding: 60px 15px 15px 15px; 
        width: 100%;
    }

    .zdjecie-item {
        width: 100%; /* Na telefonie miniatura zajmuje pełną szerokość */
    }
    
    .media-item {
        height: auto;
        max-height: 250px;
        object-fit: contain;
    }

    /* Mniejszego formatu przyciski nawigacyjne na telefonie, żeby nie zasłaniały grafiki */
    .lightbox .prev, .lightbox .next {
        font-size: 24px;
        padding: 10px;
    }
}