/* ============================================================================
   V19.8 — PREMIUM VIDEO GRID + FIXED TITLES + FIXED NAVIGATION (ULTRA FIX)
   ============================================================================ */


/* ============================================================================
   1. INLINE OVERRIDE KILLER
   ============================================================================ */

.list-videos .item,
.list-videos .item.related-item-pro,
.list-videos .item[style],
.list-videos .item.related-item-pro[style] {
    display: flex !important;
    flex-direction: column !important;
    float: none !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    box-sizing: border-box !important;
}


/* ============================================================================
   2. GLOBAL PAGE PADDING FIX
   ============================================================================ */

body:not(.video) .main-container,
body:not(.video) .main-content,
body:not(.video) .content {
    padding-left: 0 !important;
    padding-right: 0 !important;
}

body:not(.video) .headline,
body:not(.video) .sort {
    padding-left: 0 !important;
    padding-right: 0 !important;
}


/* ============================================================================
   3. GRID WRAPPERS
   ============================================================================ */

.list-videos .margin-fix,
#list_videos_most_recent_videos_items,
#list_videos_latest_videos_items,
#list_videos_most_viewed_videos_items,
#list_videos_top_rated_videos_items,
#list_videos_most_commented_videos_items,
#list_videos_related_videos_items,
#list_videos_related_videos_items_margin-fix {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    width: 100% !important;
    gap: 24px !important;
    padding: 0 !important;
    margin: 0 !important;
    box-sizing: border-box !important;
}


/* ============================================================================
   4. RESPONSIVE BREAKPOINTS
   ============================================================================ */

@media (max-width: 1400px) {
    .list-videos .margin-fix,
    #list_videos_most_recent_videos_items,
    #list_videos_latest_videos_items,
    #list_videos_most_viewed_videos_items,
    #list_videos_top_rated_videos_items,
    #list_videos_most_commented_videos_items,
    #list_videos_related_videos_items {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

@media (max-width: 950px) {
    .list-videos .margin-fix,
    #list_videos_most_recent_videos_items,
    #list_videos_latest_videos_items,
    #list_videos_most_viewed_videos_items,
    #list_videos_top_rated_videos_items,
    #list_videos_most_commented_videos_items,
    #list_videos_related_videos_items {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 550px) {
    .list-videos .margin-fix,
    #list_videos_most_recent_videos_items,
    #list_videos_latest_videos_items,
    #list_videos_most_viewed_videos_items,
    #list_videos_top_rated_videos_items,
    #list_videos_most_commented_videos_items,
    #list_videos_related_videos_items {
        grid-template-columns: 1fr !important;
        gap: 18px !important;
    }
}


/* ============================================================================
   5. VIDEO CARD DESIGN
   ============================================================================ */

.list-videos .item.related-item-pro {
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid rgba(0,0,0,0.07);
    box-shadow: 0 1px 6px rgba(0,0,0,0.05);
    transition: .25s ease;
}

.list-videos .item.related-item-pro:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.13);
}


/* ============================================================================
   6. THUMBNAIL
   ============================================================================ */

.list-videos .item .thumb-box {
    width: 100%;
    padding-top: 56.25%;
    position: relative;
    overflow: hidden;
    background: #000;
    border-radius: 14px 14px 0 0;
    z-index: 2;
}

.list-videos .item .thumb-box img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .3s ease, opacity .2s ease;
}


/* ============================================================================
   7. BADGES (HD / 2K / 4K)
   ============================================================================ */

.list-videos .thumb-duration,
.list-videos .is-hd {
    position: absolute;
    padding: 2px 7px;
    border-radius: 6px;
    font-weight: 700;
    color: #fff;
    z-index: 10 !important;
}

.list-videos .thumb-duration {
    bottom: 8px;
    right: 8px;
    background: rgba(0,0,0,0.70);
}

.list-videos .is-hd {
    top: 10px;
    right: 10px;
    background: rgba(0,0,0,0.55);
    font-size: 12px;
}


/* ============================================================================
   8. META-TOP
   ============================================================================ */

.pl-meta-top {
    padding: 10px 14px 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: #666;
    min-height: 28px;
    white-space: nowrap;
}

