/* Vlastní lightbox fotek s náhledy dole - viz gallery-lightbox.js */

html.glb-lock {
    overflow: hidden;
}

.glb {
    display: none;
    position: fixed;
    inset: 0;
    /* nad vším - hlavička webu má na tabletu a mobilu z-index 2000000002 */
    z-index: 2147483600;
    flex-direction: column;
    background: rgba(5, 5, 5, 0.96);
    color: #fff;
    font-family: Poppins, sans-serif;
    -webkit-user-select: none;
    user-select: none;
}

.glb.glb--open {
    display: flex;
}

.glb__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex: 0 0 auto;
    padding: 12px 16px;
}

.glb__counter {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.75);
}

/* tlačítka bez stylů webu (bootstrap / web.css přidávají padding, stín…) */
.glb button {
    -webkit-appearance: none;
    appearance: none;
    margin: 0;
    padding: 0;
    box-shadow: none;
    font-family: inherit;
}

.glb__close {
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 30px;
    line-height: 1;
    cursor: pointer;
    transition: background .2s;
}

.glb__stage {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1 1 auto;
    min-height: 0;
    padding: 0 72px;
}

.glb__image {
    display: block;
    max-width: 100%;
    max-height: 100%;
    border-radius: 9px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    object-fit: contain;
    transition: opacity .2s;
}

.glb--loading .glb__image {
    opacity: 0;
}

.glb__loader {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    width: 36px;
    height: 36px;
    margin: -18px 0 0 -18px;
    border: 3px solid rgba(255, 255, 255, 0.25);
    border-top-color: #e4001b;
    border-radius: 50%;
    animation: glb-spin .8s linear infinite;
}

.glb--loading .glb__loader {
    display: block;
}

@keyframes glb-spin {
    to { transform: rotate(360deg); }
}

.glb__nav {
    position: absolute;
    top: 50%;
    width: 48px;
    height: 48px;
    margin-top: -24px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: background .2s;
}

.glb__nav::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 12px;
    height: 12px;
    border-top: 2px solid #fff;
    border-right: 2px solid #fff;
}

.glb__nav--prev {
    left: 12px;
}

.glb__nav--prev::before {
    transform: translate(-30%, -50%) rotate(-135deg);
}

.glb__nav--next {
    right: 12px;
}

.glb__nav--next::before {
    transform: translate(-70%, -50%) rotate(45deg);
}

.glb__close:hover,
.glb__close:focus-visible,
.glb__nav:hover,
.glb__nav:focus-visible {
    background: #e4001b;
    outline: none;
}

.glb__thumbs {
    display: flex;
    flex: 0 0 auto;
    gap: 8px;
    padding: 12px 16px 16px;
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

/* náhledy uprostřed, dokud se vejdou; když ne, posouvají se */
.glb__thumbs::before,
.glb__thumbs::after {
    content: '';
    margin: auto;
}

.glb__thumb {
    flex: 0 0 auto;
    width: 76px;
    height: 76px;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 9px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.05);
    opacity: .55;
    cursor: pointer;
    transition: opacity .2s, border-color .2s;
}

.glb__thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.glb__thumb:hover,
.glb__thumb:focus-visible {
    opacity: .9;
    outline: none;
}

.glb__thumb.is-active {
    border-color: #e4001b;
    opacity: 1;
}

.glb--single .glb__nav,
.glb--single .glb__thumbs {
    display: none;
}

@media (max-width: 767px) {
    .glb__stage {
        padding: 0 8px;
    }

    .glb__nav {
        width: 40px;
        height: 40px;
        margin-top: -20px;
        background: rgba(5, 5, 5, 0.45);
    }

    .glb__nav--prev {
        left: 6px;
    }

    .glb__nav--next {
        right: 6px;
    }

    .glb__thumb {
        width: 56px;
        height: 56px;
    }
}
