/* Fonts: HelveticaNeue-Roman 400 -> system Helvetica Neue stack 400,
   HelveticaNeue-Bold 700 -> same stack 700 (as mxr-super-badass-dynamic-od) */

:root {
  --ink: #1a1a1a;    /* body text */
  --accent: #00b0d9; /* enclosure blue, also the manual's leader lines */
  --rule: #1a1a1a;   /* the manual's black hairlines */
  --paper: #f1f1f1;  /* tint behind callouts */
  --muted: #5e5e5e;
  /* the enclosure blue darkened to pass 4.5:1 on white */
  --link: #00718c;
  --body-font: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --head-font: var(--body-font);
}

/* ---- structure: keep as is, restyle below the brand line ---- */

*, *::before, *::after { box-sizing: border-box; }
* { margin-top: 0; }

body {
  margin: 0;
  color: var(--ink);
  background: #fff;
  font-family: var(--body-font);
  font-size: 1rem;
  line-height: 1.6;
}
h1, h2, h3, h4, h5, h6 { font-family: var(--head-font); line-height: 1.2; }

main { margin-left: 20vw; padding-bottom: 3em; }
footer { margin-left: 20vw; padding: 1.6em 3em; }

a { color: var(--link); }

img { max-width: 100%; height: auto; margin-bottom: 0.75em; }
.topic > img, li > img, figure > img { display: block; }
figure { margin: 0 0 1em; }

/* NAV */
#side-nav {
  position: fixed; top: 0; left: 0;
  width: 20vw; height: 100%;
  overflow-y: auto;
  background: #fff;
  border-right: 1px solid var(--rule);
  z-index: 5;
}
.nav-container { display: flex; flex-direction: column; margin: 1.5em 1em; }
#side-nav h4, #side-nav h5 { font-weight: 400; margin-bottom: 0.45em; }
#side-nav h4 { font-weight: 700; }
#side-nav h5 { font-size: 0.9em; margin-left: 1em; }
#side-nav a, #toc-mobile a { color: inherit; text-decoration: none; }
#side-nav a:hover, #toc-mobile a:hover { text-decoration: underline; }

/* SECTIONS */
section + section { margin-top: 3em; }
.flex-container { display: flex; padding-left: 2em; }
.half-container { width: 100%; padding: 0 1em; container-type: inline-size; }
.half-container > header { column-span: all; }
.flow > * + * { margin-bottom: 1em; }

/* One .topic per heading carries the columns, so no column runs taller than
   one topic. 63rem below = the two-column threshold of `columns: 2 30rem`. */
.topic { columns: 2 30rem; column-gap: 3em; }
.no-columns { columns: auto !important; }

/* COLUMN BREAKS. A paragraph, list item, figure, table or callout is never
   cut by the gutter. Chrome's balancer drops `break-after: avoid` when it
   gets in the way, so it is only a hint: what keeps a heading off a column's
   foot is a .keep-together holding the heading and its first block. */
p, li, figure, table, .table-scroll, .keep-together, .callout, .grid-wrapper {
  break-inside: avoid;
}
h2, h3, h4, h5, h6 { break-after: avoid; }
/* a lead-in ending in ":" stays with what it introduces */
:has(+ p > .menu-path:only-child) { break-after: avoid; }
@container (min-width: 63rem) {
  .column-end { break-after: column; }
}

/* Figure rows: the max stays indefinite, or auto-fit counts its tracks off
   it and stacks one figure per row in a narrow column. */
.grid-wrapper {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(8em, 100%), 1fr));
  gap: 1em;
}
.grid-wrapper img { width: 100%; }

