/* 도해(illustration) 블록: scripts/illus/insert.js 가 넣는 <figure class="term-illus">.
   색은 사이트 변수(--text, --muted, --accent, --accent-soft, --border, --card-bg)만 써서 다크 모드에서 자동으로 바뀐다. */
.term-illus {
  margin: 1.5em 0;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card-bg);
}
.term-illus .illus-frame { display: flex; justify-content: center; }
.term-illus .illus-frame svg,
.term-illus .illus-frame img { display: block; width: 100%; height: auto; max-height: 460px; object-fit: contain; }
.term-illus .illus-frame img { border-radius: 4px; }
.term-illus figcaption { margin-top: 10px; font-size: 0.875rem; line-height: 1.6; color: var(--muted); }
.term-illus .illus-caption { display: block; color: var(--text); }

.illus-legend {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 4px 12px;
  margin: 8px 0;
  padding: 8px 10px;
  background: var(--accent-soft);
  border-radius: 6px;
  color: var(--text);
}
.illus-legend > div { display: contents; }
.illus-legend dt { font-weight: 600; white-space: nowrap; }
/* 이탤릭은 수학 변수(<i>)에만. 함수명·약어·단위·한글 용어는 정체 */
.illus-legend dt i { font-family: "Times New Roman", serif; font-style: italic; font-size: 1.08em; }
.illus-legend dd { margin: 0; }
.illus-note { margin: 6px 0; font-size: 0.8125rem; }

.illus-table-wrap { overflow-x: auto; margin: 8px 0; }
.illus-labels { border-collapse: collapse; width: 100%; font-size: 0.8125rem; color: var(--text); }
.illus-labels caption { text-align: left; color: var(--muted); padding-bottom: 4px; }
.illus-labels th, .illus-labels td { border-bottom: 1px solid var(--border); padding: 4px 6px; text-align: left; vertical-align: top; }
.illus-labels th { color: var(--muted); font-weight: 600; }
.illus-labels .n { color: var(--muted); width: 2.2em; }
.illus-labels .orig { white-space: nowrap; }

.illus-credit { display: block; margin-top: 6px; font-size: 0.75rem; color: var(--muted); }
.illus-credit a { color: inherit; }
.term-illus figcaption .illus-labels a, .term-illus figcaption .illus-note a { color: var(--accent); }

@media (max-width: 480px) {
  .term-illus { padding: 8px; }
  /* 좁은 화면에서 SVG 글자가 너무 작아지지 않게 최소 폭을 두고 가로로 넘긴다 */
  .term-illus .illus-frame:has(svg) { overflow-x: auto; justify-content: flex-start; }
  .term-illus .illus-frame svg { min-width: 440px; }
  .illus-legend { grid-template-columns: 1fr; }
  .illus-legend dd { margin: 0 0 6px; }
  .illus-labels thead { display: none; }
  .illus-labels tr { display: grid; grid-template-columns: 2.2em 1fr; padding: 4px 0; border-bottom: 1px solid var(--border); }
  .illus-labels td { border: 0; padding: 1px 4px; }
  .illus-labels td:nth-child(n+2) { grid-column: 2; }
  .illus-labels .orig { white-space: normal; }
}

/* 통합 엔진 마크업(figure.si-figure[data-kind=illus]): 도해 SVG·사진의 크기와 좁은 화면 처리 */
.si-figure[data-kind="illus"] .si-frame { align-items: stretch; }
.si-figure[data-kind="illus"] .si-frame svg,
.si-figure[data-kind="illus"] .si-frame img { display: block; width: 100%; height: auto; max-height: 460px; object-fit: contain; }
.si-figure[data-kind="illus"] .si-frame img { border-radius: 4px; }
/* 사진·공용 그림은 흰 바탕 위에 둔다(투명 배경 그림이 다크 모드에서 묻히지 않게) */
.si-figure[data-kind="illus"] .si-frame img { background: #fff; padding: 6px; box-sizing: border-box; }
.si-figure[data-kind="illus"] figcaption { font-size: 0.875rem; }
.si-figure[data-kind="illus"] .si-caption { color: var(--text); }
.si-figure[data-kind="illus"] figcaption .illus-labels a, .si-figure[data-kind="illus"] figcaption .illus-note a { color: var(--accent); }
@media (max-width: 480px) {
  .si-figure[data-kind="illus"] { padding: 8px; }
  /* 가로 스크롤 없이 폭에 맞춰 줄여 보인다(스크롤 컨테이너가 오른쪽 라벨을 잘라 보이게 했음) */
  .si-figure[data-kind="illus"] .si-frame svg { min-width: 0; }
}
