/* Pith publisher pages. 3 Dec 2026.

   The page file for templates/publishers_index.html (the ledger of publishers),
   publisher_page.html (one publisher's record) and publisher_missing.html. The
   head, the field, the select, the button, the counter, the fold, the paper card
   and the scrolling table are shared parts; this file sets the number columns of
   the tables, the row of the form and the air between the parts. Colours, sizes
   and widths come from tokens.css.

   A number in a ledger is read down its column, so every number cell is set flush
   to the end of its column in figures of one width. The numbers are the content of
   these pages and are set in Pith's own face; the apparatus face is kept for DOIs. */

.page-reading .pub .page-head {
  padding-block: var(--space-6) var(--space-5);
}

.pub-state {
  padding-block: var(--space-4);
  border-block: var(--rule-hair);
}

.pub-asof {
  padding-bottom: var(--space-5);
}

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

.pub-shown {
  margin-bottom: var(--space-3);
}

.pub-break {
  overflow-wrap: anywhere;
}

/* How the count is made: said once, under the head. */
.pub-method {
  padding-block: var(--space-5);
  border-top: var(--rule-head);
}

.pub-method__more {
  margin-top: var(--space-5);
}

.pub-points > li {
  font: var(--type-small);
}

.pub-points > li + li {
  margin-top: var(--space-2);
}

/* The form: one column on a phone, one row from 720px. */
.pub-find {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-3);
  align-items: end;
  padding-block: var(--space-5);
  border-top: var(--rule-hair);
}

.pub-find .btn {
  min-height: var(--control);
}

.pub-ledger {
  padding-bottom: var(--space-7);
}

.pub-none {
  padding-block: var(--space-4);
}

/* The tables. core.css rules them; here the numbers are aligned and each table is
   given the width its columns need. */
.pub-table .pub-n {
  text-align: end;
  font-variant-numeric: tabular-nums;
}

.pub-table td.pub-n {
  white-space: nowrap;
}

/* A zero is a real count, set quietly so that the eye finds the numbers. */
.pub-table td.pub-zero {
  color: var(--apparatus);
}

.pub-table tbody th {
  font-weight: 400;
}

/* On a phone the name column keeps a width of its own and the heads are set small, so
   that a name and its first two numbers are in view before the table is scrolled. */
.pub-table--ledger {
  min-width: 46rem;
}

.pub-table--ledger thead th {
  font: var(--type-small);
  font-weight: 680;
}

.pub-table--ledger th:first-child {
  width: 10.5rem;
}

.pub-table--ledger th.pub-n {
  width: 5.75rem;
}

.pub-table--ledger tbody th a {
  font-weight: 600;
}

.pub-table__why {
  display: block;
  margin-top: var(--space-1);
}

.pub-table--short {
  max-width: var(--measure);
}

.pub-table--journals,
.pub-table--years {
  max-width: var(--reading);
}

.pub-table--years {
  min-width: 34rem;
}

.pub-table--notices {
  min-width: 48rem;
}

.pub-table--notices td {
  font: var(--type-small);
}

.pub-table--notices .pub-when {
  white-space: nowrap;
}

.pub-table--notices .pub-work {
  width: 34%;
}

.pub-table--notices .pub-why {
  color: var(--ink-2);
}

/* The publishers with nothing on record: their names, as links. */
.pub-rest {
  margin-top: var(--space-6);
}

.pub-rest__h {
  font-weight: 600;
}

.pub-names,
.pub-foot__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--space-5);
}

.pub-names a,
.pub-foot a,
.pub-crumb a,
.pub-recent > .pub-after a {
  display: inline-flex;
  align-items: center;
  min-height: var(--target);
}

/* Recent notices across publishers: the kind and the day, then the work. */
.pub-notice {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-1) var(--gutter);
  padding-block: var(--space-3);
  border-top: var(--rule-hair);
}

.pub-notice:last-child {
  border-bottom: var(--rule-hair);
}

.pub-notice__work > * + * {
  margin-top: var(--space-1);
}

/* One publisher: the way back, the name, the counters. */
.pub-crumb {
  padding-top: var(--space-4);
}

.pub-head {
  padding-block: var(--space-4) var(--space-6);
}

.pub-head h1 {
  overflow-wrap: break-word;
}

.pub-head > .label {
  margin-bottom: var(--space-3);
}

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

.pub-head__note {
  margin-top: var(--space-3);
}

.pub-counters {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-5) var(--gutter);
  padding-block: var(--space-5);
  border-top: var(--rule-head);
}

.pub-counters + .pub-after,
.pub-counters ~ .pub-asof {
  margin-top: 0;
  padding-bottom: var(--space-5);
}

.pub-cards {
  max-width: var(--reading);
  margin-top: var(--space-6);
}

.pub-foot {
  padding-block: var(--space-4) var(--space-7);
  border-top: var(--rule-hair);
}

@media (min-width: 720px) {
  .pub-find {
    grid-template-columns: minmax(0, 1fr) minmax(16rem, auto) auto;
    gap: var(--gutter);
  }

  .pub-notice {
    grid-template-columns: 14rem minmax(0, 1fr);
  }

  .pub-counters {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .pub-table .pub-n:last-child {
    padding-inline-end: 0;
  }

  .pub-table--ledger thead th {
    font: var(--type-body);
    font-weight: 680;
  }

  .pub-table--ledger th:first-child {
    width: auto;
  }

  .pub-table--ledger th.pub-n {
    width: 7.5rem;
  }

  .pub-table--notices {
    min-width: 54rem;
  }

  .pub-table--notices .pub-kind {
    white-space: nowrap;
  }

  .pub-table--notices .pub-work {
    width: 44%;
  }
}
