/**
 * Embedded Video Gallery - front office
 *
 *  @author    Kevin Mouchene
 *  @license   http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
 */

.evg-cover {
    position: relative;
}

/* Carousel and MagicToolbox galleries: the slide is the positioning context, and
   the theme's own still stays underneath to hold the slide's height. */
.evg-slide {
    position: relative;
}

/* MagicToolbox: the player sits just above the still (the zoom anchor is z-index 1)
   but below MagicThumb's own controls, and lets every pointer event through so the
   zoom keeps receiving the hover it works from. */
.evg-magic .evg-player {
    z-index: 2;
    pointer-events: none;
}

a.magictoolbox-selector.evg-has-video {
    display: inline-block;
}

/* Laid over the theme's own <picture>, which keeps handling the still images. */
.evg-player {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
    z-index: 3;
}

.evg-player[hidden] {
    display: none;
}

/* The zoom lightbox only knows how to show images. */
.evg-cover.evg-playing .layer {
    display: none;
}

.evg-has-video {
    position: relative;
}

.evg-thumb-badge {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 28px;
    height: 28px;
    margin: -14px 0 0 -14px;
    border-radius: 50%;
    background: rgba(0, 0, 0, .55);
    pointer-events: none;
    z-index: 2;
}

.evg-thumb-badge::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    margin: -5px 0 0 -3px;
    border-style: solid;
    border-width: 5px 0 5px 8px;
    border-color: transparent transparent transparent #fff;
}

@media (prefers-reduced-motion: reduce) {
    .evg-player {
        /* No autoplay in this mode: the poster and controls carry the interaction. */
        background: #000;
    }
}
