.mjvp {
    position: relative;
    padding: 32px 0 20px;
    margin-top: var(--mjvp-mt, 0);
    margin-bottom: var(--mjvp-mb, 0);
    clear: both;
}

.mjvp__head {
    text-align: center;
    padding: 0 20px 16px;
}

.mjvp__title {
    margin: 0;
    font-size: 24px;
    line-height: 1.25;
    font-weight: 700;
}

.mjvp__sub {
    margin: 6px 0 0;
    font-size: 14px;
    opacity: .75;
}

.mjvp__wrap {
    position: relative;
}

.mjvp__track {
    display: flex;
    gap: 10px;
    padding: 0 16px 8px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    scroll-padding-inline: 16px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.mjvp__track::-webkit-scrollbar {
    display: none;
}

/* Reset theme button styles, then size the card. Height is reserved by aspect-ratio, so nothing shifts on load. */
.mjvp .mjvp__card {
    position: relative;
    flex: 0 0 40%;
    max-width: 200px;
    min-width: 0;
    min-height: 0;
    aspect-ratio: 9 / 16;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 14px;
    overflow: hidden;
    background: #111;
    box-shadow: none;
    line-height: 1;
    text-transform: none;
    cursor: pointer;
    scroll-snap-align: start;
    contain: paint;
}

.mjvp__card video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
}

.mjvp__play {
    position: absolute;
    inset-block-end: 10px;
    inset-inline-start: 10px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(0, 0, 0, .45);
    transition: opacity .2s;
}

.mjvp__play::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-35%, -50%);
    border-style: solid;
    border-width: 6px 0 6px 10px;
    border-color: transparent transparent transparent #fff;
}

.mjvp__card.is-playing .mjvp__play {
    opacity: 0;
}

.mjvp__handle {
    position: absolute;
    top: 8px;
    left: 8px;
    right: 8px;
    display: flex;
    align-items: center;
    gap: 4px;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
    text-shadow: 0 1px 3px rgba(0, 0, 0, .7);
    pointer-events: none;
}

.mjvp__name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mjvp__verified {
    flex: 0 0 auto;
}

.mjvp .mjvp__nav {
    display: none;
}

@media (min-width: 768px) {
    .mjvp__track {
        gap: 14px;
        padding-inline: 48px;
        scroll-padding-inline: 48px;
    }

    .mjvp .mjvp__card {
        flex-basis: 200px;
    }

    .mjvp .mjvp__nav {
        display: flex;
        align-items: center;
        justify-content: center;
        position: absolute;
        top: 50%;
        z-index: 2;
        width: 36px;
        height: 36px;
        min-height: 0;
        margin: -18px 0 0;
        padding: 0;
        border: 0;
        border-radius: 50%;
        background: #fff;
        color: #111;
        font-size: 22px;
        line-height: 1;
        box-shadow: 0 2px 8px rgba(0, 0, 0, .18);
        cursor: pointer;
    }

    .mjvp .mjvp__nav--prev { right: 6px; }
    .mjvp .mjvp__nav--next { left: 6px; }
    .mjvp .mjvp__nav[disabled] { opacity: .3; cursor: default; }
}

.mjvp.is-static .mjvp__track {
    justify-content: center;
}

.mjvp.is-static .mjvp__nav {
    display: none;
}

@media (max-width: 549px) {
    .mjvp {
        margin-top: var(--mjvp-mt-sm, var(--mjvp-mt, 0));
        margin-bottom: var(--mjvp-mb-sm, var(--mjvp-mb, 0));
    }
}

/* Lightbox */
.mjvp__dialog {
    width: 100vw;
    max-width: 100vw;
    height: 100vh;
    height: 100dvh;
    max-height: 100dvh;
    margin: 0;
    padding: 0;
    border: 0;
    background: #000;
    overflow: hidden;
}

.mjvp__dialog::backdrop {
    background: rgba(0, 0, 0, .6);
}

.mjvp__dialog[open] {
    display: flex;
    align-items: center;
    justify-content: center;
}

.mjvp__stage {
    height: min(92dvh, 900px);
    aspect-ratio: 9 / 16;
    max-width: 100vw;
    border-radius: 12px;
    overflow: hidden;
    background: #000;
}

.mjvp__stage video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    background: #000;
}

.mjvp__dialog .mjvp__close,
.mjvp__dialog .mjvp__dnav {
    position: absolute;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    min-height: 0;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .16);
    color: #fff;
    font-size: 26px;
    line-height: 1;
    box-shadow: none;
    cursor: pointer;
}

.mjvp__dialog .mjvp__close { top: 12px; right: 12px; }
.mjvp__dialog .mjvp__dnav { top: 50%; margin-top: -20px; }
.mjvp__dialog .mjvp__dnav--prev { right: 12px; }
.mjvp__dialog .mjvp__dnav--next { left: 12px; }
.mjvp__dialog .mjvp__dnav[hidden] { display: none; }

@media (prefers-reduced-motion: reduce) {
    .mjvp__track { scroll-behavior: auto; }
    .mjvp__play { transition: none; }
}
