/* 급수 시험 대비 지면(/exam/) — tool/build_exam_pages.py 가 굽는 지면의 공용 모양.
   색은 소개 지면(assets/styles.css)과 같은 값을 쓴다. 인쇄는 A4 세로, 한 장에 4열. */
:root {
  --canvas: #fdfaf5;
  --surface: #ffffff;
  --surface-sunken: #f5eee4;
  --border-subtle: #e8dece;
  --border-strong: #c4b39c;
  --ink: #2e2621;
  --ink-muted: #6f6152;
  --brand: #6c3fe0;
  --brand-container: #efe8ff;
  --brand-strong: #3f2299;
  --hanja: "Noto Serif KR", "Noto Serif CJK KR", "Source Han Serif K", "AppleMyungjo", "Batang", serif;
}
* { box-sizing: border-box; }
body.ex {
  margin: 0 auto;
  max-width: 960px;
  padding: 16px;
  background: var(--canvas);
  color: var(--ink);
  font-family: "Pretendard", -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  font-size: 16px;
  line-height: 1.6;
}
a { color: var(--brand-strong); }
h1 { font-size: 28px; margin: 4px 0 8px; }
h2 { font-size: 20px; margin: 0 0 8px; }
h2 small, h3 small { font-weight: 400; color: var(--ink-muted); font-size: 14px; }
h3 { font-size: 17px; margin: 16px 0 8px; }
.ex-home { font-size: 14px; text-decoration: none; }
.ex-lead { margin: 0 0 8px; }
.ex-affil, .ex-small { font-size: 14px; color: var(--ink-muted); }
.ex-sec, .ex-cta, .ex-notice, .ex-levels {
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 16px;
  margin: 16px 0;
}
.ex-facts { padding-left: 20px; margin: 0 0 8px; }
.ex-table { border-collapse: collapse; margin: 8px 0; }
.ex-table th, .ex-table td { border: 1px solid var(--border-subtle); padding: 4px 12px; text-align: left; }
.ex-table td:last-child { text-align: right; }
.ex-list { padding-left: 20px; }
.ex-list small { color: var(--ink-muted); }
.ex-cta { background: var(--brand-container); border-color: transparent; }
.ex-btn {
  display: inline-block;
  min-height: 44px;
  padding: 10px 18px;
  border: 0;
  border-radius: 12px;
  background: var(--brand);
  color: #fff;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.ex-btn--sub { background: var(--surface); color: var(--brand-strong); border: 1px solid var(--border-strong); }
.ex-levels p { margin: 4px 0; }
.ex-levels span { display: inline-block; min-width: 88px; font-weight: 700; }
.ex-notice { font-size: 13px; color: var(--ink-muted); }
.ex-notice h2 { font-size: 15px; color: var(--ink); }

/* 학습지 칸 */
.ws-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.ws-cell { border: 1px solid var(--border-strong); border-radius: 8px; padding: 6px; background: var(--surface); break-inside: avoid; }
.ws-top { display: flex; align-items: center; gap: 8px; }
.ws-ch { font-family: var(--hanja); font-size: 44px; line-height: 1.1; min-width: 52px; text-align: center; }
.ws-he { display: flex; flex-direction: column; line-height: 1.3; }
.ws-he small { color: var(--ink-muted); font-size: 12px; }
.ws-trace { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; margin-top: 4px; }
.ws-trace span {
  position: relative;
  min-width: 0;
  aspect-ratio: 1;
  border: 1px solid var(--border-strong);
  display: flex; align-items: center; justify-content: center;
}
/* 칸 가운데 십자 점선(쓰기 칸) */
.ws-trace span::before, .ws-trace span::after { content: ""; position: absolute; pointer-events: none; }
.ws-trace span::before { left: 50%; top: 0; bottom: 0; border-left: 1px dashed var(--border-subtle); }
.ws-trace span::after { top: 50%; left: 0; right: 0; border-top: 1px dashed var(--border-subtle); }
.ws-ghost { font-family: var(--hanja); font-size: 30px; line-height: 1; overflow: hidden; color: #cfc5b8; }
.ws-foot { font-size: 12px; color: var(--ink-muted); }

@media print {
  @page { size: A4 portrait; margin: 10mm; }
  body.ex { max-width: none; padding: 0; background: #fff; font-size: 11pt; }
  .ex-head, main > .ex-sec:not(.ex-sheet), .ex-cta, .ex-levels, .ex-noprint { display: none; }
  .ex-sheet, .ex-notice { border: 0; padding: 0; margin: 0; }
  .ex-sheet h2 { font-size: 14pt; }
  .ws-grid { grid-template-columns: repeat(4, 1fr); gap: 3mm; }
  .ws-cell { border-color: #999; }
  .ws-trace span { border-color: #999; }
  .ws-trace span::before, .ws-trace span::after { border-color: #ccc; }
  .ws-ghost { color: #c8c8c8; font-size: 22pt; }
  body.print-new-only #ws-old { display: none; }
  .ws-sec + .ws-sec { break-before: page; }
  a { color: inherit; text-decoration: none; }
}
