/* ============================================================
   Xvids-Style Home — dense video grid, mobile-responsive.
   Scoped under .xvh-page so it doesn't leak into other templates.
   ============================================================ */

.xvh-page {
    /* No max-width cap — verified via Screen Ruler that xvideos's content
       fills full viewport (minus body padding) with no constraint at
       typical desktop viewports. Just bottom padding for grid breathing. */
    background: transparent;
    color: inherit;
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
    padding: 0 0 24px;
    box-sizing: border-box;
}

/* Force every content wrapper from .xvh-page down to fill 100% of its
   parent. Without this, Bootstrap's .row negative margins + container
   gutter variables can leave the grid narrower than the body content
   area, producing an asymmetric right-side gap that doesn't reflow
   correctly on viewport changes. */
.xvh-page .container-fluid,
.xvh-page .xvh-main,
.xvh-page .xvh-grid-wrap,
.xvh-page .post-grid {
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    box-sizing: border-box !important;
}
.xvh-page .row.xvh-grid,
.xvh-page .xvh-grid {
    --bs-gutter-x: 0 !important;
    --bs-gutter-y: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    max-width: none !important;
    box-sizing: border-box !important;
}

/* ---------- Banners (widget areas) ---------- */
.xvh-page .xvh-banner {
    margin: 12px auto;
    text-align: center;
}
.xvh-page .xvh-banner img,
.xvh-page .xvh-banner iframe {
    max-width: 100%;
    height: auto;
    display: inline-block;
}
.xvh-page .xvh-widget { margin: 0 auto; }

/* ---------- Grid ---------- */
.xvh-page .xvh-grid-wrap {
    margin: 0 auto;
}
.xvh-page .xvh-grid {
    display: grid;
    gap: 4px;            /* xvideos uses tight 4px gutter between tiles */
    grid-template-columns: repeat(2, 1fr);
    margin: 0;
}
@media (min-width: 576px)  { .xvh-page .xvh-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 768px)  { .xvh-page .xvh-grid { grid-template-columns: repeat(4, 1fr); } }
/* xvideos uses 5 columns at all desktop sizes — wide monitors get more
   gutter, NOT more columns. Tiles stay around 330-340px wide max. */
@media (min-width: 992px)  { .xvh-page .xvh-grid { grid-template-columns: repeat(5, 1fr); } }

/* Reset Bootstrap col padding inside the grid (we use CSS Grid gap instead) */
.xvh-page .xvh-grid > .post-item,
.xvh-page .xvh-grid > .xvh-card,
.xvh-page .xvh-grid > .cb-card {
    width: 100%;
    max-width: none;
    flex: none;
    padding: 0;
    margin: 0;
}

/* ---------- Card ---------- */
.xvh-page .xvh-card,
.xvh-page .xvh-grid .post-item {
    background: transparent;
    margin-bottom: 0;
}
.xvh-page .xvh-card .post-body {
    background: transparent;
}

/* Thumbnail */
.xvh-page .xvh-card .post-thumbnail,
.xvh-page .xvh-card .xvh-thumb {
    border-radius: 4px;
    overflow: hidden;
    background: #000;
    aspect-ratio: 16 / 9;
    position: relative;
}
.xvh-page .xvh-card img.wp-post-image,
.xvh-page .xvh-card .xvh-thumb img,
.xvh-page .xvh-grid .post-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    /* Defensive resets — kill any inherited dimming from StreamTube/Bootstrap */
    opacity: 1 !important;
    filter: none !important;
    -webkit-filter: none !important;
    mix-blend-mode: normal !important;
}

/* StreamTube ships a `.video-hover` overlay (black, opacity:0 → opacity:1 on hover)
   for its play-icon affordance. On the dense Xvids grid we don't want any chance
   of it bleeding in — hide it entirely. CB live cards keep their own LIVE badge
   so they don't need it either. */
.xvh-page .video-hover { display: none !important; }
.xvh-page .xvh-card .xvh-thumb-empty {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a1a1a, #0a0a0a);
}

/* Quality + duration badges — small corner pills.
   Every position/size property is !important because Bootstrap's `.ratio > *`
   rule (or any future cascade) would otherwise stretch them to fill the entire
   thumbnail, turning their dark background into a tile-wide overlay. */
