/* ================================================================
   Reddgifs Header — custom tube-site-style header layout.
   Mobile-first: ≤767 collapses to logo + burger + search row.
   ================================================================ */

/* ---- Reset/protect from theme bleed ---- */
.xvhdr, .xvhdr * { box-sizing: border-box; }
.xvhdr ul { list-style: none; padding: 0; margin: 0; }
.xvhdr a { text-decoration: none; color: inherit; }
.xvhdr button { background: none; border: 0; cursor: pointer; color: inherit; font: inherit; padding: 0; }

/* ---- Outer header ----
   Body horizontal padding is 0 (full-viewport content at user's monitor
   per Screen Ruler measurement of 1920px). With body
   padding 0, the bar fills viewport naturally — no negative margin trick
   or width calc needed. Just width 100% margin 0. */
.xvhdr {
    position: sticky;
    top: 0;
    z-index: 9999;
    background: #161616;
    color: #fff;
    font-family: Arial, sans-serif;
    font-size: 12px;
    line-height: 18px;
    border-bottom: 1px solid #1a1a1a;
    user-select: none;
    width: 100%;
    margin: 0;
    padding: 0 8px;
    box-sizing: border-box;
}

.xvhdr-row { display: flex; align-items: center; }

/* =================================================================
   Main row: 3-column grid → [left group] [centered search] [right group]
   - Left:  logo + prefs (auto width)
   - Mid:   search (1fr, fills remaining space, max-capped)
   - Right: topnav + tools (auto width)
   This is what makes the search appear visually centered.
   ================================================================= */
.xvhdr-row--main {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 16px;
    /* 80px content gutter via internal padding. max-width effectively
       uncapped (2079px); on
       any reasonable viewport this fills its parent (.xvhdr) so we just
       use max-width: none. */
    padding: 0 80px;
    min-height: 44px;
    max-width: none;
    margin: 0;
    width: 100%;
    box-sizing: border-box;
    font-family: Arial, sans-serif;
}
@media (max-width: 1199.98px) { .xvhdr-row--main { padding: 0 40px; } }
@media (max-width: 767.98px)  { .xvhdr-row--main { padding: 0 12px; } }

.xvhdr-left, .xvhdr-right {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}
.xvhdr-right { gap: 8px; justify-self: end; }

/* ---- Burger (mobile only) ---- */
.xvhdr-burger {
    display: none;
    width: 28px;
    height: 28px;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    flex-shrink: 0;
}
.xvhdr-burger span {
    display: block;
    height: 2px;
    width: 100%;
    background: #ddd;
    transition: transform .2s, opacity .2s;
}
.xvhdr-burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.xvhdr-burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.xvhdr-burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ---- Logo ---- */
.xvhdr-logo { flex-shrink: 0; display: inline-flex; align-items: center; }
.xvhdr-logo-text {
    color: #ce1212;
    font-style: italic;
    font-weight: 800;
    font-size: 22px;
    letter-spacing: -0.5px;
    text-transform: uppercase;
}
.xvhdr-logo-img { display: block; height: 28px; width: auto; }

