/* Chapter reading uses the site's fonts, colours and native links. */
.book-home, .book-reader { max-width: 46rem; margin-inline: auto; }
.book-intro { padding-block: 1rem 2rem; }
.book-intro h1, .book-reading-head h1 { font: 700 clamp(2rem, 1.5rem + 2vw, 3rem)/1.15 var(--font-display); overflow-wrap: anywhere; }
.book-description { font: 400 1.125rem/1.8 var(--font-text); max-width: 38rem; }
.book-meta, .book-resume-note { font: 400 .875rem/1.6 var(--font-ui); color: var(--muted); }
.book-index h2 { font: 700 1.75rem/1.3 var(--font-display); }
.book-chapters { list-style: none; margin: 0; padding: 0; font: 400 1rem/1.5 var(--font-ui); }
.book-chapters a { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: .4rem 1rem; padding: .85rem .25rem; min-height: 48px; border-bottom: 1px solid var(--rule); text-decoration: none; }
.book-chapters a:hover, .book-chapters a[aria-current] { background: var(--surface); }
.book-chapters a[aria-current] { font-weight: 700; box-shadow: inset 3px 0 var(--rubric); padding-left: .75rem; }
.book-chapter-label { color: var(--muted); font-size: .875rem; }
.book-part { padding: 1.75rem .25rem .45rem; color: var(--rubric); font-weight: 600; }
.book-reading-head { max-width: var(--measure); margin: 0 auto 1.5rem; }
.book-reading-head h1 { margin: .5rem 0 1rem; }
.book-back, .book-resume { display: inline-block; padding-block: .6rem; font: 400 .9375rem/1.6 var(--font-ui); }
.book-toolbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: .5rem; border-block: 1px solid var(--rule); background: var(--bg); margin: 0 auto 1.5rem; max-width: var(--measure); }
.book-contents { flex: 1; min-width: 0; }
.book-contents summary { cursor: pointer; padding: .85rem .5rem; min-height: 48px; font: 600 .9375rem/1.4 var(--font-ui); overflow-wrap: anywhere; }
.book-contents nav { position: absolute; top: 100%; left: 0; right: 0; max-height: 70vh; max-height: 70dvh; overflow-y: auto; overscroll-behavior: contain; padding: .5rem 1rem 1rem; border: 1px solid var(--rule); background: var(--bg); box-shadow: 0 .75rem 1.5rem #0002; }
html:not(.js) .book-contents nav { position: static; max-height: 60vh; box-shadow: none; }
.book-position { max-width: 40%; padding-right: .5rem; color: var(--muted); font: 400 .8125rem/1.4 var(--font-ui); overflow-wrap: anywhere; }
.book-prose { font-size: 1.125rem; line-height: 1.85; overflow-wrap: anywhere; }
.book-prose [id] { scroll-margin-top: 5rem; }
.book-prose p { overflow-wrap: anywhere; }
.book-prose .book-source { font: 400 .875rem/1.65 var(--font-ui); color: var(--muted); margin-top: -.35rem; }
.book-source a { text-decoration: underline; text-underline-offset: .18em; }
.book-prose .table-wrap { max-width: 100%; }
.book-prose table { min-width: 52rem; hyphens: none; }
.book-prose th, .book-prose td { min-width: 10rem; vertical-align: top; white-space: normal; }
.book-prose th:first-child, .book-prose td:first-child { min-width: 8rem; }
.book-prose td:first-child { white-space: normal; font-weight: 400; color: var(--ink); }
.book-prose td p, .book-prose th p { font-size: .9375rem; line-height: 1.65; margin: .3rem 0; }
.book-pagination { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin: 2.5rem auto 1rem; max-width: var(--measure); border-top: 1px solid var(--rule); padding-top: 1rem; }
.book-pagination a { display: block; min-height: 48px; padding: .75rem; background: var(--surface); border-radius: var(--radius); text-decoration: none; overflow-wrap: anywhere; }
.book-pagination span, .book-pagination strong { display: block; font: 400 .875rem/1.6 var(--font-ui); }
.book-pagination strong { font-weight: 600; margin-top: .4rem; }
.book-pagination a[rel="next"] { grid-column: 2; }
.book-end-link { text-align: center; font: 400 .9375rem/1.6 var(--font-ui); }
.book-end-link a { display: inline-block; padding: .75rem; }
.book-audio { max-width: var(--measure); margin: 0 auto 1.5rem; padding: 1rem; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); }
.book-audio h2 { margin: 0 0 .75rem; font: 600 1rem/1.5 var(--font-ui); }
.book-audio audio { width: 100%; }
.book-audio p { margin: .5rem 0 0; font: 400 .875rem/1.5 var(--font-ui); }
@media (max-width: 34rem) {
  .book-chapters a { grid-template-columns: 1fr; gap: .2rem; }
  .book-pagination { gap: .65rem; }
  .book-contents nav { padding-inline: .75rem; }
}
@media print {
  .book-toolbar, .book-pagination, .book-audio, .book-resume, .book-end-link { display: none; }
  .book-prose table { min-width: 0; }
  .book-prose th, .book-prose td, .book-prose th:first-child, .book-prose td:first-child { min-width: 0; }
  .book-prose .table-wrap { overflow: visible; }
}
