/**
 * DJ Refresh — Learning Library (video library), Figma "OPTION D · LynTec Pattern Adapted".
 * Scoped under .djr-vlib, rendered on the DJR chrome.
 */

.djr-page .djr-vlib { background: var(--djr-white); }

/* ---------- hero ---------- */
.djr-vlib__hero { position: relative; overflow: hidden; background: var(--djr-dark); color: var(--djr-white); }
.djr-vlib__hero-media {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0;
}
/* Legibility overlay — stronger when a media background is present. */
.djr-vlib__hero--media::before {
  content: ""; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(90deg, rgba(10,10,10,0.9) 0%, rgba(10,10,10,0.62) 55%, rgba(10,10,10,0.42) 100%);
}
.djr-vlib__hero-inner {
  position: relative; z-index: 2;
  display: flex; align-items: center; justify-content: space-between; gap: 60px;
  /* The header runs in OVERLAY mode on this page — the 100px nav floats over the hero top,
     so the content clears it (Figma: eyebrow starts ~190px into the band). */
  padding-top: 150px; padding-bottom: 56px;
}
.djr-vlib__eyebrow { display: block; margin-bottom: 10px; font-size: 12px; font-weight: 600; letter-spacing: 0.4em; text-transform: uppercase; color: var(--djr-red); }
.djr-vlib__title { margin: 0 0 10px; font-size: 40px; font-weight: 700; line-height: 1.08; color: var(--djr-white); }
.djr-vlib__tagline { margin: 0; font-size: 17px; font-weight: 400; color: var(--djr-white); }

/* subscribe card */
.djr-vlib__subscribe {
  flex: 0 0 auto; display: flex; flex-direction: column; gap: 11px;
  width: 460px; max-width: 100%; padding: 24px 26px; border-radius: 14px;
  background: rgba(255, 255, 255, 0.07); backdrop-filter: blur(4px);
}
.djr-vlib__hero--media .djr-vlib__subscribe { background: rgba(20, 20, 22, 0.72); }
.djr-vlib__subscribe-heading { font-size: 20px; font-weight: 700; color: var(--djr-white); }
.djr-vlib__subscribe-row { display: flex; gap: 10px; }
.djr-vlib__subscribe-input {
  flex: 1 1 auto; min-width: 0; height: 44px; padding: 0 14px;
  border: 0; border-radius: 8px; background: var(--djr-white);
  font-family: inherit; font-size: 13.5px; color: var(--djr-ink);
}
.djr-vlib__subscribe-input:focus { outline: 2px solid var(--djr-red); }
.djr-vlib__subscribe-btn {
  flex: 0 0 auto; height: 44px; padding: 0 20px; border: 0; border-radius: 8px;
  background: var(--djr-red); color: var(--djr-white);
  font-family: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer;
  transition: background-color 0.15s ease;
}
.djr-vlib__subscribe-btn:hover { background: var(--djr-red-dark); }
.djr-vlib__subscribe-note { font-size: 11px; color: rgba(255, 255, 255, 0.7); }

/* ---------- layout: main + right panel ---------- */
.djr-vlib__inner { padding-top: 36px; padding-bottom: 64px; }
.djr-vlib__layout { display: grid; grid-template-columns: 1fr 280px; gap: 40px; align-items: start; }
.djr-vlib__main { min-width: 0; }

/* ---------- sections + cards ---------- */
.djr-vlib__section { margin-bottom: 44px; }
.djr-vlib__section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
/* !important: legacy style.css / plugin sheets set heading colors (incl. white) at higher weight. */
.djr-page .djr-vlib__section-title { margin: 0; font-size: 24px !important; line-height: 1.25 !important; font-weight: 700; color: #000 !important; }
.djr-vlib__view-all { font-size: 13.5px; font-weight: 600; color: var(--djr-red); text-decoration: none; white-space: nowrap; }
.djr-vlib__view-all:hover { text-decoration: underline; }
.djr-vlib__flat-head { margin-bottom: 18px; font-size: 13px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--djr-muted); }
.djr-vlib__empty { padding: 40px 0; color: var(--djr-body); }

/* Flat (filtered) results stay a wrapped grid. */
.djr-vlib__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px 24px; }

