/* ==========================================================================
   Learning aids: "Teach me" explainers.
   One shared component for every long or technical page. It works without
   JavaScript: each explainer is a native
   <details>/<summary> disclosure. learn.js only adds deep links and printing.
   Texts are written in advance from the page's own content and reviewed by
   the content council. No live AI, no personal answers.
   ========================================================================== */

/* ---- Teach me ------------------------------------------------------------ */
.teach { margin: 2px 0 24px; text-align: left; }
.teach > summary {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 8px 18px 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--paper-2);
  color: var(--teal-700);
  font-family: var(--font-head);
  font-weight: 600;
  font-size: .93rem;
  line-height: 1.3;
  cursor: pointer;
  list-style: none;
  user-select: none;
  transition: background-color .18s ease, border-color .18s ease, color .18s ease;
}
.teach > summary::-webkit-details-marker { display: none; }
.teach > summary::marker { content: ""; }
.teach > summary svg { width: 18px; height: 18px; flex: none; }
.teach > summary::after {
  content: "";
  width: 7px; height: 7px; margin-left: 2px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  transition: transform .18s ease;
}
.teach[open] > summary::after { transform: rotate(225deg) translateY(-2px); }
.teach > summary:hover { background: var(--white); border-color: var(--teal-400); color: var(--teal-600); }
.teach > summary:focus-visible { outline: 3px solid var(--teal-400); outline-offset: 2px; }
.teach[open] > summary { background: var(--white); border-color: var(--teal-400); }
.teach__hint { font-family: var(--font-body); font-weight: 500; color: var(--ink-500); font-size: .86rem; }
.teach__body {
  margin-top: 12px;
  padding: 18px 22px;
  background: var(--white);
  border: 1px solid var(--line);
  border-left: 4px solid var(--teal-400);
  border-radius: 0 12px 12px 0;
  font-size: 1rem;
  line-height: 1.7;
  color: var(--ink-700);
  animation: teach-in .2s ease-out;
}
.teach__body p { margin: 0 0 .9em; }
.teach__body p:last-of-type { margin-bottom: 0; }
.teach__note {
  margin: 14px 0 0 !important;
  font-size: .84rem;
  color: var(--ink-500);
}
@keyframes teach-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* Dark sections (headings inside .bg-deep) */
.bg-deep .teach > summary { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.35); color: #eafaf7; }
.bg-deep .teach > summary:hover,
.bg-deep .teach[open] > summary { background: rgba(255,255,255,.16); color: #fff; border-color: var(--aqua-300); }
.bg-deep .teach__hint { color: #c7ebe7; }
.bg-deep .teach__body { color: var(--ink-700); }

@media (max-width: 480px) {
  .teach > summary { padding: 8px 14px 8px 12px; }
  .teach__hint { display: none; }
  .teach__body { padding: 16px 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .teach__body { animation: none; }
  .teach > summary, .teach > summary::after { transition: none; }
}
@media print {
  .teach > summary { display: none; }
  .teach__body { border: 0; border-left: 3px solid #999; padding: 6px 12px; }
}
