/**
 * Video Container Block Frontend Styles
 */

.zonkey-video-container-wrapper {
    position: relative;
    overflow: hidden;
    display: flex;
    width: 100%;
}

/* Alignment Classes */
.zonkey-video-container-wrapper.align-h-left {
    justify-content: flex-start;
}

.zonkey-video-container-wrapper.align-h-center {
    justify-content: center;
}

.zonkey-video-container-wrapper.align-h-right {
    justify-content: flex-end;
}

.zonkey-video-container-wrapper.align-v-top {
    align-items: flex-start;
}

.zonkey-video-container-wrapper.align-v-center {
    align-items: center;
}

.zonkey-video-container-wrapper.align-v-bottom {
    align-items: flex-end;
}

/* Native Video Background */
.zonkey-video-container-wrapper > video.zonkey-video-bg {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    z-index: 1;
    object-fit: cover;
}

/* iframe Video Background (YouTube/Vimeo) */
.zonkey-video-iframe-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

.zonkey-video-iframe-wrapper iframe {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100vw;
    height: 56.25vw; /* 16:9 aspect ratio */
    min-height: 100%;
    min-width: 177.78vh; /* 16:9 aspect ratio */
}

/* Poster Image Background */
.zonkey-video-poster {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* Color Overlay */
.zonkey-video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
    pointer-events: none;
}

/* Content Container */
.zonkey-video-content {
    position: relative;
    z-index: 3;
    width: 100%;
    display: flex;
}

.zonkey-video-content-inner {
    width: 100%;
    margin-left: auto;
    margin-right: auto;
}

/* Ensure nested blocks inherit text color */
.zonkey-video-content-inner h1,
.zonkey-video-content-inner h2,
.zonkey-video-content-inner h3,
.zonkey-video-content-inner h4,
.zonkey-video-content-inner h5,
.zonkey-video-content-inner h6,
.zonkey-video-content-inner p,
.zonkey-video-content-inner li,
.zonkey-video-content-inner span {
    color: inherit;
}

/* Reset margins for better control */
.zonkey-video-content-inner > *:first-child {
    margin-top: 0;
}

.zonkey-video-content-inner > *:last-child {
    margin-bottom: 0;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .zonkey-video-iframe-wrapper iframe {
        width: 300%;
        height: auto;
        min-height: 100%;
    }
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    .zonkey-video-container-wrapper > video.zonkey-video-bg {
        animation: none;
    }
}

/* Animation disable support */
.reduce-motion .zonkey-video-container-wrapper > video.zonkey-video-bg {
    animation: none;
}