/* ---------- section rows: ONE scrollable row (shared djr-scroller pattern) ---------- */
.djr-vlib__row {
  display: flex; flex-wrap: nowrap; gap: 24px;
  overflow-x: auto; scroll-behavior: smooth; overscroll-behavior-x: contain;
  -ms-overflow-style: none; scrollbar-width: none; /* progress bar replaces the native scrollbar */
  cursor: grab; user-select: none; padding-bottom: 4px;
}
.djr-vlib__row::-webkit-scrollbar { display: none; }
.djr-vlib__row.is-dragging { cursor: grabbing; scroll-behavior: auto; }
.djr-vlib__row .djr-vcard { flex: 0 0 340px; width: 340px; }
/* scroller controls (viewport + arrows + progress bar), mirroring the home/new-arrivals treatment */
.djr-vlib .djr-scroller__viewport { position: relative; }
.djr-vlib .djr-scroller__arrow {
  position: absolute; top: 96px; transform: translateY(-50%); z-index: 3;
  display: none; align-items: center; justify-content: center;
  width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%;
  background: var(--djr-white); color: var(--djr-ink);
  box-shadow: 0 6px 18px rgba(12, 16, 22, 0.18); cursor: pointer; opacity: 0;
  transition: opacity 0.18s ease, background-color 0.18s ease, color 0.18s ease;
}
.djr-vlib .djr-scroller__arrow--prev { left: 8px; }
.djr-vlib .djr-scroller__arrow--next { right: 8px; }
.djr-vlib .djr-scroller__arrow svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.djr-vlib .djr-scroller__arrow:hover { background: var(--djr-red); color: #fff; }
.djr-vlib .djr-scroller__arrow:disabled { opacity: 0 !important; pointer-events: none; }
@media (hover: hover) and (pointer: fine) {
  .djr-vlib .djr-scroller.is-scrollable:hover .djr-scroller__arrow { display: inline-flex; opacity: 1; }
}
.djr-vlib .djr-scroller__bar {
  position: relative; height: 8px; margin-top: 16px;
  border-radius: var(--djr-radius-pill); background: #e4e4e4; overflow: hidden;
}
.djr-vlib .djr-scroller.is-static .djr-scroller__bar { display: none; }
.djr-vlib .djr-scroller__thumb {
  display: block; height: 100%; width: 20%;
  border-radius: var(--djr-radius-pill); background: var(--djr-red); transition: transform 0.08s linear;
}

.djr-vcard { min-width: 0; }
.djr-vcard__thumb {
  position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; padding: 0; border: 0; margin: 0 0 12px;
  border-radius: 12px; overflow: hidden; background: var(--djr-surface); cursor: pointer;
}
.djr-vcard__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.3s ease; }
.djr-vcard:hover .djr-vcard__thumb img { transform: scale(1.04); }
.djr-vcard__thumb-empty { position: absolute; inset: 0; background: linear-gradient(135deg, #2a2a2a, #4a4a4a); }
.djr-vcard__badge {
  position: absolute; top: 10px; left: 10px; z-index: 2; padding: 4px 9px; border-radius: 6px;
  background: var(--djr-red); color: #fff; font-size: 10px; font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase;
}
.djr-vcard__duration {
  position: absolute; bottom: 10px; right: 10px; z-index: 2; padding: 3px 7px; border-radius: 5px;
  background: rgba(0, 0, 0, 0.85); color: #fff; font-size: 11.5px; font-weight: 600;
}
/* Option D: outlined play circle, always visible; brightens on hover. */
.djr-vcard__play {
  position: absolute; inset: 0; z-index: 1; display: flex; align-items: center; justify-content: center;
  color: rgba(255, 255, 255, 0.9); transition: color 0.2s ease, background-color 0.2s ease;
}
.djr-vcard__play svg { width: 42px; height: 42px; filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.45)); }
.djr-vcard__thumb:hover .djr-vcard__play,
.djr-vcard__thumb:focus-visible .djr-vcard__play { color: #fff; background: rgba(10, 10, 12, 0.18); }
/* !important: legacy sheets style bare h3 (32px) with heavier selectors on some pages. */
.djr-page .djr-vcard__title { margin: 0 0 5px; font-size: 15.5px !important; font-weight: 600 !important; line-height: 1.3 !important; color: var(--djr-ink) !important; }
.djr-vcard__desc { margin: 0 0 7px; font-size: 12.5px; line-height: 1.48; color: var(--djr-body); }
.djr-vcard__meta { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; }
.djr-vcard__meta-playlist { color: var(--djr-red); }
.djr-vcard__meta-dot { color: var(--djr-muted); }
.djr-vcard__meta-skill { color: #999; }

/* ---------- right filter panel ---------- */
.djr-vlib__sidebar {
  position: sticky; top: 24px;
  /* Cap to the viewport and scroll INSIDE the panel — otherwise, with every facet open, the
     sticky panel grows taller than the screen and you must scroll the whole page to reach the
     lower filter groups. */
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 20px 22px; border-radius: 14px; background: var(--djr-surface-alt, #f7f7f7);
  scrollbar-width: thin;
  scrollbar-color: var(--djr-muted) transparent;
}
.djr-vlib__sidebar::-webkit-scrollbar { width: 6px; }
.djr-vlib__sidebar::-webkit-scrollbar-thumb { background: var(--djr-muted); border-radius: 999px; }
.djr-vlib__sidebar::-webkit-scrollbar-track { background: transparent; }
.djr-vlib__panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.djr-vlib__panel-title { font-size: 16px; font-weight: 700; color: var(--djr-ink); }
.djr-vlib__panel-clear { border: 0; background: none; padding: 0; font-family: inherit; font-size: 12px; font-weight: 600; color: var(--djr-red); cursor: pointer; }
.djr-vlib__panel-clear:hover { text-decoration: underline; }
.djr-vlib__filter-close { display: none; border: 0; background: none; font-size: 28px; line-height: 1; color: var(--djr-body); cursor: pointer; }

.djr-vlib__search { position: relative; margin-bottom: 12px; }
.djr-vlib__search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--djr-red); pointer-events: none; }
.djr-vlib__search-input {
  width: 100%; height: 42px; padding: 0 12px 0 38px;
  border: 1px solid var(--djr-line); border-radius: 8px; background: var(--djr-white);
  font-family: inherit; font-size: 13px; color: var(--djr-ink);
}
.djr-vlib__search-input:focus { outline: none; border-color: var(--djr-red); }
.djr-vlib__search-input::-webkit-search-cancel-button,
.djr-vlib__search-input::-webkit-search-decoration { -webkit-appearance: none; appearance: none; }

.djr-vfacet { border-top: 1px solid var(--djr-line); }
.djr-vfacet__head {
  display: flex; align-items: center; justify-content: space-between; width: 100%;
  padding: 13px 0; border: 0; background: none; cursor: pointer;
  font-family: inherit; font-size: 13.5px; font-weight: 700; color: var(--djr-ink); text-align: left;
}
.djr-vfacet__count { font-style: normal; font-weight: 500; color: var(--djr-muted); }
.djr-vfacet__chevron { flex: 0 0 auto; width: 8px; height: 8px; border-right: 1.7px solid var(--djr-body); border-bottom: 1.7px solid var(--djr-body); transform: rotate(45deg); transition: transform 0.18s ease; }
.djr-vfacet.is-open .djr-vfacet__chevron { transform: rotate(225deg); }
.djr-vfacet__list { list-style: none; margin: 0; padding: 0; max-height: 0; overflow: hidden; }
.djr-vfacet.is-open .djr-vfacet__list { max-height: 1200px; padding-bottom: 12px; }
.djr-vfacet__item { display: flex; align-items: center; }
.djr-vfacet__input { position: absolute; opacity: 0; width: 0; height: 0; }
.djr-vfacet__label { display: flex; align-items: center; gap: 9px; padding: 5px 0; cursor: pointer; font-size: 13px; font-weight: 500; color: var(--djr-body); }
.djr-vfacet__label::before {
  content: ""; flex: 0 0 auto; width: 16px; height: 16px; border: 1.4px solid var(--djr-muted); border-radius: 4px; background: var(--djr-white);
  background-repeat: no-repeat; background-position: center; background-size: 10px; transition: border-color 0.15s ease, background-color 0.15s ease;
}
.djr-vfacet__input:checked + .djr-vfacet__label { color: var(--djr-ink); font-weight: 600; }
.djr-vfacet__input:checked + .djr-vfacet__label::before {
  border-color: var(--djr-red); background-color: var(--djr-red);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6L9 17l-5-5'/%3E%3C/svg%3E");
}
.djr-vlib__scrim { display: none; }
.djr-vlib__filter-toggle { display: none; }

/* ---------- support CTA band: photo left, copy right (homepage About treatment) ---------- */
.djr-vlib__cta { position: relative; overflow: hidden; min-height: 440px; display: flex; align-items: center; background: #000; color: var(--djr-white); }
.djr-vlib__cta-media {
  position: absolute; top: 0; left: 0; bottom: 0; width: 52%; z-index: 0;
  background-size: cover; background-position: center;
}
/* Fade the photo into the black band so the copy side stays clean. */
.djr-vlib__cta-media::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(0,0,0,0.1) 55%, #000 100%);
}
.djr-vlib__cta-inner { position: relative; z-index: 1; display: flex; justify-content: flex-end; padding-top: 72px; padding-bottom: 72px; width: 100%; }
.djr-vlib__cta-copy { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; width: 46%; min-width: 320px; }
.djr-vlib__cta-eyebrow { font-size: 13px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: #ea0b1c; }
.djr-page .djr-vlib__cta-heading { margin: 0; font-size: 38px !important; line-height: 1.15 !important; font-weight: 700; color: var(--djr-white) !important; }
.djr-vlib__cta-desc { margin: 0; font-size: 17px; line-height: 1.5; color: rgba(255, 255, 255, 0.9); }
.djr-vlib__cta-actions { display: flex; align-items: center; gap: 34px; padding-top: 16px; }
.djr-vlib__cta-btn {
  display: inline-flex; align-items: center; padding: 14px 28px; border-radius: var(--djr-radius-pill);
  background: var(--djr-white); color: var(--djr-ink); font-size: 15px; font-weight: 700; text-decoration: none;
  transition: background-color 0.15s ease;
}
.djr-vlib__cta-btn:hover { background: #e8e8e8; color: var(--djr-ink); }
.djr-vlib__cta-link { font-size: 15px; font-weight: 600; color: var(--djr-white); text-decoration: none; }
.djr-vlib__cta-link:hover { color: var(--djr-white); text-decoration: underline; }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .djr-vlib__grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 960px) {
  .djr-vlib__hero-inner { flex-direction: column; align-items: flex-start; gap: 28px; }
  .djr-vlib__layout { grid-template-columns: 1fr; }
  .djr-vlib__cta-media { width: 100%; }
  .djr-vlib__cta-media::after { background: rgba(0, 0, 0, 0.72); }
  .djr-vlib__cta-copy { width: 100%; }
  /* Floating filter pill — fixed bottom-centre, always reachable while browsing rails. */
  .djr-vlib__filter-toggle {
    position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 1060;
    display: inline-flex; align-items: center; gap: 8px; height: 46px; padding: 0 20px;
    border: 0; border-radius: var(--djr-radius-pill); background: var(--djr-ink); color: var(--djr-white);
    font-family: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  }
  body.djr-vlib-filters-open .djr-vlib__filter-toggle { display: none; }
  .djr-vlib__filter-count {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
    background: var(--djr-red); color: #fff; font-size: 11px; font-weight: 700;
  }
  .djr-vlib__filter-count[hidden] { display: none; }
  .djr-vlib__filter-close { display: block; }
  .djr-vlib__sidebar {
    position: fixed; top: 0; right: 0; bottom: 0; z-index: 1080; width: 320px; max-width: 88vw; border-radius: 0;
    max-height: none; /* the drawer spans the full viewport height */
    transform: translateX(100%); transition: transform 0.28s ease; overflow-y: auto;
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.25);
  }
  body.djr-vlib-filters-open .djr-vlib__sidebar { transform: translateX(0); }
  body.djr-vlib-filters-open .djr-vlib__scrim { display: block; position: fixed; inset: 0; z-index: 1070; background: rgba(0, 0, 0, 0.5); }
}
@media (max-width: 560px) {
  .djr-vlib__grid { grid-template-columns: 1fr; }
  .djr-vlib__title { font-size: 32px; }
  .djr-vlib__subscribe { width: 100%; }
  .djr-vlib__cta-heading { font-size: 24px; }
}
