/*
    ImageBox v1.3.2
    (c) Tobias Roeder
    tobiasroeder.github.io/imagebox/license
*/

body.imagebox {
    overflow: hidden;
}

img[data-imagebox] {
    cursor: pointer;
}

#imagebox {
    z-index: 99992;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background-color: rgba(0, 0, 0, 0.87);
    font-family: 'Helvetica Neue', 'Helvetica', sans-serif;

    * {
        margin: 0;
        padding: 0;
        box-sizing: border-box;
    }

    .ib-loading {
        z-index: 2;
        position: fixed;
        top: 50%;
        left: 50%;
        -webkit-animation: ibLoading 1s linear infinite;
        animation: ibLoading 1s linear infinite;
        border: 3px solid #f3f3f3;
        border-top: 3px solid #555;
        border-radius: 50%;
        width: 30px;
        height: 30px;
    }

    .ib-content {
        z-index: 99994;
        background-color: transparent;
        position: relative;
        width: 100%;
        height: 100%;

        .ib-topbar {
            z-index: 99996;
            position: fixed;
            top: 0;
            right: 0;
            width: 100%;
            display: flex;
            justify-content: space-between;

            .ib-indexes {
                color: #a8a8a8;
                font-size: 1em;
                align-items: center;
                padding: 10px;
                width: 100%;
            }

            .ib-buttons {
                display: flex;
                justify-content: flex-end;
                flex-flow: row nowrap;
                width: 100%;

                .ib-button {
                    width: 41px;
                    height: 41px;
                    background: #858585 no-repeat center center;
                    background-size: 21px 21px;
                    cursor: pointer;
                    transition: ease-in-out 0.2s;
                    text-align: center;

                    &:hover {
                        background-color: #a8a8a8;
                    }

                    &.ib-close {
                        background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none"><path stroke="white" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m6 6 12 12m0-12L6 18"/></svg>');
                        right: 0;
                    }
                }
            }
        }

        .ib-image-wrapper {
            opacity: 0;
            z-index: 99995;
            position: fixed;
            top: 0;
            right: 0;
            bottom: 0;
            left: 0;
            transition: opacity 0.6s;
            width: -webkit-fit-content;
            width: -moz-fit-content;
            width: fit-content;

            img {
                &.ib-image {
                    z-index: 99995;
                    position: fixed;
                    top: 50%;
                    left: 50%;
                    transform: translate(-50%, -50%);
                    max-width: 100vw;
                    max-height: 100vh;
                    min-width: 48px;
                    min-height: 48px;
                    -o-object-fit: contain;
                    object-fit: contain;
                    transition: ease-in-out 0.6s;
                    display: block;
                }

                &.ib-hidden {
                    opacity: 0;
                }

                &.ibFadeOut {
                    animation: ibFadeOut 0.6s forwards;
                }
                &.ibFadeIn {
                    animation: ibFadeIn 0.6s forwards;
                }
            }
        }

        .ib-control {
            div {
                z-index: 99996;
                position: fixed;
                top: 50%;
                transform: translateY(-50%);
                background-color: #858585;
                background-size: 32px 32px;
                background-position: center;
                background-repeat: no-repeat;
                padding: 32px 20px;
                cursor: pointer;
                transition: ease-in-out 0.4s;

                &[disabled] {
                    cursor: default;
                    background-color: #3d3d3d;
                    box-shadow: none;
                    pointer-events: none;
                }
            }

            .ib-control- {
                &left {
                    left: 0;
                    border-radius: 0 3px 3px 0;
                    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"><path stroke="white" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m15 6-6 6 6 6"/></svg>');
                    box-shadow: 2px 0 16px rgba(0, 0, 0, 0.5);
                }

                &right {
                    right: 0;
                    border-radius: 3px 0 0 3px;
                    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"><path stroke="white" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m9 6 6 6-6 6"/></svg>');
                    box-shadow: -2px 0 16px rgba(0, 0, 0, 0.5);
                }
            }
        }

        .ib-caption {
            z-index: 99996;
            position: fixed;
            bottom: 0;
            display: none;
            padding: 60px;
            color: #fff;
            font-size: 1.2em;
            box-sizing: border-box;
            width: 100%;
            background: linear-gradient(rgba(#000, 0), #222);

            &.location::before {
                z-index: 99996;
                position: fixed;
                content: '';
                width: 1.2em;
                height: 1.2em;
                margin-left: -28px;
                background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"><path stroke="white" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 21c3.5-3.6 7-6.824 7-10.8S15.866 3 12 3s-7 3.224-7 7.2 3.5 7.2 7 10.8"/><path stroke="white" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 13a3 3 0 1 0 0-6 3 3 0 0 0 0 6"/></svg>');
                background-size: 1.2em 1.2em;
            }
        }
    }
}

@-webkit-keyframes ibLoading {
    0% {
        -webkit-transform: rotate(0deg);
        -webkit-transform: translate(-50%, -50%);
    }
    100% {
        -webkit-transform: rotate(360deg);
        -webkit-transform: translate(-50%, -50%);
    }
}

@keyframes ibLoading {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }
    100% {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

@media screen and (max-width: 720px) {
    #imagebox .ib-content .ib-description {
        padding: 45px;
    }
}

@keyframes ibFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes ibFadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}
