/* Buildahottub Video Library
   Layout: search + sort bar, format tabs, topic chips, "Start here" strip, card grid, pop-up player. */
.bahvl {
  --bahvl-accent: #821ce7;
  --bahvl-accent-ink: #5d10a8;
  --bahvl-accent-soft: #f3eafd;
  --bahvl-warm: #c05530;
  --bahvl-ink: #1f1a26;
  --bahvl-muted: #6b6475;
  --bahvl-line: #e6e1ec;
  --bahvl-surface: #ffffff;
  --bahvl-ground: #f8f6fa;
  --bahvl-radius: 10px;
  font-family: Lato, "Helvetica Neue", Arial, sans-serif;
  color: var(--bahvl-ink);
  max-width: 1240px;
  margin: 0 auto;
}
.bahvl *, .bahvl *::before, .bahvl *::after { box-sizing: border-box; }
.bahvl button { font-family: inherit; }

/* ---------- Intro ---------- */
.bahvl-intro { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 8px 24px; margin-bottom: 18px; }
.bahvl-intro h2 { margin: 0; font-size: 1.6em; font-weight: 900; letter-spacing: -0.01em; line-height: 1.15; text-wrap: balance; }
.bahvl-intro p { margin: 4px 0 0; color: var(--bahvl-muted); font-size: 0.95em; }
.bahvl-subscribe { display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 999px; background: #e62117; color: #fff !important; font-weight: 700; font-size: 0.85em; text-decoration: none !important; white-space: nowrap; }
.bahvl-subscribe:hover { background: #c41a11; }
.bahvl-subscribe svg { width: 16px; height: 16px; fill: currentColor; }

/* ---------- Controls ---------- */
.bahvl-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: stretch; margin-bottom: 14px; }
.bahvl-search { position: relative; flex: 1 1 320px; min-width: 0; }
.bahvl-search svg { position: absolute; left: 14px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); fill: var(--bahvl-muted); pointer-events: none; }
.bahvl .bahvl-search input {
  width: 100%; height: 48px; margin: 0; padding: 0 44px 0 42px;
  border: 1.5px solid var(--bahvl-line); border-radius: var(--bahvl-radius);
  background: var(--bahvl-surface); color: var(--bahvl-ink); font-size: 1em; box-shadow: none;
}
.bahvl .bahvl-search input:focus { outline: none; border-color: var(--bahvl-accent); box-shadow: 0 0 0 3px var(--bahvl-accent-soft); }
.bahvl-clear { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 32px; height: 32px; margin: 0; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--bahvl-muted); font-size: 20px; line-height: 1; cursor: pointer; min-height: 0; }
.bahvl-clear:hover { background: var(--bahvl-ground); color: var(--bahvl-ink); }
.bahvl .bahvl-sort { height: 48px; margin: 0; padding: 0 36px 0 14px; border: 1.5px solid var(--bahvl-line); border-radius: var(--bahvl-radius); background-color: var(--bahvl-surface); color: var(--bahvl-ink); font-size: 0.95em; width: auto; flex: 0 0 auto; box-shadow: none; }

/* Format tabs */
.bahvl-tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--bahvl-line); margin-bottom: 14px; overflow-x: auto; scrollbar-width: none; }
.bahvl-tabs::-webkit-scrollbar { display: none; }
.bahvl .bahvl-tab {
  position: relative; display: inline-flex; align-items: center; gap: 8px;
  margin: 0 0 -2px; padding: 12px 18px; min-height: 0;
  border: 0; border-bottom: 3px solid transparent; background: none;
  color: var(--bahvl-muted); font-size: 1.02em; font-weight: 700; letter-spacing: 0; text-transform: none; line-height: 1.2;
  cursor: pointer; white-space: nowrap;
}
.bahvl .bahvl-tab:hover { color: var(--bahvl-ink); }
.bahvl .bahvl-tab[aria-selected="true"] { color: var(--bahvl-accent); border-bottom-color: var(--bahvl-accent); }
.bahvl-tab svg { width: 18px; height: 18px; fill: currentColor; }
.bahvl-count { font-size: 0.78em; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--bahvl-ground); color: var(--bahvl-muted); font-variant-numeric: tabular-nums; }
.bahvl-tab[aria-selected="true"] .bahvl-count { background: var(--bahvl-accent-soft); color: var(--bahvl-accent-ink); }

