/* The seal certificate. 14 Nov 2026 (the design refresh, lane D11).

   A sheet made to be printed, with a frame of its own: no site header and no footer
   (templates/seal_certificate.html). On a screen it is a sheet of paper inside one ink
   rule; printed, it is the page itself. What a program produced (the statement, a
   fingerprint, a block's hash, a command to type) is in the apparatus face and may
   break anywhere; the sentences are Pith's. Colours, sizes and widths come from
   tokens.css. */

.page-certificate {
  display: block;
}

.cert {
  max-width: var(--reading);
  margin: var(--space-6) auto;
  padding: var(--space-5) var(--margin) var(--space-6);
  border: var(--rule);
}

/* The sheet's own head: the wordmark and what the sheet is, over one ink rule. */
.cert__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
  border-bottom: var(--rule);
}

.cert__head .label {
  color: var(--apparatus);
}

.cert__title {
  font: var(--type-verdict);
  font-weight: 700;
  letter-spacing: var(--track-verdict);
}

.cert__title .ident {
  font-weight: 400;
  overflow-wrap: anywhere;
}

.cert__says {
  max-width: var(--measure);
  margin-top: var(--space-2);
}

.cert > .label {
  margin-top: var(--space-6);
  margin-bottom: var(--space-2);
}

/* Two columns: what a line is, then its value. On a phone the name sits above the
   value, so a 64-character fingerprint has the sheet's whole width. */
.cert__facts tr {
  display: block;
  padding: var(--space-3) 0;
  border-top: var(--rule-hair);
}

.cert__facts tr:last-child {
  border-bottom: var(--rule-hair);
}

.cert__facts td {
  display: block;
  padding: 0;
  border: 0;
}

.cert__facts td:first-child {
  margin-bottom: var(--space-1);
  font: var(--type-small);
  color: var(--ink-2);
}

/* A program's value: the mono, a line of its own size, breaking anywhere. */
.cert__value {
  font: var(--type-line);
  overflow-wrap: anywhere;
  word-break: break-all;
}

.cert__steps {
  padding-inline-start: var(--space-5);
  list-style: decimal;
}

.cert__steps li + li {
  margin-top: var(--space-2);
}

.cert__foot {
  max-width: var(--measure);
  margin-top: var(--space-6);
  font: var(--type-small);
  color: var(--ink-2);
}

.cert__print {
  max-width: var(--reading);
  margin: 0 auto var(--space-6);
  text-align: end;
}

@media (min-width: 720px) {
  .cert {
    padding: var(--space-7) var(--space-7) var(--space-7);
  }

  .cert__facts {
    display: table;
    table-layout: fixed;
  }

  .cert__facts tr {
    display: table-row;
    padding: 0;
    border: 0;
  }

  .cert__facts td {
    display: table-cell;
    padding: var(--space-3) 0;
    border-top: var(--rule-hair);
  }

  .cert__facts tr:last-child td {
    border-bottom: var(--rule-hair);
  }

  .cert__facts td:first-child {
    width: 30%;
    margin: 0;
    padding-inline-end: var(--space-4);
  }
}

/* Printed: the sheet is the page, with a margin a hand can hold. No rule round it and
   no button. The rows print in two columns whatever width the browser gives a printed
   page, the name's column narrow, so a 64-character fingerprint prints on one line,
   where it can be compared by eye; for that the values take the smallest step. The
   type steps down one step and the rows close up, so a seal with a file or two is one
   sheet at Letter and at A4. No row, step or closing line is split across two pages. */
@page {
  margin: 12mm;
}

@media print {
  .page-certificate {
    font: var(--type-small);
  }

  .cert {
    max-width: none;
    margin: 0;
    padding: 0;
    border: 0;
  }

  .cert__head {
    margin-bottom: var(--space-3);
    padding-bottom: var(--space-2);
  }

  /* On paper the wordmark is not a target and does not need a target's height. */
  .cert__head .wordmark {
    min-height: 0;
  }

  .cert > .label {
    margin-top: var(--space-4);
    margin-bottom: var(--space-1);
    break-after: avoid;
  }

  .cert__facts {
    display: table;
    table-layout: fixed;
  }

  .cert__facts tr {
    display: table-row;
    padding: 0;
    border: 0;
    break-inside: avoid;
  }

  .cert__facts td {
    display: table-cell;
    padding: var(--space-2) 0;
    border-top: var(--rule-hair);
  }

  .cert__facts tr:last-child td {
    border-bottom: var(--rule-hair);
  }

  .cert__facts td:first-child {
    width: 22%;
    margin: 0;
    padding-inline-end: var(--space-3);
  }

  /* A value breaks at a space before it breaks inside a fingerprint. */
  .cert__value {
    font-size: var(--size-label);
    word-break: normal;
  }

  .cert__steps li + li {
    margin-top: var(--space-1);
  }

  .cert__steps li,
  .cert__foot {
    break-inside: avoid;
  }

  .cert__foot {
    margin-top: var(--space-4);
  }

  .cert__print {
    display: none;
  }
}
