/* Lessons page. The family colours (.f-*) live in components.css, shared with the archive's answer panel. */
.mast .theme { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .3); }

/* search bar */
.ls-bar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 10px 18px; flex-wrap: wrap;
  padding: 10px var(--gutter); background: var(--surface); box-shadow: 0 2px 8px rgba(15, 27, 51, .08);
}
.ls-bar .search { flex: 1 1 320px; background: var(--page); border-color: transparent; }
.ls-bar .search:focus-within { background: var(--surface); }
.ls-only { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; color: var(--muted); }

/* layout: topics on the left, lessons on the right */
.ls-layout {
  display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 24px;
  max-width: 1240px; margin: 0 auto; padding: 20px var(--gutter) 60px;
}
.ls-topics { position: sticky; top: 76px; align-self: start; max-height: calc(100vh - 92px); overflow: auto; padding-bottom: 12px; }
.ls-main { min-width: 0; outline: 0; }

.ls-all, .ls-topic {
  display: flex; justify-content: space-between; gap: 8px; padding: 6px 10px; border-radius: 8px;
  color: var(--text); text-decoration: none; font-size: 14.5px; line-height: 1.3;
}
.ls-all { font-weight: 700; margin-bottom: 8px; }
.ls-all:hover, .ls-topic:hover { background: var(--surface); }
.ls-all.on { background: var(--header); color: #fff; }
.ls-fam { margin-bottom: 12px; padding-left: 10px; border-left: 4px solid var(--f); }
.ls-fam-h { margin: 0 0 4px; font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--f); }
.ls-topic.on { background: var(--f); color: var(--f-on); font-weight: 650; }
.ls-topic.none { color: var(--faint); }
.n { font-size: 12.5px; font-weight: 600; color: var(--faint); font-variant-numeric: tabular-nums; }
.ls-topic.on .n, .ls-all.on .n { color: inherit; opacity: .85; }

/* overview */
.ls-hello, .ls-empty {
  padding: 22px 26px; margin-bottom: 22px; background: var(--surface); border-radius: 14px;
  border-top: 6px solid var(--header); box-shadow: var(--shadow);
}
.ls-hello h2, .ls-empty h2 { margin: 0 0 8px; font-size: 24px; }
.ls-hello p { margin: 0; max-width: 72ch; color: var(--muted); }
.ls-hello .eg { padding: 0 6px; border-radius: 4px; background: #c4302b; color: #fff; font-weight: 700; white-space: nowrap; }
.ls-family { margin-bottom: 26px; }
.ls-family h2 { margin: 0 0 10px; font-size: 18px; color: var(--f); }
.ls-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.ls-card {
  display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; border-radius: 12px;
  background: var(--surface); border-left: 5px solid var(--f); box-shadow: var(--shadow);
  color: var(--text); text-decoration: none;
}
.ls-card:hover { background: var(--f-soft); }
.ls-card-h { font-weight: 700; font-size: 16px; color: var(--f); line-height: 1.3; }
.ls-card-p { font-size: 14px; color: var(--muted); }
.ls-card-n { margin-top: auto; font-size: 13px; font-weight: 600; color: var(--faint); }

/* topic heading */
.ls-head { margin-bottom: 16px; padding: 18px 22px; border-radius: 14px; background: var(--f-soft, var(--surface)); }
.ls-head h2 { margin: 0; font-size: 26px; color: var(--f, var(--text)); }
.ls-head p { margin: 6px 0 0; max-width: 75ch; }
.ls-kicker { margin: 0 0 2px !important; font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--f); }
.ls-meta { font-size: 13.5px; color: var(--muted); }
.ls-meta .ok { color: var(--ok); font-weight: 600; }
.ls-meta .warn { color: var(--warn); font-weight: 600; }
.ls-filter, .ls-none { margin: 0 0 14px; color: var(--muted); }
.ls-filter button, .ls-none button {
  margin-left: 6px; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface);
}

