#lightbox {width: 100%; height: 100%; position: fixed; top: 0; left: 0; background: rgba(0,0,0,0.85); z-index: 9999999; line-height: 0; cursor: pointer; display: none;}
#lightbox .img {
    position: relative; 
    top: 50%;
    left: 50%;
    -ms-transform: translateX(-50%) translateY(-50%);
    -webkit-transform: translate(-50%,-50%);
    transform: translate(-50%,-50%);
    max-width: 100%;
    max-height: 100%;
}
#lightbox .img img {opacity: 0; pointer-events: none; width: auto;}
@media screen and (min-width: 1200px) {
    #lightbox .img {
        max-width: 1200px;
    }
}
@media screen and (min-height: 1200px) {
    #lightbox .img {
        max-height: 1200px;
    }
}
#lightbox span {display: block; position: fixed; bottom: 13px; height: 1.5em; line-height: 1.4em; width: 100%; text-align: center; color: white; text-shadow:
    -1px -1px 0 #000,
    1px -1px 0 #000,
    -1px 1px 0 #000,
    1px 1px 0 #000;  
}

#lightbox span {display: none;}

#lightbox .videoWrapperContainer {
    position: relative; 
    top: 50%;
    left: 50%;
    -ms-transform: translateX(-50%) translateY(-50%);
    -webkit-transform: translate(-50%,-50%);
    transform: translate(-50%,-50%);
    max-width: 900px;
    max-height: 100%;
}
#lightbox .videoWrapperContainer .videoWrapper {
    height: 0;
    line-height: 0;
    margin: 0;
    padding: 0;
    position: relative;
    padding-bottom: 56.333%; /* custom */
    background: black;
} 
#lightbox .videoWrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}   
#lightbox #prev, #lightbox #next {height: 50px; line-height: 36px; display: none; margin-top: -25px; position: fixed; top: 50%; padding: 0 15px; cursor: pointer; text-decoration: none; z-index: 99; color: white; font-size: 60px;}
#lightbox.gallery #prev, #lightbox.gallery #next {display: block;}
#lightbox #prev {left: 0;}
#lightbox #next {right: 0;}
#lightbox #prev, #lightbox #next {border: 0; background: transparent; font: inherit;}
#lightbox #close {height: 40px; width: 40px; position: fixed; cursor: pointer; text-decoration: none; z-index: 99; right: 0; top: 0;}
#lightbox #close:after, #lightbox #close:before {
    position: absolute;
    top: 50%;
    left: 50%;
    content: "";
    height: 3px;
    width: 18px;
    background: white;
    transform-origin: 50% 50%;
    transform: translate(-50%, -50%) rotate(-45deg);
}
#lightbox #close:after {
    transform: translate(-50%, -50%) rotate(45deg);
}
#lightbox, #lightbox * {
    -webkit-user-select: none;  
    -moz-user-select: none;    
    -ms-user-select: none;      
    user-select: none;
}

body.lightbox-open {
    overflow: hidden;
}

#lightbox .img {
    width: min(92vw, 1200px);
    height: min(86vh, 900px);
    display: none;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    touch-action: none;
    background: transparent;
}

#lightbox.image-mode .img {
    display: flex;
}

#lightbox .img img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    opacity: 1;
    pointer-events: auto;
    object-fit: contain;
    transform-origin: center center;
    transition: transform .15s ease-out;
    cursor: grab;
}

#lightbox .img.is-dragging img {
    cursor: grabbing;
    transition: none;
}

#lightbox .videoWrapperContainer {
    display: none;
}

#lightbox.video-mode .videoWrapperContainer {
    display: block;
}

#lightbox .lightbox-controls {
    position: fixed;
    top: 1rem;
    left: 50%;
    transform: translateX(-50%);
    display: none;
    gap: .35rem;
    z-index: 100;
}

#lightbox.image-mode .lightbox-controls {
    display: flex;
}

#lightbox .lightbox-controls button,
#lightbox #close {
    min-width: 2rem;
    min-height: 2rem;
    border: 1px solid rgba(255, 255, 255, .65);
    border-radius: 4px;
    color: #fff;
    background: rgba(0, 0, 0, .55);
    cursor: pointer;
    font: inherit;
    line-height: 1;
}

#lightbox .lightbox-controls button {
    position: static;
    width: auto;
    height: auto;
    padding: .3rem .5rem;
    font-size: 1rem;
}

#lightbox .zoom-in,
#lightbox .zoom-out,
#lightbox .zoom-reset {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

#lightbox .lightbox-controls button:focus-visible,
#lightbox #close:focus-visible,
#lightbox #prev:focus-visible,
#lightbox #next:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 2px;
}

#lightbox span {
    display: none;
}

@media screen and (max-width: 600px) {
    #lightbox .lightbox-controls {
        top: .75rem;
    }

    #lightbox .lightbox-controls button,
    #lightbox #close {
        min-width: 2rem;
        min-height: 2rem;
    }

    #lightbox .img {
        width: 96vw;
        height: 80vh;
    }
}
