/* ══════════════════════════════════════════════════════════
   수업용 와이드 레이아웃 (프로토타입)

   기존 읽기용 좁은 칼럼(--maxw: 47rem 고정) 대신, 화면 크기에 맞춰
   본문 폭과 글자 크기가 함께 늘어나는 프레젠테이션 레이아웃.
   body에 class="lecture-mode"를 추가한 페이지에만 적용됩니다.
   ══════════════════════════════════════════════════════════ */

body.lecture-mode {
  --maxw: clamp(48rem, 82vw, 92rem);
  --pad: clamp(2rem, 3vw, 4.5rem);
  font-size: clamp(17px, 0.95vw + 13px, 23px);
}

/* em 기준 — rem(문서 루트 고정 16px)을 쓰면 body의 반응형 글자 크기와 무관하게
   고정되어, 넓은 화면에서 본문보다 제목이 작아 보이는 문제가 있었음 */
body.lecture-mode .page-head h1 { font-size: clamp(1.8em, 2.3vw, 2.7em); }
body.lecture-mode h2 { font-size: clamp(1.22em, 1.5vw, 1.65em); }
body.lecture-mode h3 { font-size: clamp(1.02em, 1.1vw, 1.3em); }

body.lecture-mode figure.capture img { max-width: min(100%, 64rem); }

/* 축약형 요점 목록 — 서술형 문단 대신 PPT식 짧은 항목 나열 */
body.lecture-mode ul.bullets {
  list-style: none;
  margin: .6rem 0 0;
  padding: 0;
  display: grid;
  gap: .55rem;
}
body.lecture-mode ul.bullets > li {
  position: relative;
  padding-left: 1.3rem;
  line-height: 1.55;
}
body.lecture-mode ul.bullets > li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .62em;
  width: .5rem;
  height: .5rem;
  border-radius: 2px;
  background: var(--brand);
}

/* 확인 문제 — 참여도를 높이기 위한 객관식·단답식 퀴즈 */
.quiz-item {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper-2);
  padding: 1.1rem 1.25rem;
  margin: 0 0 1rem;
}
.quiz-item:last-child { margin-bottom: 0; }
.quiz-q {
  font-weight: 700;
  letter-spacing: -0.015em;
  margin: 0 0 .7rem;
}
.quiz-q .qtype {
  display: inline-block;
  margin-right: .5rem;
  padding: .1rem .5rem;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-ink);
  font-size: .78rem;
  font-weight: 700;
  vertical-align: middle;
}
ol.quiz-choices {
  list-style: none;
  counter-reset: qc;
  padding: 0;
  margin: 0 0 .8rem;
  display: grid;
  gap: .45rem;
}
ol.quiz-choices > li {
  counter-increment: qc;
  position: relative;
  padding: .55rem .8rem .55rem 2.3rem;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  font-size: .95em;
}
ol.quiz-choices > li::before {
  content: counter(qc, decimal-leading-zero);
  position: absolute;
  left: .75rem;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: .82em;
}
details.quiz-answer summary {
  cursor: pointer;
  display: inline-block;
  color: var(--brand-ink);
  font-weight: 700;
  font-size: .88rem;
  list-style: none;
}
details.quiz-answer summary::-webkit-details-marker { display: none; }
details.quiz-answer summary::before {
  content: "▸ ";
}
details.quiz-answer[open] summary::before {
  content: "▾ ";
}
details.quiz-answer[open] summary { margin-bottom: .5rem; }
details.quiz-answer .quiz-a {
  padding: .7rem .9rem;
  border-left: 3px solid var(--brand);
  background: var(--brand-soft);
  border-radius: 0 7px 7px 0;
  font-size: .92rem;
  line-height: 1.6;
}
details.quiz-answer .quiz-a b { color: var(--ink); }

/* 표 — 설문 질문표·응답 예시·설정값표처럼 행·열이 뚜렷한 자료용 */
.tbl-wrap { margin: .9rem 0; overflow-x: auto; }
table.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: .92rem;
}
table.tbl th,
table.tbl td {
  padding: .55rem .75rem;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
table.tbl th {
  background: var(--paper-2);
  font-weight: 700;
  color: var(--ink-2);
  white-space: nowrap;
}
table.tbl tbody tr:nth-child(even) td { background: var(--paper-2); }


/* 좁은 화면(모바일)에서는 원래 읽기용 레이아웃으로 되돌림 */
@media (max-width: 46rem) {
  body.lecture-mode {
    --pad: 1.15rem;
    --maxw: none;
    font-size: 17px;
  }
}


/* ── 인쇄 (수업용 와이드 레이아웃 보정) ─────────────────────
   body.lecture-mode 의 화면 비례 글자 크기(vw)와 넓은 폭은 종이에서 어색하므로
   인쇄에서는 되돌립니다. 종이에서는 필요 없는 부분(내려받기, 퀴즈 정답 버튼)을 숨기고
   코드·표·그림이 쪽 사이에서 잘리지 않게 합니다. */
@media print {
  body.lecture-mode {
    --maxw: none;
    --pad: 0;
    font-size: 11pt;
    line-height: 1.55;
  }
  body.lecture-mode .page-head h1 { font-size: 20pt; }
  body.lecture-mode h2 { font-size: 14pt; break-after: avoid; }
  body.lecture-mode h3 { font-size: 12pt; break-after: avoid; }
  body.lecture-mode figure.capture img { max-width: 100%; }

  /* 종이에서는 의미 없는 것 */
  #download, .dl { display: none; }
  details.quiz-answer { display: none; }
  .capture-guide { border-style: dashed; }

  /* 쪽 나눔 */
  pre.code-block { white-space: pre-wrap; break-inside: avoid; }
  .tbl-wrap, table.tbl, .quiz-item { break-inside: avoid; }
  table.tbl th, table.tbl td { padding: .3rem .5rem; }
  body.lecture-mode ul.bullets > li::before { background: #000; }
}

/* 한두 쪽에 담아 나눠 줄 자료(개념 지도 등)는 글자를 줄여 인쇄 */
@media print {
  body.lecture-mode.print-compact { font-size: 9.5pt; line-height: 1.4; }
  body.print-compact .page-head h1 { font-size: 16pt; }
  body.print-compact h2 { font-size: 11.5pt; }
  body.print-compact .sec { margin-top: .5rem; padding-top: .5rem; }
  body.print-compact table.tbl th, body.print-compact table.tbl td { padding: .2rem .4rem; }
  body.print-compact .note { margin: .5rem 0; padding: .45rem .7rem; }
}
