/* Lesson article, callouts, rich content blocks. */

.article {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  padding: var(--sp-6);
  border-radius: var(--r-3xl);
  background: var(--surface-panel);
  border: 1px solid var(--border-panel);
  min-width: 0;
}

.article__label { align-self: flex-start; }
.article__title { font-size: var(--fs-28); font-weight: 700; }
.article__lead { font-size: var(--fs-14); color: var(--text-lead); max-width: 690px; }

.article__h {
  font-size: var(--fs-18);
  font-weight: 700;
  color: var(--text-title);
  margin-top: 4px;
}

.article__h3 {
  font-size: var(--fs-15);
  font-weight: 700;
  color: var(--text-title);
  margin-top: 2px;
}

.prose p {
  font-size: var(--fs-13);
  color: var(--text-list);
  line-height: 1.6;
  max-width: 72ch;
}

.prose-block {
  font-size: var(--fs-13);
  color: var(--text-list);
  line-height: 1.6;
  max-width: 72ch;
}

/* ---- Callout ---------------------------------------------------------------- */
.callout {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: var(--sp-4);
  border-radius: var(--r-xl);
  background: var(--c-bg);
  border: 1px solid var(--c-border);
}

.callout__label {
  font-size: var(--fs-10);
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--c-label);
}

.callout__body {
  font-size: var(--fs-13);
  font-weight: 500;
  color: var(--c-text);
  line-height: 1.5;
}

.callout--bridge .callout__body,
.callout--template .callout__body {
  font-size: var(--fs-12);
  font-weight: 400;
}

.callout--key { --c-bg: var(--callout-key-bg); --c-border: var(--callout-key-border); --c-label: var(--callout-key-label); --c-text: var(--callout-key-text); }
.callout--bridge,
.callout--template { --c-bg: var(--callout-bridge-bg); --c-border: var(--callout-bridge-border); --c-label: var(--callout-bridge-label); --c-text: var(--callout-bridge-text); }
.callout--info { --c-bg: var(--callout-info-bg); --c-border: var(--callout-info-border); --c-label: var(--callout-info-label); --c-text: var(--callout-info-text); }
.callout--warn { --c-bg: var(--callout-warn-bg); --c-border: var(--callout-warn-border); --c-label: var(--callout-warn-label); --c-text: var(--callout-warn-text); }
.callout--danger { --c-bg: var(--callout-danger-bg); --c-border: var(--callout-danger-border); --c-label: var(--callout-danger-label); --c-text: var(--callout-danger-text); }

.callout__body p + p,
.callout__lines > * + * { margin-top: 0; }

/* ---- Check list ("What you should understand") ---------------------------- */
.check-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.check-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: var(--fs-12);
  color: var(--text-list);
}

.check-box {
  flex: none;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: var(--r-sm);
  background: var(--accent-soft-bg);
  color: var(--accent-text);
}

.check-box svg { width: 12px; height: 12px; }

/* ---- Bullet / ordered lists ---------------------------------------------- */
.prose-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-left: 20px;
  font-size: var(--fs-13);
  color: var(--text-list);
  line-height: 1.55;
  max-width: 72ch;
}

.prose-list li::marker { color: var(--accent-text); }

/* ---- Flow (mini mental model) ------------------------------------------------ */
.flow {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  align-items: center;
}

.flow__item {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
}

.flow__item + .flow__item::before {
  content: "";
  width: 6px;
  height: 6px;
  margin-right: 0;
  border-top: 1.5px solid var(--text-faint);
  border-right: 1.5px solid var(--text-faint);
  transform: rotate(45deg);
  opacity: 0.8;
}

/* ---- Lesson controls ----------------------------------------------------- */
.lesson-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 4px;
}

/* ---- Table ---------------------------------------------------------------- */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--r-lg);
  border: 1px solid var(--border-row);
  -webkit-overflow-scrolling: touch;
}

.data-table {
  width: 100%;
  min-width: 460px;
  font-size: var(--fs-12);
  text-align: left;
}

