/* Building Science 101 course pages (course/*.html).
   Loaded after site.css and pages.css. */

.course-intro h1 { max-width: 24em; }
.course-intro .eyebrow { margin-bottom: 6px; }

.course-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 28px;
  align-items: start;
}
.course-main { min-width: 0; }
.course-main .prose { max-width: none; }

/* ---------- Lesson text ---------- */
.lesson .part-break, .lesson hr.part-break { border: 0; border-top: 2px dashed var(--line); margin: 2.2em 0 1.6em; }
.lesson-part > * + * { margin-top: 1em; }
.lesson-part { overflow: hidden; }          /* keep floated figures inside their part */
.lesson-part h2 { font-size: 32px; line-height: 1.1; }
.lesson-part h2 + h2 { font-size: 24px; font-family: var(--font-body); font-weight: 600; margin-top: 0.4em; }
.img-row { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-start; }
.img-row a, .img-row img { display: block; margin: 0; }
.img-row img { max-width: 100%; }
.lesson-video { margin: 0 0 1.2em; }
.lesson-video video { display: block; width: 100%; height: auto; border-radius: 4px; background: #000; }
.lesson-video figcaption { font-size: 15px; color: var(--muted); margin-top: 8px; }

.lesson-done { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin: 22px 0 6px; }
.mark-complete { cursor: pointer; font: inherit; font-weight: 600; border: 2px solid var(--accent); }
.mark-complete[aria-pressed="true"] { background: var(--panel); color: var(--accent); }
.mark-complete[aria-pressed="true"]::before { content: "\2713\00a0"; }
.done-note { font-size: 14px; color: var(--muted); }

.lesson-nav { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-top: 18px; }
.lesson-nav .btn { max-width: 100%; }

/* ---------- Progress ---------- */
.course-progress { margin: 10px 0 4px; }
.progress-track { height: 10px; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.progress-fill { display: block; height: 100%; background: var(--accent); transition: width 0.3s; }
.progress-text { font-size: 14px; color: var(--muted); margin-top: 6px; }
.course-progress.overview { max-width: 420px; }

/* ---------- Syllabus ---------- */
.syllabus, .syllabus ol { list-style: none; padding: 0; margin: 0; }
.prose .syllabus, .prose .syllabus ol { padding-left: 0; }
.syl-section + .syl-section { margin-top: 14px; }
.syl-section-title { display: block; font-size: 13px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.prose h3.syl-section-title { font-size: 14px; margin-top: 0; }
.syl-lesson a { display: flex; gap: 10px; align-items: baseline; padding: 6px 8px; border-radius: 4px; text-decoration: none; color: var(--ink); }
.prose .syl-lesson a { color: var(--ink); }
.syl-lesson a:hover { background: var(--bg); color: var(--accent); }
.syl-num {
  flex: 0 0 auto; width: 24px; height: 24px; line-height: 22px; text-align: center;
  border: 1px solid var(--line); border-radius: 50%; font-size: 13px; font-weight: 600; background: #fff; color: var(--ink-soft);
}
.syl-lesson.done .syl-num { background: var(--accent); border-color: var(--accent); color: #fff; font-size: 0; }
.syl-lesson.done .syl-num::before { content: "\2713"; font-size: 13px; }
.syl-lesson a[aria-current="page"] { background: var(--dark); color: #fff; font-weight: 600; }
.syl-lesson a[aria-current="page"] .syl-num { border-color: var(--accent-light); }
.syllabus-full .syl-section { border-top: 1px solid var(--line); padding-top: 12px; }
.prose .syllabus-full li + li { margin-top: 0; }

.course-side {
  position: sticky; top: 16px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 6px;
  padding: 18px 16px; max-height: calc(100vh - 32px); overflow-y: auto; font-size: 15px;
}
.side-title { font-family: var(--font-display); font-size: 24px; font-weight: 600; line-height: 1.1; }
.side-title a { text-decoration: none; }
.syllabus-side { margin-top: 14px; }
.syllabus-side .syl-lesson a { padding: 5px 6px; }

.course-start { display: flex; flex-wrap: wrap; gap: 12px; }
.quiz-best { font-weight: 600; }

/* ---------- Quiz ---------- */
.quiz { display: flex; flex-direction: column; gap: 18px; }
.quiz-q { border: 1px solid var(--line); border-radius: 6px; padding: 16px 18px; margin: 0; background: #fff; }
.quiz-q legend { font-weight: 600; padding: 0 6px; max-width: 100%; }
.q-num { display: block; font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.q-choices { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.q-choice { display: flex; gap: 10px; align-items: baseline; padding: 8px 10px; border: 1px solid var(--line); border-radius: 4px; cursor: pointer; }
.q-choice:hover { border-color: var(--ink-soft); }
.q-choice.is-right { border-color: var(--accent); background: #eef8ec; }
.q-choice.is-wrong { border-color: var(--heat); background: #fdf0ea; }
.q-feedback { margin-top: 10px; font-weight: 600; }
.q-feedback.ok { color: var(--accent); }
.q-feedback.no { color: var(--heat); }
.q-feedback .explain { display: block; font-weight: 400; color: var(--ink-soft); margin-top: 4px; }
.quiz-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.quiz button { cursor: pointer; font: inherit; font-weight: 600; }
.quiz-result { border-radius: 6px; padding: 16px 18px; font-size: 19px; font-weight: 600; }
.quiz-result.pass { background: #eef8ec; border: 1px solid var(--accent); }
.quiz-result.fail { background: #fdf0ea; border: 1px solid var(--heat); }
.quiz-result span { display: block; font-size: 15px; font-weight: 400; margin-top: 4px; }

@media (max-width: 900px) {
  .course-layout { grid-template-columns: minmax(0, 1fr); }
  .course-side { position: static; max-height: none; }
}

.prose .btn-outline, .prose .btn-outline:hover { color: var(--ink); }
.course-layout.no-side { grid-template-columns: minmax(0, 920px); }
