/* 56-about.css - the About page: the facts.
   Every page loads every stylesheet, so each rule here hangs on an ab- class. */

/* ── Who shares a row ────────────────────────────────────────────────────────
   six columns    heights 4 | measurements 2      characters 4 | files 2      made 3 | on this site 3
   four columns   heights 4   measurements 2 | characters 2     files 4       made 2 | on this site 2
   two columns    heights 2   measurements 1 | characters 1     files 2       made 2   on this site 2
   No row is left with an empty field, at any width. */
.ab-heights { --pl-four: 4; }
.ab-characters { --pl-two: 1; container: ab-characters / inline-size; }
.ab-files { --pl-four: 4; --pl-two: 2; }
.ab-pair { --pl-four: 2; }

/* ── The opening ─────────────────────────────────────────────────────────────
   pe-word hangs by the side bearing of a stem; an A has almost none, so here the
   word hangs less and its foot stands on the inset. */
.ab-grid .pe-word { margin-left: -0.015em; }
/* the law is three clauses and a statement is two sentences: each starts its own line,
   and one that has to break, breaks evenly */
.ab-clause, .ab-sentence { display: block; text-wrap: balance; }
.ab-sentence[hidden] { display: none; }               /* a sentence the build does not call for stays out */
/* the closing line opens with a P: it hangs by that stem, as the home page's closing line does */
.ab-credits .pe-line { margin-left: -0.06em; }
/* in the Slab the P begins with its slab, which stands on the inset itself */
.ab-credits.pe-in-slab .pe-line { margin-left: -0.025em; }

/* ── Links ───────────────────────────────────────────────────────────────────
   Vlak's ring; a name is never broken over two lines. Under a mouse a link is
   its own words and nothing more, as on the home page. Under a finger, and on a
   phone, it has a target one control high (--hit, 44px), drawn around the link
   so that the text and its rule stay where they are: on a phone Vlak's own way
   (a 44px box in the line) would part a short link from the full stop after it
   and drop its rule 14px below the word. */
.ab-grid a:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.ab-rows a, .ab-grid .pl-meta a { position: relative; white-space: nowrap; }
@media (pointer: coarse), (max-width: 640px) {
  .ab-rows a::after, .ab-grid .pl-meta a::after { content: ""; position: absolute; height: var(--hit); }
  /* in a line of text the target is centered on the words */
  .ab-grid .pl-meta a::after { top: 50%; left: -10px; right: -10px; margin-top: calc(var(--hit) / -2); }
  /* in a row it stands on the row's own foot and reaches upward, so a column of rows is no
     taller for it and stays in step with the list beside it */
  .ab-rows a::after { bottom: calc(-1 * var(--ab-row-pad)); left: -8px; right: -8px; }
}
@media (max-width: 640px) {
  .ab-grid .pl-meta a { display: inline; min-width: 0; min-height: 0; }
}
/* the way to the proof stands under the claim, a paragraph's distance away */
.ab-made .pl-meta { margin-top: 12px; }

/* ── Tables ──────────────────────────────────────────────────────────────── */
/* a style that is not drawn yet is set in the second ink */
.ab-todo td { color: var(--text-secondary); }
/* a list of weights that has to break, breaks evenly */
.ab-styles td:nth-child(2) { text-wrap: balance; }
/* on a phone a style takes two lines under one rule: its name and its count, then its weights */
@media (max-width: 480px) {
  .ab-styles tr { display: grid; grid-template-columns: 1fr auto; border-top: 1px solid var(--divider); padding: 9px 0; row-gap: 4px; }
  .ab-styles td { border: 0; padding: 0; }
  .ab-styles td:nth-child(2) { grid-row: 2; grid-column: 1 / -1; padding-left: 0; }
  .ab-styles td:nth-child(3) { grid-row: 1; grid-column: 2; }
}
/* In a cell one field wide a name and its value stand at least 12px apart, as in the list of
   characters beside it. From 481px up every name then keeps one line, so the two lists stay in
   step; should a name still not fit, it takes two lines rather than push the table out of its cell. */
.ab-measures td + td { padding-left: 12px; }
.ab-measures td:first-child { white-space: normal; }

/* A row that stands for a style is set in that style (pe-in-* on the row). */
.ab-styles tr, .ab-ladder tbody tr { font-family: var(--pe-spec); }
.ab-styles td:nth-child(2) span { white-space: nowrap; }
.ab-styles td:nth-child(2) span + span { margin-left: .35em; }

/* A switch and what it changes, or a table and its note, settle at the foot of the cell together. */
.ab-stack { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; min-width: 0; }
.ab-stack > table, .ab-stack > figure, .ab-stack > p { align-self: stretch; }
.ab-stack > .ab-switch[hidden] { display: none; }
@media (max-width: 640px) {
  /* five weights share a phone's width: the segments keep their height and give up side padding */
  .ab-weights .rs-toggle { padding-inline: 2px; font-size: 13px; min-width: 0; flex-basis: 0; }
}

