/* bookmaster web form -- the stylesheet of the HTML pages (typst --features html/bundle).
   The PDF does not use it. */
@font-face { font-family: 'IBM Plex Serif'; src: url(fonts/IBMPlexSerif-Regular.ttf); }
@font-face { font-family: 'IBM Plex Serif'; src: url(fonts/IBMPlexSerif-Italic.ttf); font-style: italic; }
@font-face { font-family: 'IBM Plex Serif'; src: url(fonts/IBMPlexSerif-Bold.ttf); font-weight: bold; }
@font-face { font-family: 'IBM Plex Sans'; src: url(fonts/IBMPlexSans-Regular.ttf); }
@font-face { font-family: 'IBM Plex Sans'; src: url(fonts/IBMPlexSans-Bold.ttf); font-weight: bold; }
@font-face { font-family: 'IBM Plex Mono'; src: url(fonts/IBMPlexMono-Regular.ttf); }
@font-face { font-family: 'IBM Plex Mono'; src: url(fonts/IBMPlexMono-Italic.ttf); font-style: italic; }
@font-face { font-family: 'IBM Plex Mono'; src: url(fonts/IBMPlexMono-Bold.ttf); font-weight: bold; }
:root { --ink: #161616; --muted: #525252; --line: #c6c6c6; --side: #f4f4f4; --accent: #0f62fe; --top: #161616; }
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: #fff; font: 16px/1.55 'IBM Plex Serif', Georgia, serif; }
body:not(:has(.bm-page)):not(.bm-landing) { max-width: 48rem; margin: 2rem auto; padding: 0 1rem; }
a { color: var(--accent); text-decoration: none; } a:hover { text-decoration: underline; }
.bm-top { position: sticky; top: 0; z-index: 2; height: 3rem; display: flex; align-items: center; gap: 1rem; padding: 0 1.25rem; background: var(--top); color: #fff; font-family: 'IBM Plex Sans', sans-serif; }
.bm-top a { color: #fff; font-weight: bold; } .bm-top .num { color: #a8a8a8; font-size: .85rem; margin-left: auto; }
.bm-crumbs { display: flex; align-items: center; gap: .55rem; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bm-crumbs a { font-weight: normal; color: #c6c6c6; } .bm-crumbs a:last-child { font-weight: bold; color: #fff; } .bm-crumbs .sep { color: #8d8d8d; }
/* An anchor (a chapter or section from the contents) stops below the bar on top, not under it. */
html { scroll-padding-top: 4rem; }
/* Landing pages: the tiles of one row share their row lines, so a short text beside a long one leaves no ragged edge. */
.products > .product { display: grid; grid-row: span 3; grid-template-rows: subgrid; row-gap: 0; align-content: start; }
.cards > .card { display: grid; grid-row: span 4; grid-template-rows: subgrid; row-gap: 0; align-content: start; }
.product > *, .card > * { margin-top: 0; }
.product .repo a { color: var(--muted); font-weight: normal; }
.bm-page { display: grid; grid-template-columns: 18rem minmax(0, 1fr); }
.bm-side { position: sticky; top: 3rem; height: calc(100vh - 3rem); overflow-y: auto; background: var(--side); border-right: 1px solid var(--line); padding: 1.25rem 0; font: 14px/1.4 'IBM Plex Sans', sans-serif; }
.bm-side ul { list-style: none; margin: 0; padding: 0; } .bm-side li a { display: flex; gap: .3rem; padding: .3rem 1.25rem; color: var(--ink); }
.bm-side li a:hover { background: #e0e0e0; text-decoration: none; }
.bm-side li.cur > a { font-weight: bold; border-left: 4px solid var(--accent); padding-left: calc(1.25rem - 4px); background: #fff; }
.bm-side li ul a { padding-left: 2.25rem; font-size: 13px; color: var(--muted); }
.bm-side .num { flex: 0 0 1.6rem; color: var(--muted); }
main { padding: 2rem 3rem 4rem; max-width: 56rem; min-width: 0; }
main nav ul, main nav ol { list-style: none; padding-left: 1.25rem; } main nav li { margin: .15rem 0; }
h1, h2, h3, h4 { font-family: 'IBM Plex Sans', Helvetica, sans-serif; font-weight: normal; line-height: 1.25; }
h2 { font-size: 2rem; margin: 0 0 1.5rem; padding-top: .6rem; border-top: 6px solid var(--ink); display: inline-block; }
h3 { font-size: 1.3rem; font-weight: bold; margin-top: 2.5rem; padding-top: .35rem; border-top: 1px solid var(--ink); }
h4 { font-size: 1.05rem; font-weight: bold; margin-top: 1.8rem; }
p, li, dd { max-width: 44rem; }
code, pre, var { font-family: 'IBM Plex Mono', Menlo, monospace; font-size: .86em; }
code.cmd { font-weight: bold; } var { font-style: italic; }
pre { line-height: 1.4; overflow-x: auto; }
pre.screen { background: #f4f4f4; border: 1px solid var(--line); border-radius: 4px; padding: .75rem 1rem; }
pre.code { padding: .25rem 0; }
figure { margin: 2rem 0; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); padding: .75rem 0 .5rem; }
figure > p:last-child { text-align: center; font-size: .9rem; color: var(--muted); margin: .5rem 0 0; }
figure:has(> table) { border: 0; padding: 0; } figure:has(> table) > p:last-child { text-align: left; order: -1; }
table { border-collapse: collapse; width: 100%; font-size: .95rem; margin: .5rem 0; }
tr:first-child td { font-family: 'IBM Plex Sans', sans-serif; font-weight: bold; font-size: .85rem; border-top: 2px solid var(--ink); border-bottom: 1.5px solid var(--ink); }
td { padding: .45rem .6rem; vertical-align: top; text-align: left; border-bottom: 1px solid var(--line); }
dl { display: grid; grid-template-columns: minmax(8rem, max-content) 1fr; gap: .5rem 1.25rem; } dt { font-weight: bold; } dd { margin: 0; }
dl.index { display: block; columns: 2; } dl.index dt { font-weight: normal; margin-top: .35rem; } dl.index dd { margin-left: 1.2rem; font-size: .88rem; }
.grid { display: flex; flex-wrap: wrap; gap: 1.5rem; } .grid > div { flex: 1 1 20rem; min-width: 0; }
.note { margin: 1.25rem 0; padding: .75rem 1rem; border-left: 4px solid var(--accent); background: #edf5ff; }
.syntax { border: 1px solid var(--ink); padding: .75rem; overflow-x: auto; margin: 1rem 0; } .syntax svg { max-width: 100%; height: auto; }
.bm-pager { display: flex; justify-content: space-between; gap: 1rem; margin-top: 4rem; padding-top: 1rem; border-top: 1px solid var(--line); font-family: 'IBM Plex Sans', sans-serif; }
.bm-pager a { display: block; padding: .6rem 1rem; border: 1px solid var(--line); border-radius: 4px; } .bm-pager small { display: block; color: var(--muted); }
header.titlepage { margin: 2rem 0 3rem; padding-bottom: 2rem; border-bottom: 1px solid var(--line); }
header.titlepage h1 { font-size: 2.6rem; font-weight: bold; margin: 0 0 1rem; border-top: 6px solid var(--ink); padding-top: 1rem; }
section.edition { font-size: .9rem; color: var(--muted); }
@media (max-width: 900px) { .bm-top .num { display: none; } .bm-page { grid-template-columns: minmax(0, 1fr); } .bm-side { position: static; height: auto; max-height: 40vh; border-right: 0; border-bottom: 1px solid var(--line); } main { padding: 1.25rem 1rem 3rem; } }