/* ---- Prefs (Language / Location / Orientation) ---- */
.xvhdr-prefs {
    display: flex;
    gap: 14px;
    align-items: center;
    flex-shrink: 0;
}
.xvhdr-pref {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #b8b8b8;
    font-size: 12px;
    padding: 4px 6px;
    border-radius: 3px;
    white-space: nowrap;
}
.xvhdr-pref:hover { color: #fff; background: #1a1a1a; }
.xvhdr-pref__label { color: #888; }
.xvhdr-pref__value { color: #fff; font-weight: 500; }
.xvhdr-pref__icon { font-size: 14px; }
.xvhdr-pref__icon--svg {
    display: inline-flex;
    align-items: center;
    /* SVG's stroke="currentColor" inherits this — keeps the icon white
       on dark mode, goes dark in light mode. */
}
.xvhdr-pref__icon--svg svg { display: block; }
.xvhdr-pref__caret { color: #888; font-size: 10px; margin-left: 2px; }
.xvhdr-flag { font-size: 14px; line-height: 1; }

/* ---- Search (middle column of the grid) ----
   Spec: 462×38, WHITE background, dark text, rounded pill.
   Left-aligned in its 1fr track (margin: 0) so it starts right after
   the prefs end. */
.xvhdr-search {
    /* Pulled from upstream main.css verbatim:
       .head__search { background: #fff }
       #xv-search-form .search-input { background:#fff; border:1px solid #eee; color:#000 }
       #xv-search-form .search-submit { background:#eee; border:2px solid #eee; color:#000 }
       Two-tone: white input + #eee submit button. */
    width: 100%;
    max-width: 462px;
    height: 38px;
    margin: 0;
    justify-self: center;
    display: flex;
    align-items: stretch;
    background: #fff;
    border-radius: 5px;
    overflow: hidden;
    border: 1px solid #eee;
}
.xvhdr-search:focus-within { border-color: #ccc; }
/* input[type=search] needs -webkit-appearance:none + higher specificity
   to beat Chrome's user-agent default #f1f3f4 light-grey bg. */
.xvhdr-search input.xvhdr-search__input,
.xvhdr input.xvhdr-search__input {
    flex: 1 1 auto;
    background: #fff;
    border: 0;
    color: #000;
    padding: 4px 10px;
    font-size: 14px;
    outline: none;
    min-width: 0;
    -webkit-appearance: none;
    appearance: none;
}
.xvhdr-search__input::placeholder { color: #333; }
/* button.xvhdr-search__btn / .xvhdr button.xvhdr-search__btn raise specificity
   above the .xvhdr button reset (background:none, color:inherit) defined
   earlier in this file. Without this, dark-mode search button is transparent
   with a white icon (inheriting from the dark header). */
button.xvhdr-search__btn,
.xvhdr button.xvhdr-search__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 14px;
    color: #555;          /* dark grey magnifier icon */
    background: #eee;     /* light grey button bg */
    border: 0;
}
button.xvhdr-search__btn:hover,
.xvhdr button.xvhdr-search__btn:hover { background: #d9d9d9; color: #000; }

/* ---- Top nav (Login / Join / PREMIUM) ---- */
.xvhdr-topnav { flex-shrink: 0; }
.xvhdr-topnav__list {
    display: flex;
    align-items: center;
    gap: 8px;
}
.xvhdr-topnav__list > li > a,
.xvhdr-topnav__list > li > .xvhdr-link,
.xvhdr-link {
    color: #ddd;
    padding: 6px 10px;
    font-size: 13px;
    border-radius: 3px;
    display: inline-block;
}
.xvhdr-link:hover { color: #fff; background: #1a1a1a; }
.xvhdr-btn,
button.xvhdr-btn,
.xvhdr button.xvhdr-btn,
.xvhdr-topnav__list a.xvhdr-btn,
.xvhdr-topnav__list button.xvhdr-btn {
    /* `button.xvhdr-btn` and `.xvhdr button.xvhdr-btn` bump the specificity
       to (0,1,1) and (0,2,1) respectively, so the .xvhdr-btn padding /
       font / border-radius beat the .xvhdr button reset (line ~10) which
       sets padding: 0 and font: inherit. Without these, <button> elements
       carrying .xvhdr-btn (like the ACCOUNT dropdown trigger) render as
       tight text with red bg only, no padding or proper button shape. */
    display: inline-block;
    padding: 7px 14px;
    border-radius: 3px;
    font-weight: 700;
    font-size: 12px;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    line-height: 1.2;
}
/* The .xvhdr button reset (line 10) has specificity 0,1,1 — it overrides
   single-class .xvhdr-btn--red/--white. Chain the classes (.xvhdr-btn.xvhdr-btn--X)
   for specificity 0,2,0 so the button bg actually shows. Same for the
   anchor variant — both <button> and <a> can carry these classes. */
.xvhdr-btn.xvhdr-btn--white,
a.xvhdr-btn--white {
    background: #fff;
    color: #000;
}
.xvhdr-btn.xvhdr-btn--white:hover,
a.xvhdr-btn--white:hover { background: #ddd; }
.xvhdr-btn.xvhdr-btn--red,
a.xvhdr-btn--red {
    background: #ce1212;
    color: #fff;
}
.xvhdr-btn.xvhdr-btn--red:hover,
a.xvhdr-btn--red:hover { background: #b00f0f; }

/* ---- Tools (theme / settings) ---- */
.xvhdr-tools {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}
.xvhdr-tools:empty { display: none; }   /* hide gap when logged-in (no theme/gear) */
.xvhdr-tool {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #aaa;
    border-radius: 3px;
}
.xvhdr-tool:hover { color: #fff; background: #1a1a1a; }

/* ---- Icon-only link (chat icon, logged-in users) ----
   Same square 32×32 footprint as .xvhdr-tool buttons so the chat icon visually
   sits in the same row as the ACCOUNT button without throwing off vertical
   alignment. */
.xvhdr-topnav__list > li > a.xvhdr-icon-link,
a.xvhdr-icon-link {
    width: 32px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #aaa;
    border-radius: 3px;
    background: transparent;
}
a.xvhdr-icon-link:hover { color: #fff; background: #1a1a1a; }
a.xvhdr-icon-link .xvhdr-icon-svg,
a.xvhdr-icon-link svg { width: 18px; height: 18px; opacity: 1; }

/* ---- ACCOUNT dropdown (logged-in) ---- */
.xvhdr-has-dropdown {
    position: relative;
}
.xvhdr-has-dropdown > button {
    cursor: pointer;
    border: 0;
    font: inherit;
}
.xvhdr-account-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 180px;
    margin: 0;
    padding: 6px 0;
    list-style: none;
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 3px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.55);
    z-index: 9999;
}
.xvhdr-account-menu[hidden] { display: none; }
.xvhdr-account-menu li {
    padding: 0;
    margin: 0;
    list-style: none;
}
.xvhdr-account-menu li > a {
    display: block;
    padding: 8px 14px;
    color: #ddd;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.4;
    text-decoration: none;
    text-transform: none;
    letter-spacing: 0;
}
.xvhdr-account-menu li > a:hover {
    background: #2a2a2a;
    color: #fff;
}

/* =================================================================
   Sub-nav row: Best Videos / Categories / Channels / etc.
   ================================================================= */
.xvhdr-row--sub {
    /* The upstream .head__menu-line has bg rgba(0,0,0,0) — transparent —
       so body bg shows through. The visual separation between the top
       header row and the sub-nav row is created by a top border that's
       lighter than body bg, giving the appearance of a subtle horizontal
       divider line. #1a1a1a was nearly invisible against #161616 body bg;
       bumped to #333 so the line actually shows. */
    background: transparent;
    border-top: 1px solid #333;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}
.xvhdr-row--sub::-webkit-scrollbar { height: 0; }
.xvhdr-subnav {
    /* Same pattern as the upstream `.head__menu-line__container`: 80px
       horizontal padding, no max-width cap. The menu items end up at
       80px from the parent .xvhdr-row--sub edge. */
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0 80px;
    box-sizing: border-box;
}
@media (max-width: 1199.98px) { .xvhdr-subnav { padding: 0 40px; } }
@media (max-width: 767.98px)  { .xvhdr-subnav { padding: 0 12px; } }
.xvhdr-subnav__list {
    display: flex;
    align-items: center;
    justify-content: space-between;  /* spread items across full width */
    flex-wrap: nowrap;
    white-space: nowrap;
    gap: 8px;
}
.xvhdr-subnav__list > li > a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 8px;
    color: #ccc;
    font-size: 13px;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    transition: color .15s, border-color .15s;
}
.xvhdr-icon-svg {
    flex-shrink: 0;
    opacity: 0.8;
    transition: opacity .15s;
}
.xvhdr-subnav__list > li > a:hover .xvhdr-icon-svg,
.xvhdr-subnav__list > li.current-menu-item > a .xvhdr-icon-svg {
    opacity: 1;
}
/* Live Cams icon: red dot, pulsing — overrides the generic icon color */
.xvhdr-icon-svg--live {
    color: #ce1212 !important;
    opacity: 1 !important;
    animation: xvhdrPulse 1.5s ease-in-out infinite;
}
.xvhdr-subnav__list > li > a:hover {
    color: #fff;
    border-bottom-color: #555;
}
.xvhdr-subnav__list > li.current-menu-item > a,
.xvhdr-subnav__list > li.current-menu-parent > a {
    color: #fff;
    border-bottom-color: #ce1212;
}

/* "Live Cams" red pulse — uses the SVG icon variant (.xvhdr-icon-svg--live)
   above. This @keyframes is referenced by it. */
@keyframes xvhdrPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* =================================================================
   Mobile drawer (shown when burger is tapped)
   ================================================================= */
.xvhdr-mobile-drawer {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #0d0d0d;
    border-bottom: 1px solid #1a1a1a;
    box-shadow: 0 8px 24px rgba(0,0,0,0.6);
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    z-index: 9998;
}
.xvhdr-mobile-drawer[hidden] { display: none; }
.xvhdr-mobile-drawer__inner { padding: 8px 0; }
.xvhdr-mobile-list { display: flex; flex-direction: column; }
.xvhdr-mobile-list > li > a {
    display: block;
    padding: 12px 18px;
    color: #ddd;
    font-size: 14px;
    border-bottom: 1px solid #1a1a1a;
}
.xvhdr-mobile-list > li > a:hover,
.xvhdr-mobile-list > li > a:active { background: #1a1a1a; color: #fff; }
.xvhdr-mobile-list--user > li > a.xvhdr-btn--white,
.xvhdr-mobile-list--user > li > a.xvhdr-btn--red {
    margin: 8px 16px;
    display: block;
    text-align: center;
}
.xvhdr-mobile-divider {
    border: 0;
    border-top: 1px solid #2a2a2a;
    margin: 8px 0;
}

/* =================================================================
   RESPONSIVE BREAKPOINTS
   ================================================================= */

/* Tablet — hide prefs to save space, keep everything else */
@media (max-width: 1199.98px) {
    .xvhdr-prefs { display: none; }
}

/* Small tablet — hide tools (theme/settings) */
@media (max-width: 991.98px) {
    .xvhdr-tools { display: none; }
}

/* Mobile — collapse the 3-column grid to two stacked rows:
   row 1: [burger | logo | (right nav minimal)]
   row 2: [full-width search]
*/
@media (max-width: 767.98px) {
    .xvhdr-row--main {
        grid-template-columns: auto 1fr auto;
        grid-template-rows: auto auto;
        column-gap: 8px;
        row-gap: 8px;
        padding: 8px 10px;
    }
    .xvhdr-left { gap: 10px; }
    .xvhdr-burger { display: flex; }
    .xvhdr-logo-text { font-size: 20px; }

    /* Hide topnav on mobile — moved into the burger drawer instead */
    .xvhdr-topnav { display: none; }

    /* Full-width search on row 2, spanning all 3 columns */
    .xvhdr-search {
        grid-column: 1 / -1;
        max-width: 100%;
        margin: 0;
    }
}

@media (max-width: 575.98px) {
    .xvhdr-row--main { padding: 8px 8px; }
    .xvhdr-logo-text { font-size: 18px; }
    .xvhdr-search__input { font-size: 14px; padding: 8px 10px; }  /* avoid iOS zoom on focus */
}

/* ================================================================
   Top-nav button overrides — fix double-padding bug.

   The LIs in xvhdr-topnav__list carry .xvhdr-btn / .xvhdr-link, which
   each define padding. The CHILD <a> also gets padding from the broad
   ".xvhdr-topnav__list > li > a" rule. Both apply, stacking padding
   and inflating button height. Use single-padded buttons.
   Fix: zero LI padding, let the inner <a> own the visible button.
   ================================================================ */
.xvhdr-topnav__list > li.xvhdr-btn,
.xvhdr-topnav__list > li.xvhdr-link {
    padding: 0;
}

/* "Categories ▾" caret — categories.js adds .xvhdr-mega-parent to the LI. */
.xvhdr-subnav__list > li.xvhdr-mega-parent > a::after {
    content: ' \25BE';   /* ▾ */
    margin-left: 4px;
    font-size: 10px;
    color: inherit;
    opacity: 0.85;
}

/* RED videos sub-nav item: small red square badge before "videos" label. */
.xvhdr-icon-redbadge {
    display: inline-block;
    background: #ce1212;
    color: #fff;
    font-weight: 700;
    font-size: 10px;
    line-height: 1;
    padding: 2px 4px;
    border-radius: 2px;
    letter-spacing: 0.5px;
    margin-right: 4px;
    vertical-align: middle;
}

/* "Join for FREE" white button — small, mixed case, white bg. */
.xvhdr-topnav__list > li.xvhdr-btn--white > a {
    display: inline-block;
    padding: 5px 10px;
    background: #fff;
    color: #000;
    font-size: 12px;
    font-weight: 700;
    text-transform: none;
    letter-spacing: 0;
    line-height: 1.4;
    border-radius: 3px;
}
.xvhdr-topnav__list > li.xvhdr-btn--white > a:hover { background: #ddd; }

/* PREMIUM red button — same compact padding, keep uppercase. */
.xvhdr-topnav__list > li.xvhdr-btn--red > a {
    display: inline-block;
    padding: 5px 10px;
    background: #ce1212;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    line-height: 1.4;
    border-radius: 3px;
}
.xvhdr-topnav__list > li.xvhdr-btn--red > a:hover { background: #b00f0f; }

/* ================================================================
   LIGHT THEME — activates only when <html data-theme="light">.
   Default state (no attribute or data-theme="dark") is unchanged.
   ================================================================ */
html[data-theme="light"] .xvhdr {
    background: #f5f5f5;
    color: #000;
    border-bottom-color: #ddd;
}
html[data-theme="light"] .xvhdr a { color: inherit; }
html[data-theme="light"] .xvhdr-pref { color: #333; }
html[data-theme="light"] .xvhdr-pref:hover { background: #e5e5e5; color: #000; }
html[data-theme="light"] .xvhdr-search__input {
    background: #fff;
    color: #000;
    border-color: #ccc;
}
html[data-theme="light"] .xvhdr-search__input::placeholder { color: #888; }
html[data-theme="light"] .xvhdr-search__btn {
    background: #e5e5e5;
    color: #333;
    border-color: #ccc;
}
html[data-theme="light"] .xvhdr-search__btn:hover { background: #d5d5d5; color: #000; }
html[data-theme="light"] .xvhdr-link { color: #333; }
html[data-theme="light"] .xvhdr-link:hover { color: #000; background: #e5e5e5; }
html[data-theme="light"] .xvhdr-tool { color: #555; }
html[data-theme="light"] .xvhdr-tool:hover { color: #000; background: #e5e5e5; }
html[data-theme="light"] .xvhdr-row--sub { background: #ececec; border-color: #ddd; }
html[data-theme="light"] .xvhdr-subnav__list > li > a { color: #333; }
html[data-theme="light"] .xvhdr-subnav__list > li > a:hover { color: #000; }
html[data-theme="light"] .xvhdr-subnav__list > li.is-current > a,
html[data-theme="light"] .xvhdr-subnav__list > li > a.is-current { color: #000; }

/* Body / main content area in light mode. Higher specificity than the
   xvids-site.php dark default rule (html body[class][class][class]).
   Adding [class] selectors bumps specificity to win the cascade. */
html[data-theme="light"],
html[data-theme="light"] body,
html[data-theme="light"] body[class],
html[data-theme="light"] body[class][class],
html[data-theme="light"] body[class][class][class],
html[data-theme="light"] body[class][class][class][class] {
    background-color: #fff !important;
    color: #000 !important;
}
/* Tile titles / meta in light mode (StreamTube tile classes). */
html[data-theme="light"] .post-meta__title,
html[data-theme="light"] .post-meta__title a,
html[data-theme="light"] .xvh-card .post-meta__title,
html[data-theme="light"] .rg-home-card .post-meta__title,
html[data-theme="light"] .xvh-card .post-meta__title a,
html[data-theme="light"] .rg-home-card .post-meta__title a { color: #111 !important; }
html[data-theme="light"] .post-meta__items,
html[data-theme="light"] .post-meta__views,
html[data-theme="light"] .post-meta__author { color: #666 !important; }


/* ================================================================
 * STRATEGY B PHASE 3.2 � DUAL-CLASS TRANSITION (2026-06-03)
 *
 * Below: full duplicate of every rule above, with `xvhdr-` rewritten
 * as `rg-hdr-` (including @keyframes names + animation references).
 * During the transition markup carries BOTH prefixes; the two halves
 * style different class names but produce identical rendered output.
 * Phase 6 strips the upper (original) half and keeps this clone.
 * ================================================================ */

/* ---- Reset/protect from theme bleed ---- */
.rg-hdr, .rg-hdr * { box-sizing: border-box; }
.rg-hdr ul { list-style: none; padding: 0; margin: 0; }
.rg-hdr a { text-decoration: none; color: inherit; }
.rg-hdr button { background: none; border: 0; cursor: pointer; color: inherit; font: inherit; padding: 0; }

/* ---- Outer header ----
   Body horizontal padding is 0 (full-viewport content at user's monitor
   per Screen Ruler measurement of 1920px). With body
   padding 0, the bar fills viewport naturally — no negative margin trick
   or width calc needed. Just width 100% margin 0. */
.rg-hdr {
    position: sticky;
    top: 0;
    z-index: 9999;
    background: #161616;
    color: #fff;
    font-family: Arial, sans-serif;
    font-size: 12px;
    line-height: 18px;
    border-bottom: 1px solid #1a1a1a;
    user-select: none;
    width: 100%;
    margin: 0;
    padding: 0 8px;
    box-sizing: border-box;
}

.rg-hdr-row { display: flex; align-items: center; }

/* =================================================================
   Main row: 3-column grid → [left group] [centered search] [right group]
   - Left:  logo + prefs (auto width)
   - Mid:   search (1fr, fills remaining space, max-capped)
   - Right: topnav + tools (auto width)
   This is what makes the search appear visually centered.
   ================================================================= */
.rg-hdr-row--main {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 16px;
    /* 80px content gutter via internal padding. max-width effectively
       uncapped (2079px); on
       any reasonable viewport this fills its parent (.rg-hdr) so we just
       use max-width: none. */
    padding: 0 80px;
    min-height: 44px;
    max-width: none;
    margin: 0;
    width: 100%;
    box-sizing: border-box;
    font-family: Arial, sans-serif;
}
@media (max-width: 1199.98px) { .rg-hdr-row--main { padding: 0 40px; } }
@media (max-width: 767.98px)  { .rg-hdr-row--main { padding: 0 12px; } }

.rg-hdr-left, .rg-hdr-right {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}
.rg-hdr-right { gap: 8px; justify-self: end; }

/* ---- Burger (mobile only) ---- */
.rg-hdr-burger {
    display: none;
    width: 28px;
    height: 28px;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    flex-shrink: 0;
}
.rg-hdr-burger span {
    display: block;
    height: 2px;
    width: 100%;
    background: #ddd;
    transition: transform .2s, opacity .2s;
}
.rg-hdr-burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.rg-hdr-burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.rg-hdr-burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ---- Logo ---- */
.rg-hdr-logo { flex-shrink: 0; display: inline-flex; align-items: center; }
.rg-hdr-logo-text {
    color: #ce1212;
    font-style: italic;
    font-weight: 800;
    font-size: 22px;
    letter-spacing: -0.5px;
    text-transform: uppercase;
}
.rg-hdr-logo-img { display: block; height: 28px; width: auto; }

/* ---- Prefs (Language / Location / Orientation) ---- */
.rg-hdr-prefs {
    display: flex;
    gap: 14px;
    align-items: center;
    flex-shrink: 0;
}
.rg-hdr-pref {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #b8b8b8;
    font-size: 12px;
    padding: 4px 6px;
    border-radius: 3px;
    white-space: nowrap;
}
.rg-hdr-pref:hover { color: #fff; background: #1a1a1a; }
.rg-hdr-pref__label { color: #888; }
.rg-hdr-pref__value { color: #fff; font-weight: 500; }
.rg-hdr-pref__icon { font-size: 14px; }
.rg-hdr-pref__icon--svg {
    display: inline-flex;
    align-items: center;
    /* SVG's stroke="currentColor" inherits this — keeps the icon white
       on dark mode, goes dark in light mode. */
}
.rg-hdr-pref__icon--svg svg { display: block; }
.rg-hdr-pref__caret { color: #888; font-size: 10px; margin-left: 2px; }
.rg-hdr-flag { font-size: 14px; line-height: 1; }

/* ---- Search (middle column of the grid) ----
   Spec: 462×38, WHITE background, dark text, rounded pill.
   Left-aligned in its 1fr track (margin: 0) so it starts right after
   the prefs end. */
.rg-hdr-search {
    /* Pulled from upstream main.css verbatim:
       .head__search { background: #fff }
       #xv-search-form .search-input { background:#fff; border:1px solid #eee; color:#000 }
       #xv-search-form .search-submit { background:#eee; border:2px solid #eee; color:#000 }
       Two-tone: white input + #eee submit button. */
    width: 100%;
    max-width: 462px;
    height: 38px;
    margin: 0;
    justify-self: center;
    display: flex;
    align-items: stretch;
    background: #fff;
    border-radius: 5px;
    overflow: hidden;
    border: 1px solid #eee;
}
.rg-hdr-search:focus-within { border-color: #ccc; }
/* input[type=search] needs -webkit-appearance:none + higher specificity
   to beat Chrome's user-agent default #f1f3f4 light-grey bg. */
.rg-hdr-search input.rg-hdr-search__input,
.rg-hdr input.rg-hdr-search__input {
    flex: 1 1 auto;
    background: #fff;
    border: 0;
    color: #000;
    padding: 4px 10px;
    font-size: 14px;
    outline: none;
    min-width: 0;
    -webkit-appearance: none;
    appearance: none;
}
.rg-hdr-search__input::placeholder { color: #333; }
/* button.rg-hdr-search__btn / .rg-hdr button.rg-hdr-search__btn raise specificity
   above the .rg-hdr button reset (background:none, color:inherit) defined
   earlier in this file. Without this, dark-mode search button is transparent
   with a white icon (inheriting from the dark header). */
button.rg-hdr-search__btn,
.rg-hdr button.rg-hdr-search__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 14px;
    color: #555;          /* dark grey magnifier icon */
    background: #eee;     /* light grey button bg */
    border: 0;
}
button.rg-hdr-search__btn:hover,
.rg-hdr button.rg-hdr-search__btn:hover { background: #d9d9d9; color: #000; }

/* ---- Top nav (Login / Join / PREMIUM) ---- */
.rg-hdr-topnav { flex-shrink: 0; }
.rg-hdr-topnav__list {
    display: flex;
    align-items: center;
    gap: 8px;
}
.rg-hdr-topnav__list > li > a,
.rg-hdr-topnav__list > li > .rg-hdr-link,
.rg-hdr-link {
    color: #ddd;
    padding: 6px 10px;
    font-size: 13px;
    border-radius: 3px;
    display: inline-block;
}
.rg-hdr-link:hover { color: #fff; background: #1a1a1a; }
.rg-hdr-btn,
button.rg-hdr-btn,
.rg-hdr button.rg-hdr-btn,
.rg-hdr-topnav__list a.rg-hdr-btn,
.rg-hdr-topnav__list button.rg-hdr-btn {
    /* `button.rg-hdr-btn` and `.rg-hdr button.rg-hdr-btn` bump the specificity
       to (0,1,1) and (0,2,1) respectively, so the .rg-hdr-btn padding /
       font / border-radius beat the .rg-hdr button reset (line ~10) which
       sets padding: 0 and font: inherit. Without these, <button> elements
       carrying .rg-hdr-btn (like the ACCOUNT dropdown trigger) render as
       tight text with red bg only, no padding or proper button shape. */
    display: inline-block;
    padding: 7px 14px;
    border-radius: 3px;
    font-weight: 700;
    font-size: 12px;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    line-height: 1.2;
}
/* The .rg-hdr button reset (line 10) has specificity 0,1,1 — it overrides
   single-class .rg-hdr-btn--red/--white. Chain the classes (.rg-hdr-btn.rg-hdr-btn--X)
   for specificity 0,2,0 so the button bg actually shows. Same for the
   anchor variant — both <button> and <a> can carry these classes. */
.rg-hdr-btn.rg-hdr-btn--white,
a.rg-hdr-btn--white {
    background: #fff;
    color: #000;
}
.rg-hdr-btn.rg-hdr-btn--white:hover,
a.rg-hdr-btn--white:hover { background: #ddd; }
.rg-hdr-btn.rg-hdr-btn--red,
a.rg-hdr-btn--red {
    background: #ce1212;
    color: #fff;
}
.rg-hdr-btn.rg-hdr-btn--red:hover,
a.rg-hdr-btn--red:hover { background: #b00f0f; }

/* ---- Tools (theme / settings) ---- */
.rg-hdr-tools {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}
.rg-hdr-tools:empty { display: none; }   /* hide gap when logged-in (no theme/gear) */
.rg-hdr-tool {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #aaa;
    border-radius: 3px;
}
.rg-hdr-tool:hover { color: #fff; background: #1a1a1a; }

/* ---- Icon-only link (chat icon, logged-in users) ----
   Same square 32×32 footprint as .rg-hdr-tool buttons so the chat icon visually
   sits in the same row as the ACCOUNT button without throwing off vertical
   alignment. */
.rg-hdr-topnav__list > li > a.rg-hdr-icon-link,
a.rg-hdr-icon-link {
    width: 32px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #aaa;
    border-radius: 3px;
    background: transparent;
}
a.rg-hdr-icon-link:hover { color: #fff; background: #1a1a1a; }
a.rg-hdr-icon-link .rg-hdr-icon-svg,
a.rg-hdr-icon-link svg { width: 18px; height: 18px; opacity: 1; }

/* ---- ACCOUNT dropdown (logged-in) ---- */
.rg-hdr-has-dropdown {
    position: relative;
}
.rg-hdr-has-dropdown > button {
    cursor: pointer;
    border: 0;
    font: inherit;
}
.rg-hdr-account-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 180px;
    margin: 0;
    padding: 6px 0;
    list-style: none;
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 3px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.55);
    z-index: 9999;
}
.rg-hdr-account-menu[hidden] { display: none; }
.rg-hdr-account-menu li {
    padding: 0;
    margin: 0;
    list-style: none;
}
.rg-hdr-account-menu li > a {
    display: block;
    padding: 8px 14px;
    color: #ddd;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.4;
    text-decoration: none;
    text-transform: none;
    letter-spacing: 0;
}
.rg-hdr-account-menu li > a:hover {
    background: #2a2a2a;
    color: #fff;
}

/* =================================================================
   Sub-nav row: Best Videos / Categories / Channels / etc.
   ================================================================= */
.rg-hdr-row--sub {
    /* The upstream .head__menu-line has bg rgba(0,0,0,0) — transparent —
       so body bg shows through. The visual separation between the top
       header row and the sub-nav row is created by a top border that's
       lighter than body bg, giving the appearance of a subtle horizontal
       divider line. #1a1a1a was nearly invisible against #161616 body bg;
       bumped to #333 so the line actually shows. */
    background: transparent;
    border-top: 1px solid #333;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}
.rg-hdr-row--sub::-webkit-scrollbar { height: 0; }
.rg-hdr-subnav {
    /* Same pattern as the upstream `.head__menu-line__container`: 80px
       horizontal padding, no max-width cap. The menu items end up at
       80px from the parent .rg-hdr-row--sub edge. */
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0 80px;
    box-sizing: border-box;
}
@media (max-width: 1199.98px) { .rg-hdr-subnav { padding: 0 40px; } }
@media (max-width: 767.98px)  { .rg-hdr-subnav { padding: 0 12px; } }
.rg-hdr-subnav__list {
    display: flex;
    align-items: center;
    justify-content: space-between;  /* spread items across full width */
    flex-wrap: nowrap;
    white-space: nowrap;
    gap: 8px;
}
.rg-hdr-subnav__list > li > a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 8px;
    color: #ccc;
    font-size: 13px;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    transition: color .15s, border-color .15s;
}
.rg-hdr-icon-svg {
    flex-shrink: 0;
    opacity: 0.8;
    transition: opacity .15s;
}
.rg-hdr-subnav__list > li > a:hover .rg-hdr-icon-svg,
.rg-hdr-subnav__list > li.current-menu-item > a .rg-hdr-icon-svg {
    opacity: 1;
}
/* Live Cams icon: red dot, pulsing — overrides the generic icon color */
.rg-hdr-icon-svg--live {
    color: #ce1212 !important;
    opacity: 1 !important;
    animation: rg-hdrPulse 1.5s ease-in-out infinite;
}
.rg-hdr-subnav__list > li > a:hover {
    color: #fff;
    border-bottom-color: #555;
}
.rg-hdr-subnav__list > li.current-menu-item > a,
.rg-hdr-subnav__list > li.current-menu-parent > a {
    color: #fff;
    border-bottom-color: #ce1212;
}

/* "Live Cams" red pulse — uses the SVG icon variant (.rg-hdr-icon-svg--live)
   above. This @keyframes is referenced by it. */
@keyframes rg-hdrPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* =================================================================
   Mobile drawer (shown when burger is tapped)
   ================================================================= */
.rg-hdr-mobile-drawer {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #0d0d0d;
    border-bottom: 1px solid #1a1a1a;
    box-shadow: 0 8px 24px rgba(0,0,0,0.6);
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    z-index: 9998;
}
.rg-hdr-mobile-drawer[hidden] { display: none; }
.rg-hdr-mobile-drawer__inner { padding: 8px 0; }
.rg-hdr-mobile-list { display: flex; flex-direction: column; }
.rg-hdr-mobile-list > li > a {
    display: block;
    padding: 12px 18px;
    color: #ddd;
    font-size: 14px;
    border-bottom: 1px solid #1a1a1a;
}
.rg-hdr-mobile-list > li > a:hover,
.rg-hdr-mobile-list > li > a:active { background: #1a1a1a; color: #fff; }
.rg-hdr-mobile-list--user > li > a.rg-hdr-btn--white,
.rg-hdr-mobile-list--user > li > a.rg-hdr-btn--red {
    margin: 8px 16px;
    display: block;
    text-align: center;
}
.rg-hdr-mobile-divider {
    border: 0;
    border-top: 1px solid #2a2a2a;
    margin: 8px 0;
}

/* =================================================================
   RESPONSIVE BREAKPOINTS
   ================================================================= */

/* Tablet — hide prefs to save space, keep everything else */
@media (max-width: 1199.98px) {
    .rg-hdr-prefs { display: none; }
}

/* Small tablet — hide tools (theme/settings) */
@media (max-width: 991.98px) {
    .rg-hdr-tools { display: none; }
}

/* Mobile — collapse the 3-column grid to two stacked rows:
   row 1: [burger | logo | (right nav minimal)]
   row 2: [full-width search]
*/
@media (max-width: 767.98px) {
    .rg-hdr-row--main {
        grid-template-columns: auto 1fr auto;
        grid-template-rows: auto auto;
        column-gap: 8px;
        row-gap: 8px;
        padding: 8px 10px;
    }
    .rg-hdr-left { gap: 10px; }
    .rg-hdr-burger { display: flex; }
    .rg-hdr-logo-text { font-size: 20px; }

    /* Hide topnav on mobile — moved into the burger drawer instead */
    .rg-hdr-topnav { display: none; }

    /* Full-width search on row 2, spanning all 3 columns */
    .rg-hdr-search {
        grid-column: 1 / -1;
        max-width: 100%;
        margin: 0;
    }
}

@media (max-width: 575.98px) {
    .rg-hdr-row--main { padding: 8px 8px; }
    .rg-hdr-logo-text { font-size: 18px; }
    .rg-hdr-search__input { font-size: 14px; padding: 8px 10px; }  /* avoid iOS zoom on focus */
}

/* ================================================================
   Top-nav button overrides — fix double-padding bug.

   The LIs in rg-hdr-topnav__list carry .rg-hdr-btn / .rg-hdr-link, which
   each define padding. The CHILD <a> also gets padding from the broad
   ".rg-hdr-topnav__list > li > a" rule. Both apply, stacking padding
   and inflating button height. Use single-padded buttons.
   Fix: zero LI padding, let the inner <a> own the visible button.
   ================================================================ */
.rg-hdr-topnav__list > li.rg-hdr-btn,
.rg-hdr-topnav__list > li.rg-hdr-link {
    padding: 0;
}

/* "Categories ▾" caret — categories.js adds .rg-hdr-mega-parent to the LI. */
.rg-hdr-subnav__list > li.rg-hdr-mega-parent > a::after {
    content: ' \25BE';   /* ▾ */
    margin-left: 4px;
    font-size: 10px;
    color: inherit;
    opacity: 0.85;
}

/* RED videos sub-nav item: small red square badge before "videos" label. */
.rg-hdr-icon-redbadge {
    display: inline-block;
    background: #ce1212;
    color: #fff;
    font-weight: 700;
    font-size: 10px;
    line-height: 1;
    padding: 2px 4px;
    border-radius: 2px;
    letter-spacing: 0.5px;
    margin-right: 4px;
    vertical-align: middle;
}

/* "Join for FREE" white button — small, mixed case, white bg. */
.rg-hdr-topnav__list > li.rg-hdr-btn--white > a {
    display: inline-block;
    padding: 5px 10px;
    background: #fff;
    color: #000;
    font-size: 12px;
    font-weight: 700;
    text-transform: none;
    letter-spacing: 0;
    line-height: 1.4;
    border-radius: 3px;
}
.rg-hdr-topnav__list > li.rg-hdr-btn--white > a:hover { background: #ddd; }

/* PREMIUM red button — same compact padding, keep uppercase. */
.rg-hdr-topnav__list > li.rg-hdr-btn--red > a {
    display: inline-block;
    padding: 5px 10px;
    background: #ce1212;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    line-height: 1.4;
    border-radius: 3px;
}
.rg-hdr-topnav__list > li.rg-hdr-btn--red > a:hover { background: #b00f0f; }

/* ================================================================
   LIGHT THEME — activates only when <html data-theme="light">.
   Default state (no attribute or data-theme="dark") is unchanged.
   ================================================================ */
html[data-theme="light"] .rg-hdr {
    background: #f5f5f5;
    color: #000;
    border-bottom-color: #ddd;
}
html[data-theme="light"] .rg-hdr a { color: inherit; }
html[data-theme="light"] .rg-hdr-pref { color: #333; }
html[data-theme="light"] .rg-hdr-pref:hover { background: #e5e5e5; color: #000; }
html[data-theme="light"] .rg-hdr-search__input {
    background: #fff;
    color: #000;
    border-color: #ccc;
}
html[data-theme="light"] .rg-hdr-search__input::placeholder { color: #888; }
html[data-theme="light"] .rg-hdr-search__btn {
    background: #e5e5e5;
    color: #333;
    border-color: #ccc;
}
html[data-theme="light"] .rg-hdr-search__btn:hover { background: #d5d5d5; color: #000; }
html[data-theme="light"] .rg-hdr-link { color: #333; }
html[data-theme="light"] .rg-hdr-link:hover { color: #000; background: #e5e5e5; }
html[data-theme="light"] .rg-hdr-tool { color: #555; }
html[data-theme="light"] .rg-hdr-tool:hover { color: #000; background: #e5e5e5; }
html[data-theme="light"] .rg-hdr-row--sub { background: #ececec; border-color: #ddd; }
html[data-theme="light"] .rg-hdr-subnav__list > li > a { color: #333; }
html[data-theme="light"] .rg-hdr-subnav__list > li > a:hover { color: #000; }
html[data-theme="light"] .rg-hdr-subnav__list > li.is-current > a,
html[data-theme="light"] .rg-hdr-subnav__list > li > a.is-current { color: #000; }

/* Body / main content area in light mode. Higher specificity than the
   xvids-site.php dark default rule (html body[class][class][class]).
   Adding [class] selectors bumps specificity to win the cascade. */
html[data-theme="light"],
html[data-theme="light"] body,
html[data-theme="light"] body[class],
html[data-theme="light"] body[class][class],
html[data-theme="light"] body[class][class][class],
html[data-theme="light"] body[class][class][class][class] {
    background-color: #fff !important;
    color: #000 !important;
}
/* Tile titles / meta in light mode (StreamTube tile classes). */
html[data-theme="light"] .post-meta__title,
html[data-theme="light"] .post-meta__title a,
html[data-theme="light"] .xvh-card .post-meta__title,
html[data-theme="light"] .rg-home-card .post-meta__title,
html[data-theme="light"] .xvh-card .post-meta__title a,
html[data-theme="light"] .rg-home-card .post-meta__title a { color: #111 !important; }
html[data-theme="light"] .post-meta__items,
html[data-theme="light"] .post-meta__views,
html[data-theme="light"] .post-meta__author { color: #666 !important; }
