#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 .title {
    display: inline-block;
    position: relative;
    top: 10%;
    left: 10%;
    background: rgba(61, 61, 61, 0.8);
    color: white;
    line-height: 1em;
    padding: 1em 1em;
    text-align: center;
    line-height: 1.2em;
    width: 20vw;
}

#lightbox .content {
    display: inline-block;
    width: 100%;
    height: 100%;
    display: flex;
}
#lightbox .img-container {
    width: 100%;
    height: 100%;
    padding: 0 50px;
}

#lightbox .img {
    position: relative;
    top: 50%;
    left: 50%;
    -ms-transform: translateX(-50%) translateY(-50%);
    -webkit-transform: translate(-50%, -50%);
    transform: translate(-50%, -50%);
}

@media(orientation: landscape) {
    #lightbox .img {
        max-height: calc(80vh - 50px);
        max-width: calc(80vh - 50px);
    }
    #lightbox .img.lightbox-scale-smal30 {
        max-height: calc(45vh - 50px);
        max-width: calc(45vh - 50px);
    }
    #lightbox .img.lightbox-scale-smal60 {
        max-height: calc(60vh - 50px);
        max-width: calc(60vh - 50px);
    }
    #lightbox .img.lightbox-scale-smal65 {
        max-height: calc(62.5vh - 50px);
        max-width: calc(62.5vh - 50px);
    }
    #lightbox .img.lightbox-scale-smal70 {
        max-height: calc(65vh - 50px);
        max-width: calc(65vh - 50px);
    }
    #lightbox .img.lightbox-scale-smal75 {
        max-height: calc(67.5vh - 50px);
        max-width: calc(67.5vh - 50px);
    }
    #lightbox .img.lightbox-scale-smal80 {
        max-height: calc(70vh - 50px);
        max-width: calc(70vh - 50px);
    }
    #lightbox .img.lightbox-scale-smal90 {
        max-height: calc(75vh - 50px);
        max-width: calc(75vh - 50px);
    }
}

@media(orientation: portrait) {
    #lightbox .img {
        max-height: calc(80vw - 50px);
        max-width: calc(80vw - 50px);
    }

    #lightbox .img.lightbox-scale-smal30 {
        max-height: calc(45vw - 50px);
        max-width: calc(45vw - 50px);
    }
    #lightbox .img.lightbox-scale-smal60 {
        max-height: calc(60vw - 50px);
        max-width: calc(60vw - 50px);
    }
    #lightbox .img.lightbox-scale-smal65 {
        max-height: calc(62.5vw - 50px);
        max-width: calc(62.5vw - 50px);
    }
    #lightbox .img.lightbox-scale-smal70 {
        max-height: calc(65vw - 50px);
        max-width: calc(65vw - 50px);
    }
    #lightbox .img.lightbox-scale-smal75 {
        max-height: calc(67.5vw - 50px);
        max-width: calc(67.5vw - 50px);
    }
    #lightbox .img.lightbox-scale-smal80 {
        max-height: calc(70vw - 50px);
        max-width: calc(70vw - 50px);
    }
    #lightbox .img.lightbox-scale-smal90 {
        max-height: calc(75vw - 50px);
        max-width: calc(75vw - 50px);
    }

    #lightbox .content {
        flex-direction: column;
    }

    #lightbox .img-container {
        padding: 0;
    }

    #lightbox .title {
        top: 60%;
        left: 50%;
        -ms-transform: translateX(-50%) translateY(-40%);
        -webkit-transform: translate(-50%, -40%);
        transform: translate(-50%, -40%);
        width: 40vw;
    }
}

#lightbox .img img {
    opacity: 0;
    pointer-events: none;
}

#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-prev, #lightbox-next {
    position: fixed;
    top: 50%;
    height: 1em;
    width: 1em;
    color: white;
    text-align: center;
    line-height: 0.8em;
    display: block;
    font-size: 4em;
    z-index: 10;
}

#lightbox-prev, #lightbox-next {
    display: block;
}

#lightbox-prev {
    left: 0;
}

#lightbox-next {
    right: 0;
}

#lightbox-close {
    height: 3em;
    width: 3em;
    margin: 0.5em;
    position: fixed;
    cursor: pointer;
    text-decoration: none;
    z-index: 99;
    right: 0;
    top: 0;
}

#lightbox-close:after, #lightbox-close:before {
    position: absolute;
    margin-top: 22px;
    margin-left: 14px;
    content: "";
    height: 3px;
    background: white;
    width: 23px;
    -webkit-transform-origin: 50% 50%;
    -moz-transform-origin: 50% 50%;
    -o-transform-origin: 50% 50%;
    transform-origin: 50% 50%;
    /* Safari */
    -webkit-transform: rotate(-45deg);
    /* Firefox */
    -moz-transform: rotate(-45deg);
    /* IE */
    -ms-transform: rotate(-45deg);
    /* Opera */
    -o-transform: rotate(-45deg);
}

#lightbox-close:after {
    /* Safari */
    -webkit-transform: rotate(45deg);
    /* Firefox */
    -moz-transform: rotate(45deg);
    /* IE */
    -ms-transform: rotate(45deg);
    /* Opera */
    -o-transform: rotate(45deg);
}

#lightbox, #lightbox * {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

#lightbox a {
    text-decoration: none;
}
