/*
 * Overlay Styles
 */

@close_button_size: 33px;

html {

    &.blur {
        .siteWrapper {
            filter: blur(5px);
        }
    }

    &.noScroll {
        overflow: hidden;
    }
}

.overlayBoxOuter {
    position: fixed;
    z-index:9100;
    top: 0;
    width: 100%;
    min-height: 100%;
    height: 100%;
    background: #090909;
    background: rgba(0,0,0,0.5);
    overflow: hidden;

    .ps-container {
        position: relative;

        > .ps-scrollbar-y-rail {
            opacity: 1;
        }
    }
}

.overlayBox {
    position: absolute;
    opacity: 0;
    display: block;
    max-width: 100%;

    .overlayContent {
        background: #fff;
        margin-top: @close_button_size;
        max-height: ~'calc(100% - @{close_button_size})';
        position: relative;
        height: 100%;
    }

    &.hasLink {

        .overlayImage {
            position: relative;
        }
    }

    .overlayImage {

        img {
            max-width: 100%;
            height: auto;
            display: block;
        }
    }

    .overlayVideo {
        position: relative;

        iframe,
        video {
            position: absolute;
            top: 0;
            left: 0;
            display: block;
            background-color: @dark_color;
        }
    }

    &.overlayFullscreen {

        .overlayAjax {
            height: 100% !important;

            iframe {
                width: 100%;
                height: 100%;
            }
        }

        .overlayContent, .overlayVideo {
            height: 100% !important;
            padding: 0 !important;
        }
    }

    .overlayAjax {
        overflow-y: auto;
        max-height: 100%;
    }
}

.overlayContentLoading, .overlayLoading {

    &:before {
        position: absolute;
        top: 50%;
        left: 50%;
        .fa(f1ce, #fff);
        .rems(30);
        transform: translate(-50%, -50%);
        animation: overlay-spinner 2s infinite linear;
    }
}

@keyframes overlay-spinner {

  0% {
    transform: translate(-50%, -50%) rotate(0);
  }
  100% {
    transform: translate(-50%, -50%) rotate(350deg);
  }

}

.noScroll {
    overflow: hidden;
    position: relative;
}

.overlayCloseButton {
    z-index: 9200;
    text-align: right;
    position: absolute;
    top: 0;
    right: 0;

    a {
        background: @highlight_color;
        color: #fff;
        font-weight: bold;
        display: inline-block;
        cursor: pointer;
        padding: 5px 10px;
        font-family: @primary_font;
        font-size: 14px;
        text-transform: uppercase;
        z-index: 9200;
        outline: 0;
        text-decoration: none;
    }
}

.overlayAjax {
    padding: 20px;
}

.overlayBoxTitle {
    position: relative;
    bottom: 0;
    line-height: 30px;
    font-size: 18px;
    width: 100%;
    text-align: center;
    left: 0;
    display: block;
    color: #fff;
}

.overlayBoxLink {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: block;
}

.overlayBox {

    .galleryPrev, .galleryNext {
        position: absolute;
        top: 50%;
        left: 20px;
        transform: translateY(-50%);
        background: rgba(255, 255, 255, 0.3);
        width: 40px;
        height: 40px;
        line-height: 40px;
        border-radius: 50%;
        transition: background 0.3s;
        text-align: center;
        cursor: pointer;
        z-index: 100;

        &:before {
            .fa(f104);
            .rems(20);
            color: #fff;
        }

        &:hover {
            background: rgba(255, 255, 255, 0.5);
        }

        &:focus {
            border: none;
            outline: none;
        }

        &.arrowInactive {
            display: none;
        }
    }

    .galleryNext {
        right: 20px;
        left: auto;

        &:before {
            content: '\f105';
        }
    }
}
