/* Static rules for mvideo shortcode/block. Per-instance ratio via --gm-pb (single number,
   defaulted to 56.25 = 16:9). Used as % on desktop, vw on mobile (full-bleed wrap). */

.mvideo-wrap {
    position: relative;
    overflow: hidden;
    padding-bottom: calc(var(--gm-pb, 56.25) * 1%);
    height: 0;
}
.mvideo-wrap iframe,
.mvideo-wrap .video-js {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-width: 0;
    outline-width: 0;
}

/* Failure overlay — shown by mvideo.js on YT.Player onError or load timeout. */
.mvideo-wrap .mvideo-failure-overlay {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    z-index: 10;
    padding: 16px;
    text-align: left;
}
.mvideo-wrap .mvideo-failure-overlay.is-shown { display: flex; }
.mvideo-wrap .mvideo-failure-card {
    max-width: 480px;
    width: 100%;
    position: relative;
    font-size: 15px;
    line-height: 1.45;
}
.mvideo-wrap .mvideo-failure-title {
    margin: 0 0 10px;
    font-size: 18px;
    color: #fff;
}
.mvideo-wrap .mvideo-failure-message {
    margin: 0;
    color: #fff;
}
.mvideo-wrap .mvideo-failure-close {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 32px;
    height: 32px;
    border: 0;
    background: transparent;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
    padding: 0;
}

/* Facade — thumbnail + play button rendered until user click; iframe replaces it. */
.mvideo-wrap .mvideo-facade {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: 0;
    padding: 0;
    cursor: pointer;
    background: #000;
    overflow: hidden;
}
.mvideo-wrap .mvideo-facade img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.mvideo-wrap .mvideo-facade-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 68px;
    height: 48px;
    opacity: 0.85;
    transition: opacity 150ms ease;
    pointer-events: none;
}
.mvideo-wrap .mvideo-facade:hover .mvideo-facade-play,
.mvideo-wrap .mvideo-facade:focus-visible .mvideo-facade-play { opacity: 1; }

@media (max-width: 767px) {
    .mvideo-wrap {
        width: 100vw;
        left: 50%;
        right: 50%;
        margin-left: -50vw;
        margin-right: -50vw;
        padding-bottom: 0;
        height: calc(var(--gm-pb, 56.25) * 1vw);
    }
}
