/* Episodes, "dark & brass" (mockups/brass/dark/lessons.html). */

/* head: title, search, and the episode to start with */
.phead { padding-bottom: 0; }
.phead .wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 64px; align-items: end; padding-bottom: 64px; }
.search { position: relative; margin-top: 32px; max-width: 520px; }
.search input { width: 100%; min-height: 56px; padding: 0 52px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--card); color: var(--ink); font: 500 16px var(--sans); transition: border-color .2s, box-shadow .2s; -webkit-appearance: none; appearance: none; }
.search input::placeholder { color: var(--muted); }
.search input:focus { outline: 0; border-color: var(--acc); box-shadow: 0 0 0 4px rgba(201,164,92,.18); }
.search svg { position: absolute; left: 20px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; color: var(--muted); pointer-events: none; }
.search kbd { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); padding: 2px 8px; border-radius: 6px; border: 1px solid var(--line-2); font: 500 12px var(--sans); color: var(--muted); }
.phead .counts { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 20px; font-size: 15px; color: var(--muted); }
.phead .counts b { color: var(--ink); font-weight: 600; }
/* the start-here card */
.start { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); border-radius: 22px; overflow: hidden; background: var(--card); box-shadow: 0 40px 80px -40px rgba(0,0,0,.8); transition: transform .35s cubic-bezier(.2,.8,.2,1); }
.start:hover { transform: translateY(-3px); }
.start .ph { display: block; position: relative; min-height: 240px; }
.start .ph img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.start .ph .play { position: absolute; left: 50%; top: 50%; translate: -50% -50%; width: 56px; height: 56px; background: rgba(255,248,236,.95); color: var(--on-acc); box-shadow: 0 10px 30px -8px rgba(0,0,0,.6); }
.start .t { padding: 28px 28px 26px; display: flex; flex-direction: column; }
.start .meta { font-size: 14px; color: var(--muted); }
.start h2 { margin-top: 8px; font-size: 26px; line-height: 1.2; }
.start h2 a::after { content: ""; position: absolute; inset: 0; }
.start h2 a:focus-visible { outline: 0; }
.start:has(h2 a:focus-visible) { outline: 2px solid var(--acc); outline-offset: 3px; }
.start p { margin-top: 12px; font-size: 15px; color: var(--muted); max-width: 34ch; }
.start .row { display: flex; align-items: center; gap: 10px; margin-top: auto; padding-top: 20px; font-size: 14px; color: var(--muted); }

/* body: topics beside the grid */
.lib { padding: 64px 0 112px; }
.lib .wrap { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 56px; align-items: start; }
.lib .wrap > * { min-width: 0; }
.topics { position: sticky; top: 96px; }
.topics h2 { font-size: 15px; font-weight: 600; color: var(--muted); letter-spacing: .01em; margin-bottom: 10px; padding-left: 14px; }
.topics ul { list-style: none; margin: 0; padding: 0; }
.topics button { display: flex; width: 100%; justify-content: space-between; align-items: center; gap: 12px; min-height: 44px; padding: 9px 14px; border: 0; border-radius: 10px; background: none; font-size: 16px; text-align: left; color: var(--ink); cursor: pointer; transition: background .2s; }
.topics button:hover { background: var(--card); }
.topics button.is-active { background: var(--d); font-weight: 600; }
.topics button span { font-size: 13px; font-weight: 400; color: var(--muted); font-variant-numeric: tabular-nums; }
.topics button.is-active span { color: var(--acc); }
.cont { display: block; margin-top: 28px; padding: 18px 16px; border-radius: 14px; background: var(--card); box-shadow: var(--shadow, none); }
.cont small { display: block; font-size: 13px; color: var(--muted); }
.cont b { display: block; margin-top: 4px; font-size: 15px; line-height: 1.35; }
.cont .more { min-height: 32px; margin-top: 8px; font-size: 14px; }

