#main-video-player .theroot-video-info {
    display: none;
    width: 100%;
}

body.mobile-sticky-active #main-video-player {
    display: flex !important;
    flex-direction: row;
}

#main-video-player .theroot-video-info .theroot-video-blog-logo {
    max-width: 90px;
    height: 12px;
    margin: 6px 0px;
}

#main-video-player .theroot-video-info .theroot-video-info-top .theroot-video-info-view {
    display: block;
    font-size: 12px;
    line-height: 24px;
}

#main-video-player .theroot-video-info .theroot-video-info-top .theroot-video-info-view a {
    text-decoration: none;
    box-shadow: unset;
    color: white;
}

#main-video-player .theroot-video-info .theroot-video-info-title {
    display: block;
    color: white;
    font-size: 12px;
    line-height: 18px;
    text-decoration: none;
}

body.mobile-sticky-active #main-video-player .theroot-video-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-left: 5px;
}

body.mobile-sticky-active #main-video-player .theroot-video-info .theroot-video-info-top {
    display: flex;
    justify-content: space-between;
    padding-right: 40px;
}

/* Fix video dimensions - more specific selectors to avoid affecting other elements */
#video-playlist-container {
    max-width: 800px !important;
    margin: 20px auto !important;
    position: relative !important;

    border: 1px solid rgb(229, 229, 229);
    border-radius: 8px 8px 0 0;
}

#main-video-player-title {
    font-size: 16px;
    font-weight: bold;
    line-height: 24px;
    padding: 8px 8px 12px;
}

    #main-video-player-title::before {
    content: "Watch: ";
    }

#main-video-player {
    width: 100% !important;
    max-width: 800px !important;
    height: 450px !important;
    background: #000 !important;
    transition: all 0.3s ease-in-out !important;
}

#main-video-player .theroot-video-container {
    width: 100% !important;
    height: 450px !important;
    position: relative !important;
}

#main-video-player .theroot-video-container video {
    width: 100% !important;
    height: 450px !important;
    max-height: 450px !important;
    object-fit: cover !important;
}

#main-video-player .video-js {
    width: 100% !important;
    height: 450px !important;
    max-height: 450px !important;
}

/* ───────────────────────────────────────────────────────────────── */
/* MOBILE OVERRIDE: preserve aspect ratio on screens ≤ 768px         */
/* ───────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    /* 1) Make the container use an aspect‐ratio instead of fixed height */
    #main-video-player {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: var(--sticky-aspect-ratio, 16/9) !important;
    background: #000 !important;
    transition: all 0.3s ease-in-out !important;
    }

    /* 2) Ensure the inner wrapper fills that box */
    #main-video-player .theroot-video-container {
    width: 100% !important;
    height: 100% !important;
    position: relative !important;
    background: transparent !important;
    }

    /* 3) Make the video itself scale responsively */
    #main-video-player .theroot-video-container video,
    #main-video-player .video-js,
    #main-video-player .video-js .vjs-tech {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    background: transparent !important;
    }
}

/* Desktop sticky/floating video styles - FIXED to eliminate black bars */
#main-video-player.sticky {
    position: fixed !important;
    bottom: 20px !important;
    right: 20px !important;
    width: var(--sticky-video-width, 320px) !important;
    height: var(--sticky-video-height, 180px) !important;
    max-width: var(--sticky-video-width, 320px) !important;
    z-index: 9999 !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3) !important;
    border-radius: 8px !important;
    overflow: hidden !important;
    /* Remove any background that could cause black bars */
    background: transparent !important;
}

#main-video-player.sticky .theroot-video-container {
    width: var(--sticky-video-width, 320px) !important;
    height: var(--sticky-video-height, 180px) !important;
    margin: 0;
    /* Remove any background that could cause black bars */
    background: transparent !important;
}

#main-video-player.sticky .theroot-video-container video {
    width: var(--sticky-video-width, 320px) !important;
    height: var(--sticky-video-height, 180px) !important;
    max-height: var(--sticky-video-height, 180px) !important;
    /* CRITICAL: Use contain instead of cover to eliminate black bars */
    object-fit: contain !important;
    /* Remove any background that could cause black bars */
    background: transparent !important;
}

#main-video-player.sticky .video-js {
    width: var(--sticky-video-width, 320px) !important;
    height: var(--sticky-video-height, 180px) !important;
    max-height: var(--sticky-video-height, 180px) !important;
    /* Remove any background that could cause black bars */
    background: transparent !important;
}

/* Remove VideoJS default backgrounds that cause black bars */
#main-video-player.sticky .video-js .vjs-tech {
    object-fit: contain !important;
    background: transparent !important;
}

#main-video-player.sticky .video-js .vjs-poster {
    background-size: contain !important;
    background-color: transparent !important;
}