.pl-sponsor {
    flex-shrink: 1;
    max-width: 60%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pl-sponsor-link {
    font-weight: 700;
    background: linear-gradient(90deg, #ff4ba8, #ff2f93);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.pl-meta-right {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
    white-space: nowrap;
}

.pl-views {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.pl-views-icon {
    width: 16px;
    height: 16px;
}

.pl-separator {
    opacity: .45;
    font-weight: 600;
}

.pl-time {
    opacity: .85;
}


/* ============================================================================
   9. VIDEO TITLE (BASE)
   ============================================================================ */

.list-videos .video-title {
    padding: 4px 14px 6px;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.32;
    color: #111;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 50px;
}


/* ============================================================================
   10. HIDE RATING
   ============================================================================ */

.list-videos .stats-row .pos,
.list-videos .stats-row .neutral {
    display: none !important;
}


/* ============================================================================
   11. HEADLINE MOBILE FIX
   ============================================================================ */

@media (max-width: 700px) {
    .headline,
    .headline h1,
    .sort {
        padding-left: 12px !important;
        padding-right: 12px !important;
    }
}


/* ============================================================================
   12. ZOOM PREVIEW (DESKTOP ONLY)
   ============================================================================ */

@media (hover: hover) and (pointer: fine) {
    .list-videos .item.related-item-pro .thumb-box {
        overflow: hidden;
        transition: transform .30s ease, opacity .25s ease;
    }

    .list-videos .item.related-item-pro:hover .thumb-box {
        transform: scale(1.08) !important;
        opacity: .97;
    }

    .list-videos .item.related-item-pro:hover .thumb-box img {
        transform: scale(1.12) !important;
        opacity: .96;
    }

    .list-videos .item.related-item-pro:hover {
        transform: scale(1.03) !important;
        box-shadow: 0 18px 32px rgba(0,0,0,0.22);
        z-index: 30;
    }
}


/* ============================================================================
   13. FINAL PREMIUM NAVIGATION
   ============================================================================ */

.navigation {
    position: sticky;
    top: 0;
    z-index: 9999;
    background: rgba(255, 255, 255, 0.92);
    border-bottom: 1px solid rgba(0,0,0,0.06);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: 16px 0 12px;
}

.navigation ul.primary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 36px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.navigation ul.primary li a {
    display: inline-flex;
    align-items: center;
    font-family: "Inter", "Roboto", "Helvetica Neue", Arial, sans-serif;
    font-weight: 700;
    font-size: 15.5px;
    color: #222;
    text-decoration: none;
    padding-bottom: 5px;
    border-bottom: 2px solid transparent;
    transition: color .25s ease, border-color .25s ease;
}

.navigation ul.primary li a:hover,
.navigation ul.primary li.selected a {
    color: #ff2fa5;
    border-bottom-color: #ff2fa5;
}

@media (max-width: 1050px) {
    .navigation ul.primary {
        gap: 28px;
    }
}

@media (max-width: 800px) {
    .navigation {
        padding: 12px 0 10px;
    }

    .navigation ul.primary {
        flex-wrap: wrap;
        gap: 18px;
        padding: 0 10px;
    }

    .navigation ul.primary li a {
        font-size: 14.2px;
        padding-bottom: 4px;
    }
}


/* ============================================================================
   14. FINAL HARD FIX TITLE — OVERRIDE EVERYTHING
   ============================================================================ */

.list-videos .item.related-item-pro .video-title,
.list-videos .item.related-item-pro strong.video-title,
.list-videos .item.related-item-pro .strong-video-title {
    padding: 4px 14px 6px !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    line-height: 1.32 !important;
    color: #111 !important;

    display: -webkit-box !important;
    -webkit-box-orient: vertical !important;
    -webkit-line-clamp: 2 !important;

    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: normal !important;

    max-height: 50px !important;
    min-height: 50px !important;
    height: 50px !important;

    margin: 0 !important;
    box-sizing: border-box !important;

    word-break: break-word !important;
}

/* HARD FIX — link musi być blokowy, inaczej line-clamp wariuje */
.pl-video-link {
    display: block !important;
}


/* ============================================================================
   V19.9 — RELATED VIDEOS (PREMIUM STYLE + TABS + CLEAN HEADER)
   ============================================================================ */

/* ----------------------- Nagłówek sekcji ----------------------- */

.pl-related-title {
    margin: 40px 0 20px;
    font-size: 24px;
    font-weight: 800;
    color: #111;
    padding-left: 2px;
    line-height: 1.3;
}

/* ----------------------- Tabs / Filtry ----------------------- */

.pl-related-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 0 0 22px;
    padding: 0;
    list-style: none;
}

.pl-related-tabs li {
    margin: 0;
    padding: 0;
}

.pl-related-tabs li a,
.pl-related-tabs li span.active {
    display: inline-block;
    padding: 6px 14px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 30px;
    border: 1px solid rgba(0,0,0,0.15);
    text-decoration: none;
    transition: .25s ease;
}

.pl-related-tabs li a {
    background: #fff;
    color: #333;
}

.pl-related-tabs li a:hover {
    background: #ffebf7;
    border-color: #ff2fa5;
    color: #ff2fa5;
}

.pl-related-tabs li span.active {
    background: #ff2fa5;
    color: #fff;
    border-color: #ff2fa5;
    cursor: default;
}

/* ----------------------- Odstęp od siatki ----------------------- */

.related-videos {
    margin-top: 40px;
}

@media (max-width: 700px) {
    .pl-related-title {
        font-size: 20px;
        margin-bottom: 14px;
    }

    .pl-related-tabs {
        gap: 8px;
    }

    .pl-related-tabs li a,
    .pl-related-tabs li span.active {
        padding: 5px 12px;
        font-size: 13px;
    }
}