/* KONTEJNER SLOŽEK */
#gallery-folders {
    display: flex;
    flex-wrap: wrap;
    gap: 25px;
    justify-content: center;
    margin-top: 40px;
    position: relative;
    z-index: 1; /* NEPŘEKRÝVÁ MENU */
}

.folder-box {
    background: rgba(0,0,0,0.75);
    border: 2px solid #ff7a00;
    padding: 20px 30px;
    border-radius: 6px;
    cursor: pointer;
    transition: 0.2s ease;
    font-size: 22px;
    color: #ffd200;
    text-transform: uppercase;
}

.folder-box:hover {
    background: #ff7a00;
    color: #000;
}

/* MINIATURY */
#gallery-photos {
    display: none;
    margin-top: 40px;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
    position: relative;
    z-index: 1; /* NEPŘEKRÝVÁ MENU */
}

.photo-thumb {
    width: 220px;
    height: 150px;
    object-fit: cover;
    border: 2px solid #ff7a00;
    cursor: pointer;
    transition: 0.2s ease;
}

.photo-thumb:hover {
    transform: scale(1.05);
}

/* FULLSCREEN */
#photo-viewer {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.9);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999; /* správně – nad vším */
    pointer-events: none; /* DŮLEŽITÉ – neblokuje menu, když je skrytý */
}

#photo-viewer.active {
    display: flex;
    pointer-events: auto; /* klikání jen když je otevřený */
}

/* Křížek zavření */
.viewer-close {
    position: absolute;
    top: max(20px, env(safe-area-inset-top));
    right: max(20px, env(safe-area-inset-right));
    width: 48px;
    height: 48px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 122, 0, 0.9);
    color: #000;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, transform 0.2s ease;
}

.viewer-close:hover {
    background: #ff7a00;
    transform: scale(1.1);
}

.viewer-close:focus-visible {
    outline: 2px solid #ffd200;
    outline-offset: 2px;
}

#photo-viewer img {
    max-width: 90%;
    max-height: 90%;
    border: 3px solid #ff7a00;
    border-radius: 6px;
}

/* ŠIPKY */
.viewer-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 60px;
    color: #ffd200;
    cursor: pointer;
    user-select: none;
    padding: 20px;
    transition: color 0.2s ease, transform 0.2s ease;
}

#arrow-left { left: 20px; }
#arrow-right { right: 20px; }

.viewer-arrow:hover {
    color: #ff7a00;
}

.viewer-arrow:active {
    transform: translateY(-50%) scale(0.95);
}

/* Mobil – menší šipky, větší klikací plocha, křížek */
@media (max-width: 768px) {
    .viewer-close {
        width: 44px;
        height: 44px;
        font-size: 24px;
        top: max(12px, env(safe-area-inset-top));
        right: max(12px, env(safe-area-inset-right));
    }

    #gallery-folders {
        padding: 20px 12px;
        gap: 16px;
    }

    .folder-box {
        padding: 16px 24px;
        font-size: 18px;
        min-height: 48px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .photo-thumb {
        width: 100%;
        max-width: 280px;
        height: 180px;
    }

    #photo-viewer img {
        max-width: 95%;
        max-height: 85%;
    }

    .viewer-arrow {
        font-size: 40px;
        padding: 24px;
    }

    #arrow-left { left: 8px; }
    #arrow-right { right: 8px; }
}
