/* The browser's print preview is the final, page-by-page view of the document. */
@page schedule-portrait-sheet { size: letter portrait; margin: 12mm; }
@page schedule-wide-sheet { size: A4 landscape; margin: 10mm; }

@media print {
  html, body { width: auto !important; min-width: 0 !important; }
  #printRoot { direction: rtl; }
  #printRoot .paper {
    width: 100% !important;
    box-sizing: border-box !important;
    overflow: visible !important;
    padding: 4mm !important;
    border: 1px solid #222 !important;
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
    font-size: 14px;
    line-height: 1.5;
  }
  #printRoot .paper.exam-a4 { page: exam-a4-sheet; }
  #printRoot .paper.exam-letter { page: exam-letter-sheet; }
  #printRoot .schedule-paper { page: schedule-portrait-sheet; }
  #printRoot .schedule-paper.print-wide { page: schedule-wide-sheet; }
  #printRoot .timetable-paper { page: timetable-sheet; }

  /* These are block flow elements so each question can move to the next page. */
  #printRoot .ref-questions { display: block !important; }
  #printRoot .ref-question,
  #printRoot .ref-part,
  #printRoot .ref-image,
  #printRoot .schedule-table tr,
  #printRoot .timetable-table tr,
  #printRoot .schedule-sign,
  #printRoot .timetable-sign,
  #printRoot .ref-footer {
    break-inside: avoid-page;
    page-break-inside: avoid;
  }
  #printRoot .reference-head,
  #printRoot .schedule-heading,
  #printRoot .timetable-heading,
  #printRoot .timetable-meta,
  #printRoot .ref-note { break-after: avoid-page; page-break-after: avoid; }
  #printRoot .schedule-notes { break-inside: auto; }
  #printRoot .schedule-notes strong { break-after: avoid-page; }
  #printRoot .schedule-notes div { break-inside: avoid-page; }
  #printRoot .ref-image { max-width: 100% !important; max-height: 65mm !important; height: auto !important; }
  #printRoot .ref-part { font-size: 15px; }
  #printRoot .ref-note, #printRoot .ref-footer { font-size: 14px; }

  /* A table header is repeated by print engines when a table spans pages. */
  #printRoot .schedule-table,
  #printRoot .timetable-table { width: 100% !important; min-width: 0 !important; table-layout: fixed; }
  #printRoot .schedule-table thead,
  #printRoot .timetable-table thead { display: table-header-group !important; }
  #printRoot .schedule-table tbody,
  #printRoot .timetable-table tbody { display: table-row-group !important; }
  #printRoot .schedule-table th,
  #printRoot .schedule-table td,
  #printRoot .timetable-table th,
  #printRoot .timetable-table td { overflow-wrap: anywhere; word-break: normal; vertical-align: middle; }
  #printRoot .schedule-table { font-size: 13px !important; }
  #printRoot .schedule-table th, #printRoot .schedule-table td { padding: 7px 5px !important; font-size: 13px !important; }
  #printRoot .schedule-multi th:nth-child(1), #printRoot .schedule-multi td:nth-child(1) { width: 7% !important; }
  #printRoot .schedule-multi th:nth-child(2), #printRoot .schedule-multi td:nth-child(2) { width: 19% !important; }
  #printRoot .schedule-multi th:nth-child(n+3), #printRoot .schedule-multi td:nth-child(n+3) { width: auto !important; }
  #printRoot .schedule-paper.print-wide .schedule-table th,
  #printRoot .schedule-paper.print-wide .schedule-table td { font-size: 12px !important; padding: 6px 4px !important; }
  #printRoot .timetable-scroll { overflow: visible !important; }
  #printRoot .timetable-table td { height: auto !important; padding: 8px 5px !important; font-size: 13px !important; }
  #printRoot .timetable-table td strong { font-size: 13px !important; }
  #printRoot .timetable-table td small { font-size: 11px !important; }
  #printRoot .timetable-table th { font-size: 13px !important; }
}
