/* ──────────────────────────────────────────────────────────────────────────
   Lesson content blocks (research §2.4)
   Применяются в .lesson-content и на /help/blocks demo
   ────────────────────────────────────────────────────────────────────────── */

/* ─── Callouts: Опасно / Важно / К сведению ─── */
.callout {
  display: flex;
  gap: var(--s-3);
  padding: var(--s-4);
  border-radius: var(--r-lg);
  margin: var(--s-5) 0;
  background: #f1f5f9;
  border-left: 4px solid #94a3b8;
  font-size: 0.95em;
  line-height: var(--lh-normal);
}
.callout-ico {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #475569;
}
.callout-body { flex: 1; min-width: 0; }
.callout-body p:first-child { margin-top: 0; }
.callout-body p:last-child { margin-bottom: 0; }
.callout-title {
  font-weight: var(--fw-semibold);
  font-size: var(--fs-sm);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
  color: #334155;
}

.callout--danger {
  background: #fef2f2;
  border-left-color: #dc2626;
}
.callout--danger .callout-ico { color: #b91c1c; }
.callout--danger .callout-title { color: #b91c1c; }

.callout--warning {
  background: #fffbeb;
  border-left-color: #f59e0b;
}
.callout--warning .callout-ico { color: #b45309; }
.callout--warning .callout-title { color: #92400e; }

.callout--info {
  background: #eff6ff;
  border-left-color: var(--c-primary);
}
.callout--info .callout-ico { color: var(--c-primary); }
.callout--info .callout-title { color: var(--c-primary-text); }

.callout--success {
  background: #f0fdf4;
  border-left-color: #16a34a;
}
.callout--success .callout-ico { color: #15803d; }
.callout--success .callout-title { color: #15803d; }

/* ─── Toggle (раскрываемый блок) ─── */
details.toggle {
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  margin: var(--s-4) 0;
  overflow: hidden;
  background: var(--c-surface);
}
details.toggle > summary {
  padding: var(--s-3) var(--s-4);
  cursor: pointer;
  font-weight: var(--fw-semibold);
  color: var(--c-text);
  background: var(--c-surface-2);
  list-style: none;
  display: flex;
  align-items: center;
  gap: var(--s-2);
  transition: background var(--t-fast);
}
details.toggle > summary::-webkit-details-marker { display: none; }
details.toggle > summary::before {
  content: '';
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  transition: transform var(--t-fast);
  flex-shrink: 0;
}
details.toggle[open] > summary::before {
  transform: rotate(45deg);
}
details.toggle > summary:hover { background: #e2e8f0; }
details.toggle > .toggle-body {
  padding: var(--s-4);
  border-top: 1px solid var(--c-border);
  background: var(--c-surface);
}
details.toggle > .toggle-body > *:first-child { margin-top: 0; }
details.toggle > .toggle-body > *:last-child { margin-bottom: 0; }

/* ─── Checklist (как методисту выделить чек-лист) ─── */
ul.checklist {
  list-style: none;
  padding: 0;
  margin: var(--s-4) 0;
}
ul.checklist > li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px var(--s-3);
  border-left: 2px solid var(--c-border);
  background: var(--c-surface-2);
  border-radius: 0 var(--r) var(--r) 0;
  margin-bottom: 6px;
  font-size: 0.95em;
}
ul.checklist > li::before {
  content: '';
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border: 2px solid var(--c-border-strong);
  border-radius: 4px;
  background: var(--c-surface);
  margin-top: 1px;
}
ul.checklist > li.is-done {
  border-left-color: #16a34a;
}
ul.checklist > li.is-done::before {
  background: #16a34a url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="3.5" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"/></svg>') center/14px no-repeat;
  border-color: #16a34a;
}
ul.checklist > li.is-done .checklist-text {
  color: var(--c-text-muted);
  text-decoration: line-through;
  text-decoration-color: var(--c-border-strong);
}
.checklist-text { flex: 1; }

/* ─── NPA reference (ссылка на нормативку) ─── */
a.npa-ref {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  background: var(--c-primary-soft);
  color: var(--c-primary-text);
  border-radius: 6px;
  font-size: 0.92em;
  text-decoration: none;
  font-weight: var(--fw-medium);
  border: 1px solid rgba(30, 58, 138, 0.15);
  transition: background var(--t-fast), border-color var(--t-fast);
}
a.npa-ref:hover {
  background: #dbeafe;
  border-color: var(--c-primary);
  text-decoration: none;
}
a.npa-ref::before {
  content: '';
  width: 14px;
  height: 14px;
  background: currentColor;
  -webkit-mask: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"/><polyline points="14 2 14 8 20 8"/></svg>') center/14px no-repeat;
  mask: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"/><polyline points="14 2 14 8 20 8"/></svg>') center/14px no-repeat;
  flex-shrink: 0;
}

/* ─── Tables (методички) ─── */
.lesson-content table {
  border-collapse: collapse;
  width: 100%;
  margin: var(--s-5) 0;
  font-size: 0.95em;
}
.lesson-content thead th {
  background: var(--c-surface-2);
  font-weight: var(--fw-semibold);
  color: var(--c-text);
  text-align: left;
  padding: 10px 14px;
  border-bottom: 2px solid var(--c-border);
  font-size: var(--fs-sm);
}
.lesson-content tbody td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--c-border);
  vertical-align: top;
}
.lesson-content tbody tr:last-child td { border-bottom: none; }

/* ─── Improved blockquote ─── */
.lesson-content blockquote {
  border-left: 3px solid var(--c-primary);
  background: var(--c-primary-soft);
  padding: var(--s-3) var(--s-4);
  margin: var(--s-5) 0;
  font-style: italic;
  color: var(--c-text);
  border-radius: 0 var(--r) var(--r) 0;
}
.lesson-content blockquote > p:last-child { margin-bottom: 0; }

/* ─── Code blocks (терминология, команды) ─── */
.lesson-content pre {
  background: #0f172a;
  color: #f1f5f9;
  padding: var(--s-4);
  border-radius: var(--r-lg);
  overflow-x: auto;
  margin: var(--s-4) 0;
  font-size: 0.9em;
  line-height: 1.5;
}
.lesson-content pre code {
  background: none;
  color: inherit;
  padding: 0;
}

/* ─── Image with caption ─── */
.lesson-content figure {
  margin: var(--s-5) 0;
  text-align: center;
}
.lesson-content figure img {
  max-width: 100%;
  height: auto;
  border-radius: var(--r-lg);
  border: 1px solid var(--c-border);
}
.lesson-content figcaption {
  margin-top: var(--s-2);
  font-size: var(--fs-sm);
  color: var(--c-text-muted);
  font-style: italic;
}
