/* SPDX-License-Identifier: MIT OR Apache-2.0
 *
 * commentary.css — a reading set as a reading, styled once for both places the
 * book offers one: the sheet the reading page raises over a passage
 * (bitcoin-book.html, from its nav bar's Commentary key) and the leaf-borne
 * toggle the Ledger opens over a ledger or an address (bitcoin-ledger.html).
 * Shared so a reading looks the same wherever it is met. The markup both render
 * is btc-commentary.js.
 *
 * Set as reading matter, in its own type size: commentary is prose to be read,
 * not a table to be consulted, so it takes --scale-commentary (btc-fontscale.js;
 * 1 on a page that never loads it), which follows the body until a reader steps
 * it away — a reading is somebody else's writing, and wanting it a size apart
 * from the record is an ordinary thing to want. The settings panel has a row
 * for it, and a pinch on the sheet sets the same number. One measure holds the
 * sheet, carrying the prose's own font, since ch resolves per element.
 */
.commentary-measure {
  max-width: 46ch; margin: 0 auto;
  font: 400 calc(15.5px * var(--scale-commentary, 1))/1.6 'Newsreader',serif;
}
.commentary-entry { margin: 0 0 26px; }
.commentary-entry:last-of-type { margin-bottom: 0; }
/* The reading's subject, in the monospace eyebrow the book keeps for a curated
   name — a heading, deliberately not the passage's own title type: this names
   what is being commented on, it does not retitle the page. */
.commentary-name {
  margin: 0 0 10px; font: 600 calc(10px * var(--scale-commentary, 1))/1.5 'IBM Plex Mono',monospace;
  letter-spacing: .18em; text-transform: uppercase; color: var(--accent);
}
.commentary-entry p {
  margin: 0 0 .8em; font: 400 calc(15.5px * var(--scale-commentary, 1))/1.6 'Newsreader',serif;
  color: var(--ink-soft); font-variant-numeric: oldstyle-nums;
}
.commentary-entry p:last-child { margin-bottom: 0; }
/* While a reading is being read off disk, and where one could not be: an
   annotation's failure is worth stating (the record on the page is unaffected),
   never worth a blank sheet. */
.commentary-loading, .commentary-missing {
  margin: 0; font: italic 400 calc(14px * var(--scale-commentary, 1))/1.6 'Newsreader',serif; color: var(--meta);
}
.commentary-missing code { font: 400 calc(12px * var(--scale-commentary, 1))/1.5 'IBM Plex Mono',monospace; color: var(--dim); }
/* A contributed reading's byline. The name is the point of the whole layer —
   it is what lets a reader weigh the claim — so it sits in the accent, quiet
   but not hidden. */
.commentary-by { font-style: italic; color: var(--dim); }
.commentary-by a { color: var(--accent); text-decoration: none; border-bottom: 1px solid var(--rule); }
.commentary-by a:hover { border-bottom-color: var(--accent); }
/* ── A reading at rest, in a leaf ──────────────────────────────────────────
   Where the reading page floats its sheet above a sticky bar, the Ledger opens
   one in place, beneath the leaf's own matter: a ledger's title leaf and an
   address's leaf each carry a toggle for the readings kept on that name. Same
   summary as the reading page's keys (notation.css dresses those), so the
   gesture is learned once. */
/* The Ledger's hero centres its matter — a title page's habit — but prose is
   read from a left edge, so the reading sets itself flush left inside a block
   that stays centred. Only the toggle keeps the hero's alignment, being chrome
   rather than reading matter. */
.leaf-commentary { margin: 26px auto 0; max-width: 560px; text-align: left; }
.leaf-commentary > summary {
  cursor: pointer; font: 500 11px/1 'IBM Plex Mono',monospace; letter-spacing: .1em; text-transform: uppercase;
  color: var(--dim); list-style: none; text-align: center;
}
.leaf-commentary > summary::-webkit-details-marker { display: none; }
.leaf-commentary > summary::before { content: '+ '; color: var(--accent); }
.leaf-commentary[open] > summary::before { content: '– '; }
.leaf-commentary > summary:hover { color: var(--ink-soft); }
.leaf-commentary .commentary-measure { margin: 16px 0 0; }