/* a lesson */
.lesson {
  margin-bottom: 16px; padding: 18px 22px 12px; background: var(--surface); border-radius: 14px;
  border-top: 5px solid var(--f); box-shadow: var(--shadow); scroll-margin-top: 80px;
}
.lesson.target { box-shadow: 0 0 0 3px var(--f); }
.pt.target-pt { background: var(--mark); border-radius: 8px; animation: pt-flash 2.4s ease-out 1; }
@keyframes pt-flash { from { box-shadow: 0 0 0 4px var(--f); } to { box-shadow: 0 0 0 0 transparent; } }
.lesson-topic {
  display: inline-block; margin-bottom: 4px; padding: 1px 9px; border-radius: 999px;
  background: var(--f-soft); color: var(--f); font-size: 12px; font-weight: 700; text-decoration: none;
}
.lesson h3 { margin: 0; font-size: 19px; line-height: 1.3; }
.lesson h3 a { color: var(--text); text-decoration: none; }
.lesson h3 a:hover { color: var(--f); text-decoration: underline; }
.lesson-sum { margin: 4px 0 0; color: var(--muted); }
.pts { margin: 12px 0 0; padding: 0; list-style: none; counter-reset: pt; }
.pt { position: relative; padding: 12px 0 12px 36px; border-top: 1px solid var(--border); counter-increment: pt; }
.pt::before {
  content: counter(pt); position: absolute; left: 0; top: 13px; width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center; background: var(--f-soft); color: var(--f); font-size: 12.5px; font-weight: 800;
}
.pt p { margin: 0; max-width: 78ch; line-height: 1.6; }
.pt-kind {
  display: inline-block; margin-bottom: 4px; padding: 0 8px; border-radius: 4px;
  font-size: 11.5px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
}
.k-exercise .pt-kind { background: #0f766e; color: #fff; }
.k-story .pt-kind { background: #a15c07; color: #fff; }
.k-exercise { background: linear-gradient(90deg, var(--f-soft), transparent 60%); border-radius: 0 0 8px 8px; }
.pt mark { background: var(--mark); color: inherit; border-radius: 2px; }

/* sources under each point */
.cites { margin: 8px 0 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.cite { padding: 6px 10px; border-radius: 8px; background: var(--page); border-left: 3px solid var(--g); font-size: 13.5px; }
.cite-links { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.cite-yt, .cite-tr { font-weight: 700; text-decoration: none; white-space: nowrap; border-radius: 4px; padding: 1px 7px; }
.cite-yt { background: #c4302b; color: #fff; font-variant-numeric: tabular-nums; }
.cite-yt:hover { background: #a3241f; }
.cite-tr { background: var(--g-soft); color: var(--g); }
.cite-tr:hover { text-decoration: underline; }
.cite-video { color: var(--muted); min-width: 0; overflow-wrap: anywhere; }
.cite-words summary { margin-top: 4px; cursor: pointer; color: var(--muted); font-size: 13px; width: max-content; }
.cite-words summary:hover { color: var(--text); }
.cite-words blockquote {
  margin: 6px 0 2px; padding: 8px 12px; border-radius: 6px; background: var(--surface);
  font-size: 14px; line-height: 1.55; color: var(--text); max-width: 80ch;
}

@media (max-width: 900px) {
  .ls-layout { grid-template-columns: minmax(0, 1fr); gap: 12px; padding-top: 12px; }
  .ls-topics {
    position: static; max-height: none; display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px;
    scrollbar-width: thin;
  }
  .ls-fam { display: contents; }
  .ls-fam-h { display: none; }
  .ls-all, .ls-topic { flex: none; white-space: nowrap; margin: 0; background: var(--surface); border-left: 3px solid var(--f, var(--header)); }
  .ls-hello, .ls-empty, .ls-head, .lesson { padding-left: 16px; padding-right: 16px; }
  .pt { padding-left: 30px; }
  .ls-bar { position: static; }
}
