/* Reports: the app's only printed documents, deliberately left out of the
   daisyUI rewrite and of the Tailwind entry point. A board report is read on
   paper, round a table, so the rules below are written against what browsers
   actually do when printing rather than against what the screen looks like.
   On screen they draw from the active daisyUI theme's variables.

   Three rules are load-bearing, and each one fails quietly if forgotten:

   1. Background colours do not print. Chrome's print dialog has "Background
      graphics" off by default, so anything highlighted with a tint simply is
      not there on paper. Emphasis here is borders and weight only -- which is
      why a ready applicant's name is boxed rather than shaded.
   2. A dark theme would print near-white text onto white paper. The theme
      variables are re-answered below for print so the document is black on
      white whatever the reader had on screen.
   3. `page-break-inside` on each record keeps an applicant whole. Without it
      a name lands at the foot of one page and their address at the head of
      the next.

   Not achievable, and deliberately not attempted: "Page 1 of 2". Paged-media
   margin boxes and counter(pages) are unsupported in these browsers; the
   browser's own footer supplies page numbers, along with the URL and date. */

/* The report's own text hierarchy.

   These four were Tailwind utilities until the daisyUI conversion finished and
   the `@theme inline` bridge that defined them was deleted. The reports were
   deliberately left unconverted, so the deletion took their hierarchy with it
   and left the class names behind doing nothing: heading, muted and faint all
   printed as the same solid black, on the one document in the app that exists
   to be read on paper.

   Defined here rather than back in the theme so the reports keep their stated
   independence from it. The print block below re-answers --color-base-content
   as black, so these resolve to greys of that on paper and to the active
   theme's ink on screen. */
.text-ink {
  color: var(--color-base-content);
}

.text-ink-muted {
  color: color-mix(in oklab, var(--color-base-content) 72%, transparent);
}

.text-ink-subtle {
  color: color-mix(in oklab, var(--color-base-content) 58%, transparent);
}

.text-ink-faint {
  color: color-mix(in oklab, var(--color-base-content) 45%, transparent);
}

.report-sheet {
  border-collapse: collapse;
}

.report-sheet .legend th {
  text-align: left;
  padding: 0.15rem 0.5rem;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: color-mix(in oklab, var(--color-base-content) 64%, transparent);
}

.report-sheet thead tr.legend:last-child th {
  border-bottom: 1px solid color-mix(in oklab, var(--color-base-content) 20%, transparent);
  padding-bottom: 0.4rem;
}

.report-sheet .group th {
  text-align: left;
  padding: 1.1rem 0.5rem 0.3rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-bottom: 1px solid color-mix(in oklab, var(--color-base-content) 20%, transparent);
}

.report-sheet .notice td {
  padding: 0.5rem;
  font-size: 0.8rem;
  border-bottom: 1px solid color-mix(in oklab, var(--color-base-content) 7%, transparent);
}

.report-sheet .notice ul {
  margin-top: 0.15rem;
  list-style: disc;
  padding-left: 1.1rem;
}

/* One record. Kept whole across a page break, and separated from the next by
   a rule rather than by space alone -- space disappears at the foot of a page
   and the two records read as one. */
.report-sheet .record {
  page-break-inside: avoid;
  break-inside: avoid;
}

.report-sheet .record td {
  padding: 0.35rem 0.5rem;
  vertical-align: top;
}

.report-sheet .record > tr:first-child td {
  padding-top: 0.7rem;
}

.report-sheet .record > tr:last-child td {
  padding-bottom: 0.7rem;
  border-bottom: 1px solid color-mix(in oklab, var(--color-base-content) 12%, transparent);
}

.report-sheet .record .secondary td,
.report-sheet .record .commentary td {
  color: color-mix(in oklab, var(--color-base-content) 75%, transparent);
  font-size: 0.8rem;
}

.report-sheet .record .name {
  display: inline-block;
  font-size: 1.05rem;
  font-weight: 600;
}

/* The highlight. A border, never a fill -- see rule 1 above. */
.report-sheet .record.ready .name {
  border: 1.5px solid var(--color-base-content);
  padding: 0.1rem 0.45rem;
}

.report-sheet .record .blockers td {
  font-size: 0.8rem;
  padding-top: 0.15rem;
}

.report-sheet .record .commentary .on {
  display: inline-block;
  min-width: 6.5rem;
  color: color-mix(in oklab, var(--color-base-content) 64%, transparent);
  font-variant-numeric: tabular-nums;
}

@media print {
  @page {
    size: Letter portrait;
    margin: 0.6in;
  }

  /* Rule 2. Both :root and every data-theme, because the dark themes answer
     from [data-theme="..."] selectors and these unlayered declarations must
     outrank all of them whatever the reader had on screen. */
  :root,
  [data-theme] {
    --color-base-100: #ffffff;
    --color-base-200: #ffffff;
    --color-base-300: #f0f0f0;
    --color-base-content: #000000;

    color-scheme: light;
  }

  body {
    background: #ffffff;
  }

  /* A printed page is not a hypertext: the link target is noise, and the blue
     is a colour cartridge spent on nothing. */
  .report a {
    color: inherit;
    text-decoration: none;
  }

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

  .report-sheet thead {
    display: table-header-group;
  }
}
