/* ── Shared lesson page layout & hierarchy ── */

:root {
  --lesson-bg: #f4f6f9;
  --lesson-ink: #0f172a;
  --lesson-muted: #64748b;
  --lesson-border: #e2e8f0;
  --lesson-accent: #2563eb;
  --lesson-accent-soft: #dbeafe;
}

body.lesson-page {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: var(--lesson-bg);
  color: var(--lesson-ink);
  line-height: 1.6;
}

.lesson-wrap {
  max-width: 740px;
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}

/* Hero */
.lesson-hero {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 2px solid var(--lesson-border);
}

.module-badge {
  display: inline-block;
  background: var(--lesson-accent-soft);
  color: var(--lesson-accent);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.25rem 0.65rem;
  border-radius: 5px;
  margin-bottom: 0.6rem;
}

.lesson-hero h1 {
  font-size: 1.85rem;
  font-weight: 750;
  letter-spacing: -0.025em;
  line-height: 1.2;
  margin: 0 0 0.35rem;
}

.lesson-meta {
  color: var(--lesson-muted);
  font-size: 0.9rem;
  margin: 0;
}

/* Legend bar */
.format-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  font-size: 0.82rem;
  padding: 0.75rem 1rem;
  background: #fff;
  border: 1px solid var(--lesson-border);
  border-radius: 10px;
  margin-bottom: 2rem;
  color: var(--lesson-muted);
}
.format-legend .key-bank { color: #166534; font-weight: 600; }
.format-legend .key-note { color: #b45309; font-weight: 600; }

/* Sections */
.lesson-section {
  margin-bottom: 2.5rem;
}

.section-head {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--lesson-border);
}

.section-head h2 {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0;
  color: var(--lesson-ink);
}

.section-head .section-q-ids {
  font-size: 0.75rem;
  color: var(--lesson-muted);
  font-weight: 600;
}

.section-intro {
  font-size: 0.92rem;
  color: var(--lesson-muted);
  margin: 0 0 1rem;
}

/* Supplementary content below answers */
.learn-aside {
  margin: 0.75rem 0 0;
  padding: 0.55rem 0.85rem;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
}
.learn-aside-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--lesson-muted);
  margin-bottom: 0.5rem;
}

.analogy-box {
  background: #fffbeb;
  border-left: 4px solid #f59e0b;
  padding: 0.85rem 1rem;
  border-radius: 0 10px 10px 0;
  margin: 1rem 0 1.5rem;
  font-size: 0.9rem;
}

/* Practice block */
.practice-section {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 2px solid var(--lesson-border);
}
.practice-section h2 { font-size: 1.15rem; margin-bottom: 0.35rem; }
.practice-section > p { color: var(--lesson-muted); font-size: 0.9rem; margin-bottom: 1rem; }

.lesson-footer {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--lesson-border);
  font-size: 0.85rem;
  color: var(--lesson-muted);
}
.lesson-footer a { color: var(--lesson-accent); }

/* Exam questions group label */
.exam-group-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--lesson-muted);
  margin: 1.5rem 0 0.25rem;
}

/* Quiz cards reuse exam-card shell */
.exam-card.quiz-card .answer-stack { gap: 0.75rem; }
.exam-card.quiz-card .quiz-input { margin-top: 0.25rem; }
