/* Homepage videos (public/includes/video_cover.html): the cover fills the box
   that sets the video's shape, and the player that replaces it does too. */
.hub2-video { position: relative; }

.video-cover,
.video-cover-frame {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.video-cover {
    display: block;
    overflow: hidden;
    background: color-mix(in srgb, var(--slms-heading) 88%, black);
    cursor: pointer;
}

/* YouTube's cover is 4:3 with bands above and below a 16:9 video; covering
   the 16:9 box crops exactly those bands. */
.video-cover__image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease, filter 0.4s ease;
}

.video-cover__play {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 4.25rem;
    height: 4.25rem;
    display: grid;
    place-items: center;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    background: color-mix(in srgb, black 62%, transparent);
    box-shadow: 0 0 0 2px color-mix(in srgb, white 85%, transparent);
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.video-cover__play svg {
    width: 2rem;
    height: 2rem;
    margin-left: 0.2rem;
    fill: white;
}

.video-cover:hover .video-cover__image,
.video-cover:focus-visible .video-cover__image {
    transform: scale(1.03);
    filter: brightness(0.9);
}

.video-cover:hover .video-cover__play,
.video-cover:focus-visible .video-cover__play {
    background: var(--slms-accent);
    transform: translate(-50%, -50%) scale(1.06);
}

.video-cover:focus-visible {
    outline: 3px solid var(--slms-accent);
    outline-offset: -3px;
}

@media (prefers-reduced-motion: reduce) {
    .video-cover__image,
    .video-cover__play { transition: none; }
}