/* Topic chips */
.bahvl-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 22px; }
.bahvl .bahvl-chip {
  margin: 0; padding: 7px 13px; min-height: 0; line-height: 1.2;
  border: 1.5px solid var(--bahvl-line); border-radius: 999px; background: var(--bahvl-surface);
  color: var(--bahvl-ink); font-size: 0.86em; font-weight: 700; text-transform: none; letter-spacing: 0;
  cursor: pointer; white-space: nowrap;
}
.bahvl .bahvl-chip:hover { border-color: var(--bahvl-accent); }
.bahvl .bahvl-chip[aria-pressed="true"] { background: var(--bahvl-accent); border-color: var(--bahvl-accent); color: #fff; }
.bahvl-chip span { font-weight: 400; opacity: 0.7; margin-left: 3px; font-variant-numeric: tabular-nums; }
.bahvl .bahvl-chip:disabled { opacity: 0.4; cursor: default; border-color: var(--bahvl-line); }
@media (max-width: 640px) {
  .bahvl-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-right: -16px; padding-right: 16px; }
  .bahvl-chips::-webkit-scrollbar { display: none; }
}

/* Section headings */
.bahvl-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0 0 12px; }
.bahvl-section-head h3 { margin: 0; font-size: 1.15em; font-weight: 900; }
.bahvl-section-head p { margin: 0; color: var(--bahvl-muted); font-size: 0.85em; font-variant-numeric: tabular-nums; }
.bahvl-start { margin-bottom: 30px; padding: 18px; border-radius: 14px; background: var(--bahvl-accent-soft); }
.bahvl-start .bahvl-section-head h3 { color: var(--bahvl-accent-ink); }

/* ---------- Cards ---------- */
.bahvl-grid { display: grid; gap: 22px 18px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.bahvl-grid.is-shorts { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 18px 14px; }
.bahvl-start .bahvl-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 760px) { .bahvl-start .bahvl-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) {
  .bahvl-grid { grid-template-columns: 1fr; }
  .bahvl-grid.is-shorts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 10px; }
  .bahvl-start .bahvl-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.bahvl-card { display: flex; flex-direction: column; gap: 8px; min-width: 0; color: inherit !important; text-decoration: none !important; cursor: pointer; }
