/* css/gallery.css */
#gallery {
    scroll-margin-top: 90px;
    padding-top: 40px;
    padding-bottom: 80px;
}

.gallery-container {
    display: flex;
    flex-direction: row;
    gap: 40px;
    align-items: flex-start;
}

@media (max-width: 768px) {
    .gallery-sidebar {
        display: none;
    }
    .gallery-container {
        flex-direction: column;
    }
    .gallery-slider-area {
        width: 100%;
        height: auto;
        padding-top: 20px;
    }
    .polaroid-stack {
        width: 280px;
        height: 360px;
    }
    .polaroid-card {
        padding: 10px 10px 70px 10px;
    }
    .polaroid-caption {
        font-size: 1.6rem;
        bottom: 20px;
    }
}

.gallery-sidebar {
    flex: 1;
    min-width: 250px;
}

.gallery-categories {
    list-style: none;
    padding: 0;
    margin: 0;
}

.cat-btn {
    padding: 15px 20px;
    margin-bottom: 10px;
    background: rgba(255,255,255,0.5);
    border-radius: 10px;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
}

.cat-btn:hover {
    background: rgba(255,255,255,0.8);
    transform: translateX(5px);
}

.cat-btn.active {
    background: white;
    border-left: 4px solid var(--gold);
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.gallery-slider-area {
    flex: 2;
    position: relative;
    height: 600px; /* Zmienione z 500px w związku z większymi kartami */
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    perspective: 1000px;
}

.polaroid-stack {
    position: relative;
    width: 400px; /* Zwiększone z 300px */
    height: 520px; /* Zwiększone z 380px */
}

.polaroid-card {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: white;
    padding: 15px 15px 90px 15px; /* Większy margines dolny dla podpisu (z 50px na 90px) */
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    border-radius: 5px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.6s cubic-bezier(0.4, 0.0, 0.2, 1);
    transform-origin: center center;
    cursor: pointer;
    z-index: 1;
}

/* Base polaroid style */
.polaroid-img-wrapper {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #f4f4f4;
}

.polaroid-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.polaroid-card:hover .polaroid-img-wrapper img {
    transform: scale(1.05);
}

.polaroid-caption {
    position: absolute;
    bottom: 25px;
    left: 0;
    width: 100%;
    text-align: center;
    font-family: 'Clicker Script', cursive; /* Ozdobna czcionka */
    font-size: 2.2rem;
    color: #333;
}

/* Stack styling via JS */
.polaroid-card.stack-top {
    opacity: 1;
    visibility: visible;
    z-index: 10;
    transform: translateX(0) translateY(0) rotate(0deg) scale(1);
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

.polaroid-card.stack-1 {
    opacity: 0.9;
    visibility: visible;
    z-index: 9;
    transform: translateX(10px) translateY(10px) rotate(4deg) scale(0.95);
}

.polaroid-card.stack-2 {
    opacity: 0.7;
    visibility: visible;
    z-index: 8;
    transform: translateX(-15px) translateY(20px) rotate(-3deg) scale(0.9);
}

.polaroid-card.stack-3 {
    opacity: 0.4;
    visibility: visible;
    z-index: 7;
    transform: translateX(5px) translateY(30px) rotate(2deg) scale(0.85);
}

/* Add a cool animation when zooming */
.polaroid-card.stack-top:active {
    transform: scale(0.95);
}

/* Lightbox */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.9); /* Darker backdrop for premium feel */
    z-index: 999999; /* Even higher to beat any other fixed elements */
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.lightbox:not(.hidden) {
    opacity: 1;
    pointer-events: all;
}

.lightbox-content {
    display: flex;
    justify-content: center;
    align-items: center;
    max-width: 90%;
    max-height: 90%;
}

.lightbox-polaroid {
    background: white;
    padding: 20px 20px 110px 20px;
    box-shadow: 0 0 40px rgba(0,0,0,0.8);
    border-radius: 5px;
    position: relative;
    max-height: 85vh; /* Ograniczenie wysokości */
    display: flex;
    flex-direction: column;
}

.lightbox-polaroid img {
    max-height: calc(85vh - 130px);
    width: auto;
    object-fit: contain;
    display: block;
}

.lightbox-nav {
    background: none;
    border: none;
    color: white;
    font-size: 4rem;
    cursor: pointer;
    padding: 20px;
    transition: transform 0.2s, color 0.2s;
    user-select: none;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100000;
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

@media (max-width: 768px) {
    .lightbox-nav {
        font-size: 2.5rem;
        padding: 10px;
    }
    .lightbox-polaroid {
        padding: 15px 15px 80px 15px;
        max-width: 85%;
    }
    .lightbox-polaroid .polaroid-caption {
        font-size: 1.8rem;
        bottom: 25px;
    }
}

.lightbox-nav:hover {
    color: var(--nude);
    transform: translateY(-50%) scale(1.1);
}

.lightbox-nav:active {
    transform: translateY(-50%) scale(0.9);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 40px;
    color: white;
    cursor: pointer;
    font-family: sans-serif;
    line-height: 0.9;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s;
    z-index: 100001;
}

@media (max-width: 768px) {
    .lightbox-close {
        top: 10px;
        right: 10px;
        width: 40px;
        height: 40px;
        font-size: 25px;
    }
}

.lightbox-close:hover {
    color: var(--nude);
    background: rgba(255,255,255,0.2);
}

