/* /book: the free PDF book. Written by site/book_page.py; uses the tokens in site.css. */
.book-head h1 { max-width: 14em; }
.book-course { margin-top: 20px; max-width: 520px; font-size: 0.9375rem; line-height: 1.4375rem; color: var(--ink-2); }
.book-course a { font-weight: 500; text-decoration: underline; text-decoration-color: var(--rule-2); text-underline-offset: 3px; }
.book-meta { margin-top: 16px; font-size: 0.875rem; line-height: 1.375rem; color: var(--muted); }
.book-meta .mono { color: var(--ink-2); font-size: 0.8125rem; white-space: nowrap; }
.book-form { margin-top: 28px; max-width: 520px; }
.book-form h2 { font-size: 1.25rem; line-height: 1.75rem; }
.book-check { display: flex; align-items: flex-start; gap: 12px; min-height: 28px; font-size: 0.9375rem; line-height: 1.5rem; color: var(--ink-2); cursor: pointer; }
.book-check input { flex: none; width: 24px; height: 24px; margin: 0; accent-color: var(--accent); }
.book-ready h2, .book-again h2 { font-size: 1.25rem; line-height: 1.75rem; }
.book-ready p, .book-again p { font-size: 1rem; line-height: 1.625rem; color: var(--ink-2); }
.book-ready h2:focus { outline: none; }
.book-linkbtn { background: none; border: 0; padding: 4px 0; min-height: 28px; font: inherit; font-size: 0.9375rem; color: var(--link); cursor: pointer; text-decoration: underline; text-decoration-color: var(--rule-2); text-underline-offset: 3px; justify-self: start; }
.book-linkbtn:hover { text-decoration-color: var(--link); }
.book-head .phead__grid { grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: 64px; align-items: start; }
.book-cover { margin: 6px 0 0; justify-self: end; max-width: 440px; width: 100%; }
.book-cover img { display: block; width: 100%; height: auto; border: 1px solid var(--rule-2); border-radius: 4px; filter: var(--frame-img-filter); }
.book-cover .book-meta { margin-top: 14px; }
/* Section heads on this page: the heading, then its lede at reading width (the site's split head leaves a hole when ledes run long) */
.book .section__head { display: block; max-width: 760px; }
.book .section__head p { margin-top: 12px; max-width: 64ch; }
/* What's inside: a contents page. Each part's head stays beside its chapters; each chapter is one line that opens to its summary. */
.book-parts { border-top: 1px solid var(--rule-2); }
.book-part { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: 48px; padding: 32px 0; border-bottom: 1px solid var(--rule-2); }
.book-part__head { position: sticky; top: 96px; align-self: start; }
.book-part h3 { font-size: 1.25rem; line-height: 1.75rem; letter-spacing: -0.01em; }
.book-part__head p { margin-top: 8px; font-size: 1rem; line-height: 1.625rem; color: var(--ink-2); }
.book-chapters { list-style: none; padding: 0; margin: -10px 0 0; }
.book-chapters li { scroll-margin-top: 96px; }
.book-chapters li:not(:last-child) { border-bottom: 1px solid var(--rule); }
.book-chapters summary { list-style: none; display: grid; grid-template-columns: 44px minmax(0, 1fr) 18px; column-gap: 8px; align-items: start; min-height: 48px; padding: 11px 0; cursor: pointer; }
.book-chapters summary::-webkit-details-marker { display: none; }
.book-chapters .mono { color: var(--muted); font-size: 0.875rem; line-height: 1.625rem; }
.book-chapters__t { margin: 0; font-size: 1.0625rem; line-height: 1.625rem; font-weight: 600; color: var(--ink); }
.book-chapters summary svg { width: 18px; height: 18px; margin-top: 4px; color: var(--muted); transition: transform .2s var(--ease); }
.book-chapters summary svg { transform: rotate(0deg); }
.book-chapters details[open] summary svg { transform: rotate(180deg); }
.book-chapters summary:hover .book-chapters__t, .book-chapters li:target .book-chapters__t { color: var(--accent); }
.book-chapters details p { margin-block: 0 18px; margin-inline: 52px 26px; font-size: 1rem; line-height: 1.625rem; color: var(--ink-2); max-width: 66ch; }
.book-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 28px; margin-top: 40px; }
@media (prefers-reduced-motion: reduce) { .book-chapters summary svg { transition: none; } }
@media (max-width: 68.75em) {
  .book-head .phead__grid { grid-template-columns: minmax(0, 1fr) minmax(0, 360px); gap: 40px; }
}
@media (max-width: 53.75em) {
  .book-head .phead__grid { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .book-cover { justify-self: start; max-width: 300px; margin: 0; }
  .book-cover img { max-width: 220px; }
  .book-part { grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 28px 0; }
  .book-part__head { position: static; }
}
.book-table { width: 100%; border-collapse: collapse; font-size: 1rem; line-height: 1.5rem; border-top: 1px solid var(--rule-2); }
.book-table caption { text-align: start; font-size: 0.875rem; line-height: 1.25rem; color: var(--muted); padding-bottom: 12px; }
.book-table th, .book-table td { text-align: start; vertical-align: top; padding-block: 12px; padding-inline: 0 16px; border-bottom: 1px solid var(--rule); }
.book-table thead th { font-size: 0.875rem; line-height: 1.25rem; font-weight: 500; color: var(--muted); border-bottom-color: var(--rule-2); }
.book-table tbody th { font-weight: 500; color: var(--ink); }
.book-table td { color: var(--ink-2); }
.book-table .mono { font-size: 0.875rem; }
.book-ch { display: inline-block; min-width: 28px; min-height: 24px; line-height: 1.5rem; margin-inline-end: 4px; color: var(--ink-2); }
a.book-ch { color: var(--link); text-decoration: underline; text-decoration-color: var(--rule-2); text-underline-offset: 3px; }
.book-table tr > :last-child { padding-inline-end: 0; }
.book-table + .book-table, .steps + .book-table { margin-top: 32px; }
.book-table th .mono { white-space: nowrap; }
/* two-column tables line their second column up with the chapter column of the contents above */
.book-lists tbody th, .book-lists thead th:first-child { width: calc((100% - 48px) / 3 + 48px); }
.book-note { margin-top: 20px; max-width: 70ch; font-size: 1rem; line-height: 1.625rem; color: var(--ink-2); }
@media (max-width: 40em) {
  .book-form { padding: 20px; }
  .book-chapters summary { grid-template-columns: 36px minmax(0, 1fr) 18px; }
  .book-chapters details p { margin-block: 0 16px; margin-inline: 44px 0; }
  .book-table, .book-table tbody, .book-table tr, .book-table th, .book-table td { display: block; }
  .book-table caption { display: block; }
  .book-lists tbody th { width: auto; }
  .book-table thead { position: absolute; clip-path: inset(50%); overflow: hidden; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; white-space: nowrap; }
  .book-table tr { padding: 12px 0; border-bottom: 1px solid var(--rule); }
  .book-table th, .book-table td { padding: 0; border: 0; }
  .book-table td + td { margin-top: 4px; }
  .book-table td[data-label]::before { content: attr(data-label) ": "; color: var(--muted); }
}
