/*
 * The print sheet (32 § Print, 61 §8, ruled plain CSS in 71 §6).
 *
 * Deliberately hand-written rather than Tailwind utilities. Tailwind is a
 * SCREEN vocabulary; a print sheet wants points, page breaks and @page margins,
 * and expressing those through utilities would be a translation nobody could
 * read six months from now.
 *
 * This stylesheet handles PRESENTATION ONLY. Every omission that matters —
 * the precise-detail text, a restricted location label — is absent from the
 * TEMPLATE, not hidden here. A stylesheet does not travel with a sheet that
 * leaves the building, and Ctrl+U does not consult it.
 */

/* Landscape, as the client's own Grid is: their layout PDF is US Letter on its
 * side (2026-10-23). Orientation only, no paper name — A4 here forced the wrong
 * sheet on a Letter printer; the reader's default paper is the right one.
 * Chromium, Edge and Firefox preset the dialogue from this; Safari ignores
 * `@page size` and the reader turns the page by hand. Not `page-orientation`,
 * which rotates content inside a page rather than turning the page. */
@page {
  size: landscape;
  margin: 12mm;
}

/* Spacing is tight on purpose (2026-10-23): one sample per sheet means one
 * landscape PAGE, and the vertical room is what runs out first. Line height
 * and cell padding were trimmed rather than the type, which stays at 10pt. */
.print-sheet {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 10pt;
  line-height: 1.2;
  color: #000;
}

.print-sheet h1 {
  font-size: 16pt;
  font-weight: 700;
  margin: 0;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
}

/* The same three columns as the grid below it: number, Bates No. and stamp across
   the first two, the representative photo and the media total in the third. The
   header owns the gap to the grid, so it is the same whether or not a Bates No.
   line is present. */
.print-sheet .sheet-head {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3pt;
  margin-bottom: 6pt;
}

.print-sheet .sheet-identity { grid-column: span 2; }

.print-sheet .bates {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 9pt;
  margin: 1pt 0 0;
}

.print-sheet .grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3pt;
}

.print-sheet .cell {
  border: 0.75pt solid #666;
  border-radius: 3pt;
  padding: 2.5pt 5pt 3pt;
  /* One sample per sheet, and never a cell torn in half by a page break. */
  break-inside: avoid;
  page-break-inside: avoid;
}

.print-sheet .cell h2 {
  font-size: 7.5pt;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0 0 1pt;
}

/* On the cell itself, not a descendant: the sheet writes `class="cell span-2"`.
   The descendant form matched nothing, so 2C and 2G never spanned and every
   cell after them slid one column left (found 2026-10-23). */
.print-sheet .cell.span-2 { grid-column: span 2; }

/* The Ledger cells (pkg-13 Phase A) arrive as <dl> grids; on paper they are
 * plain aligned label–value lines. Explicit, because UA defaults would
 * indent every <dd> by 40px. The screen's Tailwind utilities never load in
 * this layout, so the semantic classes are the whole contract. */
.print-sheet dl.ledger {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0 6pt;
  margin: 0;
}
.print-sheet dl.ledger-three { grid-template-columns: max-content max-content 1fr; }
.print-sheet dl.ledger dt,
.print-sheet dl.ledger dd { margin: 0; }
.print-sheet dl.ledger .rule { grid-column: 1 / -1; border-top: 0.5pt solid #999; margin: 1.5pt 0; }

/* Tier 2, the derived text — "+3.0" beside a structure, "± 4%", an imperial size,
 * the cap line, the word before a photograph list — quiet on paper as on the
 * screen. The `derived` class is semantic, carried beside the Tailwind
 * utilities exactly as `ledger` and `rule` are: this stylesheet names no
 * utility (pkg-10 D3). Until the tier had a name here it printed at the full
 * 10pt, and the cap line alone wrapped to two lines in 1F — one of the lines
 * that put a dense sheet onto a second page (2026-11-02). */
.print-sheet .derived {
  font-size: 8pt;
  color: #333;
}

.print-sheet .sheet-stamp {
  display: flex;
  align-items: center;
  gap: 8pt;
  margin-top: 3pt;
}

.print-sheet .stamp {
  margin: 0;
  font-size: 8pt;
  color: #333;
  white-space: nowrap;
}

/* The Grid banner's photo and figure, at about its scale. Its h-24 is 72pt, which
   pushed the densest sheets onto a second page; anything above 68pt still did
   (2026-11-02), and 64pt keeps a little in hand for other browsers. The frame is
   square whatever shape the photograph is, so the header keeps one height across
   the catalogue. The partial's own utilities never load here, hence every
   property of the frame, placeholder included. */
/* The third column in two equal halves: the photo centered in the left one, the
   total in the right. */
.print-sheet .sheet-media {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  justify-items: center;
}

.print-sheet .sheet-photo {
  display: block;
  box-sizing: border-box;
  width: 64pt;
  height: 64pt;
  object-fit: contain;
  border-radius: 3pt;
}

.print-sheet div.sheet-photo {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0.75pt dashed #999;
  font-size: 8pt;
  color: #666;
}

/* Monospace, as the number is: Georgia's old-style figures made a lone 0 read as
   the letter o. */
.print-sheet .media-total {
  margin: 0;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 18pt;
  font-weight: 700;
}

/* The print button (screen only), beside the stamp. In the UI font rather than
   the sheet's serif so it reads as a control and not as content. */
.print-action {
  font: 10pt system-ui, -apple-system, "Segoe UI", sans-serif;
  padding: 3pt 9pt;
  border: 1px solid #999;
  border-radius: 4pt;
  background: #f4f4f4;
  color: #000;
  cursor: pointer;
}
.print-action:hover { background: #e8e8e8; }

/* One sample per sheet (32). */
.print-sheet { page-break-after: always; }
.print-sheet:last-child { page-break-after: auto; }

@media print {
  /* Application chrome needs no rule here: the print LAYOUT renders none,
   * which is the same absence-over-suppression choice the omission rules make.
   * A general `.no-print { display: none }` would be dead CSS pretending to be
   * a safeguard; the print button below is hidden by its own name instead.
   *
   * What does belong here is genuinely print-only presentation. Note how
   * narrow these are: an over-broad rule would silently take real content with
   * it — a blanket `details { display: none }`, written to hide screen
   * disclosure widgets, would remove the neutral site code along with them if
   * the markup ever nested differently. */
  a { text-decoration: none; color: #000; }

  /* The UA's 8px body margin, top and bottom, inside the @page margins: sixteen
   * pixels nobody asked for, and exactly the width of the one-page budget's
   * last line (found 2026-11-02 — the dense sheet laid out at 709px of 725 and
   * still printed two pages). Screen keeps it; the sheet is read there in a
   * window, not against a page edge. */
  html, body { margin: 0; padding: 0; }

  body { background: #fff; }

  /* The one screen control the sheet carries, hidden by NAME — a rule as
   * narrow as the thing it hides, which is the opposite of a blanket class. */
  .print-action { display: none; }
}