/* Close button for sticky video */
#main-video-player.sticky::after {
    content: '×' !important;
    position: absolute !important;
    top: 5px !important;
    right: 10px !important;
    color: white !important;
    font-size: 20px !important;
    font-weight: bold !important;
    cursor: pointer !important;
    background: rgba(0, 0, 0, 0.7) !important;
    border-radius: 50% !important;
    width: 25px !important;
    height: 25px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 10000 !important;
    line-height: 1 !important;
}

#main-video-player.sticky::after:hover {
    background: rgba(0, 0, 0, 0.9) !important;
}

/* Placeholder to maintain layout when video goes sticky */
#video-placeholder {
    width: 100% !important;
    height: 450px !important;
    background: #f0f0f0 !important;
    display: none !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 8px !important;
    color: #666 !important;
    font-size: 16px !important;
}

#video-placeholder.active {
    display: flex !important;
}

/* Ensure featured images are NOT affected - be very specific */
.wp-post-image,
.featured-image img,
.post-thumbnail img,
article img.wp-post-image,
.entry-content .wp-post-image,
.post-featured-image img,
.hero-image img,
.article-hero img {
    width: auto !important;
    max-width: 100% !important;
    height: auto !important;
    object-fit: none !important;
}

/* Reset any problematic image styles outside the video container */
img:not(#main-video-player img):not(#video-playlist-container img) {
    height: auto !important;
}

/* Make sure our video container styles don't leak */
body:not(#video-playlist-container) img,
.entry-content img:not(#main-video-player img),
.post-content img:not(#main-video-player img),
.content img:not(#main-video-player img) {
    height: auto !important;
    max-width: 100% !important;
}

/* Prevent leaks: never style ALL img tags globally */
img:not(.entry-content img):not(.post-content img):not(.content img):not(.footer img) {
    max-width: none !important;
    height: auto !important;
    object-fit: initial !important;
}

/* Mobile responsive sticky video - horizontal layout with dynamic sizing */
@media (max-width: 768px) {
    #main-video-player.sticky {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: auto !important;
        width: 100% !important;
        height: 100px !important;
        max-width: 100% !important;
        background: rgba(0, 0, 0, 0.95) !important;
        backdrop-filter: blur(10px) !important;
        border-radius: 0 !important;
        display: flex !important;
        align-items: flex-start !important;
        /* justify-content: center !important; */
        padding: 10px 12px !important;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5) !important;
        z-index: 9999 !important;
    }

    #main-video-player.sticky .theroot-video-container {
        width: var(--sticky-video-width, 142px) !important;
        height: var(--sticky-video-height, 80px) !important;
        flex-shrink: 0 !important;
        border-radius: 4px !important;
        overflow: hidden !important;
        /* Remove background to prevent black bars */
        background: transparent !important;
    }

    #main-video-player.sticky .theroot-video-container video {
        width: var(--sticky-video-width, 142px) !important;
        height: var(--sticky-video-height, 80px) !important;
        max-height: var(--sticky-video-height, 80px) !important;
        /* Use contain to eliminate black bars on mobile too */
        object-fit: contain !important;
        background: transparent !important;
    }

    #main-video-player.sticky .video-js {
        width: var(--sticky-video-width, 142px) !important;
        height: var(--sticky-video-height, 80px) !important;
        max-height: var(--sticky-video-height, 80px) !important;
        background: transparent !important;
    }

    /* Remove VideoJS backgrounds on mobile */
    #main-video-player.sticky .video-js .vjs-tech {
        object-fit: contain !important;
        background: transparent !important;
    }

    /* Dynamic video title positioning based on video width */
    /*
    #main-video-player.sticky::before {
            content: attr(data-video-title) !important;
            position: absolute !important;
            left: calc(var(--sticky-video-width, 142px) + 22px) !important;
            top: 50% !important;
            transform: translateY(-50%) !important;
            color: white !important;
            font-size: 14px !important;
            font-weight: 600 !important;
            line-height: 1.3 !important;
            max-width: calc(100% - var(--sticky-video-width, 142px) - 80px) !important;
            overflow: hidden !important;
            text-overflow: ellipsis !important;
            display: -webkit-box !important;
            -webkit-line-clamp: 2 !important;
            -webkit-box-orient: vertical !important;
            white-space: normal !important;
        }
    /*
    /* Close button repositioned for mobile */
    #main-video-player.sticky::after {
        content: '×' !important;
        position: absolute !important;
        top: 10px !important;
        right: 12px !important;
        color: white !important;
        font-size: 24px !important;
        font-weight: bold !important;
        cursor: pointer !important;
        background: rgba(255, 255, 255, 0.2) !important;
        border-radius: 50% !important;
        width: 28px !important;
        height: 28px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        z-index: 10001 !important;
        line-height: 1 !important;
    }

    #main-video-player.sticky::after:hover {
        background: rgba(255, 255, 255, 0.3) !important;
    }

    /* Add some top padding to body when sticky is active on mobile */
    body.mobile-sticky-active {
        padding-top: 100px !important;
    }

    /* Hide desktop placeholder on mobile when sticky */
    #video-placeholder.active {
        display: none !important;
    }
}

