/* SPD Lab — lecture note pages (lectures/*.html). Builds on ../assets/css/style.css tokens. */

.lecture-page .site-header .nav a:not(.nav-hipd) { display: inline; }
.lx-progress { position: fixed; top: var(--header-h); left: 0; right: 0; height: 2px; z-index: 49; background: transparent; }
.lx-progress i { display: block; height: 100%; width: 0; background: var(--ink); }

/* ---------- cover ---------- */
.lx-cover { padding: calc(var(--header-h) + clamp(48px, 7vw, 96px)) 0 clamp(56px, 7vw, 96px); border-bottom: 1px solid var(--line); }
.lx-cover-grid { display: grid; grid-template-columns: 1fr 1.05fr; gap: 40px clamp(40px, 6vw, 96px); align-items: center; }
.lx-course { margin-top: 26px; font-size: 14px; color: var(--ink-2); }
.lx-series { margin-top: 18px; font-size: clamp(22px, 2.4vw, 30px); font-weight: 200; color: var(--ink-2); line-height: 1.2; }
.lx-cover h1 { margin-top: 14px; font-size: clamp(34px, 4.4vw, 60px); font-weight: 700; line-height: 1.12; }
.lx-deck { margin-top: 22px; font-size: 16px; color: var(--ink-2); font-weight: 300; line-height: 1.8; }
.lx-author { margin-top: 28px; font-size: 15px; color: var(--ink); }
.lx-author a { color: var(--ink-3); margin-left: 10px; font-size: 13.5px; }
.lx-author a:hover { color: var(--ink); }
.lx-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 18px 36px; margin-top: 40px; }
.lx-back { font-size: 13.5px; color: var(--ink-3); border-bottom: 1px solid var(--line-strong); padding-bottom: 4px; }
.lx-back:hover { color: var(--ink); }
.lx-cover-text { grid-template-columns: minmax(0, 860px); }
.lx-cover-fig img { width: 100%; height: auto; border: 1px solid var(--line); }

/* ---------- layout ---------- */
.lx-layout { display: grid; grid-template-columns: 230px minmax(0, 720px); gap: 40px clamp(48px, 7vw, 110px); padding-top: clamp(56px, 7vw, 96px); padding-bottom: clamp(80px, 10vw, 140px); justify-content: center; }
.lx-toc { position: sticky; top: calc(var(--header-h) + 32px); align-self: start; max-height: calc(100vh - var(--header-h) - 64px); overflow-y: auto; scrollbar-width: none; }
.lx-toc::-webkit-scrollbar { display: none; }
.lx-toc-k { font-size: 12px; color: var(--ink-3); text-transform: uppercase; margin-bottom: 14px; }
.lx-toc a { display: block; font-size: 13px; line-height: 1.5; color: var(--ink-3); padding: 6px 0 6px 14px; position: relative; transition: color .25s; }
.lx-toc a::before { content: ""; position: absolute; left: 0; top: 13px; width: 5px; height: 5px; background: var(--ink-4); transition: background .25s; }
.lx-toc a:hover, .lx-toc a.on { color: var(--ink); }
.lx-toc a.on::before { background: var(--ink); }
.lx-toc .lx-toc-part { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); color: var(--ink-2); font-weight: 600; font-size: 13.5px; }
.lx-toc .lx-toc-part::before { top: 21px; }
.lx-toc .lx-toc-part small { display: block; font-size: 11px; font-weight: 500; color: var(--ink-3); margin-bottom: 2px; }
.lx-toc .lx-toc-part:first-of-type { margin-top: 0; }

