/* Print view — strips the wiki chrome so a page comes out of the printer as a
   standalone document. Written for the association paperwork, which has to be
   printed, signed and filed with the court, but applies to every page. */

/* --- Screen: the button that opens the browser print dialog --- */

.page-actions {
  display: flex;
  justify-content: flex-end;
  margin-bottom: -1.5rem;
}

.print-button {
  background: none;
  border: 1px solid #d5d8dc;
  border-radius: 3px;
  color: #7a8288;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.8rem;
  line-height: 1;
  padding: 0.35rem 0.6rem;
}

.print-button:hover {
  background: #f4f5f6;
  border-color: #b8bdc2;
  color: #38424d;
}

.print-button .fa {
  margin-right: 0.35rem;
}

/* --- Print --- */

@media print {

  @page {
    size: A4;
    margin: 20mm 18mm;
  }

  /* Everything that is wiki, not document. */
  #top-bar,
  #sidebar,
  #sidebar-toggle,
  #breadcrumb-bar,
  #overlay,
  #navigation,
  #page-toc,
  #site-footer,
  #github-contrib,
  .page-actions,
  .searchbox,
  #searchbox {
    display: none !important;
  }

  /* Reclaim the space the sidebar and the content gutters were holding. */
  html,
  body {
    background: #fff !important;
    color: #000 !important;
    font-size: 11pt;
  }

  #body {
    margin-left: 0 !important;
  }

  .padding {
    padding: 0 !important;
  }

  #body-inner,
  #page-content {
    margin: 0 !important;
    max-width: none !important;
    padding: 0 !important;
    width: auto !important;
  }

  #page-with-toc {
    display: block !important;
  }

  /* A serif face reads better on paper and looks like what a court expects. */
  #page-content,
  #page-content p,
  #page-content li,
  #page-content td,
  #page-content th {
    font-family: "Times New Roman", Times, Georgia, serif;
    line-height: 1.45;
  }

  /* The page title is the document title; markdown h1s are section headings. */
  #page-content > h1:first-of-type {
    border: 0;
    font-size: 16pt;
    margin: 0 0 1.5rem;
    text-align: center;
    text-transform: none;
  }

  #page-content h1,
  #page-content h2,
  #page-content h3 {
    border: 0;
    color: #000;
    page-break-after: avoid;
  }

  #page-content h1 {
    font-size: 12pt;
    margin: 1.4rem 0 0.5rem;
  }

  #page-content h2 {
    font-size: 11.5pt;
    margin: 1.2rem 0 0.4rem;
  }

  #page-content h3 {
    font-size: 11pt;
    margin: 1rem 0 0.3rem;
  }

  /* Links are dead on paper — print them as ordinary text, no URL in tow. */
  #page-content a,
  #page-content a:visited {
    color: #000 !important;
    text-decoration: none !important;
  }

  #page-content a[href]::after {
    content: "" !important;
  }

  /* Signature blocks, attendance sheets and resolutions must not be split. */
  #page-content table {
    border-collapse: collapse;
    page-break-inside: avoid;
    width: 100%;
  }

  #page-content th,
  #page-content td {
    border: 1px solid #000;
    padding: 0.3rem 0.4rem;
    vertical-align: top;
  }

  #page-content thead {
    display: table-header-group;
  }

  #page-content tr {
    page-break-inside: avoid;
  }

  #page-content p,
  #page-content li {
    orphans: 2;
    widows: 2;
  }

  #page-content hr {
    border: 0;
    border-top: 1px solid #000;
    margin: 1.2rem 0;
  }

  /* Start a fresh sheet where the markdown asks for one. */
  .page-break {
    page-break-before: always;
  }
}
