/* ============================================================
   Lecture · 기본 자료구조 (2과목 10강) — slide layout extensions
   Builds on /colors_and_type.css and /slides/_slide.css
   ─ 코어(_slide.css)에 이미 승격된 컴포넌트는 재정의하지 않음:
     def-box · metaphor · mnemonic · real · pass-tip
     · cmp-tbl · trap-row · q-source · tbl.compact · callout.compact
   ─ 여기에는 10강 신규 자료구조 도식 컴포넌트만 정의.
   ============================================================ */

/* ---------- 4-objective grid (학습 목표) — 08강에서 가져온 패턴 ---------- */
.obj-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
.obj-item {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 16px;
  align-items: center;
  padding: 16px 20px;
  background: var(--ink-50);
  border: 1.5px solid var(--ink-200);
  border-radius: 12px;
}
.obj-item .badge {
  width: 52px;
  height: 52px;
  background: var(--eduwill-yellow);
  color: var(--ink-1000);
  display: grid;
  place-items: center;
  font: 800 26px/1 var(--font-sans);
  border-radius: 12px;
}
.obj-item h3 { margin: 0; font: 800 18px/1.15 var(--font-sans); color: var(--ink-1000); }
.obj-item p  { margin: 4px 0 0; font-size: 13px; color: var(--ink-700); line-height: 1.4; }

/* ============================================================
   흐름 노드 행 — A → B → C 같은 inline 시퀀스 (운행 결과·리스트 체인)
   08강 .flow 재사용
   ============================================================ */
.flow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}
.flow .box {
  padding: 10px 16px;
  border-radius: 10px;
  background: white;
  border: 1.5px solid var(--ink-300);
  font: 700 16px/1.2 var(--font-sans);
  color: var(--ink-900);
  text-align: center;
}
.flow .box.dark { background: var(--ink-1000); color: white; border-color: var(--ink-1000); }
.flow .box.mid  { background: var(--eduwill-yellow); color: var(--ink-1000); border-color: var(--eduwill-yellow); font-weight: 800; }
.flow .box small { display: block; font-size: 11px; font-weight: 600; opacity: 0.7; margin-top: 2px; }
.flow .arw { color: var(--ink-500); font-size: 20px; font-weight: 800; }

/* ============================================================
   SVG diagram primitives — 트리·그래프 노드/간선 (08강 dg-* 재사용 + 확장)
   ============================================================ */
.dg-line   { stroke: var(--ink-300); stroke-width: 2; }
.dg-line-y { stroke: var(--eduwill-yellow-600); stroke-width: 2.5; }
.dg-edge   { stroke: var(--ink-400); stroke-width: 2.5; }
.dg-node   { fill: var(--ink-1000); }
.dg-node-t { fill: white; font: 800 15px var(--font-sans); text-anchor: middle; dominant-baseline: central; }
.dg-leaf   { fill: var(--eduwill-yellow); stroke: var(--ink-1000); stroke-width: 2; }
.dg-leaf-t { fill: var(--ink-1000); font: 800 15px var(--font-sans); text-anchor: middle; dominant-baseline: central; }
.dg-root   { fill: var(--ink-1000); stroke: var(--eduwill-yellow); stroke-width: 3.5; }
.dg-cap    { fill: var(--ink-500); font: 700 12px var(--font-sans); text-anchor: middle; }
.dg-op     { fill: var(--info-500); }      /* 수식 트리 연산자 노드 */

/* 트리/그래프 도식 프레임 */
.tree-frame {
  background: var(--ink-50);
  border: 1.5px solid var(--ink-200);
  border-radius: 12px;
  padding: 12px;
  display: grid;
  place-items: center;
}
.tree-frame.hi { background: var(--eduwill-yellow-50); border-color: var(--eduwill-yellow); }
.tree-frame svg { width: 100%; height: auto; max-height: 210px; display: block; }
.tree-frame .cap { margin-top: 6px; font-size: 12px; color: var(--ink-500); font-weight: 600; text-align: center; }

/* ============================================================
   스택(LIFO) 도식 — 위로 쌓고 위에서 꺼냄, 입출구 1개(top)
   ============================================================ */
.stack-dg {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  width: 150px;
}
.stack-dg .top-label {
  font: 800 13px/1 var(--font-sans);
  color: var(--eduwill-yellow-700);
  margin-bottom: 6px;
  letter-spacing: 0.04em;
}
.stack-dg .top-label .arr { color: var(--ink-700); }
.stack-dg .cell {
  width: 100%;
  padding: 13px 0;
  text-align: center;
  font: 800 20px/1 var(--font-sans);
  color: var(--ink-1000);
  background: white;
  border: 2px solid var(--ink-300);
  border-bottom-width: 0;
}
.stack-dg .cell.hi { background: var(--eduwill-yellow); border-color: var(--ink-1000); }
.stack-dg .cell:first-of-type { border-radius: 8px 8px 0 0; }
.stack-dg .base {
  width: 100%;
  height: 0;
  border-bottom: 4px solid var(--ink-1000);
}
.stack-dg .floor-note { margin-top: 6px; font-size: 11px; color: var(--ink-500); font-weight: 600; }

