
/* Video Wrapper */
.custom-video-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* Maintain 16:9 aspect ratio for the video */
    height: 0; /* Maintain aspect ratio using padding */
    display: block;
    overflow: hidden;
}

/* Video Element (MP4) */
.custom-video-wrapper video {
    width: 100%;
    height: auto; /* Ensure the video takes up the correct height based on aspect ratio */
    display: block;
    position: relative; /* Keep video in normal page flow */
}

/* YouTube Iframe */
.custom-video-wrapper iframe {
    width: 100%;
    height: 100%; /* Fill the height of the container */
    border: 0;
    position: relative; /* Ensure iframe is in normal page flow */
}

/* Overlay Style */
.custom-video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    cursor: pointer;
    z-index: 5;
}

/* Mobile Styles for screens below 768px */
@media (max-width: 767px) {
    .custom-video-wrapper {
        width: 100% !important;
        height: 0 !important;
        padding-bottom: 56.25%; /* Maintain aspect ratio */
        position: relative;
        z-index: 1;
    }

    .custom-video-wrapper video,
    .custom-video-wrapper iframe {
        width: 100% !important;
        height: auto !important; /* Ensure height is determined by aspect ratio */
        position: relative;
    }

    .custom-video-overlay {
        width: 100% !important;
        height: 100% !important;
        top: 0;
        left: 0;
        position: absolute;
        background-size: cover;
        background-position: center;
        z-index: 2;
    }
}
