/* ============================================================
   history.css: shared styles for "history" course chapters (rule P1 "Styling").

   A chapter links this sheet and its own course sheet, and wraps its content in
       <div class="history-lesson <course>">
   where <course> is the course's slug (styles/courses/<course>.css sets that course's colours).
   Every rule is scoped under .history-lesson, so nothing leaks into the site.

   The colours that differ between courses are CSS variables; the value after the
   comma in var(--cN, value) is the default (the first course's colour). To start a
   new course in this genre, copy a sibling's styles/courses/<course>.css, rename its
   class and change the values.

   Variables:
     --c1             default #9db4ff    e.g. .ch-num, .concept-card h4, .course-name
     --c2             default #2a3f8a    e.g. h2
     --c3             default #121a33    e.g. .finding-box, .ref-table th
     --c4             default #5a78d6    e.g. .challenge-block, .finding-box
     --c5             default #c5d2ff    e.g. .finding-box .box-title
   ============================================================ */
.history-lesson {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  color: #c9d1d9;
  max-width: 900px;
  margin: 0 auto;
  line-height: 1.7;
}

.history-lesson .lesson-head {
  margin-bottom: 1.8rem;
}

.history-lesson .course-name {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--c1, #9db4ff);
  margin: 0 0 0.3rem 0;
}

.history-lesson .chapter-sub {
  font-size: 0.85rem;
  color: #8b949e;
  margin: 0;
}

.history-lesson h2 {
  font-size: 1.4rem;
  color: #f0f4f8;
  border-bottom: 2px solid var(--c2, #2a3f8a);
  padding-bottom: 0.4rem;
  margin: 2.2rem 0 1rem 0;
}

.history-lesson h3 {
  font-size: 1.1rem;
  color: var(--c1, #9db4ff);
  margin: 1.6rem 0 0.7rem 0;
}

.history-lesson p {
  margin: 0 0 1rem 0;
}

.history-lesson .section-intro {
  font-style: italic;
  color: #a8b3bf;
  font-size: 1.02rem;
}

.history-lesson .tip-box, .history-lesson .warn-box, .history-lesson .finding-box {
  border-radius: 8px;
  padding: 1rem 1.2rem;
  margin: 1.3rem 0;
  border-left: 4px solid;
}

.history-lesson .tip-box {
  background: #121c2b;
  border-color: #4a8fd9;
}

.history-lesson .warn-box {
  background: #241c10;
  border-color: #d9a02b;
}

.history-lesson .finding-box {
  background: var(--c3, #121a33);
  border-color: var(--c4, #5a78d6);
}

.history-lesson .tip-box .box-title, .history-lesson .warn-box .box-title, .history-lesson .finding-box .box-title {
  font-weight: 700;
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.95rem;
}

.history-lesson .tip-box .box-title {
  color: #7fb6f0;
}

.history-lesson .warn-box .box-title {
  color: #e8c060;
}

.history-lesson .finding-box .box-title {
  color: var(--c5, #c5d2ff);
}

.history-lesson .concept-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin: 1.3rem 0;
}

.history-lesson .concept-card {
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 8px;
  padding: 1rem 1.2rem;
}

.history-lesson .concept-card h4 {
  margin: 0 0 0.5rem 0;
  color: var(--c1, #9db4ff);
  font-size: 1rem;
}

.history-lesson .concept-card p {
  margin: 0;
  font-size: 0.92rem;
  color: #b8c2cc;
}

.history-lesson .ref-table-wrap {
  overflow-x: auto;
  margin: 1.3rem 0;
}

.history-lesson .ref-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.history-lesson .ref-table th, .history-lesson .ref-table td {
  border: 1px solid #30363d;
  padding: 0.55rem 0.75rem;
  text-align: left;
  vertical-align: top;
}

.history-lesson .ref-table th {
  background: var(--c3, #121a33);
  color: var(--c1, #9db4ff);
}

.history-lesson .ref-table tr:nth-child(even) td {
  background: #12151a;
}

.history-lesson .challenge-block {
  background: #161b22;
  border: 1px solid #30363d;
  border-left: 4px solid var(--c4, #5a78d6);
  border-radius: 8px;
  padding: 1rem 1.2rem;
  margin: 1rem 0;
}

.history-lesson .ch-num {
  font-weight: 700;
  color: var(--c1, #9db4ff);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.history-lesson .ch-body {
  margin: 0.5rem 0;
}

.history-lesson .ch-task {
  font-weight: 600;
  color: #f0f4f8;
}

.history-lesson .ch-link {
  display: inline-block;
  margin-top: 0.5rem;
}

.history-lesson .ch-link a {
  color: #58a6ff;
  text-decoration: none;
  font-size: 0.9rem;
}

.history-lesson .ch-link a:hover {
  text-decoration: underline;
}

.history-lesson .quick-ref {
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 8px;
  padding: 1.2rem 1.4rem;
  margin: 2rem 0 1rem 0;
}

.history-lesson .quick-ref h3 {
  margin-top: 0;
  color: var(--c1, #9db4ff);
}

.history-lesson .quick-ref ul {
  margin: 0;
  padding-left: 1.3rem;
}

.history-lesson .quick-ref li {
  margin-bottom: 0.4rem;
}

.history-lesson strong {
  color: #f0f4f8;
}