/* TABLES */
.table-scroll { overflow-x: auto; margin-bottom: 1em; }
.doc-table { width: 100%; border-collapse: collapse; font-size: 0.92em; }
.doc-table th, .doc-table td {
  padding: 0.4em 0.6em;
  text-align: left;
  vertical-align: top;
  border: 1px solid var(--rule);
}
.doc-table thead th { background: var(--accent); color: #fff; }

.callout {
  background: var(--paper);
  border-left: 4px solid var(--accent);
  padding: 0.7em 1em;
  margin-bottom: 1em;
}
.callout > :last-child { margin-bottom: 0; }

@media (max-width: 900px) {
  .flex-container { flex-direction: column; padding-left: 0; }
  .half-container { padding: 0 1em; }
  nav { display: none; }
  main, footer { margin: 0 auto; }
  footer { padding: 1.6em 1em; }
  #toc-mobile { display: block; }
  /* a diagram with small labels scrolls instead of shrinking */
  .wide-figure { overflow-x: auto; }
  .wide-figure img { min-width: 700px; }
}
/* 901, not 900: at exactly 900px both queries match and the mobile TOC
   would vanish together with the nav */
@media (min-width: 901px) { #toc-mobile { display: none; } }

/* ---- brand: masthead, heading treatment, callouts, from this manual ---- */

#side-nav { border-right-color: #d9d9d9; }
#side-nav h3 {
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.85em;
}

#masthead {
  padding: 2.5em 0 2.5em;
}
/* the title takes the room, the photo sits right after it */
#masthead .flex-container { align-items: center; gap: 3em; }
#masthead .half-container:first-child { flex: 1; }
/* no size containment here, or the auto-width photo column collapses to 0 */
#masthead .half-container:last-child { flex: 0 0 auto; width: auto; container-type: normal; }
#masthead h1 { margin: 0; font-size: 1em; line-height: 1.1; }
#masthead h1 img {
  display: block;
  height: 6em;
  width: auto;
  margin-bottom: 1.2em;
}
#masthead h1 span {
  display: block;
  font-size: 2.6em;
  font-weight: 700;
  padding-top: 0.4em;
  border-top: 1px solid var(--rule);
}
/* CSP027 sits top right, level with the logo, as on the cover */
.masthead-title { position: relative; }
.model-code {
  position: absolute;
  top: 0;
  right: 0;
  font-weight: 700;
  margin: 0;
}
.masthead-photo {
  display: block;
  width: 180px;
  margin: 0 auto;
}

/* the manual rules every heading with a black hairline, bold text under it */
main h2, main h3 {
  font-weight: 700;
  padding-top: 0.5em;
  border-top: 1px solid var(--rule);
}
h2 { font-size: 1.3em; margin-bottom: 1em; }
h3 { font-size: 1.05em; margin-bottom: 0.8em; }

sup { font-size: 0.5em; line-height: 0; }
/* the manual sets list numbers in HelveticaNeue-Bold */
ol > li::marker { font-weight: 700; }

.lead { font-size: 1.25em; line-height: 1.45; }
.url { font-size: 1.25em; margin-top: 1.5em; }

.controls-wrapper {
  grid-template-columns: minmax(14em, 22em) 1fr;
  gap: 2em;
  align-items: center;
}
.controls-wrapper img { margin: 0; }
.controls-list { padding-left: 1.4em; margin: 0; }
.controls-list li { margin-bottom: 0.5em; }
/* the control numbers print without a period; the Directions steps keep one */
.controls-list li::marker { content: counter(list-item) "  "; }

ol > li { margin-bottom: 0.6em; }
ol > li > p { margin-bottom: 0.5em; }

/* rows ruled top and bottom, no vertical dividers, no fill: as printed */
.doc-table { font-size: 1em; }
.doc-table th, .doc-table td {
  border: 0;
  border-bottom: 1px solid var(--rule);
  font-weight: 400;
  padding: 0.45em 0.6em 0.45em 0.4em;
}
.doc-table tr:first-child > * { border-top: 1px solid var(--rule); }
.doc-table th { width: 50%; }
.table-note { font-size: 0.85em; color: var(--muted); padding-left: 0.5em; }

footer {
  border-top: 1px solid var(--rule);
  font-size: 0.85em;
  color: var(--muted);
}

@media (max-width: 900px) {
  #masthead .flex-container { flex-direction: column-reverse; }
  .controls-wrapper { grid-template-columns: 1fr; }
}
