/* General overlay styles
------------------------------------------------------------------------------------------ */

body.overlay-active {
    overflow: hidden;
}

/* For some reason, elements with the '.aos-...' class disappear when the overlay is active. So we set the visibilty to 'visible' if '.overlay-active' is set on the body */
html.js body.overlay-active [class*="aos-"] {
    visibility: visible;
}


.overlay {
    display: none;
}
.overlay.active {
    display: block;
    width: 100vw;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1045;
}

.overlay-container {
    position: relative;
    z-index: 1;
    transform: translateY(-50%);
    top: 50%;
    width: 90vw;
    max-width: 1140px;
    margin: 0 auto;
}

.overlay__close {
    position: absolute;
    width: 36px;
    height: 36px;
    top: 10px;
    right: 10px;
    z-index: 999;
    cursor: pointer;
    transition: transform 0.2s;
}
.overlay__close svg * {
    transition: all 0.2s ease-in-out;
}
.overlay__close:where(:hover, :focus) {
    transform: scale(1.1);
}
.overlay__close:where(:hover, :focus) svg circle {
    fill: var(--wp--preset--color--brand-color);
}
.overlay__close:where(:hover, :focus) svg line {
    stroke: var(--wp--preset--color--headlines);
}

.overlay__content {
    width: 100%;
    height: auto;
    max-height: 90vh;
    margin: 0 auto;
    overflow-y: auto;
    background: #fff;
    box-shadow: 0 4px 40px 0 rgba(0,0,0,0.24);
    border-radius: 12px;
}

.overlay__background {
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.2);
    position: fixed;
    top: 0;
    left: 0;
    z-index: -1;
}


.animate-fadeIn {
    animation: fadeIn 0.2s;
}
.animate-fadeOut {
    animation: fadeOut 0.2s;
}


@keyframes fadeIn {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}
@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}





/* Fix overlay position 'fixed' not working due to animation-fill-mode 'forward' */
body.overlay-active .do-animation {
    -webkit-animation-fill-mode: none !important;
            animation-fill-mode: none !important;
}

/* Fix wrong iframe size for YouTube video if autoplay is disabled */
@supports (aspect-ratio: 16/9) {
    .overlay__content[data-autoplay="false"] .mejs-container.wp-video-shortcode {
        aspect-ratio: 16/9;
        width: auto !important;
        height: auto !important;
    }
    .overlay__content[data-autoplay="false"] .mejs-container.wp-video-shortcode iframe {
        width: 100% !important;
        height: 100% !important;
    }
}