/* ---------- body typography ---------- */
.lx-body { font-size: 16.5px; line-height: 1.95; color: #d8d8d6; }
.lx-body > p { margin: 0 0 1.1em; font-weight: 300; }
.lx-part { margin: clamp(72px, 9vw, 120px) 0 36px; padding-top: 28px; border-top: 1px solid var(--line-strong); scroll-margin-top: calc(var(--header-h) + 24px); }
.lx-body > .lx-part:first-child { margin-top: 0; }
.lx-kicker { font-size: 12.5px; color: var(--ink-3); margin-bottom: 10px; display: inline-flex; align-items: center; gap: 10px; }
.lx-kicker::before { content: ""; width: 8px; height: 8px; background: var(--ink); }
.lx-part h2 { font-size: clamp(26px, 3vw, 38px); font-weight: 700; line-height: 1.25; color: var(--ink); }
.lx-lead { margin-top: 14px; font-size: 17px; color: var(--ink-2); font-weight: 300; line-height: 1.7; }
.lx-body h3 { margin: 64px 0 18px; font-size: 22px; font-weight: 700; line-height: 1.4; color: var(--ink); scroll-margin-top: calc(var(--header-h) + 24px); }
.lx-body h4 { margin: 36px 0 10px; font-size: 16px; font-weight: 600; color: var(--ink); display: flex; align-items: center; gap: 10px; }
.lx-body h4::before { content: ""; width: 6px; height: 6px; background: var(--ink-2); }
.lx-src { font-size: 13px; color: var(--ink-3); margin: -6px 0 22px; line-height: 1.6; }

.lx-quote { margin: 36px 0; padding: 4px 0 4px 26px; border-left: 2px solid var(--ink); }
.lx-quote p { font-size: 19px; line-height: 1.7; color: var(--ink); font-weight: 400; }
.lx-quote cite { display: block; margin-top: 10px; font-style: normal; font-size: 13px; color: var(--ink-3); }

.lx-list { list-style: none; margin: 8px 0 26px; }
.lx-list li { position: relative; padding: 10px 0 10px 20px; border-bottom: 1px solid var(--line); font-size: 15.5px; line-height: 1.75; font-weight: 300; }
.lx-list li::before { content: ""; position: absolute; left: 0; top: 21px; width: 6px; height: 6px; background: var(--ink-2); }

/* boxes: tinted panel, square corners, left rule */
.lx-box { margin: 32px 0; padding: 24px 28px; background: #141416; border-left: 2px solid var(--ink-3); }
.lx-box-k { display: block; font-size: 11.5px; color: var(--ink-3); text-transform: uppercase; margin-bottom: 8px; }
.lx-box b { display: block; font-size: 16.5px; font-weight: 600; color: var(--ink); line-height: 1.5; margin-bottom: 10px; }
.lx-box ul { list-style: none; }
.lx-box li { position: relative; padding: 5px 0 5px 18px; font-size: 15px; line-height: 1.75; color: #cfcfcd; font-weight: 300; }
.lx-box li::before { content: ""; position: absolute; left: 0; top: 16px; width: 5px; height: 5px; background: var(--ink-3); }
.lx-easy { border-left-color: var(--ink); }
.lx-check li::before { width: 9px; height: 9px; top: 14px; background: none; border: 1px solid var(--ink-2); }

.lx-cards { margin: 24px 0 32px; border-top: 1px solid var(--line-strong); }
.lx-cards > div { display: grid; grid-template-columns: 150px 1fr; gap: 24px; padding: 20px 0; border-bottom: 1px solid var(--line); }
.lx-cards dt { font-size: 15px; font-weight: 700; color: var(--ink); line-height: 1.5; }
.lx-cards dd b { display: block; font-size: 16px; font-weight: 600; color: var(--ink); line-height: 1.5; }
.lx-cards dd span { display: block; margin-top: 6px; font-size: 14.5px; color: var(--ink-2); line-height: 1.75; font-weight: 300; }

.lx-table { margin: 24px 0 36px; overflow-x: auto; }
.lx-table table { width: 100%; border-collapse: collapse; font-size: 14.5px; line-height: 1.65; }
.lx-table th { text-align: left; font-weight: 600; color: var(--ink); padding: 12px 16px 12px 0; border-bottom: 2px solid var(--ink-2); white-space: nowrap; }
.lx-table td { padding: 14px 16px 14px 0; border-bottom: 1px solid var(--line); vertical-align: top; color: #cfcfcd; font-weight: 300; }
.lx-table td:first-child { color: var(--ink); font-weight: 500; white-space: nowrap; }

.lx-fig { margin: 36px 0 40px; }
.lx-fig img { width: 100%; height: auto; display: block; border: 1px solid var(--line); transition: opacity .3s; }
.lx-fig a:hover img { opacity: .88; }
.lx-fig figcaption { margin-top: 12px; font-size: 13px; color: var(--ink-3); line-height: 1.6; display: flex; gap: 10px; }
.lx-fig figcaption::before { content: ""; flex: 0 0 auto; width: 5px; height: 5px; margin-top: 8px; background: var(--ink-3); }

.lx-refs { list-style: none; margin-top: 12px; }
.lx-refs li { padding: 10px 0 10px 24px; text-indent: -24px; border-bottom: 1px solid var(--line); font-size: 13.5px; line-height: 1.7; color: var(--ink-2); font-weight: 300; overflow-wrap: anywhere; }

.lx-qs { list-style: none; counter-reset: q; margin: 8px 0 26px; border-top: 1px solid var(--line-strong); }
.lx-qs li { counter-increment: q; display: grid; grid-template-columns: 36px 1fr; gap: 8px; padding: 16px 0; border-bottom: 1px solid var(--line); font-size: 15.5px; line-height: 1.8; font-weight: 300; }
.lx-qs li::before { content: "Q" counter(q); font-size: 13px; font-weight: 600; color: var(--ink); padding-top: 3px; }
.lx-refs a, .lx-body p a { color: var(--ink); border-bottom: 1px solid var(--line-strong); overflow-wrap: anywhere; }
.lx-refs a:hover, .lx-body p a:hover { border-bottom-color: var(--ink); }

.lx-end { margin-top: 96px; padding-top: 28px; border-top: 1px solid var(--line-strong); display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 20px; font-size: 14px; color: var(--ink-3); }

@media (max-width: 1180px) {
  .lecture-page .site-header .nav a:not(.nav-hipd) { display: none; }
}
@media (max-width: 960px) {
  .lx-cover-grid { grid-template-columns: 1fr; }
  .lx-layout { grid-template-columns: minmax(0, 1fr); }
  .lx-toc { position: static; max-height: none; border-bottom: 1px solid var(--line); padding-bottom: 20px; }
  .lx-toc a:not(.lx-toc-part) { display: none; }
  .lx-toc .lx-toc-part { margin-top: 8px; padding-top: 8px; }
}
@media (max-width: 640px) {
  .lx-body { font-size: 15.5px; }
  .lx-cards > div { grid-template-columns: 1fr; gap: 6px; }
  .lx-box { padding: 20px 18px; }
}

/* lecture images are shown inline only (no raw-file links); copying is blocked by assets/js/protect.js, printing is allowed */
.lx-protected img { -webkit-user-drag: none; }

/* ---------- print: black on white, content only ---------- */
@media print {
  @page { margin: 18mm 16mm; }
  body, .lecture-page { background: #fff !important; color: #111 !important; }
  .site-header, .site-footer, .lx-progress, .lx-toc, .lx-actions, .lx-back, .gt-host { display: none !important; }
  .lx-cover { padding: 0 0 24px; border-bottom: 1px solid #999; }
  .lx-cover-grid, .lx-layout { display: block; padding: 0; }
  .lx-cover h1, .lx-part h2, .lx-body h3, .lx-body h4, .lx-cards dt, .lx-cards dd b, .lx-box b, .lx-quote p, .lx-table th, .lx-table td:first-child { color: #000 !important; }
  .lx-body, .lx-body > p, .lx-list li, .lx-box li, .lx-table td, .lx-cards dd span, .lx-refs li, .lx-deck, .lx-lead, .lx-course, .lx-series, .lx-author { color: #222 !important; }
  .lx-src, .lx-fig figcaption, .lx-kicker, .eyebrow, .lx-box-k { color: #555 !important; }
  .lx-box { background: #f3f3f3 !important; border-left-color: #666 !important; }
  .lx-quote { border-left-color: #000 !important; }
  .lx-part { border-top-color: #999; margin-top: 28px; }
  .lx-fig, .lx-table, .lx-box, .lx-cards > div { break-inside: avoid; }
  .lx-part, .lx-body h3 { break-after: avoid; }
  .lx-body a { color: #000 !important; }
  .rv { opacity: 1 !important; transform: none !important; }
}

/* accent hover (orange) — lecture links */
.lx-toc a:hover { color: var(--orange); }
.lx-toc a:hover::before { background: var(--orange); }
.lx-back { transition: color .25s, border-color .25s; }
.lx-back:hover { color: var(--orange); border-bottom-color: var(--orange); }
.lx-author a:hover, .lx-refs a:hover, .lx-body p a:hover { color: var(--orange); border-bottom-color: var(--orange); }

/* student reader (tools/reader2lecture.py) */
.lx-sec-lead { margin: 0 0 8px; }
.lx-box p { font-size: 15px; line-height: 1.8; color: #cfcfcd; font-weight: 300; }
.lx-table small { display: block; margin-top: 4px; font-size: 12.5px; color: var(--ink-3); }
.lx-colophon { margin-top: 56px; }
