/* ============================================================================
   GLOW — Video library (Learn grid, homepage latest video, video pages)
   Loaded only on learn.html, index.html and learn/*.html. Uses tokens from styles.css.
   ========================================================================== */

/* -------- Shared bits ----------------------------------------------------- */
.vl-meta { font-size: .88rem; color: var(--muted); margin: 0; }
.vl-card__link { color: inherit; }
.vl-card__link:hover { color: var(--ember); }
.vl-card__link::after { content: ""; position: absolute; inset: 0; z-index: 1; } /* whole card clickable */

/* Thumbnails: 16:9, crops YouTube's letterbox bars */
.vl-thumb { position: relative; display: flex; align-items: center; justify-content: center; aspect-ratio: 16/9;
  overflow: hidden; background: linear-gradient(140deg, #33302b, #4a423a); border-radius: 0; box-shadow: none; }
.vl-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.vl-thumb .video-play { width: 64px; height: 64px; position: relative; z-index: 2; }
.vl-thumb .video-play svg { width: 24px; height: 24px; }
.vl-duration { position: absolute; right: 10px; bottom: 10px; z-index: 3; background: rgba(44,39,35,.82); color: #fff;
  font-size: .74rem; font-weight: 600; padding: .2rem .5rem; border-radius: 6px; letter-spacing: .02em; }
.video-embed.vl-thumb iframe ~ .vl-duration { display: none; }

/* -------- Featured (newest video): Learn + homepage ------------------------ */
.vl-featured { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); align-items: center; padding: 0; overflow: hidden; position: relative; }
.vl-featured .vl-thumb--featured { width: 100%; aspect-ratio: 16/9; }
.vl-featured .vl-thumb--featured .video-play { width: 84px; height: 84px; }
.vl-featured .vl-thumb--featured .video-play svg { width: 30px; height: 30px; }
.vl-featured__body { padding: clamp(24px, 3.2vw, 44px); display: flex; flex-direction: column; justify-content: center; gap: .7rem; }
.vl-featured__title { font-size: var(--step-2); margin: 0; }
.vl-featured__summary { color: var(--ink-2); margin: .2rem 0 .4rem; font-size: 1rem; line-height: 1.6; }
.vl-featured .btn-row { display: flex; flex-wrap: wrap; gap: .7rem; position: relative; z-index: 2; }
.vl-featured .vl-card__link::after { display: none; }
@media (max-width: 900px) {
  .vl-featured { grid-template-columns: 1fr; }
}

/* -------- Library: filters + grid ----------------------------------------- */
.vl-library { margin-top: clamp(48px, 6vw, 80px); }
.vl-library__title { font-size: var(--step-2); margin-bottom: 1rem; }
.vl-filters { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.6rem; }
.vl-filter { font: inherit; font-size: .9rem; font-weight: 500; color: var(--ink-2); background: var(--surface);
  border: 1px solid var(--line-2); border-radius: var(--r-pill); padding: .5rem 1rem; cursor: pointer; min-height: 40px;
  display: inline-flex; align-items: center; gap: .45rem; transition: border-color .15s, color .15s, background .15s; }
.vl-filter:hover { border-color: var(--ember); color: var(--ember); }
.vl-filter[aria-pressed="true"] { background: var(--ember); border-color: var(--ember); color: #fff; }
.vl-count { font-size: .76rem; font-weight: 600; opacity: .7; }
.vl-status { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.vl-card { position: relative; }
.vl-card[hidden] { display: none; }
.vl-card .post-card__body { gap: .45rem; }
.vl-card h3 { font-size: 1.22rem; line-height: 1.25; }
.vl-card .video-embed { cursor: pointer; z-index: 2; }
.vl-badge { align-self: flex-start; margin-top: .3rem; font-size: .76rem; font-weight: 600; color: var(--ember);
  background: var(--ember-tint); padding: .25rem .65rem; border-radius: var(--r-pill); }
.vl-more-row { display: flex; justify-content: center; margin-top: clamp(24px, 3vw, 36px); }
.vl-more-row .btn[hidden] { display: none; }
.vl-note { margin-top: 1.4rem; max-width: none; }

/* -------- Video page ------------------------------------------------------ */
.vp-hero { position: relative; overflow: hidden; padding-block: clamp(32px, 5vw, 64px) clamp(8px, 2vw, 16px);
  background: linear-gradient(180deg, var(--cream), var(--canvas)); }
.vp-hero .container { position: relative; z-index: 1; }
.vp-crumbs { display: flex; gap: .5rem; align-items: center; font-size: .86rem; color: var(--muted); margin-bottom: 1rem; }
.vp-crumbs a { font-weight: 600; }
.vp-head { max-width: 860px; margin-bottom: clamp(20px, 3vw, 32px); }
.vp-head h1 { font-size: var(--step-4); margin-bottom: .6rem; }
.vp-dates { font-size: .92rem; }
.vp-video { max-width: 1040px; }
.vp-body { padding-top: clamp(40px, 6vw, 72px); }
.vp-article { max-width: var(--prose); margin-inline: auto; }
.vp-article p { max-width: none; color: var(--ink-2); line-height: 1.75; }
.vp-article > p:first-child { font-size: var(--step-1); line-height: 1.6; color: var(--ink); }
.vp-article h2 { font-size: var(--step-2); margin-top: 2.2em; margin-bottom: .6em; scroll-margin-top: calc(var(--nav-h) + 16px); }
.vp-article a { text-decoration: underline; text-underline-offset: 2px; }

/* Downloads */
.dl-box { margin: 2.2rem 0 2.6rem; padding: clamp(22px, 3vw, 32px); background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--shadow); scroll-margin-top: calc(var(--nav-h) + 16px); }
.dl-box .eyebrow { margin-bottom: .5rem; }
.vp-article .dl-box__title { font-size: var(--step-1); margin: 0 0 .3rem; }
.vp-article .dl-box__intro { font-size: .95rem; color: var(--muted); margin-bottom: 1.1rem; }
.dl-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.dl-item { display: flex; align-items: center; gap: 1rem; padding: .9rem 1rem; border: 1px solid var(--line); border-radius: var(--r);
  background: var(--canvas); scroll-margin-top: calc(var(--nav-h) + 16px); }
.dl-item:target { border-color: var(--honey); box-shadow: 0 0 0 3px var(--honey-soft); }
.dl-item__icon { flex-shrink: 0; width: 40px; height: 40px; border-radius: 10px; background: var(--ember-tint); color: var(--ember);
  display: flex; align-items: center; justify-content: center; }
.dl-item__icon svg { width: 22px; height: 22px; }
.dl-item__text { flex: 1; display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.dl-item__kind { font-size: .74rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--sage); }
.dl-item__title { font-weight: 600; color: var(--ink); line-height: 1.35; font-size: 1rem; }
.vp-article .dl-item .btn { text-decoration: none; flex-shrink: 0; }
@media (max-width: 640px) {
  .dl-item { flex-wrap: wrap; }
  .dl-item .btn { width: 100%; justify-content: center; }
}

/* End matter: topics, sources, disclosure */
.vp-narrow { max-width: calc(var(--prose) + 2 * clamp(20px, 5vw, 48px)); }
.vp-topics { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-bottom: 1.6rem; }
.vp-topics__label { font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-right: .3rem; }
.vp-chip { font-size: .86rem; font-weight: 500; padding: .35rem .85rem; border-radius: var(--r-pill); border: 1px solid var(--line-2);
  background: var(--surface); color: var(--ink-2); }
.vp-chip:hover { border-color: var(--ember); color: var(--ember); }
.vp-sources { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 1rem 0; margin-bottom: 1.6rem; }
.vp-sources summary { cursor: pointer; font-weight: 600; color: var(--ink); list-style: none; }
.vp-sources summary::-webkit-details-marker { display: none; }
.vp-sources summary::after { content: " +"; color: var(--ember); }
.vp-sources[open] summary::after { content: " \2212"; }
.vp-sources__body { margin-top: 1rem; display: grid; gap: 1rem; }
.vp-sources__group h3 { font-family: "Figtree", sans-serif; font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 .4rem; }
.vp-sources__group ul { margin: 0; padding-left: 1.1rem; display: grid; gap: .35rem; font-size: .92rem; }
.vp-disclosure { font-size: .84rem; color: var(--muted); line-height: 1.6; }
.vp-disclosure p { max-width: none; margin-bottom: .7em; }
.vp-disclosure__title { font-family: "Figtree", sans-serif; font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin: 0 0 .5rem; }
.vp-back { margin: 1.8rem 0 0; }

/* Phones: topic filters become one swipeable row */
@media (max-width: 640px) {
  .vl-filters { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none;
    margin-inline: calc(-1 * clamp(20px, 5vw, 48px)); padding-inline: clamp(20px, 5vw, 48px); padding-bottom: 4px; }
  .vl-filters::-webkit-scrollbar { display: none; }
  .vl-filter { flex-shrink: 0; white-space: nowrap; }
  .dl-box { padding: 18px; }
}
