/* Alder: the video library (/learn/videos), one video's page
   (/learn/videos/{slug}) and the two pieces a lesson page borrows (an
   uploaded video's player, the link to the video's page). Linked by
   modules/videolib/videolib.pages.php after the learn sheets.
   Mobile first: one column and 44px targets at 390, more columns as the
   page widens. Nothing here depends on hover. */

.vlib {
  width: min(100% - 2 * var(--al-gutter, 24px), var(--al-max, 1280px));
  margin-inline: auto; padding: 8px 0 72px;
  color: var(--al-ink, #0E2A1B); font-family: var(--al-sans, system-ui, sans-serif);
  overflow-x: clip;
}
.vlib a { color: var(--al-moss, #1C6B3C); text-underline-offset: 3px; }

/* Search */
.vlib-search { margin: 0 0 16px; }
.vlib-search__label { display: block; margin: 0 0 8px; font-size: 14px; font-weight: 600; color: var(--al-muted, #5B6E66); }
.vlib-search__row { display: flex; gap: 8px; max-width: 640px; }
.vlib-search__input {
  flex: 1 1 auto; min-width: 0; min-height: 48px; padding: 0 16px;
  border: 1px solid var(--al-line, rgba(14, 42, 27, .16)); border-radius: 999px;
  background: #fff; color: inherit; font: inherit; font-size: 16px;
}
.vlib-search__input:focus-visible, .vlib-search__btn:focus-visible, .vlib-chip:focus-visible,
.vlib-card:focus-visible, .vlib-lesson:focus-visible, .vlib-back a:focus-visible, .vlib-transcript summary:focus-visible {
  outline: 2px solid var(--al-moss, #1C6B3C); outline-offset: 2px;
}
.vlib-search__btn {
  flex: 0 0 auto; min-height: 48px; padding: 0 22px; border: 0; border-radius: 999px;
  background: var(--al-pill, #14532D); color: #fff; font: inherit; font-size: 15px; font-weight: 600; cursor: pointer;
}

/* Module chips: they scroll sideways on a phone rather than wrap into a wall */
.vlib-chips { display: flex; gap: 8px; margin: 0 calc(-1 * var(--al-gutter, 24px)) 12px; padding: 4px var(--al-gutter, 24px); overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.vlib-chips::-webkit-scrollbar { display: none; }
.vlib a.vlib-chip {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px;
  border-radius: 999px; background: var(--al-sand, #F5EFE6); color: var(--al-ink, #0E2A1B);
  font-size: 15px; font-weight: 500; text-decoration: none; white-space: nowrap;
}
.vlib a.vlib-chip.is-on { background: var(--al-pill, #14532D); color: #fff; }
.vlib-chip__n { font-size: 13px; opacity: .72; font-variant-numeric: tabular-nums; }
.vlib-count { margin: 0 0 20px; font-size: 15px; color: var(--al-body, #4A5568); }
.vlib-count a { display: inline-block; margin-left: 6px; padding: 12px 0; }

/* Cards */
.vlib-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; margin: 0; padding: 0; list-style: none; }
.vlib a.vlib-card { display: flex; flex-direction: column; height: 100%; border-radius: var(--al-r, 16px); background: var(--al-sand, #F5EFE6); color: inherit; text-decoration: none; overflow: hidden; }
.vlib-card__pic { position: relative; display: block; aspect-ratio: 16 / 9; background: var(--al-sand-2, #ECE3D4); overflow: hidden; }
.vlib-card__pic img { display: block; width: 100%; height: 100%; object-fit: cover; }
.vlib-card__pic--fig { display: grid; place-items: center; }
.vlib-card__pic--fig .al-fig { max-width: 62%; }
.vlib-card__play {
  position: absolute; left: 12px; bottom: 12px; display: grid; place-items: center; width: 44px; height: 44px;
  border-radius: 50%; background: var(--al-pill, #14532D); color: #fff; box-shadow: var(--al-raise, 0 8px 16px -10px rgba(14, 42, 27, .45));
}
.vlib-card__play svg { width: 20px; height: 20px; fill: currentColor; margin-left: 2px; }
.vlib-card__clock {
  position: absolute; right: 12px; bottom: 12px; padding: 4px 8px; border-radius: 8px;
  background: rgba(14, 42, 27, .86); color: #fff; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums;
}
.vlib-card__body { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px 20px; }
.vlib-card__module { font-size: 13px; font-weight: 600; letter-spacing: .02em; color: var(--al-moss, #1C6B3C); }
.vlib-card__title { font-family: var(--al-display, inherit); font-size: 19px; font-weight: 600; line-height: 1.25; text-wrap: balance; }
.vlib-card__credit { font-size: 14px; color: var(--al-muted, #5B6E66); }
.vlib-empty { padding: 32px 24px; border-radius: var(--al-r, 16px); background: var(--al-sand, #F5EFE6); }
.vlib-empty__h { margin: 0 0 6px; font-family: var(--al-display, inherit); font-size: 20px; font-weight: 600; }
.vlib-empty p { margin: 0; }
.vlib-empty a { display: inline-block; padding: 10px 0; }

/* One video's page */
.vlib-watch__stage { margin: 0 0 28px; }
.vlib-player { border-radius: var(--al-r, 16px); overflow: hidden; background: var(--al-sand-2, #ECE3D4); }
.vlib-player .ocd-vfacade { border-radius: 0; background: var(--al-sand-2, #ECE3D4); }
.vlib-player .ocd-vfacade::after { content: none; }
.vlib-player .ocd-vfacade:hover .ocd-vfacade-thumb { transform: none; filter: none; }
.vlib-player .ocd-vfacade-play, .vlib-player .ocd-vfacade:hover .ocd-vfacade-play {
  width: 72px; height: 72px; border: 0; background: var(--al-pill, #14532D); color: #fff;
  -webkit-backdrop-filter: none; backdrop-filter: none; box-shadow: var(--al-raise, 0 8px 16px -10px rgba(14, 42, 27, .45));
}
.vlib-player .ocd-vfacade-play svg { width: 30px; height: 30px; fill: currentColor; margin-left: 3px; }
.vlib-player__fig { position: absolute; inset: 0; display: grid; place-items: center; }
.vlib-player__fig .al-fig { max-width: min(46%, 420px); }
.vlib-player--file video { display: block; width: 100%; aspect-ratio: 16 / 9; background: #0E2A1B; }
.vlib-watch__cols { display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px; }
.vlib-watch__desc { font-size: 18px; line-height: 1.6; color: var(--al-body, #4A5568); max-width: 44rem; }
.vlib-watch__desc p { margin: 0 0 1em; }
.vlib-watch__source { max-width: 44rem; margin: 0 0 24px; padding: 16px 18px; border-radius: var(--al-r, 16px); background: var(--al-paper, #E6F5EC); font-size: 15px; line-height: 1.55; }
.vlib-watch__source p { margin: 0; }
.vlib-watch__source a { color: var(--al-moss, #1C6B3C); text-decoration: underline; text-underline-offset: 3px; }
.vlib-watch__out { display: inline-flex; align-items: center; min-height: 44px; margin-top: 4px; font-weight: 600; }
.vlib-transcript { max-width: 44rem; border-radius: var(--al-r, 16px); background: var(--al-sand, #F5EFE6); }
.vlib-transcript summary { min-height: 48px; padding: 12px 18px; font-weight: 600; cursor: pointer; }
.vlib-transcript__body { padding: 0 18px 18px; font-size: 16px; line-height: 1.65; color: var(--al-body, #4A5568); }
.vlib-transcript__body p { margin: 0 0 1em; }
.vlib-watch__aside h2 { margin: 0 0 12px; font-family: var(--al-display, inherit); font-size: 18px; font-weight: 600; }
.vlib-lessons { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.vlib a.vlib-lesson { display: flex; align-items: center; gap: 14px; min-height: 64px; padding: 10px 14px; border-radius: var(--al-r, 16px); background: var(--al-sand, #F5EFE6); color: inherit; text-decoration: none; }
.vlib-lesson img { flex: 0 0 auto; width: 96px; height: 54px; border-radius: 8px; object-fit: cover; background: var(--al-sand-2, #ECE3D4); }
.vlib-lesson__module { display: block; font-size: 13px; font-weight: 600; color: var(--al-moss, #1C6B3C); }
.vlib-lesson__title { display: block; font-size: 16px; font-weight: 600; line-height: 1.3; }
.vlib-back { margin: 32px 0 0; }
.vlib-back a { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-weight: 600; text-decoration: none; }
.vlib-back svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Inside a lesson page */
.lrn-video .vlib-player { margin: 0; }
.vlib-lessonlink { margin: 24px 0 0; }
.vlib-lessonlink a { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 18px; border-radius: 999px; background: var(--al-sand, #F5EFE6); color: var(--al-ink, #0E2A1B); font-weight: 600; text-decoration: none; }
.vlib-lessonlink svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

@media (min-width: 640px) {
  .vlib-chips { flex-wrap: wrap; margin-inline: 0; padding-inline: 0; overflow: visible; }
  .vlib-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1000px) {
  .vlib-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
  .vlib-watch__cols { grid-template-columns: minmax(0, 1fr) 340px; gap: 48px; align-items: start; }
  .vlib-watch__stage { max-width: 1040px; }
}
@media (prefers-reduced-motion: no-preference) {
  .vlib-card__pic img { transition: transform .4s var(--al-ease, ease); }
  .vlib a.vlib-card:active .vlib-card__pic img { transform: scale(1.02); }
}