.data-table th {
  padding: 10px 14px;
  font-size: var(--fs-10);
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--cyan);
  background: var(--surface-row);
  border-bottom: 1px solid var(--border-row);
  white-space: nowrap;
}

.data-table td {
  padding: 10px 14px;
  color: var(--text-list);
  border-bottom: 1px solid var(--border-row);
  vertical-align: top;
}

.data-table tr:last-child td { border-bottom: 0; }
.data-table td:first-child { color: var(--text-strong); font-weight: 600; }

/* ---- Compare columns ------------------------------------------------------ */
.compare {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
}

.compare__col {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px;
  border-radius: var(--r-lg);
  background: var(--surface-row);
  border: 1px solid var(--border-row);
}

.compare__title { font-size: var(--fs-13); font-weight: 700; color: var(--text-title); }
.compare__tag { font-size: var(--fs-10); font-weight: 600; color: var(--cyan); letter-spacing: 0.02em; }
.compare__col ul { padding-left: 16px; display: flex; flex-direction: column; gap: 5px; font-size: var(--fs-12); color: var(--text-list); }
.compare__col li::marker { color: var(--accent-text); }

/* ---- Code block ------------------------------------------------------------ */
.code-block {
  position: relative;
  border-radius: var(--r-lg);
  background: var(--surface-code);
  border: 1px solid var(--border-code);
  overflow: hidden;
}

.code-block__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: 6px 8px 6px 14px;
  border-bottom: 1px solid var(--border-code);
  font-size: var(--fs-10);
  font-weight: 600;
  color: #7f93ab;
  letter-spacing: 0.02em;
}

.code-block__copy {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: var(--r-pill);
  font-size: var(--fs-10);
  font-weight: 600;
  color: #b8c7d9;
  background: rgba(148, 163, 184, 0.12);
}

.code-block__copy svg { width: 12px; height: 12px; }
.code-block__copy:hover { background: rgba(148, 163, 184, 0.22); }
.code-block__copy:focus-visible { outline: none; box-shadow: 0 0 0 2px #17d4c1; }

.code-block pre {
  margin: 0;
  padding: 14px;
  overflow-x: auto;
  font-size: 12px;
  line-height: 1.6;
  color: #d6e2f0;
  tab-size: 2;
}

/* ---- Exercise ----------------------------------------------------------------- */
.exercise {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: var(--sp-4);
  border-radius: var(--r-xl);
  background: var(--surface-row);
  border: 1px dashed var(--border-row-active);
}

.exercise__title { font-size: var(--fs-14); font-weight: 700; color: var(--text-title); }
.exercise__prompt { font-size: var(--fs-13); color: var(--text-list); line-height: 1.55; }
.exercise__steps { padding-left: 20px; display: flex; flex-direction: column; gap: 6px; font-size: var(--fs-12); color: var(--text-list); }
.exercise__answer { padding-top: 6px; }

.recap {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: var(--sp-4);
  border-radius: var(--r-xl);
  background: var(--surface-row-active);
  border: 1px solid var(--border-row-active);
}

/* ---- Collapsible (mobile outline / runbook) ---- */
.collapsible__summary {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: 4px 2px;
  list-style: none;
  cursor: pointer;
  font-size: var(--fs-12);
  font-weight: 600;
  color: var(--text-strong);
  border-radius: var(--r-md);
}

.collapsible__summary::-webkit-details-marker { display: none; }
.collapsible__summary svg { width: 16px; height: 16px; transition: transform var(--dur-fast) ease; }
.collapsible[open] > .collapsible__summary svg { transform: rotate(180deg); }
.collapsible__summary:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.collapsible__body { display: flex; flex-direction: column; gap: 10px; }
.collapsible[open] > .collapsible__body { margin-top: 0; }

@media (max-width: 900px) {
  .collapsible__summary { display: flex; min-height: 40px; }
  .collapsible[open] > .collapsible__body { margin-top: 12px; }
}
