/*
 * Print stylesheet.
 *
 * Two jobs:
 *   1. QR sign sheets that volunteers cut out and tape beside each artwork. These have to
 *      come out of a normal office printer, on plain letter paper, with the QR big enough
 *      to scan from arm's length and the artwork code readable without glasses.
 *   2. The final results report, which goes in front of a board.
 *
 * Deliberately no PDF library — see ADR-007. Print-to-PDF from the browser produces a
 * better result than a hand-rolled PDF and costs nothing to maintain.
 */

@media print {
  @page {
    size: letter portrait;
    margin: 0.5in;
  }

  :root {
    --ink: #000;
    --ink-soft: #222;
    --line: #999;
  }

  body {
    background: #fff !important;
    color: #000 !important;
    font-size: 11pt;
  }

  /* Chrome and Edge drop background colors by default; the sign layout relies on borders
     rather than fills so it survives either way. */
  .site-header,
  .site-footer,
  .site-nav,
  .admin__sidebar,
  .admin__topbar,
  .no-print,
  .btn,
  .pager,
  form.no-print {
    display: none !important;
  }

  .admin { display: block !important; }
  .admin__content { padding: 0 !important; }
  main { padding: 0 !important; }
  .shell { max-width: none; padding: 0 !important; }

  .card, .artwork {
    border: 1px solid #999 !important;
    box-shadow: none !important;
    break-inside: avoid;
  }

  a { color: #000 !important; text-decoration: none; }
  /* Expand real links so a printed report is still followable. Skip in-page anchors and
     the QR sheet, where the URL is already under the code. */
  .print-expand-links a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 9pt;
    color: #444;
  }

  table.data { font-size: 10pt; }
  table.data thead { display: table-header-group; }
  table.data thead th { position: static !important; background: #eee !important; }
  table.data tr { break-inside: avoid; }

  /* ----------------------------------------------------------- QR sign sheets -- */
  .sign-sheet {
    display: grid;
    /* Two per page, each roughly half a letter page. Big enough that the QR is ~2.4in
       square, which scans reliably from about three feet. */
    grid-template-columns: 1fr;
    gap: 0;
  }

  .sign {
    break-inside: avoid;
    break-after: page;
    border: 2px solid #000;
    border-radius: 6pt;
    padding: 0.35in;
    text-align: center;
    height: 9.4in;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
  }
  .sign:last-child { break-after: auto; }

  .sign--two-up {
    height: 4.55in;
    break-after: auto;
    margin-bottom: 0.2in;
  }
  .sign--two-up .sign__qr img { width: 2.1in; height: 2.1in; }
  .sign--two-up .sign__title { font-size: 14pt; }

  .sign__org {
    font-size: 12pt;
    font-weight: 700;
    letter-spacing: .02em;
    text-transform: uppercase;
  }
  .sign__event { font-size: 10pt; color: #333; margin-bottom: .1in; }

  .sign__number {
    font-family: ui-monospace, Consolas, monospace;
    font-size: 26pt;
    font-weight: 700;
    line-height: 1;
  }
  .sign__title { font-size: 17pt; font-weight: 700; margin: .06in 0 .02in; line-height: 1.2; }
  .sign__artist { font-size: 13pt; }

  .sign__qr { margin: .12in 0; }
  .sign__qr img { width: 3in; height: 3in; margin: 0 auto; }

  .sign__scan { font-size: 14pt; font-weight: 700; }

  .sign__code {
    font-family: ui-monospace, Consolas, monospace;
    font-size: 15pt;
    font-weight: 700;
    letter-spacing: .06em;
    border: 1px solid #000;
    border-radius: 4pt;
    padding: .05in .15in;
    display: inline-block;
    margin-top: .06in;
  }

  .sign__url { font-size: 9pt; color: #333; word-break: break-all; margin-top: .04in; }

  /* The one thing a visitor most needs to know, and the reason the vote is a button
     press rather than a page load. */
  .sign__reassurance {
    font-size: 10pt;
    font-style: italic;
    margin-top: .08in;
    border-top: 1px solid #999;
    padding-top: .06in;
  }

  /* ------------------------------------------------------------ results report -- */
  .report-header { border-bottom: 3px solid #000; padding-bottom: .1in; margin-bottom: .15in; }
  .report-header h1 { font-size: 18pt; margin: 0; }
  .report-meta { font-size: 10pt; color: #333; }
  .report-footer {
    margin-top: .2in;
    padding-top: .08in;
    border-top: 1px solid #999;
    font-size: 9pt;
    color: #333;
  }

  .status {
    border: 1px solid #666 !important;
    background: none !important;
    color: #000 !important;
  }
}
