/* Version 1.8.2 - Mobile-First Layout Stabilization (No FOUC) */

:root {
    --hvg-blue: rgb(30, 115, 190);
    --hvg-text: rgb(71, 71, 71);
    --hvg-text-light: #777;
    --hvg-border: #eee;
    --hvg-bg-light: #f9f9f9;
}

/* 1. Main Slider Fixes */
.hvg-gallery-wrapper {
    max-width: 1270px;
    margin: 40px auto;
    position: relative;
    padding-bottom: 50px;
    /* Space for dots */
    box-sizing: border-box;
}

.hvg-swiper-container {
    overflow: hidden;
    width: 100%;
}

/* Fix for gallery layout on load (FOUC) - Mobile First */
.hvg-swiper-container:not(.swiper-initialized) .swiper-wrapper {
    display: flex !important;
    gap: 15px;
    /* Mobile gap */
}

.hvg-swiper-container:not(.swiper-initialized) .hvg-slide-item {
    width: 85% !important;
    /* Default mobile width (1.2 slides visible) */
    flex-shrink: 0;
}

/* Desktop Fallback (Matching JS breakpoints) */
@media (min-width: 1024px) {
    .hvg-swiper-container:not(.swiper-initialized) .swiper-wrapper {
        gap: 25px;
        /* Desktop gap */
    }

    .hvg-swiper-container:not(.swiper-initialized) .hvg-slide-item {
        width: calc(33.333% - 17px) !important;
        /* Proper 3-column desktop width */
    }
}

.hvg-slide-item {
    height: auto;
    box-sizing: border-box;
}

/* Fix clickable area: Link should be block and contain its children correctly */
.hvg-slide-item a {
    display: block;
    text-decoration: none;
    width: 100%;
}

.hvg-thumbnail-card {
    aspect-ratio: 16/9;
    width: 100%;
    background-size: cover;
    background-position: center;
    border-radius: 4px;
    border: 1px solid var(--hvg-border);
    background-color: var(--hvg-bg-light);
    transition: transform 0.2s ease;
}

.hvg-slide-item a:hover .hvg-thumbnail-card {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.hvg-card-title-main {
    margin: 15px 0 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--hvg-text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
    transition: color 0.2s ease;
}

.hvg-slide-item a:hover .hvg-card-title-main {
    color: var(--hvg-blue);
}

/* Footer Navigation (Arrows in place of dots) */
.hvg-gallery-footer-nav {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 15px !important;
    margin-top: 30px !important;
    position: relative !important;
    height: auto !important;
    visibility: visible !important;
}

.hvg-small-nav {
    position: static !important;
    width: 40px !important;
    height: 40px !important;
    margin: 0 !important;
    color: var(--hvg-blue) !important;
    border: 1px solid var(--hvg-border) !important;
    border-radius: 4px !important;
    background: white !important;
    transition: all 0.2s ease !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    inset: auto !important;
    /* Resets top/left/right/bottom */
    transform: none !important;
}

.hvg-small-nav:after {
    font-size: 16px !important;
    font-weight: 800 !important;
}

.hvg-small-nav:hover:not(.swiper-button-disabled) {
    background: var(--hvg-blue) !important;
    color: white !important;
    border-color: var(--hvg-blue) !important;
}

.hvg-small-nav.swiper-button-disabled {
    opacity: 0.2 !important;
    cursor: default !important;
    background: #f9f9f9 !important;
    border-color: #eee !important;
}

.hvg-nav-divider {
    width: 1px !important;
    height: 20px !important;
    background: var(--hvg-border) !important;
    display: block !important;
}

/* 2. Watch Page Redesign (Light Theme) */
.hvg-watch-main {
    max-width: 1270px !important;
    width: 100% !important;
    margin: 0 auto !important;
    display: grid !important;
    grid-template-columns: 920px 320px !important;
    /* FORCED COLUMN SIZES */
    gap: 30px !important;
    padding: 30px 0 !important;
    background: transparent !important;
    box-sizing: border-box !important;
}

.hvg-video-section {
    min-width: 0 !important;
    /* Needed for grid children containing text */
    width: 920px !important;
}

.hvg-video-container {
    width: 100% !important;
    aspect-ratio: 16/9 !important;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    position: relative;
}

.hvg-video-info h1 {
    font-size: 24px !important;
    margin: 25px 0 10px !important;
    font-weight: 700 !important;
    color: #333 !important;
    line-height: 1.2 !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
}

.hvg-content {
    color: var(--hvg-text);
    line-height: 1.6;
    font-size: 15px;
}

/* 3. Sidebar (FIXED WIDTH) */
.hvg-watch-sidebar {
    width: 320px !important;
    min-width: 320px !important;
    max-width: 320px !important;
}

.hvg-watch-sidebar h3 {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--hvg-blue);
    display: inline-block;
    padding-bottom: 8px;
    color: var(--hvg-text);
}

.hvg-sidebar-list {
    display: flex !important;
    flex-direction: column !important;
    gap: 15px !important;
    overflow-y: auto !important;
    padding-right: 10px !important;
    max-height: 500px;
}

/* Custom Scrollbar for Sidebar */
.hvg-sidebar-list::-webkit-scrollbar {
    width: 6px;
}

.hvg-sidebar-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.hvg-sidebar-list::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 10px;
}

.hvg-sidebar-list::-webkit-scrollbar-thumb:hover {
    background: var(--hvg-blue);
}

.hvg-sidebar-item {
    display: flex;
    gap: 12px;
    text-decoration: none;
    align-items: flex-start;
}

.hvg-sidebar-thumb {
    width: 140px;
    aspect-ratio: 16/9;
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
    border-radius: 4px;
    border: 1px solid var(--hvg-border);
    background-color: var(--hvg-bg-light);
}

.hvg-sidebar-info {
    flex: 1;
    min-width: 0;
}

.hvg-sidebar-title {
    font-size: 13px !important;
    font-weight: 600;
    line-height: 1.4;
    color: var(--hvg-text);
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.2s ease;
}

.hvg-sidebar-item:hover .hvg-sidebar-title {
    color: var(--hvg-blue);
}

.hvg-sidebar-meta {
    font-size: 11px;
    color: var(--hvg-text-light);
    margin-top: 4px;
}

/* Autoplay Overlay Polish */
#hvg-autoplay-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 100;
    color: white;
}

#hvg-autoplay-overlay h3 {
    font-size: 24px;
    margin-bottom: 20px;
}

#hvg-cancel-autoplay {
    background: var(--hvg-blue);
    border: none;
    color: white;
    padding: 10px 25px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
}

/* Responsive */
@media (max-width: 1270px) {
    .hvg-watch-main {
        grid-template-columns: 1fr 320px !important;
        padding-left: 20px !important;
        padding-right: 20px !important;
    }

    .hvg-video-section {
        width: auto !important;
    }
}

@media (max-width: 991px) {
    .hvg-watch-main {
        display: block !important;
        /* Stack them on mobile */
    }

    .hvg-video-section {
        width: 100% !important;
        max-width: 100% !important;
    }

    .hvg-watch-sidebar {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        margin-top: 30px;
    }

    .hvg-gallery-wrapper {
        padding: 0 20px 50px;
    }
}

/* ENSURE THEME DOESN'T CONSTRICT US */
.single-hvg_video .container,
.single-hvg_video .content-area,
.single-hvg_video .site-main,
.single-hvg_video #primary,
.single-hvg_video main,
.single-hvg_video .entry-content {
    max-width: 1320px !important;
    width: 100% !important;
    min-width: 0 !important;
    padding-left: 15px !important;
    padding-right: 15px !important;
}