/* ============================================================
   큐(FIFO) 도식 — front(출구) ← [.. .. ..] ← rear(입구)
   ============================================================ */
.queue-dg { display: flex; flex-direction: column; gap: 8px; align-items: center; }
.queue-dg .rail { display: flex; align-items: center; gap: 0; }
.queue-dg .cell {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  font: 800 20px/1 var(--font-sans);
  color: var(--ink-1000);
  background: white;
  border: 2px solid var(--ink-300);
  border-right-width: 0;
}
.queue-dg .cell:first-child { border-radius: 8px 0 0 8px; }
.queue-dg .cell:last-child  { border-right-width: 2px; border-radius: 0 8px 8px 0; }
.queue-dg .cell.hi { background: var(--eduwill-yellow); border-color: var(--ink-1000); }
.queue-dg .ports { display: flex; justify-content: space-between; width: 100%; }
.queue-dg .port {
  font: 800 13px/1.3 var(--font-sans);
  color: var(--ink-700);
  text-align: center;
}
.queue-dg .port b { display: block; color: var(--eduwill-yellow-700); font-size: 14px; }
.queue-dg .port.front b { color: var(--ok-700); }
.queue-dg .port.rear b  { color: var(--info-700); }

/* ============================================================
   연결 리스트 노드 체인 — [Data | Next] → [Data | Next] → NULL
   ============================================================ */
.node-chain { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; justify-content: center; }
.node-chain .node {
  display: flex;
  border: 2px solid var(--ink-1000);
  border-radius: 8px;
  overflow: hidden;
  background: white;
}
.node-chain .node .data {
  padding: 12px 16px;
  font: 800 17px/1 var(--font-sans);
  color: var(--ink-1000);
  background: var(--eduwill-yellow);
}
.node-chain .node .next {
  padding: 12px 14px;
  font: 700 13px/1 var(--font-sans);
  color: var(--ink-500);
  border-left: 2px solid var(--ink-300);
  display: grid;
  place-items: center;
}
.node-chain .arw { color: var(--ink-700); font-size: 20px; font-weight: 800; }
.node-chain .null {
  font: 800 14px/1 var(--font-mono);
  color: var(--err-700);
  padding: 0 6px;
}

/* ============================================================
   Big-O 빅쓰리 카드 — O(1)·O(log n)·O(n)
   ============================================================ */
.bigo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.bigo-card {
  background: white;
  border: 1.5px solid var(--ink-200);
  border-radius: 12px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.bigo-card .o {
  font: 800 30px/1 var(--font-mono);
  color: var(--ink-1000);
  letter-spacing: -0.02em;
}
.bigo-card .nm { font-size: 14px; font-weight: 800; color: var(--eduwill-yellow-700); }
.bigo-card .ex { font-size: 13px; color: var(--ink-700); line-height: 1.4; }

/* ============================================================
   LIFO/FIFO 시그니처 칩 (스택/큐 대비)
   ============================================================ */
.sig {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 14px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.sig.lifo { background: var(--warn-100); color: var(--warn-700); }
.sig.fifo { background: var(--ok-50);   color: var(--ok-700); }

/* ---------- utility: small caption ---------- */
.cap { font-size: 12px; color: var(--ink-500); }

/* ============================================================
   푸터 안전영역(y≤672) 압축 — 10강 데크 전역 (헤드리스 실측 기반)
   ─ tools/measure-safezone.mjs 측정 결과 자료구조 도식·def-box가
     높이 큰 블록이라, 본 데크는 갭·def-box·metaphor를 일괄 축소.
   ─ _slide.css 코어보다 뒤에 로드되므로 이 데크에만 적용됨.
   ============================================================ */
.slide-content { gap: 22px; }

.def-box { grid-template-columns: 118px 1fr; }
.def-box .term { padding: 14px 10px; }
.def-box .term .abbr { font-size: 25px; letter-spacing: -0.02em; line-height: 1.05; }
.def-box .term .full { font-size: 10px; margin-top: 4px; line-height: 1.25; word-break: keep-all; }
.def-box .body { padding: 14px 20px; }
.def-box .body .label { font-size: 11px; }
.def-box .body .text { font-size: 15.5px; line-height: 1.45; margin-top: 4px; }

.metaphor { padding: 13px 18px; }
.metaphor .icon { width: 38px; height: 38px; font-size: 18px; }
.metaphor .text { font-size: 14.5px; line-height: 1.45; }

.pass-tip, .real, .callout.compact { padding: 12px 18px; }
.pass-tip .text, .real .text { font-size: 14.5px; line-height: 1.45; }
.mnemonic { padding: 13px 20px; }
.mnemonic .phrase { font-size: 18px; }
