/*
 * Styly prohlížeče fotek (lightbox) pro obrázky v obsahu diskuze a fotky v chatu (viz wwwroot/js/lightbox.js).
 * Overlay je skrytý, dokud na něj JS nepřidá třídu .lightbox-open; .lightbox-single = jediná fotka (bez šipek a počitadla).
 * Překryv je tmavý v obou vzhledech webu, barvy jsou proto pevné (bílé ovládání na ztmavení).
 */
.lightbox-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(0, 0, 0, 0.88);
    align-items: center;
    justify-content: center;
    padding: 3.5rem 4rem 4rem;
    touch-action: pan-y pinch-zoom;
}

.lightbox-overlay.lightbox-open {
    display: flex;
}

.lightbox-figure {
    margin: 0;
    max-width: 100%;
    max-height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .5rem;
}

.lightbox-image {
    max-width: 100%;
    max-height: calc(100vh - 10rem);
    object-fit: contain;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.5);
    cursor: default;
}

.lightbox-caption {
    max-width: 60rem;
    color: #eee;
    font-size: .9rem;
    line-height: 1.4;
    text-align: center;
    overflow-wrap: anywhere;
}

/* Křížek pro zavření – vpravo nahoře přes celou stránku. */
.lightbox-close {
    position: fixed;
    top: 0.75rem;
    right: 1.25rem;
    width: 2.75rem;
    height: 2.75rem;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 2.5rem;
    line-height: 1;
    cursor: pointer;
    z-index: 2001;
}

.lightbox-close:hover {
    color: #ddd;
}

/* Šipky na okrajích okna. */
.lightbox-nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 3rem;
    height: 4.5rem;
    border: none;
    border-radius: .5rem;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-size: 2.75rem;
    line-height: 1;
    cursor: pointer;
    z-index: 2001;
}

.lightbox-nav:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.25);
}

.lightbox-nav:disabled {
    opacity: .3;
    cursor: default;
}

.lightbox-prev {
    left: .5rem;
}

.lightbox-next {
    right: .5rem;
}

/* Spodní lišta: počitadlo a Stáhnout. */
.lightbox-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: .75rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    color: #fff;
    font-size: .95rem;
    z-index: 2001;
}

.lightbox-counter:empty {
    display: none;
}

.lightbox-download {
    color: #fff;
    text-decoration: underline;
}

.lightbox-download:hover {
    color: #ddd;
}

.lightbox-single .lightbox-nav {
    display: none;
}

/* Na telefonu fotka zabere skoro celou šířku; šipky leží přes její okraj (procházet jde i tažením prstem). */
@media (max-width: 767.98px) {
    .lightbox-overlay {
        padding: 3.5rem .5rem 4rem;
    }

    .lightbox-nav {
        width: 2.5rem;
        height: 3.5rem;
        font-size: 2.25rem;
        background: rgba(0, 0, 0, 0.35);
    }
}

/* Když je lightbox otevřený, zamkneme scrollování stránky pod ním. */
body.lightbox-active {
    overflow: hidden;
}
