/* ============================================================================
   Subtle Skin Engine (v2 — safe). Keeps the ORIGINAL header + grid 100% intact.
   Varies ONLY cosmetic details per site so sites don't look identical:
     • card title treatment   (oh-card-*)
     • section heading style   (oh-home-*)
     • badge + thumbnail feel  (oh-ft-*)
     • spacing / title size    (oh-d-*)
   NOTHING here changes header structure, grid display, or element positions
   (except the self-contained "overlay" title, which stays inside the card box).
   ============================================================================ */

/* ---- density: gentle spacing + title size (grid columns unchanged) --------- */
body.oh-d-compact  { --ohx-gap: 14px; --ohx-pad: 30px; --ohx-title: .92rem; }
body.oh-d-normal   { --ohx-gap: 18px; --ohx-pad: 40px; --ohx-title: .96rem; }
body.oh-d-spacious { --ohx-gap: 24px; --ohx-pad: 52px; --ohx-title: 1rem; }
.ohsec  { margin-bottom: var(--ohx-pad, 40px); }
.ohgrid { gap: calc(var(--ohx-gap,18px) + 4px) var(--ohx-gap,18px); }
.ohc-title { font-size: var(--ohx-title, .96rem); }

/* baseline polish for every site: title turns accent on hover */
.ohc-title a { transition: color .15s ease; }
.ohc:hover .ohc-title a { color: var(--c-accent, #e60000); }

/* ============================ CARD STRUCTURAL VARIANTS =====================
   These match the per-site DOM emitted by vbase_card() (different markup, not
   just CSS). Each renders cleanly inside the standard grid.                     */

/* default (.ohc) — theme baseline (avatar-left + full sub). */

/* overlay: caption is a child of the thumb anchor → sits over the image. */
.ohc-v-overlay .ohc-over {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 34px 12px 12px; z-index: 2;
  background: linear-gradient(to top, rgba(0,0,0,.9) 18%, rgba(0,0,0,.35) 62%, transparent);
}
.ohc-v-overlay .ohc-over .ohc-title { margin: 0 0 3px; }
.ohc-v-overlay .ohc-title a, .ohc-v-overlay:hover .ohc-title a { color: #fff; }
.ohc-v-overlay .ohc-sub { color: rgba(255,255,255,.82); }

/* minimal: no avatar node at all; clean title + stats. */
.ohc-v-min .ohc-meta { width: 100%; }

/* accent: a channel chip row above the title, accent left-bar on the meta. */
.ohc-v-accent .ohc-meta { border-left: 3px solid var(--c-accent,#e60000); padding-left: 10px; }
.ohc-v-accent .ohc-title { font-weight: 800; }
.ohc-v-accent .ohc-chip { display: flex; align-items: center; gap: 7px; margin-bottom: 6px; font-size: .76rem; color: var(--c-muted,#aaa); font-weight: 600; }
.ohc-v-accent .ohc-chip .ohc-av { width: 22px; height: 22px; font-size: .72rem; }

/* ============================ SECTION HEADINGS ============================
   Restyle only the section <h2>. Grid is untouched.                            */

/* grid — plain (default). */
body.oh-home-hero    .ohsec-head h2 { border-left: 4px solid var(--c-accent,#e60000); padding-left: 11px; font-weight: 800; }
body.oh-home-rows    .ohsec-head h2 { display: inline-block; padding-bottom: 6px; border-bottom: 3px solid var(--c-accent,#e60000); }
body.oh-home-masonry .ohsec-head h2::before { content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--c-accent,#e60000); margin-right: 9px; vertical-align: middle; }
body.oh-home-sidebar .ohsec-head h2 { text-transform: uppercase; letter-spacing: .07em; }
body.oh-home-list    .ohsec-head h2 { color: var(--c-accent,#e60000); }

/* ============================ BADGE / THUMBNAIL FEEL ======================
   Tie thumbnail corners + duration/quality badge to the footer axis.           */

/* rich — default rounded thumb + dark badge. */
body.oh-ft-slim    .ohc-thumb { border-radius: 6px; }
body.oh-ft-slim    .ohc-q     { background: var(--c-accent,#e60000); color: #fff; }
body.oh-ft-columns .ohc-thumb { border-radius: 16px; }
body.oh-ft-columns .ohc-dur   { background: rgba(0,0,0,.62); border: 1px solid rgba(255,255,255,.45); }

/* ============================ HEADER STRUCTURAL VARIANTS ===================
   Match the per-site header DOM from header.php (different element order +
   grouping wrappers). All keep a clean single/two-row bar. Mobile falls back to
   the theme's stacked behavior so the nav drawer keeps working.                 */

/* classic — theme default (no override). */

/* search: search field grows in the middle. */
.ohh-v-search .ohhead-search { flex: 1; }

/* centered: two rows — brand+actions, then centered nav+search. */
.ohh-v-centered .ohhead-in { flex-direction: column; align-items: stretch; gap: 10px; }
.ohh-v-centered .ohhead-row { display: flex; align-items: center; gap: 14px; width: 100%; }
.ohh-v-centered .ohhead-r1 { justify-content: space-between; }
.ohh-v-centered .ohhead-r2 { justify-content: center; }
.ohh-v-centered .ohhead-r2 .ohhead-search { flex: 0 1 480px; }

/* split: logo left, everything else grouped to the right. */
.ohh-v-split .ohhead-grp { display: flex; align-items: center; gap: 14px; margin-left: auto; }

/* stack: brand group + tools group on row 1, full-width nav on row 2. */
.ohh-v-stack .ohhead-in { flex-direction: column; align-items: stretch; gap: 8px; }
.ohh-v-stack .ohhead-row { display: flex; align-items: center; gap: 14px; }
.ohh-v-stack .ohhead-r1 { justify-content: space-between; }
.ohh-v-stack .ohhead-grp { display: flex; align-items: center; gap: 12px; }
.ohh-v-stack .ohhead-r1 .ohhead-search { flex: 1; max-width: 440px; }
.ohh-v-stack .ohhead-r2 { border-top: 1px solid var(--c-line,#272727); padding-top: 6px; overflow-x: auto; }

/* mobile: unified, robust header for EVERY variant — [burger][logo][actions] on one
   row, full-width search below, nav in the burger dropdown. Uses !important because the
   desktop per-variant rules (.ohh-v-* .ohhead-r2 .ohhead-search, specificity 0,3,0) are
   MORE specific than these overrides and would otherwise leak into mobile and hide the
   burger + actions (Upload/avatar/dark-mode). Keeping this predictable > a fancy
   per-variant mobile layout that silently drops the menu. */
@media (max-width: 900px) {
  .ohhead-in { flex-direction: row !important; flex-wrap: wrap !important; align-items: center !important; gap: 10px !important; }
  .ohhead-row, .ohhead-grp { display: contents !important; }
  .ohhead-burger { display: grid !important; order: 1 !important; }
  .ohhead-logo   { order: 2 !important; flex: 0 1 auto !important; justify-content: flex-start !important; }
  .ohhead-actions{ order: 3 !important; margin-left: auto !important; }
  .ohhead-search { order: 4 !important; flex: 1 1 100% !important; margin: 0 !important; max-width: none !important; }

  /* Mobile burger menu = clean floating dropdown panel (was rendering in-flow,
     unstyled). Anchor to the header + force the absolute panel. */
  .ohhead { position: relative; }
  body.ohnav-open .ohhead-nav {
    position: absolute !important; left: 10px; right: 10px; top: calc(100% + 6px);
    flex-direction: column; align-items: stretch; gap: 2px;
    background: var(--c-surface, #1a1a1a); border: 1px solid var(--c-line, #272727); border-radius: 14px;
    padding: 8px; box-shadow: 0 16px 40px rgba(0,0,0,.5); z-index: 1100; max-height: 72vh; overflow-y: auto;
  }
  body.ohnav-open .ohhead-nav ul, body.ohnav-open .ohhead-nav .menu { flex-direction: column; align-items: stretch; gap: 2px; width: 100%; }
  body.ohnav-open .ohhead-nav a { padding: 11px 14px; border-radius: 9px; }
}

/* ============================ PER-CARD CHROME (watch-later + play) ==========
   The watch-later button + play overlay repeat on every card → vary them per site
   so they're not identical. Position by card variant, shape/size by footer axis;
   the WL ICON itself also varies (set in vbase_card by the footer axis).         */
.oh-card-overlay .ohwl { left: 8px; right: auto; }                 /* top-left */
.oh-card-minimal .ohwl { top: auto; bottom: 8px; }                 /* bottom-right */
.oh-card-accent  .ohwl { left: 8px; right: auto; top: auto; bottom: 8px; } /* bottom-left */
.oh-ft-slim    .ohwl { border-radius: 7px; }                       /* rounded-square */
.oh-ft-columns .ohwl { width: 34px; height: 34px; }               /* larger circle */
/* centered play circle (always visible, like the references) */
.ohc-play { opacity: .92; background: transparent; }
.ohc-thumb:hover .ohc-play { opacity: 1; }
.ohc-play svg { width: 46px; height: 46px; fill: #fff; background: rgba(0,0,0,.5); border-radius: 50%; padding: 13px; box-sizing: border-box; filter: none; }
.ohc-thumb:hover .ohc-play svg { background: var(--c-accent, #e60000); }
.oh-card-minimal .ohc-play svg { width: 40px; height: 40px; }
.oh-card-accent  .ohc-play svg { width: 52px; height: 52px; }
.oh-card-overlay .ohc-play { background: transparent; }

/* ============================ APP POLISH (reference-grade) =================
   Mobile bottom tab bar + icon pills + verified badge — app-style, like the
   user's reference designs.                                                     */

/* search bar — subtle neutral pill that reads well on BOTH light + dark themes */
.ohhead-search input { background: rgba(127,127,127,.1); }
.ohhead-search button { background: rgba(127,127,127,.16); }

/* pill icons */
.ohpill-i { display: inline-flex; vertical-align: middle; margin-right: 6px; }
.ohpill-i svg { width: 14px; height: 14px; }

/* verified check next to channel names */
.ohverified { display: inline-flex; vertical-align: middle; margin-left: 4px; color: var(--c-accent, #e60000); }
.ohverified svg { width: 13px; height: 13px; }

/* mobile bottom tab bar */
.ohtab { display: none; }
@media (max-width: 900px) {
  .ohtab { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 1000; height: 58px;
    background: var(--c-surface, #1a1a1a); border-top: 1px solid var(--c-line, #272727);
    padding: 0 4px calc(0px + env(safe-area-inset-bottom, 0px)); align-items: center; }
  .ohtab-i { flex: 1 1 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: .62rem; font-weight: 600; text-decoration: none; height: 100%;
    /* reset native <button> chrome AND override the theme's broad `button{background:var(--vb-red)!important}`
       rule (some slots are <button> now) so they render like the <a> items. */
    background: transparent !important; border: 0 !important; border-radius: 0 !important; color: var(--c-muted, #aaa) !important;
    -webkit-appearance: none; appearance: none; font-family: inherit; cursor: pointer; padding: 0; }
  .ohtab-i.on { color: var(--c-accent, #e60000) !important; }
  .ohtab-i svg { width: 22px; height: 22px; }
  /* center FAB: same flex slot as the others (so 2 left / 2 right stay symmetric),
     a centered raised red circle, no label. */
  .ohtab-fab { gap: 0; }
  .ohtab-fab svg { width: 26px; height: 26px; color: #fff;
    background: var(--c-accent, #e60000); width: 50px; height: 50px; padding: 12px; border-radius: 50%;
    margin-top: -18px; box-shadow: 0 4px 14px rgba(0,0,0,.35); box-sizing: border-box; }
  /* clear the fixed 58px tab bar PLUS the iOS home-indicator safe area (the bar itself
     grows by safe-area) — otherwise the last content sits hidden under the bar and the
     page appears to "not scroll to the bottom". */
  body { padding-bottom: calc(62px + env(safe-area-inset-bottom, 0px)); }
}

/* ============================ YOUTUBE-STYLE LEFT SIDEBAR SHELL =============
   home=sidebar → a fixed left nav rail (desktop) + content shifted right, like
   the reference. Hidden on mobile (the bottom tab bar takes over).              */
.ohside { display: none; }
@media (min-width: 1000px) {
  body.oh-home-sidebar .ohside { display: block; position: fixed; top: 0; left: 0; bottom: 0; width: 224px; z-index: 60;
    background: var(--c-surface, #1a1a1a); border-right: 1px solid var(--c-line, #272727); padding: 72px 10px 24px; overflow-y: auto; }
  body.oh-home-sidebar .ohmain, body.oh-home-sidebar #footer, body.oh-home-sidebar #colophon { margin-left: 224px; }
  body.oh-home-sidebar .ohhead-nav { display: none; } /* nav lives in the sidebar */
  body.oh-home-sidebar .ohhead { z-index: 70; } /* header bar above the sidebar */
  .ohside-nav { display: flex; flex-direction: column; gap: 2px; }
  .ohside-i { display: flex; align-items: center; gap: 14px; padding: 9px 12px; border-radius: 10px; color: var(--c-text, #f1f1f1); text-decoration: none; font-size: .88rem; font-weight: 600; }
  .ohside-i svg { width: 22px; height: 22px; flex: 0 0 auto; }
  .ohside-i:hover { background: rgba(127,127,127,.12); }
  .ohside-i.on { background: var(--c-accent, #e60000); color: #fff; }
  .ohside-sec { color: var(--c-muted, #aaa); font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; padding: 16px 12px 6px; border-top: 1px solid var(--c-line, #272727); margin-top: 10px; }
}

/* hero = swipeable featured carousel (shown for sidebar + hero homes). */
.ohhero { display: none; }
body.oh-home-sidebar .ohhero, body.oh-home-hero .ohhero { display: block; position: relative; margin: 0 0 22px; }
.ohhero-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; border-radius: 16px; }
.ohhero-track::-webkit-scrollbar { display: none; }
.ohhero-slide { position: relative; flex: 0 0 100%; scroll-snap-align: center; min-height: 320px; display: flex; align-items: flex-end;
  background: var(--c-surface, #1a1a1a) center/cover no-repeat; border-radius: 16px; text-decoration: none; color: #fff; }
/* lighter gradient — image is the star; only the bottom darkens for text legibility */
.ohhero-slide::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.82), rgba(0,0,0,.15) 42%, transparent 70%); border-radius: 16px; }
.ohhero-cap { position: relative; z-index: 1; padding: 22px 26px 38px; max-width: 620px; }
.ohhero-tag { display: inline-block; font-size: .66rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #fff; background: var(--c-accent, #e60000); padding: 3px 10px; border-radius: 999px; margin-bottom: 10px; }
.ohhero-cap h2 { margin: 0 0 14px; font-size: 1.5rem; font-weight: 800; line-height: 1.2; color: #fff; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.ohhero-btn { display: inline-block; background: #fff; color: #111; font-weight: 800; padding: 9px 18px; border-radius: 999px; }
.ohhero-dots { position: absolute; bottom: 12px; left: 0; right: 0; display: flex; justify-content: center; gap: 6px; z-index: 2; }
.ohhero-dots button { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,.5); border: 0; padding: 0; cursor: pointer; transition: .2s; }
.ohhero-dots button.on { background: #fff; width: 22px; border-radius: 5px; }
@media (max-width: 700px) { .ohhero-slide { min-height: 200px; } .ohhero-cap { padding: 22px 22px 34px; } .ohhero-cap h2 { font-size: 1.3rem; } }

/* ============================ NEON STYLE (oh-style-neon) ===================
   Futuristic gradient treatment (logo/FAB/pills/play/hero glow) — like the
   neon reference designs. Triggered by the 'neon' color palette.               */
.oh-style-neon { --vb-grad: linear-gradient(120deg, #a855f7, #22d3ee 58%, #ec4899); }
.oh-style-neon .ohhead-name { background: var(--vb-grad); -webkit-background-clip: text; background-clip: text; color: transparent; font-weight: 800; }
.oh-style-neon .ohhead-logo .mark { background: var(--vb-grad); }
.oh-style-neon .ohpill.active { background: var(--vb-grad); border-color: transparent; color: #fff; }
.oh-style-neon .ohhead-search button { background: var(--vb-grad); color: #fff; }
.oh-style-neon .ohtab-fab svg { background: var(--vb-grad) !important; }
.oh-style-neon .ohc:hover .ohc-play svg { background: var(--vb-grad) !important; }
.oh-style-neon .ohhero { background: linear-gradient(120deg, #a855f7, #6d28d9 48%, #0b0f1e 100%); }
.oh-style-neon .ohside-i.on { background: var(--vb-grad); }
.oh-style-neon .ohc-thumb { box-shadow: 0 0 0 1px rgba(168,85,247,.28); }
.oh-style-neon .ohsec-head h2 { background: var(--vb-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ============================ GLASS STYLE (oh-style-glass) =================
   Glassmorphism — frosted translucent cards/header/pills over a soft color glow.  */
body.oh-style-glass { background:
  radial-gradient(900px 480px at 82% -8%, rgba(245,158,11,.32), transparent 60%),
  radial-gradient(700px 500px at -10% 30%, rgba(168,85,247,.18), transparent 60%),
  var(--c-bg, #181206); }
.oh-style-glass .ohsec .ohgrid .ohc { background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.14); border-radius: 18px; padding: 8px; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.oh-style-glass .ohc-thumb { border-radius: 13px; }
.oh-style-glass .ohc-body { padding: 9px 6px 5px; }
.oh-style-glass .ohpill { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.18); backdrop-filter: blur(10px); }
.oh-style-glass .ohpill.active { background: rgba(255,255,255,.22); }
.oh-style-glass .ohhead { background: rgba(20,16,8,.55); border-bottom: 1px solid rgba(255,255,255,.1); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
.oh-style-glass .ohhead-search input { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.18); }
.oh-style-glass .ohside { background: rgba(20,16,8,.45); backdrop-filter: blur(16px); }
.oh-style-glass .ohtab { background: rgba(20,16,8,.6); backdrop-filter: blur(16px); }
.oh-style-glass .ohhero-slide { border-radius: 20px; }

/* ============================ TABS STYLE (oh-style-tabs) ===================
   Filter pills → underline text-tabs; bottom bar → flat 5-icon (no raised FAB). */
.oh-style-tabs .ohpills { gap: 2px; border-bottom: 1px solid var(--c-line, #272727); }
.oh-style-tabs .ohpill { background: transparent !important; border: 0 !important; border-radius: 0 !important; color: var(--c-muted, #aaa); padding: 11px 14px; border-bottom: 2px solid transparent !important; }
.oh-style-tabs .ohpill.active { color: var(--c-accent, #e60000); border-bottom-color: var(--c-accent, #e60000) !important; background: transparent !important; }
.oh-style-tabs .ohpill-i { display: none; }
@media (max-width: 900px) {
  .oh-style-tabs .ohtab-fab svg { margin-top: 0; background: transparent !important; width: 24px; height: 24px; padding: 0; color: var(--c-muted, #aaa); border-radius: 0; box-shadow: none; }
}

/* (watch + footer widgets: keep the theme's original layout — no overrides) */
