/* raizelo — printed verification receipt (Task 11).
   Loaded only for print media (see the media="print" link in App.razor), so nothing here
   needs its own @media print guard to stay off-screen — the guards below are kept anyway
   because that is the literal spec text for this task, and because a few rules (the
   hidden-page-content list) read clearer as an explicit block. */

/* A4 with generous margins: the sheet count follows the data, so nothing is clipped.
   The artboard fixed two sheets with overflow:hidden, which was derived from the
   one-proof case — with two proofs, or a non-empty merkle proof, that silently destroys
   evidence on a document that exists to be evidence. */
@page {
  size: A4;
  margin: 14mm 12mm;
}

@media print {
  /* Everything but the receipt disappears, including the estimate line: the screen page
     is printable and routing cannot stop someone pressing Ctrl+P on it. */
  body > *:not([data-print-receipt]):not(.home):not(.policy):not(.site-footer),
  .result,
  .localhash,
  .check,
  [data-estimated-anchor] {
    display: none !important;
  }

  [data-print-receipt] { display: block; }
  body:has(> [data-print-receipt]) > .site-footer { display: none !important; }

  /* The homepage has no receipt to swap in, so the blanket rule above printed a blank
     sheet on it — that rule was written for a page that HAS one, and Ctrl+P is just as
     reachable here. `.home` and `.policy` are only ever the <main> of Home.razor and
     Privacy.razor, so these exclusions cannot change a single thing about what the
     verification page prints.

     EVERY NEW PAGE ROOT HAS TO BE ADDED HERE, or that page prints blank and nothing says
     so. PrintStylesheet_DoesNotBlankTheOtherPages names the roots it knows about; it
     cannot know about one that does not exist yet.

     What survives is what the page SAYS; every control is dropped, because a drop zone,
     a live counter and a submit button have no function on paper. The footer stays: it
     carries the chain id and the contract address, which is exactly what a sheet handed
     to someone else needs. */
  .checkbox { display: none !important; }
  .language-switcher { display: none !important; }

  /* A política é o documento deste site que mais chance tem de ir para o papel — é a
     folha que alguém arquiva ou leva ao jurídico. O índice sai: âncoras não clicam
     impressas, e a numeração das seções já é o índice no papel. */
  .policy__index,
  .policy__topbar,
  .policy__contents,
  .policy__brand { display: none !important; }

  .policy { max-width: none; padding: 0; color: #1F1710; font-family: var(--sans); }
  .policy__layout { display: block; margin-top: 0; }
  .policy__head { position: static; }
  .policy__reading { max-width: none; }
  .policy__title { font-size: 17pt; }
  .policy__h2 { font-size: 12pt; break-after: avoid; page-break-after: avoid; }
  .policy__h3 { font-size: 10.5pt; break-after: avoid; page-break-after: avoid; }
  .policy__text p, .policy__text li { font-size: 9.5pt; }
  .policy__card { break-inside: avoid; page-break-inside: avoid; }
  .policy__card-number { background: none; color: #1F1710; border: 1px solid #1F1710; }

  /* Sem rolagem no papel: a tabela inteira tem de caber ou quebrar, nunca sumir. */
  .policy__tablewrap { overflow: visible; }
  .policy__table { min-width: 0; font-size: 8.5pt; }

  .home {
    max-width: none;
    padding: 0;
    color: #1F1710;
    font-family: var(--sans);
  }

  /* One column on paper, always: the two-column hero is a screen affordance, and a
     sheet has no second column to put an aside in. */
  .home__grid { display: block; }
  .home__intro, .home__aside { display: block; }
  .home__aside { margin-top: 12pt; }

  /* The contact link is an action, and paper has no actions. The mark stays: a printed
     page that does not say who issued it is worth less than one that does. */
  .home__contact { display: none; }
  .home__bar { padding: 0 0 10pt; }
  .home__brand img { width: 90pt; }

  .home__headline { font-size: 15pt; }
  .home__lead { font-size: 10pt; }
  .home__eyebrow { font-size: 7.5pt; }
  .home__eyebrow-rule { display: none; }

  /* Border and bold, not a fill: the same reasoning as .receipt__network above. "Não é
     definitivo" must not be the claim that drops out when a browser declines to print
     backgrounds. */
  .home__band {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    border: 1.5pt solid #000;
    padding: 6pt 8pt;
    font-weight: 700;
    background: none;
    color: #1F1710;
  }

  /* The band is a flex row of a marker and a text block now, so the weight and colour
     above no longer land on the sentence itself. The marker goes: a filled amber square
     is exactly the ink a printer is allowed to drop. */
  .home__band-mark { display: none; }
  .home__band-text p { font-weight: 700; color: #1F1710; }
  .home__band-text a { font-size: 8.5pt; border: 0; }

  /* A form is an action, and paper has no actions. The address survives, because it is
     the one part of this card that still works once printed. */
  .contact__form, .contact__note { display: none; }
  .contact { border: 0; padding: 0; margin-top: 10pt; }
  .contact__title { font-size: 11pt; }
  .contact__lead { font-size: 9pt; }

  .home__how { break-inside: avoid; page-break-inside: avoid; }
  .home__how-title { font-size: 10pt; }
  .home__step-text { font-size: 10pt; }

  /* One column on paper regardless of the sheet, and the chip drops its fill: a
     printer that declines backgrounds would otherwise hand the reader deep-brown ink on
     deep-brown ink, which is how an ordinal becomes a blank square. Border and dark
     text survive that. */
  .home__steps { display: block; }
  .home__step { display: flex; flex-direction: row; gap: 6pt; margin-bottom: 5pt; }
  .home__step-number {
    padding: 1pt 3pt;
    color: #1F1710;
    background: none;
    border: 0.75pt solid #1F1710;
    font-size: 8pt;
  }

  /* No copy button on paper, and a contract address must arrive whole. */
  .site-footer__value {
    font-family: var(--mono);
    font-size: 8pt;
    word-break: break-all;
  }

  /* The only mechanism that repeats a header on every sheet. */
  .receipt__sheet thead { display: table-header-group; }
  .receipt__sheet tfoot { display: table-footer-group; }

  /* One proof per sheet, and never a block split across the fold. */
  .receipt__sheet { break-after: page; page-break-after: always; }
  .receipt__sheet:last-child { break-after: auto; page-break-after: auto; }
  .receipt__cmd,
  .receipt__hash,
  .receipt__network { break-inside: avoid; page-break-inside: avoid; }

  /* Full value, wrapped rather than truncated: on paper there is no copy button. */
  .receipt__hash {
    font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
    word-break: break-all;
    font-size: 9.5pt;
  }

  /* -webkit- FIRST: Chrome only shipped the unprefixed property in 136, while Safari has
     had it since 15.4. Without it, browsers drop backgrounds when printing and the
     network warning loses its band. The band itself is drawn with a solid black border
     and bold text rather than as a background image or gradient, so — unlike the
     ceremonial seal, which is decorative and allowed to vanish on paper — the testnet
     warning does not actually depend on print-color-adjust being honoured at all. It is
     declared here as belt-and-suspenders only, in case a later change adds a fill. */
  .receipt__network {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    border: 1.5pt solid #000;
    padding: 6pt 8pt;
    font-weight: 700;
  }
}

/* ------------------------------------------------------------------------------------
   Typography and layout, read from artboard 2a's inline styles (the ink colours, the
   dotted row dividers, the mono label treatment, the command-box background). Sizes are
   the artboard's px values converted to pt at the standard 96px/72pt ratio (px * .75) —
   a straight numeric copy would render a third larger on paper than the artboard shows
   on screen, which is not fidelity, it is a new, invented size.
   The artboard drew two different header layouts (a bigger one for sheet 1, a compact
   "continuação" recap for sheet 2) because it assumed exactly two sheets. This receipt
   cannot assume that, so every repeated header uses the fuller layout — see the comment
   in PrintReceipt.razor for why a single reusable <thead> cannot tell first from Nth.
   ------------------------------------------------------------------------------------ */
@media print {
  .receipt {
    color: #1F1710;
    font-family: var(--sans);
  }

  .receipt__sheet {
    width: 100%;
    border-collapse: collapse;
  }

  .receipt__sheet thead th {
    text-align: left;
    padding: 0 0 12pt;
    border-bottom: 1.5pt solid var(--coffee);
  }

  .receipt__brandline {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20pt;
  }

  /* The text block beside the wordmark: title over the query timestamp, both right of
     the logo — the only child that is a <div> (the wordmark is an <img>). */
  .receipt__brandline > div {
    display: flex;
    flex-direction: column;
    gap: 3pt;
    text-align: right;
  }

  .receipt__title {
    font-size: 11pt;
    font-weight: 600;
    color: #1F1710;
  }

  .receipt__queried {
    font-family: var(--mono);
    font-size: 8pt;
    color: #4A4034;
  }

  .receipt__network {
    margin-top: 10pt;
    font-size: 9.5pt;
    line-height: 1.5;
  }

  .receipt__headline {
    margin: 14pt 0 4pt;
    font-size: 22pt;
    font-weight: 600;
    letter-spacing: -.02em;
    color: #1F1710;
  }

  .receipt__sheet tbody td[colspan] {
    padding: 8pt 0;
  }

  /* One dotted-row fact table, the same treatment as .proof__facts on screen. Scoped to
     rows that are NOT the free-text blocks (headline, how-to-check, disclaimer), which
     carry colspan="2" and read as prose, not as a label/value pair. */
  .receipt__sheet tbody th,
  .receipt__sheet tbody td:not([colspan]) {
    border-top: .75pt dotted rgba(31, 23, 16, .4);
    padding: 7pt 0;
    vertical-align: top;
    font-size: 9.5pt;
  }

  .receipt__sheet tbody th {
    width: 30mm;
    padding-right: 10pt;
    font-family: var(--mono);
    font-size: 8pt;
    font-weight: 400;
    letter-spacing: .08em;
    text-transform: uppercase;
    text-align: left;
    color: #4A4034;
  }

  .receipt__sheet h2 {
    margin: 0 0 8pt;
    padding-bottom: 6pt;
    font-family: var(--mono);
    font-size: 8pt;
    font-weight: 500;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: #4A4034;
    border-bottom: .75pt solid #1F1710;
  }

  .receipt__cmd {
    margin: 0 0 6pt;
    font-family: var(--mono);
    font-size: 9pt;
    color: #1F1710;
    background: #F1EDE6;
    border: .75pt solid rgba(31, 23, 16, .3);
    padding: 6pt 8pt;
    white-space: pre-wrap;
    word-break: break-all;
  }

  .receipt__note {
    margin: 0 0 10pt;
    font-size: 9pt;
    line-height: 1.5;
    color: #2E2620;
  }

  .receipt__disclaimer {
    margin: 0;
    font-size: 8.5pt;
    line-height: 1.55;
    color: #2E2620;
  }
}