.bar-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-bottom: 20px; margin-bottom: 28px; border-bottom: 1px solid var(--line-2); }
.bar-row .count { font-size: 15px; color: var(--muted); }
.tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border: 0; border-radius: 999px; background: var(--card); box-shadow: inset 0 0 0 1px var(--line-2); font: 500 15px var(--sans); color: var(--ink); cursor: pointer; }
.chip:hover { box-shadow: inset 0 0 0 1px var(--ink); }
.chip[aria-pressed="true"] { box-shadow: inset 0 0 0 1px var(--acc); color: var(--acc-2); }
.chip[aria-pressed="true"] svg { fill: currentColor; }
.chip svg { width: 16px; height: 16px; }
.chip select { appearance: none; border: 0; background: none; font: inherit; color: inherit; padding-right: 18px; cursor: pointer; }
.chip select option { background: var(--card); color: var(--ink); }
.chip.sel { position: relative; }
.chip.sel::after { content: ""; position: absolute; right: 16px; top: 50%; width: 7px; height: 7px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: translateY(-70%) rotate(45deg); pointer-events: none; }
.chip.sel:focus-within { outline: 2px solid var(--acc); outline-offset: 3px; }
.chip.sel select:focus-visible { outline: 0; }
.view { display: inline-flex; border-radius: 999px; background: var(--card); box-shadow: inset 0 0 0 1px var(--line-2); overflow: hidden; }
.view button { min-width: 44px; min-height: 44px; border: 0; background: none; display: grid; place-items: center; color: var(--muted); cursor: pointer; }
.view button svg { width: 18px; height: 18px; fill: currentColor; }
.view button[aria-pressed="true"] { background: var(--d); color: var(--ink); }

.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 36px 28px; list-style: none; margin: 0; padding: 0; }
/* the card's own parts that the library adds: progress and the heart */
.lesson .prog { position: absolute; left: 0; right: 0; bottom: 0; z-index: 1; height: 4px; background: rgba(255,255,255,.2); }
.lesson .prog::before { content: ""; display: block; height: 100%; width: calc(var(--pct, 0) * 1%); background: var(--acc); }
.lesson .fav { position: absolute; right: 10px; top: 10px; z-index: 2; display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff; cursor: pointer; opacity: 0; transition: opacity .2s; }
.lesson:hover .fav, .lesson .fav:focus-visible, .lesson .fav[aria-pressed="true"] { opacity: 1; }
.lesson .fav[aria-pressed="true"] { color: var(--acc); }
.lesson .fav[aria-pressed="true"] svg { fill: currentColor; }
@media (hover: none) { .lesson .fav { opacity: 1; } }
/* list view */
.grid.video-grid--list { grid-template-columns: 1fr; gap: 0; }
.grid.video-grid--list .lesson { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 24px; align-items: center; padding: 16px 0; border-bottom: 1px solid var(--line); }
.grid.video-grid--list .lesson .t { padding: 0; }
.grid.video-grid--list .lesson .fav { right: auto; left: 150px; }
.empty { padding: 48px 0; text-align: center; color: var(--muted); }
.empty .ghost { margin-top: 16px; }

@media (max-width: 1100px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 860px) {
  .phead .wrap { grid-template-columns: 1fr; gap: 36px; padding-bottom: 48px; }
  .lib .wrap { grid-template-columns: 1fr; gap: 32px; }
  .topics { position: static; }
  .topics ul { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: none; }
  .topics ul::-webkit-scrollbar { display: none; }
  .topics button { white-space: nowrap; background: var(--card); box-shadow: inset 0 0 0 1px var(--line); }
  .topics h2 { padding-left: 0; }
  .cont { display: none; }
  .search kbd { display: none; }
}
@media (max-width: 600px) {
  .grid { grid-template-columns: 1fr; gap: 32px; }
  .start { grid-template-columns: 1fr; }
  .start .ph { min-height: 0; height: 220px; }
  .grid.video-grid--list .lesson { grid-template-columns: 120px minmax(0, 1fr); gap: 16px; }
  .grid.video-grid--list .lesson .fav { display: none; }
}

.chip select { align-self: stretch; min-height: 44px; }
