/* A document on paper. The document page loads this for Ctrl+P, and the PDF export will load it too (decision 0036), so
   only document styles belong here: the app shell's print rules are in app.css. Selectors start with :root so they
   outrank app.css's rules, which share their selectors with the editor. */

@page {
  margin: 0.75in;
  size: letter;
}

:root .document-title-row {
  margin-top: 20px;
}

:root .document-title-row h1 {
  font-size: 28px;
}

:root .document-meta {
  margin: 10px 0 20px;
}

:root .document-content {
  font-size: 14px;
  line-height: 1.55;
}

:root .document-content h1 {
  font-size: 24px;
  margin: 28px 0 10px;
}

:root .document-content h2 {
  font-size: 20px;
  margin: 28px 0 10px;
  padding-bottom: 6px;
}

:root .document-content h3 {
  font-size: 16px;
  margin: 22px 0 8px;
}

:root .document-content h4 {
  font-size: 14px;
  margin: 18px 0 6px;
}

/* A heading never ends a page, and a picture, quote, code block, or table row never splits across two. */
:root .document-content :is(h1, h2, h3, h4, h5, h6) {
  break-after: avoid-page;
  break-inside: avoid;
}

:root .document-content :is(.document-image, .document-blockquote, .document-code-block, tr) {
  break-inside: avoid;
}

:root .document-content :is(p, li) {
  orphans: 3;
  widows: 3;
}

:root .document-image {
  margin: 12px 0;
  max-height: 7in;
  width: auto;
}

/* Printers drop backgrounds by default, which would print a ticked box as an empty one. */
:root .document-task-checkbox {
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

:root .document-content .document-table-wrap {
  overflow: visible;
}

:root .document-content .document-table {
  font-size: 12.5px;
}

:root .document-content .document-table :is(th, td) {
  padding: 6px 10px;
}

/* A long link or code value may break anywhere so the table fits, while words in a narrow column break only between
   words. */
:root .document-content .document-table :is(th, td) :is(a, code) {
  overflow-wrap: anywhere;
}

/* Long lines wrap instead of running off the page, which would make the browser shrink every page to fit. */
:root .document-code-block {
  overflow: visible;
}

:root pre.document-code-block code {
  white-space: pre-wrap;
  word-break: break-word;
}

:root .document-code-copy {
  display: none;
}

/* A PDF document prints only a line pointing to Export PDF (decision 0037). */
:root .pdf-print-pointer {
  font-size: 14px;
  line-height: 1.55;
  margin: 24px 0 0;
}
