/* ============================================================
   lesson.css — Lesson Page Layout & Typography
   ============================================================ */

/* --- Article container --- */
#lesson-article {
  max-width: 680px;
  margin: 0 auto;
}

/* --- Lesson Header --- */
.lesson-header {
  margin-bottom: 36px;
  padding-bottom: 24px;
  border-bottom: 2px solid rgba(156, 132, 112, 0.14);
}

.lesson-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

#lesson-title {
  font-family: 'Heebo', sans-serif;
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.25;
  margin: 0;
}

/* --- Hero decoration bar under title --- */
.lesson-header::after {
  content: '';
  display: block;
  width: 60px;
  height: 4px;
  background: linear-gradient(90deg, var(--accent), var(--accent-soft));
  border-radius: 2px;
  margin-top: 18px;
}

/* --- Lesson Sections --- */
.lesson-sections {
  color: var(--text-soft);
  font-size: 1rem;
  line-height: 1.8;
}

.lesson-sections section {
  margin-bottom: 40px;
}

.lesson-sections section:last-child {
  margin-bottom: 0;
}

/* h2 inside lesson content */
.lesson-sections h2 {
  font-family: 'Heebo', sans-serif;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
  padding-top: 24px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.lesson-sections h2::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 1em;
  background: var(--accent-soft);
  border-radius: 2px;
  flex-shrink: 0;
}

/* h3 inside lesson content */
.lesson-sections h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 20px;
  margin-bottom: 10px;
}

/* Paragraphs */
.lesson-sections p {
  color: var(--text-soft);
  margin-bottom: 1rem;
  line-height: 1.8;
}

/* Ordered / unordered lists inside content */
.lesson-sections ul,
.lesson-sections ol {
  margin: 12px 0 20px 0;
  padding-right: 4px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lesson-sections ul li,
.lesson-sections ol li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--text-soft);
  font-size: 0.97rem;
  line-height: 1.65;
  padding-right: 4px;
}

.lesson-sections ul li::before {
  content: '•';
  color: var(--accent);
  font-size: 1.1rem;
  flex-shrink: 0;
  margin-top: 1px;
}

.lesson-sections ol {
  counter-reset: lesson-ol;
}

.lesson-sections ol li {
  counter-increment: lesson-ol;
}

.lesson-sections ol li::before {
  content: counter(lesson-ol) '.';
  color: var(--accent);
  font-weight: 700;
  font-size: 0.9rem;
  flex-shrink: 0;
  min-width: 20px;
  margin-top: 2px;
}

/* Strong / em */
.lesson-sections strong {
  font-weight: 700;
  color: var(--text-primary);
}

.lesson-sections em {
  font-style: italic;
  color: var(--text-soft);
}

/* Code / kbd */
.lesson-sections code {
  font-family: 'Courier New', monospace;
  font-size: 0.88em;
  background: rgba(156, 132, 112, 0.12);
  color: var(--text-primary);
  padding: 2px 6px;
  border-radius: 4px;
}

/* --- Horizontal Rule --- */
.lesson-sections hr {
  border: none;
  border-top: 2px solid rgba(156, 132, 112, 0.12);
  margin: 32px 0;
}

/* --- Infographic Container (inside lesson) --- */
.infographic-container {
  max-width: 540px;
  margin: 24px auto;
  padding: 24px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.infographic-caption {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-align: center;
  font-style: italic;
}

/* --- Lesson Summary --- */
#lesson-summary {
  margin-top: 48px;
}

/* --- Complete Button row --- */
.complete-row {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 2px solid rgba(156, 132, 112, 0.1);
}

/* --- Next Hint --- */
#next-hint {
  margin-top: 24px;
}

/* --- Lesson Nav (prev/next buttons) --- */
.lesson-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 40px;
  padding-top: 28px;
  border-top: 2px solid rgba(156, 132, 112, 0.1);
}

/* When only next or only prev */
.lesson-nav:has(#prev-btn[hidden]) {
  grid-template-columns: 1fr;
}

.lesson-nav:has(#prev-btn[hidden]) #next-btn {
  grid-column: 1 / -1;
  justify-self: center;
  min-width: 200px;
}

/* --- Responsive --- */
@media (max-width: 768px) {
  #lesson-title {
    font-size: 1.5rem;
  }

  .lesson-sections h2 {
    font-size: 1.15rem;
  }

  .lesson-nav {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .lesson-nav #prev-btn,
  .lesson-nav #next-btn {
    justify-self: stretch;
    text-align: center;
  }

  .infographic-container {
    padding: 16px 0;
  }
}
