/* Reading hierarchy for lesson slides, scoped to course content.
   Plus Jakarta Sans is declared once in tokens.css. Reading measure is set in em, never ch:
   in Jakarta 1ch is about .73em, so 72ch would be roughly 116 characters per line. */
.lesson-view .slide {
  --course-note-font: var(--font-sans);
  --reading-ink: var(--color-text);
  --reading-body: var(--neutral-800);
  font-family: var(--course-note-font);
  color: var(--reading-body);
  font-size: var(--text-reading);
  line-height: var(--leading-reading);
}
.lesson-view .slide :is(h1, h2, h3) { font-family: var(--course-note-font); }
/* Form and action UI uses the same interface face, sized by its own rules. */
.lesson-view .slide :is(button, input, textarea, select, .upload-work, .response-heading, .response-heading label, .demo-heading, .demo-controls label) {
  font-family: var(--course-font);
}
.lesson-view .slide h1 {
  color: var(--reading-ink);
  font-size: clamp(1.75rem, 1.35rem + 1.5vw, 2.25rem);
  font-weight: var(--weight-bold);
  line-height: 1.25;
  letter-spacing: var(--tracking-tight);
  margin: 10px 0 28px;
  max-width: 28em;
  text-wrap: pretty;
}
.lesson-view .slide h2 {
  color: var(--reading-ink);
  font-size: var(--text-2xl);
  font-weight: var(--weight-bold);
  line-height: 1.3;
  letter-spacing: var(--tracking-snug);
  margin: 32px 0 14px;
}
.lesson-view .slide h3 {
  color: var(--reading-ink);
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  line-height: 1.4;
  letter-spacing: var(--tracking-snug);
  margin: 24px 0 12px;
}
.lesson-view .slide > .eyebrow {
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-caps);
  line-height: var(--leading-xs);
  color: var(--color-brand);
}
.lesson-view .prose,
.lesson-view .lesson-note-sections ul,
.lesson-view .slide .objectives,
.lesson-view .definition-list dd {
  font-size: var(--text-reading);
  font-weight: var(--weight-regular);
  line-height: var(--leading-reading);
  color: var(--reading-body);
}
/* One comfortable reading column; visuals, activities and answer areas keep the full width. */
.lesson-view .slide > .prose,
.lesson-view .lesson-note-sections,
.lesson-view .slide .objectives,
.lesson-view .definition-list,
.lesson-view .concept-content > .prose,
.lesson-view .main-question { max-width: var(--measure); }
.lesson-view .prose { white-space: normal; }
.lesson-view .prose p { white-space: pre-wrap; margin: 0 0 18px; }
.lesson-view .prose > :last-child { margin-bottom: 0; }
.lesson-view .prose ul,
.lesson-view .prose ol,
.lesson-view .lesson-note-sections ul,
.lesson-view .slide .objectives { padding-left: 24px; margin: 12px 0 20px; }
.lesson-view .prose li,
.lesson-view .lesson-note-sections li,
.lesson-view .slide .objectives li { padding: 0 0 0 3px; margin: 8px 0; }
.lesson-view .prose li > p { margin-bottom: 0; }
.lesson-view .prose li ul,
.lesson-view .prose li ol { margin: 6px 0 10px; }
.lesson-view .prose li::marker,
.lesson-view .lesson-note-sections li::marker { color: var(--color-brand); font-size: .85em; }
.lesson-view .slide strong,
.lesson-view .slide b { font-weight: var(--weight-bold); color: var(--reading-ink); }
.lesson-view .lesson-note-sections section { margin: 0 0 32px; }
.lesson-view .lesson-note-sections h2 { margin-top: 0; }
.lesson-view .lesson-note-sections section + section { padding-top: 4px; }
.lesson-view .definition-list dt { font-size: var(--text-reading); font-weight: var(--weight-bold); color: var(--color-brand-strong); }
.lesson-view .definition-list dd { margin-top: 8px; }
.lesson-view .definition-source,
.lesson-view .definition-tag { font-size: var(--text-xs); color: var(--color-text-tertiary); }
.lesson-view .formula-heading h3 { margin: 0; font-size: var(--text-md); color: var(--color-brand-strong); }
.lesson-view .formula-expression { font-size: 22px; line-height: 1.5; color: var(--reading-ink); }
.lesson-view .formula-card p { font-size: 15px; line-height: 1.6; color: var(--reading-body); }
.lesson-view .slide table { font-size: 15px; line-height: 1.5; }
.lesson-view .slide th { font-weight: var(--weight-bold); color: var(--reading-ink); background: var(--color-surface-subtle); }
.lesson-view .slide td,.lesson-view .slide th { padding: 12px; }
.lesson-view .slide figcaption { font-size: var(--text-sm); line-height: 1.5; color: var(--color-text-tertiary); }
.lesson-view .main-question { font-size: var(--text-xl); line-height: 1.65; font-weight: var(--weight-medium); color: var(--reading-ink); }
.lesson-view .teacher-caption { font-size: var(--text-md); line-height: 1.65; color: var(--color-text-secondary); }

@media (max-width: 700px) {
  .lesson-view .slide h1 { font-size: 26px; margin-bottom: 24px; }
  .lesson-view .slide h2 { font-size: 22px; }
  .lesson-view .slide h3 { font-size: 19px; }
  .lesson-view .prose,
  .lesson-view .lesson-note-sections ul,
  .lesson-view .slide .objectives,
  .lesson-view .definition-list dd { font-size: 17px; line-height: 1.7; }
  .lesson-view .lesson-note-sections section { margin-bottom: 26px; }
}

/* Dark theme: --neutral-800 is a fixed primitive (dark grey), so the reading body gets a tone between
   primary and secondary text, keeping the light theme's slightly softer body than headings. */
:root[data-theme="dark"] .lesson-view .slide { --reading-body: color-mix(in srgb, var(--color-text) 55%, var(--color-text-secondary)); }
