/* Robert Video Grid — all selectors are intentionally prefixed with rvg- */

.rvg-wrap {
    position: relative;
    width: 100%;
}

/* Flex is the compatibility fallback; modern browsers upgrade to CSS Grid. */
.rvg-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    width: 100%;
    padding: 12px 0 32px;
}

.rvg-card {
    position: relative;
    width: calc(50% - 12px);
    overflow: hidden;
    background: #eeeeee;
    transform: translate3d(0, 0, 0) scale(1);
    filter: blur(0);
    opacity: 1;
    will-change: transform, filter, opacity;
    transition:
        transform 0.5s cubic-bezier(0.22, 1, 0.36, 1),
        box-shadow 0.5s cubic-bezier(0.22, 1, 0.36, 1),
        filter 0.45s ease,
        opacity 0.45s ease;
}

/* 16:9 without relying on the aspect-ratio property, for older Safari. */
.rvg-card::before {
    content: "";
    display: block;
    padding-top: 56.25%;
}

.rvg-video {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #eeeeee;
    outline: none;
}

@supports (display: grid) {
    .rvg-grid {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .rvg-card {
        width: 100%;
    }
}

.rvg-focus-overlay {
    position: fixed;
    inset: 0;
    z-index: 2147483000;
    pointer-events: none;
    opacity: 0;
    background: rgba(248, 248, 248, 0.22);
    transition: opacity 0.48s ease;
}

@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
    .rvg-focus-overlay {
        background: rgba(248, 248, 248, 0.08);
        -webkit-backdrop-filter: blur(3px);
        backdrop-filter: blur(3px);
    }
}

.rvg-focus-overlay.is-visible {
    opacity: 1;
}

body.rvg-focus-active .rvg-wrap {
    position: relative;
    z-index: 2147483001;
}

.rvg-grid.has-active .rvg-card:not(.is-active) {
    filter: blur(2px);
    opacity: 0.72;
}

.rvg-card.is-active {
    z-index: 2;
    transform: translate3d(0, -8px, 0) scale(1.01);
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.95),
        0 0 48px 14px rgba(255, 255, 255, 0.88),
        0 18px 44px rgba(0, 0, 0, 0.05);
}

.rvg-play-fallback {
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 5;
    transform: translate(-50%, -50%);
    width: 58px;
    height: 58px;
    border: 1px solid rgba(255,255,255,0.72);
    border-radius: 50%;
    background: rgba(255,255,255,0.88);
    color: #111;
    font-size: 19px;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 8px 26px rgba(0,0,0,0.12);
    -webkit-tap-highlight-color: transparent;
}

.rvg-play-fallback[hidden] {
    display: none !important;
}

@media (max-width: 980px) {
    .rvg-grid {
        gap: 18px;
    }

    .rvg-card {
        width: calc(50% - 9px);
    }
}

/* Phones: one large 16:9 video per row. */
@media (max-width: 700px) {
    .rvg-grid {
        display: block;
        padding: 8px 0 24px;
    }

    .rvg-card,
    .rvg-card.is-active,
    .rvg-card.is-mobile-active {
        width: 100%;
        margin: 0 0 16px;
        transform: none;
    }

    .rvg-card.is-mobile-active {
        box-shadow: 0 10px 28px rgba(0, 0, 0, 0.06);
    }
}

@media (hover: none), (pointer: coarse) {
    .rvg-focus-overlay {
        display: none !important;
    }

    .rvg-grid.has-active .rvg-card:not(.is-active) {
        filter: none;
        opacity: 1;
    }
}

@media (prefers-reduced-motion: reduce) {
    .rvg-card,
    .rvg-focus-overlay {
        transition: none !important;
    }

    .rvg-card.is-active {
        transform: none;
    }
}