.bahvl-thumb { position: relative; display: block; aspect-ratio: 16 / 9; max-width: 100%; border-radius: var(--bahvl-radius); overflow: hidden; background: #ddd6e6; }
.is-shorts .bahvl-thumb { aspect-ratio: 9 / 16; border-radius: 12px; }
.bahvl-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; margin: 0; transition: transform .35s ease; }
.bahvl-card:hover .bahvl-thumb img, .bahvl-card:focus-visible .bahvl-thumb img { transform: scale(1.04); }
.bahvl-card:focus-visible { outline: 3px solid var(--bahvl-accent); outline-offset: 3px; border-radius: var(--bahvl-radius); }
.bahvl-play { position: absolute; left: 50%; top: 50%; width: 54px; height: 38px; margin: -19px 0 0 -27px; border-radius: 10px; background: rgba(20, 14, 28, .72); display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity .2s, background .2s; }
.bahvl-play::after { content: ""; border-style: solid; border-width: 9px 0 9px 15px; border-color: transparent transparent transparent #fff; margin-left: 4px; }
.bahvl-card:hover .bahvl-play, .bahvl-card:focus-visible .bahvl-play { opacity: 1; background: #e62117; }
.bahvl-badge { position: absolute; right: 7px; bottom: 7px; padding: 2px 6px; border-radius: 5px; background: rgba(15, 10, 20, .82); color: #fff; font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.4; }
.bahvl-tag { position: absolute; left: 7px; top: 7px; padding: 2px 8px; border-radius: 5px; background: var(--bahvl-warm); color: #fff; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; line-height: 1.5; }
.bahvl-title { margin: 0; font-size: 0.98em; font-weight: 700; line-height: 1.35; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.is-shorts .bahvl-title { font-size: 0.88em; -webkit-line-clamp: 3; }
.bahvl-meta { margin: -4px 0 0; color: var(--bahvl-muted); font-size: 0.82em; font-variant-numeric: tabular-nums; }
.bahvl-card:hover .bahvl-title { color: var(--bahvl-accent); }
.bahvl mark { background: #fde9a9; color: inherit; padding: 0 1px; border-radius: 2px; }

/* Empty + more */
.bahvl-empty { padding: 48px 16px; text-align: center; color: var(--bahvl-muted); border: 2px dashed var(--bahvl-line); border-radius: 14px; }
.bahvl-empty strong { display: block; color: var(--bahvl-ink); font-size: 1.1em; margin-bottom: 6px; }
.bahvl-empty button { margin-top: 14px; }
.bahvl-more { display: flex; flex-direction: column; align-items: center; gap: 10px; margin: 30px 0 10px; }
.bahvl-more p { margin: 0; color: var(--bahvl-muted); font-size: 0.85em; font-variant-numeric: tabular-nums; }
.bahvl .bahvl-btn { margin: 0; padding: 12px 28px; min-height: 0; border: 0; border-radius: 999px; background: var(--bahvl-accent); color: #fff; font-size: 0.95em; font-weight: 700; text-transform: none; letter-spacing: 0; line-height: 1.2; cursor: pointer; }
.bahvl .bahvl-btn:hover { background: var(--bahvl-accent-ink); }
.bahvl .bahvl-btn.is-ghost { background: transparent; color: var(--bahvl-accent); border: 1.5px solid var(--bahvl-accent); }

/* ---------- Player ---------- */
.bahvl-modal { position: fixed; inset: 0; z-index: 100000; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(12, 8, 18, .88); }
.bahvl-modal[hidden] { display: none !important; }
.bahvl-dialog { position: relative; width: min(1100px, 100%); max-height: 100%; display: flex; flex-direction: column; gap: 14px; }
.bahvl-modal.is-short .bahvl-dialog { width: min(440px, 100%); }
.bahvl-frame { position: relative; width: 100%; aspect-ratio: 16 / 9; max-height: calc(100vh - 190px); background: #000; border-radius: 12px; overflow: hidden; }
.bahvl-modal.is-short .bahvl-frame { aspect-ratio: 9 / 16; max-height: calc(100vh - 210px); margin: 0 auto; width: auto; height: calc(100vh - 210px); max-width: 100%; }
.bahvl-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.bahvl-info { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px; color: #fff; }
.bahvl-info h4 { margin: 0; color: #fff; font-size: 1.1em; line-height: 1.35; flex: 1 1 300px; min-width: 0; text-wrap: balance; }
.bahvl-modal.is-short .bahvl-info h4 { font-size: 0.98em; }
.bahvl-info-links { display: flex; gap: 10px; flex-wrap: wrap; }
.bahvl-info-links a { color: #fff !important; font-size: 0.85em; font-weight: 700; padding: 8px 14px; border-radius: 999px; border: 1.5px solid rgba(255, 255, 255, .35); text-decoration: none !important; white-space: nowrap; }
.bahvl-info-links a:hover { border-color: #fff; }
.bahvl-info-links a.is-cta { background: var(--bahvl-accent); border-color: var(--bahvl-accent); }
.bahvl .bahvl-x, .bahvl .bahvl-nav { position: absolute; margin: 0; padding: 0; min-height: 0; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .14); color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; line-height: 1; }
.bahvl .bahvl-x { top: -46px; right: 0; width: 38px; height: 38px; font-size: 24px; }
.bahvl .bahvl-nav { top: 50%; width: 46px; height: 46px; margin-top: -23px; font-size: 26px; }
.bahvl .bahvl-x:hover, .bahvl .bahvl-nav:hover { background: rgba(255, 255, 255, .3); }
.bahvl-nav.is-prev { left: -62px; }
.bahvl-nav.is-next { right: -62px; }
.bahvl-modal.is-short .bahvl-nav.is-prev { left: -60px; }
.bahvl-modal.is-short .bahvl-nav.is-next { right: -60px; }
@media (max-width: 1240px) { .bahvl-modal:not(.is-short) .bahvl-nav { display: none; } }
@media (max-width: 600px) {
  .bahvl-modal { padding: 56px 10px 10px; }
  .bahvl-modal .bahvl-nav { display: none; }
  .bahvl-modal.is-short .bahvl-frame { height: calc(100vh - 230px); }
}
@media (prefers-reduced-motion: reduce) { .bahvl * { transition: none !important; } }
body.bahvl-lock { overflow: hidden; }
