/* Lesson reader typography, steps, figures, diagrams, tables, prompts & zoom lightbox */
.lesson-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: center;
  margin: 14px 0 22px;
  padding: 12px 16px;
  background: #f5f7fc;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 14px;
  color: var(--muted);
}
.lesson-meta strong { color: var(--ink); font-weight: 700; }

.lesson-body {
  color: #1f2b40;
  overflow-wrap: anywhere;
  font-size: 16.5px;
  line-height: 1.82;
  letter-spacing: -0.015em;
}
.lesson-body > *:first-child { margin-top: 0; }
.lesson-body p { margin: 0 0 16px; }
.lesson-body h2 {
  margin: 36px 0 14px;
  padding-bottom: 10px;
  border-bottom: 2px solid #e6ecf6;
  font-size: clamp(21px, 2.3vw, 26px);
  line-height: 1.35;
  color: var(--ink);
}
.lesson-body h3 {
  margin: 26px 0 10px;
  font-size: clamp(18px, 1.8vw, 20px);
  line-height: 1.4;
  color: #21345c;
}
.lesson-body ul, .lesson-body ol {
  margin: 0 0 18px;
  padding-left: 22px;
}
.lesson-body li { margin: 6px 0; }
.lesson-body strong { color: #13203d; font-weight: 700; }
.lesson-body a { color: #2b4db8; text-underline-offset: 3px; }
.lesson-body pre { max-width: 100%; overflow-x: auto; }
.lesson-body code {
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 0.9em;
  background: #eef2fa;
  color: #20377a;
  padding: 2px 6px;
  border-radius: 5px;
}

.lesson-lead {
  padding: 18px 20px;
  margin: 0 0 24px;
  background: linear-gradient(180deg, #f6f9ff 0%, #eff4ff 100%);
  border: 1px solid #d4e0fa;
  border-left: 4px solid #3556c2;
  border-radius: 10px;
  font-size: 16.5px;
  line-height: 1.75;
  color: #192949;
}
.lesson-lead p:last-child { margin-bottom: 0; }

.lesson-prep {
  margin: 20px 0 26px;
  padding: 18px 20px;
  background: #fbfcfe;
  border: 1px solid var(--line);
  border-radius: 11px;
}
.lesson-prep h3 { margin: 0 0 10px; font-size: 17px; }
.lesson-prep ul { margin: 0; }

.lesson-step {
  margin: 24px 0;
  padding: 20px 22px;
  background: #ffffff;
  border: 1px solid #d9e2f0;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(24, 36, 68, 0.04);
}
.lesson-step-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.step-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  background: #233c85;
  color: #fff;
  font-size: 12.5px;
  font-weight: 750;
  letter-spacing: 0.03em;
}
.lesson-step-head h3 {
  margin: 0;
  font-size: 19px;
  color: var(--ink);
}
.step-result {
  margin-top: 12px;
  padding: 11px 14px;
  background: #f1f8f3;
  border: 1px solid #cde6d4;
  border-radius: 8px;
  font-size: 15px;
  color: #1d472c;
}
.step-result strong { color: #163b23; }

.lesson-callout {
  margin: 20px 0;
  padding: 15px 18px;
  border-radius: 10px;
  border: 1px solid #d8e2f5;
  background: #f7faff;
  font-size: 15.5px;
  line-height: 1.72;
}
.lesson-callout.is-warn {
  background: #fff9f2;
  border-color: #f4d6b5;
  color: #5c3412;
}
.lesson-callout.is-warn strong { color: #4a2608; }
.lesson-callout.is-tip {
  background: #f2f9f5;
  border-color: #c8e6d4;
  color: #1b432c;
}
.lesson-callout p:last-child { margin-bottom: 0; }

/* Figures & zoomable screenshots */
.lesson-fig {
  margin: 22px 0;
  padding: 12px;
  background: #f8fafd;
  border: 1px solid #d9e2f0;
  border-radius: 12px;
  text-align: center;
}
.lesson-fig img {
  display: block;
  max-width: 100%;
  width: auto;
  max-height: 560px;
  height: auto;
  margin: 0 auto;
  border-radius: 8px;
  border: 1px solid #e1e7f2;
  cursor: zoom-in;
  background: #fff;
}
.lesson-fig figcaption {
  margin-top: 10px;
  font-size: 13.5px;
  line-height: 1.55;
  color: #52627b;
}
.lesson-fig figcaption::after {
  content: " · 클릭하면 크게 볼 수 있어요";
  color: #6b7d9a;
  font-size: 12.5px;
}

/* Visual flow diagrams for conceptual & new lessons */
.lesson-diagram {
  margin: 22px 0;
  padding: 18px;
  background: #f6f8fd;
  border: 1px solid #d8e2f3;
  border-radius: 12px;
}
.diagram-title {
  font-size: 14px;
  font-weight: 700;
  color: #2b448f;
  margin-bottom: 12px;
}
.diagram-flow {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}
.diagram-node {
  position: relative;
  padding: 13px 14px;
  background: #fff;
  border: 1px solid #d4dff2;
  border-radius: 10px;
  text-align: left;
}
.diagram-node strong {
  display: block;
  font-size: 14.5px;
  color: #182a54;
  margin-bottom: 4px;
}
.diagram-node span {
  display: block;
  font-size: 13.5px;
  line-height: 1.5;
  color: #53637d;
}

/* Tables */
.lesson-table-wrap {
  margin: 20px 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
.lesson-table-wrap table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14.5px;
  line-height: 1.6;
  min-width: 460px;
}
.lesson-table-wrap th, .lesson-table-wrap td {
  padding: 11px 14px;
  border-bottom: 1px solid #e6ecf5;
  text-align: left;
  vertical-align: top;
}
.lesson-table-wrap thead th {
  background: #f2f5fb;
  color: #18274a;
  font-weight: 700;
}
.lesson-table-wrap tbody tr:last-child td { border-bottom: 0; }

/* Code & Copyable Prompt Boxes */
.prompt-box {
  position: relative;
  margin: 18px 0;
  border: 1px solid #cdd9f0;
  border-radius: 10px;
  background: #172136;
  color: #edf2ff;
  overflow: hidden;
}
.prompt-box-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 14px;
  background: #101829;
  font-size: 13px;
  color: #aebce0;
}
.prompt-copy {
  border: 1px solid #435785;
  background: #233357;
  color: #f3f6ff;
  border-radius: 6px;
  padding: 4px 10px;
  font: 600 12.5px var(--sans);
  cursor: pointer;
}
.prompt-copy:hover { background: #31477a; }
.prompt-box pre {
  margin: 0;
  padding: 14px 16px;
  overflow-x: auto;
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 13.5px;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
}
.prompt-box code {
  background: transparent;
  color: inherit;
  padding: 0;
}

/* Troubleshooting cards */
.trouble-list {
  display: grid;
  gap: 12px;
  margin: 18px 0 24px;
}
.trouble-item {
  padding: 15px 18px;
  background: #fcfdff;
  border: 1px solid #dce4f1;
  border-radius: 10px;
}
.trouble-item h3 {
  margin: 0 0 6px;
  font-size: 16.5px;
  color: #9e2a2b;
}
.trouble-item p { margin: 0 0 8px; font-size: 15px; }
.trouble-item p:last-child { margin-bottom: 0; }

/* Practice mission box */
.lesson-practice {
  margin: 26px 0 18px;
  padding: 18px 20px;
  background: #f5f7ff;
  border: 1px solid #ccd8f7;
  border-radius: 11px;
}
.lesson-practice h3 { margin: 0 0 8px; font-size: 17.5px; color: #243e8a; }
.lesson-practice p:last-child { margin-bottom: 0; }

/* Interactive Lightbox */
.lesson-lightbox {
  padding: 0;
  border: none;
  border-radius: 12px;
  background: #0f172a;
  color: #fff;
  max-width: min(94vw, 1180px);
  max-height: 92vh;
  box-shadow: 0 20px 55px rgba(0, 0, 0, 0.55);
}
.lesson-lightbox::backdrop { background: rgba(10, 16, 30, 0.78); }
.lightbox-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  background: #17233f;
  font-size: 13.5px;
}
.lightbox-actions { display: flex; gap: 6px; }
.lightbox-actions button {
  border: 1px solid #415580;
  background: #233357;
  color: #fff;
  border-radius: 6px;
  padding: 5px 10px;
  font: 600 13px var(--sans);
  cursor: pointer;
}
.lightbox-stage {
  overflow: auto;
  max-height: calc(92vh - 54px);
  padding: 14px;
  text-align: center;
}
.lightbox-stage img {
  display: inline-block;
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  transform-origin: top center;
  transition: transform 0.15s ease;
}

@media (max-width: 600px) {
  .lesson-body { font-size: 15.5px; line-height: 1.78; }
  .lesson-step { padding: 15px 15px; }
  .lesson-fig { padding: 8px; }
  .lesson-table-wrap table { min-width: 380px; font-size: 13.5px; }
}
