/* =============================================================
   print.css — 印刷・PDF保存
   ・「印刷／PDF保存」ボタン：#print-root に複製した提出物だけを出力
   ・ブラウザのメニューから印刷：ページ全体を読みやすく出力
   ============================================================= */
@media print {
  @page { size: A4; margin: 15mm 14mm; }

  html, body { background: #fff !important; color: #000; font-size: 10.5pt; line-height: 1.6; }
  a { color: #000; }

  .site-header, .toc-wrap, .site-footer, .skip-link,
  .sec-done, .btn, .btn-row, .seg, .quiz__summary, .notice, .dd-help, .toggles,
  [data-no-print] { display: none !important; }

  .layout { display: block; padding: 0; max-width: none; }
  main { padding: 0; }
  h2 { margin-top: 12mm; break-after: avoid; }
  h3 { margin-top: 8mm; break-after: avoid; }
  .figure, .ba__panel, .q, .metric, .criteria__group, table, tr { break-inside: avoid; }
  .ba__panel[hidden] { display: block !important; }
  .exercise, .asg-sheet { border-width: 1px; }

  /* 提出物だけを印刷するモード */
  body.is-print-target > *:not(#print-root) { display: none !important; }
  #print-root { display: none; }
  body.is-print-target #print-root { display: block !important; position: static; visibility: visible; width: auto; }
}

/* 画面・印刷共通：提出物シートの体裁 */
#print-root .print-sheet { font-family: var(--font-sans); color: #000; }
#print-root .print-sheet__head { border-bottom: 2px solid #000; padding-bottom: 3mm; margin-bottom: 5mm; }
#print-root .print-sheet__head h1 { font-size: 16pt; margin: 0; }
#print-root .print-sheet__head p { margin: 1mm 0 0; font-size: 9pt; }
#print-root .print-value {
  border: 1px solid #555; padding: 2mm 3mm; min-height: 8mm;
  white-space: pre-wrap; font-size: 10pt; line-height: 1.6;
}
#print-root .print-check { display: inline-block; width: 1.2em; font-weight: 700; }
#print-root img { max-height: 85mm; width: auto; max-width: 100%; border: 1px solid #999; }
#print-root .img-drop { min-height: 0; background: none; border: 0; padding: 0; place-items: start; }
#print-root .form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4mm; margin-bottom: 4mm; }
#print-root .form-grid--1 { grid-template-columns: 1fr; }
#print-root .asg-sheet { border: 0; padding: 0; margin: 0; }
#print-root .rubric td:has(.print-check-on) { background: #e6e6e6; }
#print-root .table-wrap { overflow: visible; }
#print-root .field__hint, #print-root .field__status, #print-root input[type="file"] { display: none; }

/* エディタの印刷 */
#print-root .print-only { display: block; }
#print-root .ed__panel-label { font-weight: 700; margin: 3mm 0 1mm; }
#print-root .ed__code + *, #print-root .ed .print-value { font-family: var(--font-mono); font-size: 8pt; line-height: 1.45; white-space: pre-wrap; }
#print-root .ed__main { display: block; }
#print-root .ed__frame-wrap { border: 1px solid #555; margin-top: 4mm; }
#print-root .ed__frame { width: 100%; border: 0; height: 120mm; }
#print-root .ed__tabs { display: none; }
