/* SPDX-License-Identifier: MIT OR Apache-2.0
 *
 * btc-toc.css — how a list of chapters is set: the headings, the rows, and
 * the pencil the unmined ones are written in. Shared by the two pages that
 * set such a list — the table of contents (bitcoin-contents.html) and the
 * appendix leaves (bitcoin-appendix.html) — because a row built by
 * btc-mempool.js should read the same wherever it is shown. Both pages carry
 * the colour variables these rules draw on. */

/* The contents nest by the book's own citation scheme: a Volume part header,
   then a Book sub-header whenever consecutive entries share one, so each row
   need only cite the portion of its reference that its heading hasn't already
   named -- a chapter under its book, or a book·chapter under its volume. */
.toc-vol { margin:36px 0 4px; padding-top:15px; border-top:1px solid var(--rule);
  font:600 11px/1 'IBM Plex Mono',monospace; letter-spacing:.22em; text-transform:uppercase; color:var(--accent); }
.toc-vol:first-child { margin-top:8px; padding-top:0; border-top:none; }
.toc-book { margin:15px 0 1px; padding-left:16px;
  font:600 10px/1 'IBM Plex Mono',monospace; letter-spacing:.16em; text-transform:uppercase; color:var(--meta); }

/* A contents row: title on the left, its remaining reference on the right; the
   whole row navigates into the book, the manuscript's own citation form. */
.toc-entry { display:flex; align-items:baseline; gap:16px; padding:9px 2px 9px 16px; border-bottom:1px solid var(--hair); text-decoration:none; }
.toc-entry.under-book { padding-left:32px; }
.toc-title { flex:1; min-width:0; font:500 17px/1.35 'Newsreader',serif; color:var(--ink-soft); }
.toc-ref { flex:none; min-width:84px; text-align:right; font:600 13px/1.4 'IBM Plex Mono',monospace; letter-spacing:.06em; color:var(--accent); white-space:nowrap; font-variant-numeric:tabular-nums; }
.toc-ref.none { color:var(--meta); font-weight:400; }
.toc-entry:hover .toc-title { color:var(--ink); }
.toc-entry:hover .toc-ref, .toc-entry:focus-visible .toc-ref { text-decoration:underline; color:var(--accent-2); }
.toc-entry:focus-visible { outline:none; }
/* A row whose subject carries a credited reading (btc-commentary.js) wears the
   credit beneath its title: "commentary by" whoever wrote it. The annotation
   register — small monospace, meta-grey — so it reads as a note about the row
   rather than part of the row's name, and so a contents scanned quickly still
   separates the record's places from readings of them. */
.toc-commentary { display:block; margin-top:.3em; font:400 10.5px/1.4 'IBM Plex Mono',monospace; letter-spacing:.08em; text-transform:uppercase; color:var(--meta); }
.toc-entry:hover .toc-commentary { color:var(--dim); }
/* The contents' one credit, a footnote at the leaf's foot (see
   bitcoin-contents.html's colophon block): same annotation register as the
   row credit above, set off by the same rule the volume heads use. */
.toc-colophon { margin-top:34px; padding-top:14px; border-top:1px solid var(--rule); font:400 10.5px/1.6 'IBM Plex Mono',monospace; letter-spacing:.08em; text-transform:uppercase; color:var(--meta); }

/* A row that stands for a whole part of the book rather than a passage in it
   — the top-level contents' volumes, appendices and front-matter leaves. It
   is set a shade larger than a chapter's row, since it names a container of
   them, and carries beneath its name the line that part's own leaf carries
   at its head: what it spans, and how much of it there is. Prose register,
   not the annotation register a credit takes — this is the row's own
   description, not a note about it. */
.toc-part .toc-title { font-size:19px; color:var(--ink); }
.toc-span { display:block; margin-top:.25em; font:400 12.5px/1.5 'Public Sans',sans-serif; letter-spacing:.01em; color:var(--meta); }
.toc-part:hover .toc-span { color:var(--dim); }
/* The row that closes a group drops its own hairline: the next heading rules
   off above itself, and two rules with a gap between them read as an empty
   band rather than a division. */
.toc-part:has(+ .toc-vol) { border-bottom:none; }

/* A reader's own bookmark, sitting inline in reading order, wears the same
   ribbon it flies in the book. */
.toc-bm { display:inline-block; width:9px; height:12px; margin-right:8px; color:var(--accent); vertical-align:baseline; }
/* The citation mark on a cited work's row: gold, like the reference it is. */
.toc-cite-mark { color:var(--accent); font-weight:600; }
.toc-bm svg { display:block; width:100%; height:100%; }

/* Unmined chapters -- the mempool's projections, and the appendix's future
   chapters. Both continue the contents past the tip, so they dress like
   ordinary rows but in the manuscript's pencil rather than its ink: dim
   titles and meta-grey references (a provisional number, not a citation). */
.toc-entry.projected .toc-title { color:var(--dim); font-style:italic; }
.toc-entry.projected .toc-ref { color:var(--meta); font-weight:400; }
.toc-entry.projected:hover .toc-title { color:var(--ink-soft); }
.toc-entry.projected:hover .toc-ref { color:var(--dim); }
/* Something said about a list rather than in it -- that the curated contents
   could not be read, say. A note, not a row. */
.toc-proj-note { padding:10px 2px 2px 32px; font:400 12px/1.6 'Public Sans',sans-serif; color:var(--meta); }

/* An appendix used to wear its heading inside a longer list, and that heading
   was the door to its own leaf. It has a contents leaf of its own now -- the
   contents runs a leaf per volume and per appendix -- so a part's heading is
   the leaf's head, and the door is the leaf's ▾. One sub-head within a leaf
   is still a door: a BIP's, on the Consensus leaf, opening that fork's own
   title leaf -- dressed as the Book sub-header it stands in for. */
a.toc-bip { display:block; text-decoration:none; }
a.toc-bip::after { content:' ›'; }
a.toc-bip:hover, a.toc-bip:focus-visible { color:var(--accent-2); text-decoration:underline; }
