.wp-video-background-container {
    position: relative;
    overflow: hidden;
    width: 100%;
    height: 100%;
    z-index: -1; /* Ensure video is behind content */
}

.wp-video-background-container video {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    transform: translate(-50%, -50%);
    object-fit: cover; /* Ensures video covers the container */
    z-index: -1;
}

/* Fallback for browsers that don't support object-fit */
@supports not (object-fit: cover) {
    .wp-video-background-container video {
        width: 100%;
        height: 100%;
        transform: none;
        top: 0;
        left: 0;
    }
}

/* Overlay for styling purposes */
.wp-video-background-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5); /* Example overlay color and opacity */
    z-index: 0; /* Position above video, below content */
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .wp-video-background-container video {
        /* Adjustments for smaller screens if needed, though object-fit: cover usually handles this well */
    }
}

/* Ensure the target element has a position context for the absolute positioned video */
/* This will be applied by JavaScript if the target element is not body */
.wp-video-background-target-element {
    position: relative;
}