.xvh-page .xvh-quality,
.xvh-page .xvh-duration {
    position: absolute !important;
    width: auto !important;
    height: auto !important;
    max-width: none !important;
    max-height: none !important;
    background: rgba(0, 0, 0, 0.78) !important;
    color: #fff !important;
    font-weight: 700 !important;
    padding: 2px 6px !important;
    border-radius: 2px !important;
    line-height: 1.2 !important;
    letter-spacing: 0.4px !important;
    z-index: 2 !important;
    pointer-events: none !important;
    margin: 0 !important;
    inset: auto !important;
}
.xvh-page .xvh-quality {
    top: 4px !important;
    right: 4px !important;
    font-size: 10px !important;
}
.xvh-page .xvh-duration {
    bottom: 4px !important;
    right: 4px !important;
    font-size: 11px !important;
    font-weight: 600 !important;
}

/* Meta block under thumb */
.xvh-page .xvh-card .xvh-meta,
.xvh-page .xvh-card .post-bottom {
    margin-top: 6px;
    padding: 0;
}

.xvh-page .xvh-title {
    font-family: Arial, sans-serif;
    font-size: 12px;
    line-height: 16px;
    font-weight: 700;          /* xvideos titles are bold */
    margin: 6px 0 2px;
    color: #fff;
    /* 2-line clamp */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.xvh-page .xvh-title a {
    color: inherit;
    text-decoration: none;
}
.xvh-page .xvh-title a:hover {
    color: #ce1212;
}

.xvh-page .xvh-submeta {
    font-family: Arial, sans-serif;
    font-size: 11px;
    line-height: 16px;
    color: #888;
}
.xvh-page .xvh-submeta > span {
    margin-right: 3px;
}
.xvh-page .xvh-author {
    color: #ddd;
    font-weight: 500;
}
.xvh-page .xvh-suggested {
    color: #ce1212;
    font-weight: 600;
}

/* Mobile: slightly bigger title for tap-target legibility */
@media (max-width: 575.98px) {
    .xvh-page .xvh-title { font-size: 13px; }
    .xvh-page .xvh-submeta { font-size: 11px; }
    .xvh-page .xvh-quality, .xvh-page .xvh-duration { font-size: 10px; padding: 1px 5px; }
}

/* ---------- "Suggested" subtle accent on whole tile ---------- */
.xvh-page .xvh-card--suggested .xvh-thumb::after {
    content: "";
    position: absolute;
    inset: 0;
    border: 2px solid rgba(206, 18, 18, 0.55);
    border-radius: 4px;
    pointer-events: none;
    z-index: 3;
}

/* ---------- CB live cards mixed into the grid ----------
   Override Bootstrap-y CB card defaults so it sits flush with .xvh-card density. */
.xvh-page .xvh-grid .cb-card {
    margin-bottom: 0 !important;
}
.xvh-page .xvh-grid .cb-card .post-bottom {
    margin-top: 6px !important;
    padding: 0;
}
.xvh-page .xvh-grid .cb-card .post-meta__title {
    font-size: 13px;
    font-weight: 600;
    margin: 0 0 2px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.xvh-page .xvh-grid .cb-card .post-meta__title a {
    color: #fff;
    text-decoration: none;
}
.xvh-page .xvh-grid .cb-card .post-meta__items {
    font-size: 11px;
    color: #888;
}
.xvh-page .xvh-grid .cb-card .post-meta__views,
.xvh-page .xvh-grid .cb-card .post-meta__author {
    font-size: 11px;
}
.xvh-page .xvh-grid .cb-card .cb-live-badge {
    font-size: 10px !important;
    padding: 2px 6px !important;
}

/* ---------- Pagination ---------- */
.xvh-page .xvh-pagination-wrap {
    margin: 18px auto;
    text-align: center;
}
.xvh-page .xvh-pagination {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 4px;
    justify-content: center;
}
.xvh-page .xvh-pagination .page-numbers {
    display: inline-block;
    padding: 7px 11px;
    background: #1a1a1a;
    color: #ddd;
    border-radius: 3px;
    font-size: 13px;
    text-decoration: none;
    border: 1px solid #2a2a2a;
    line-height: 1.2;
}
.xvh-page .xvh-pagination .page-numbers:hover {
    background: #2a2a2a;
    color: #fff;
}
.xvh-page .xvh-pagination .page-numbers.current {
    background: #ce1212;
    color: #fff;
    border-color: #ce1212;
}
.xvh-page .xvh-pagination .page-numbers.dots {
    background: transparent;
    border-color: transparent;
    color: #888;
}

/* Mobile pagination — tighter */
@media (max-width: 575.98px) {
    .xvh-page .xvh-pagination .page-numbers {
        padding: 6px 9px;
        font-size: 12px;
    }
}

/* ---------- Empty state ---------- */
.xvh-page .xvh-empty {
    text-align: center;
    padding: 60px 20px;
    color: #888;
    font-size: 14px;
}
