/* soosik 인쇄용 스타일 */
/* 브라우저 인쇄(Ctrl+P) 시 적용 - PDF 저장도 동일 경로 */

@media print {
  @page {
    size: A4;
    margin: 15mm 12mm;
  }

  html, body {
    background: #fff !important;
    margin: 0;
    padding: 0;
    overflow: visible !important;
    height: auto !important;
  }

  /* UI 숨김 */
  .toolbar,
  .sidebar,
  .dropdown,
  .info-box {
    display: none !important;
  }

  .workspace {
    display: block !important;
    padding: 0 !important;
    margin: 0 !important;
    height: auto !important;
    overflow: visible !important;
  }
  .page-container {
    padding: 0 !important;
    gap: 0 !important;
    overflow: visible !important;
    background: #fff !important;
    display: block !important;
  }

  /* 페이지 자체는 box-shadow / 시각 가이드 제거, 화면 mm 그대로 사용 */
  .page {
    box-shadow: none !important;
    margin: 0 auto !important;
    padding: 0 !important;
    width: auto !important;
    min-height: auto !important;
    page-break-after: auto;
    background-image: none !important;
  }
  .page.a4 { width: 100% !important; background-image: none !important; }
  .page.b4 { width: 100% !important; background-image: none !important; }
  .page-corner { display: none !important; }

  .exam-body {
    outline: none !important;
    min-height: auto !important;
  }

  /* 2단/3단 시험지 */
  .exam-body.cols-2 {
    column-count: 2;
    column-gap: 10mm;
    column-rule: 1px solid #999;
  }
  .exam-body.cols-3 {
    column-count: 3;
    column-gap: 8mm;
    column-rule: 1px solid #999;
  }

  /* 페이지 경계에서 수식/문제가 잘리지 않게 */
  .exam-body .problem,
  .exam-body .answer-box,
  .exam-body .choices,
  .katex-display,
  .soosik-eq,
  .katex {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  /* 인쇄 시 색상 유지 (배경, 색깔 글자) */
  * {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    color-adjust: exact;
  }

  /* 수식 호버 효과 제거 */
  .soosik-eq:hover {
    background: transparent !important;
    outline: none !important;
  }

  /* 문제 번호 색은 검정으로 (잉크 절약) */
  .exam-body .problem-num { color: #000 !important; }
  .exam-body .problem-body > .score { color: #000 !important; }

  /* 헤더 라인은 진하게 */
  .exam-header { border-bottom-color: #000 !important; }
}