/* Style by style: every row is set in the style and the weight it measures. The four columns
   of figures are one width, so the figures step evenly whatever their heads say. */
.ab-ladder { table-layout: fixed; }
.ab-ladder td { font-weight: inherit; }
.ab-ladder th:first-child { width: 24%; }
.ab-ladder td + td, .ab-ladder th + th { padding-left: 0; }
@media (max-width: 640px) {
  /* a column is under 90px: its head shows the short form and is still read out in full (as Vlak's rs-sr) */
  .ab-ladder th[data-short] span { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
  .ab-ladder th[data-short]::after { content: attr(data-short); content: attr(data-short) / ""; }
}
/* Beside the styles table the cell is three fields wide and the columns stand on them: the
   style's name in the first field, then two columns of figures to a field. 100cqw is three
   fields and two hairlines less two insets, so a field is (100cqw + 38px) / 3. */
@media (min-width: 1224px) {
  .ab-by-weight { container-type: inline-size; }
  .ab-ladder th:first-child { width: auto; }
  .ab-ladder th:nth-child(n+2) { width: calc((100cqw + 41px) / 6); }       /* half a field and half a hairline */
}

/* Files: a file's name is set in the Mono, at the size of the code. */
.ab-names .ab-file { font-family: var(--pe-mono); font-size: 13px; }
.ab-names[hidden] { display: none; }

/* A note under a list stands a row's distance below it. */
.ab-note { margin-top: 16px; }
.ab-note[hidden] { display: none; }

/* Statements that are read are set in the Serif, at its Regular. */
.pe-in-serif .ab-read { font-weight: 400; }

/* ── Rows on hairlines: a list set the way pe-table sets its rows ─────────── */
.ab-rows {
  --ab-row-pad: 9px;                         /* a row stands 9px from its rule, as in pe-table */
  margin: 0; padding: 0; list-style: none;
  font-size: 15px; font-weight: 400; line-height: 1.3;
  font-variant-numeric: tabular-nums;
}
.ab-rows > li {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  padding: var(--ab-row-pad) 0;
  border-top: 1px solid var(--divider);
  break-inside: avoid;
}
.ab-rows > li > span:first-child { white-space: nowrap; }
.ab-rows a {
  margin-bottom: -1px;                       /* the rule under the link does not make its row taller */
  font-weight: 500; color: var(--text); text-decoration: none;
  border-bottom: 1px solid var(--divider);
  transition: border-color var(--duration-snap) var(--ease);
}
.ab-rows a:hover { border-color: var(--text); }

/* Character groups: two columns once they hold the longest name (171px) and, from 808px,
   one column of rows per field. Either way names and counts stand on the fields' own insets:
   between two columns lie two insets and the hairline between their fields. */
.ab-groups { column-gap: var(--gutter); }
@container ab-characters (min-width: 364px) { .ab-groups { columns: 2; } }
@container ab-characters (min-width: 384px) { .ab-groups { column-gap: calc(2 * var(--pl-cell-pad) + var(--pl-hairline)); } }
@container ab-characters (min-width: 808px) { .ab-groups { columns: 4; } }

/* ── Heights: the letters between the family's lines ──────────────────────────
   The letters are drawn from the outlines; the lines are hairlines in the ink of
   the grid's own seams, set on whole pixels. On a cell of four fields each line
   runs on into the last field and is the rule of its own row there; on a narrow
   cell the rows are a table under the drawing. 36-about.js places them. */
.ab-figure { position: relative; }
.ab-draw { position: relative; }
.ab-draw svg { position: relative; }
.ab-line { position: absolute; left: 0; right: 0; height: 1px; background: var(--divider); }
.ab-levels, .ab-figure figcaption { margin-top: 16px; }
.ab-figure figcaption { text-wrap: balance; }          /* on a phone it takes two lines: two of one length */
.ab-figure-wide .ab-levels, .ab-figure-wide figcaption { margin-top: 0; }
.ab-figure-wide .ab-levels > li { position: absolute; right: 0; padding: 0; border: 0; }
.ab-figure-wide .ab-levels > .ab-level-above { transform: translateY(-100%); }
.ab-figure-wide figcaption { position: absolute; left: 0; }

/* ── The code: the cell is the frame, so the block drops its own ──────────── */
.ab-code.rs-code-block { border: 0; background: none; }
.ab-code .rs-code-block-pre { padding: 0; font-size: 13px; line-height: 1.55; }
.ab-code code:empty { display: none; }
/* a source line that has to wrap hangs under its value, seven characters in */
.ab-code .rs-code-block-line { min-height: 1.55em; padding-left: 7ch; text-indent: -7ch; }
.ab-keep { white-space: nowrap; }

/* ── The footer under this page ──────────────────────────────────────────────
   Its last column says whose Strak is, where it stands and what the site is made with. On
   this page those three are the page itself, in ink, straight above it. So here the footer
   ends after its lists and nothing is said twice in one screen. */
body:has(.ab-grid) .pl-footer-about { display: none; }
