/* Print rules.
 *
 * SKELETON, not a receipt layout. The actual receipt cannot be designed yet:
 * which fields it carries is a question for the doctor, and the paper size
 * and feed depend on the clinic's receipt printer, which is an open spike in
 * the stage 1 plan. Guessing at it now would produce a layout that has to be
 * thrown away.
 *
 * What is settled, and what this file is for: the screen is full of controls
 * that must never reach paper, and working that out again in the middle of
 * building the receipt is wasted effort. So the chrome is turned off here,
 * the shell is flattened to a single column, and the page is given margins.
 * Stage 1 then only has to lay out the receipt itself. */

@media print {
  /* Interface, not content: navigation, data entry, and anything clickable. */
  .sidebar,
  .topbar,
  form,
  .action-group,
  button,
  .no-print {
    display: none !important;
  }

  /* A hidden view must stay hidden -- printing is not a reason to reveal
     every screen at once. */
  [hidden] {
    display: none !important;
  }

  /* The two-column shell collapses; the content cap comes off so the paper
     width is the only constraint. */
  .app {
    display: block;
  }

  .content {
    max-width: none;
    padding: 0;
  }

  body {
    background: #fff;
  }

  /* On screen a card is a raised white panel against grey. On paper the grey
     is gone, so the border and shadow are describing a distinction that no
     longer exists -- and the shadow costs toner for nothing. */
  .card {
    border: none;
    box-shadow: none;
    padding: 0;
  }

  .card + .card {
    margin-top: var(--space-6);
  }

  /* Keep a row from being split down the middle across a page break --
     matters for a statement or a day sheet, which are the first things
     anyone will actually print.
     Repeating the header on each page is NOT set here: display:
     table-header-group is already thead's initial value, so the usual
     incantation for it is a no-op. Measured, not assumed. */
  tr {
    break-inside: avoid;
  }

  /* 健保申報頁的「和北昕比對」只印比對結果，不印整頁申報資料。 */
  .printing-claim-compare #view-nhi-claims > :not(#claim-compare-card) {
    display: none !important;
  }

  @page {
    margin: 12mm;
  }
}
