/* Adapters for standalone teaching documents. Keep their readers and slide controls. */
html.teaching-document { font-size: 16px; }
.legacy-document, .legacy-book .book {
  color: var(--ink);
  background: var(--paper);
}
.legacy-document { font-family: var(--font-body); font-size: 18px; line-height: 1.8; padding: 2rem 1.5rem; overflow-wrap: anywhere; }
.legacy-document .main-container { max-width: 1100px; }
.legacy-document :is(h1, h2, h3, h4, h5, h6),
.legacy-book .book .book-body .page-wrapper .page-inner section.normal :is(h1, h2, h3, h4, h5, h6) {
  color: var(--accent); font-family: var(--font-body); line-height: 1.4;
}
.legacy-document h1 { font-size: 1.7rem; }
.legacy-document h1.title { font-size: clamp(1.65rem, 4vw, 2.15rem); margin-top: 0; }
.legacy-document h2 { font-size: 1.45rem; }
.legacy-document h3 { font-size: 1.15rem; }
.legacy-document #header { margin-bottom: 2rem; }
.legacy-document #header :is(.subtitle, .author, .date) { color: var(--muted); font-size: .95rem; font-weight: normal; }
.legacy-document a,
.legacy-book .book .book-body .page-wrapper .page-inner section.normal a { color: var(--accent); text-underline-offset: .2em; }
.legacy-document a:hover,
.legacy-book .book .book-body .page-wrapper .page-inner section.normal a:hover { color: var(--accent-hover); }
.legacy-document a:focus-visible, .legacy-book a:focus-visible { outline: 3px solid #af6500; outline-offset: 3px; }
.legacy-document blockquote,
.legacy-book .book .book-body .page-wrapper .page-inner section.normal blockquote {
  color: var(--muted); font-family: inherit; font-size: .95em;
  background: var(--wash); border-left: 3px solid var(--accent); padding: .5rem 1.2rem;
}
.legacy-document blockquote p { margin: .5em 0; }
.legacy-document :is(pre, code) { box-shadow: none; border-color: var(--rule); }
.legacy-document #TOC { background: var(--wash); border: 1px solid var(--rule); border-radius: 4px; }
.legacy-document .tocify-item { color: var(--ink); font-size: .9rem; padding: .2rem .4rem; }
.legacy-document .list-group-item.active,
.legacy-document .list-group-item.active:hover,
.legacy-document .list-group-item.active:focus { color: var(--paper); background: var(--accent); border-color: var(--accent); }
.legacy-document table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; }
.legacy-document td, .legacy-document th { border: 1px solid var(--rule); padding: .6rem .8rem; }
.legacy-document th { background: var(--wash); }
.legacy-document img { max-width: 100%; height: auto; }
.legacy-book .book.font-family-0 { font-family: var(--font-body); }
/* GitBook's existing sepia/night switches still control the reading palette. */
.legacy-book .book.color-theme-1 { --ink: #514432; --muted: #6f604b; --paper: #f3eacb; --wash: #eae0bf; --rule: #d9ccaa; }
.legacy-book .book.color-theme-2 { --ink: #e3ebe5; --muted: #b0bfb5; --accent: #9cd4be; --accent-hover: #c0eadb; --paper: #1c2823; --wash: #26372f; --rule: #44594d; }
.legacy-book .book .book-body { color: var(--ink); background: var(--paper); }
.legacy-book .book .book-body .page-wrapper .page-inner { max-width: var(--measure); }
.legacy-book .book .book-body .page-wrapper .page-inner section.normal { color: var(--ink); line-height: 1.8; }
.legacy-book .book .book-header { background: var(--wash); border-bottom: 1px solid var(--rule); color: var(--muted); }
.legacy-book .book .book-summary { background: var(--wash); border-right: 1px solid var(--rule); font-family: var(--font-body); }
.legacy-book .book .book-summary ul.summary li a { color: var(--ink); }
.legacy-book .book .book-summary ul.summary li.active > a { color: var(--accent); font-weight: bold; }
.legacy-book .book .book-body .page-wrapper .page-inner section.normal table :is(th, td) { border-color: var(--rule); }
.legacy-book .book .book-body .page-wrapper .page-inner section.normal table tr:nth-child(2n) { background: var(--wash); }
/* Keep remark's presentation dimensions and typography scale; change its visual family. */
.legacy-slides .remark-slide-content { color: var(--ink); background-color: var(--paper); font-family: var(--font-body); }
.legacy-slides .remark-slide-content :is(h1, h2, h3) { color: var(--accent); font-family: var(--font-body); text-shadow: none; }
.legacy-slides .remark-slide-content a { color: var(--accent); text-underline-offset: .15em; }
.legacy-slides .remark-slide-content.inverse { background-color: var(--accent); color: var(--paper); text-shadow: none; }
.legacy-slides .remark-slide-content.inverse :is(h1, h2, h3, a) { color: var(--paper); }
.legacy-slides .remark-slide-number { color: var(--muted); }
.legacy-slides .inverse .remark-slide-number { color: var(--paper); }
.legacy-slides .remark-slide-container:first-child .inverse { background-blend-mode: multiply; }
.legacy-slides .remark-slide-container:first-child .inverse span[style*="color"] { color: inherit !important; }
.legacy-slides .my-footer { background-color: var(--accent); }
@media (max-width: 767px) {
  .legacy-document { font-size: 17px; padding: 1.25rem .75rem; }
  .legacy-document .main-container { padding-inline: 0; }
  .legacy-document .toc-content { padding-inline: .5rem; }
  .legacy-document #TOC { position: static; width: 100%; max-height: 40vh; margin-bottom: 1.5rem; }
}
@media print { .legacy-document #TOC { position: static; } }
