/* Site-only tweaks for the mdBook build (#1870). The print stylesheet lives
 * next door in pdf.css; this file is what a reader on plynth.fm/manual sees.
 */

/* The manual's reference tables run wide (the FX-command table is six
 * columns). Let them scroll inside their own box rather than pushing the page
 * sideways on a phone — the same rule the repo's own docs follow. mdBook's own
 * default theme already sets this (it's a no-op here), but the momentum-scroll
 * line below is ours: without it, dragging inside the box on iOS Safari can
 * feel stuck rather than scrolling (#2193). */
.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* At a phone width, `table td/th`'s 20px side padding (40px per cell) is the
 * single biggest cost in a reference table's min-content width — a 5-column
 * gamepad-controls table pays 200px of that alone against ~350px of
 * available width, which is most of why #2193's tables needed ~2-3x the
 * visible box in horizontal scroll to reach their last column. Shrinking
 * padding (and the type a notch) buys most of that back without touching
 * layout above this breakpoint. 620px matches mdBook's own sidebar
 * breakpoint (chrome.css) rather than inventing a second one. Scoped to
 * `screen` so the print/PDF path (theme/pdf.css, a fixed-width medium) never
 * inherits it. */
@media only screen and (max-width: 620px) {
  .table-wrapper table {
    font-size: 0.9em;
  }
  .table-wrapper table td,
  .table-wrapper table th {
    padding: 3px 8px;
    /* `main`'s overflow-wrap: break-word (general.css) only acts as a
     * layout-time fallback — it doesn't shrink a table column's computed
     * min-content width, so one long slash-joined run (the CHORD engine's
     * "OCT/5/sus4/m/m7/m9/m11/M/M7/M9/69.") was still forcing its whole
     * column, and the table, wider than the viewport even after the padding
     * cut above. `anywhere` (unlike `break-word`) counts toward min-content,
     * closing that gap; it's a no-op for every shorter cell that already
     * wraps at a space. */
    overflow-wrap: anywhere;
  }
}

/* Callouts. The manual has exactly four (Why / Watch out / From an M8 / Try
 * this) and writes all of them as blockquotes, so the shared blockquote style
 * has to read as a callout rather than as a pull-quote. */
.content blockquote {
  border-inline-start: 3px solid var(--links);
  background: var(--quote-bg);
  border-block: none;
  padding: 0.6em 1em;
}

/* Part headings in the sidebar carry the book's spine; the default renders
 * them at body weight, which loses the five-part shape the manual is built
 * around. */
.chapter li.part-title {
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.85em;
}
