/* FONTS
   Same Roland template as boss-ns-1x and boss-ge-7:
     MyriadPro-Regular / Semibold / Bold (every text face) -> Source Sans 3
   RolandOwnersManual-01rev2 is Roland's dingbat font (asterisks, bullets,
   arrows, the ▼/▲ switch marks); its glyphs are replaced by Unicode */
@import url("https://fonts.googleapis.com/css2?family=Source+Sans+3:wght@400;600;700&display=swap");

/* PALETTE — sampled off the manual's pages */
:root {
  --ink: #231f20; /* body text, table rules */
  --green: #398953; /* chapter block and rule, section bars */
  --green-light: #a6cbb0; /* table header row */
  --navy: #10508c; /* step instructions, NOTE badge */
  --orange: #d45636; /* step numbers */
  --link: #3375c4; /* cross-references */
}

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

body {
  color: var(--ink);
  font-family: "Source Sans 3", sans-serif;
  margin: 0;
}
p,
li {
  line-height: 1.55;
}
main {
  margin-left: 20vw;
  padding-bottom: 3em;
}
img {
  width: 100%;
  margin-bottom: 0.75em;
}
a {
  text-decoration: none;
  color: var(--link);
}
a:hover,
a:active {
  text-decoration: underline;
}

/* MASTHEAD: boss-ns-1x's arrangement (pedal beside the title block), with
   this cover's blue BOSS logo and plain model lettering */
#masthead {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.5em 3em;
  padding: 2em 3em;
}
#masthead > img {
  order: -1;
  width: 10em;
  margin: 0;
}
#masthead .title {
  flex: 1 1 20em;
}
#masthead h1 {
  display: flex;
  flex-direction: column;
  gap: 1em;
  font-size: 1rem;
  font-weight: 400;
  margin: 0;
}
#masthead h1 img {
  width: min(13em, 55%);
  margin: 0;
}
#masthead h1 span {
  align-self: flex-end;
  font-size: 3.2em;
  line-height: 1;
}
#masthead .title p {
  font-size: 1.9em;
  font-weight: 400;
  text-align: right;
  border-bottom: 3px solid var(--ink);
  margin: 0.3em 0 0;
}
#masthead .cover-note {
  flex-basis: 100%;
  font-size: 0.9em;
  margin: 0;
}

/* HEADINGS
   Chapter: large regular type beside a green block, over a green rule */
.flow h2 {
  font-weight: 400;
  font-size: 2.2em;
  line-height: 1.2;
  border-left: 0.45em solid var(--green);
  border-bottom: 2px solid var(--green);
  padding: 0.05em 0 0.05em 0.4em;
  margin-bottom: 0.75em;
}
/* Section: white type reversed out of a green bar */
.flow h3 {
  column-span: all;
  font-weight: 400;
  font-size: 1.45em;
  color: #fff;
  background: var(--green);
  padding: 0.05em 0.3em;
  margin: 1.5em 0 0.6em;
}
/* Small bold run-in head that stays inside its column */
.flow h3.plain {
  column-span: none;
  font-weight: 700;
  font-size: 1.05em;
  color: var(--ink);
  background: none;
  padding: 0;
  margin: 0 0 0.4em;
}
.flow h2,
.flow h3 {
  break-after: avoid;
}
.half-container > header + * {
  margin-top: 0;
}

/* SIDE NAVIGATION */
#side-nav {
  width: 20vw;
  background: white;
  position: fixed;
  z-index: 5;
  height: 100%;
  overflow-y: auto;
  border-right: 1px solid rgba(57, 137, 83, 0.2);
}
.nav-container {
  display: flex;
  flex-direction: column;
  margin: 1em 1em 2em;
}
.nav-container h3 {
  margin-bottom: 1.5rem;
}
.nav-container h4,
#toc-mobile h4 {
  font-size: 1em;
  font-weight: 700;
  margin: 0.9em 0 0.4em;
}
.nav-container h5,
#toc-mobile h5 {
  font-size: 0.9em;
  font-weight: 600;
  margin: 0 0 0.35em 0.75em;
}
.nav-container a,
#toc-mobile a {
  color: var(--ink);
}
#toc-mobile {
  padding: 0 1em;
}

/* CONTAINERS */
.flex-container {
  display: flex;
  padding-left: 2em;
}
.half-container {
  padding: 0 1em;
  width: 100%;
  columns: 2 30em;
  column-gap: 3em;
}
.half-container > header {
  column-span: all;
}
.no-columns {
  columns: auto !important;
}
.flow p,
.flow li,
figure,
.keep-together {
  break-inside: avoid;
}
section + section {
  margin-top: 3em;
}
.flow > * + * {
  margin-bottom: 1em;
}

/* FIGURES */
figure {
  margin: 0 0 1em;
}
figure img {
  display: block;
  margin: 0;
}
/* Upper bounds keep crops near their native size instead of upscaling */
figure.wide {
  column-span: all;
}
figure.wide img {
  max-width: 50em;
  margin: 0 auto;
}
.fig-m img {
  max-width: 24em;
}
.fig-knob img {
  max-width: 14em;
  margin: 0.4em 0 0;
}

/* Panel descriptions: the numbered diagram stays in view beside the table */
.panel-layout {
  display: grid;
  grid-template-columns: minmax(12em, 17em) 1fr;
  gap: 2em;
  align-items: start;
}
.panel-layout > figure {
  position: sticky;
  top: 1em;
}

/* "* note" lines */
ul.ast {
  list-style-type: "* ";
  padding-left: 1em;
}
.xref::before {
  content: "→ ";
}

/* STEPS: white numbers in orange discs, bold navy instructions, plain follow-up */
ol.steps {
  list-style: none;
  counter-reset: step;
  padding-left: 2em;
}
ol.steps > li {
  counter-increment: step;
  position: relative;
  margin-bottom: 0.9em;
}
ol.steps > li::before {
  content: counter(step);
  position: absolute;
  left: -2.1em;
  top: 0.2em;
  width: 1.35em;
  height: 1.35em;
  border-radius: 50%;
  background: var(--orange);
  color: #fff;
  font-size: 0.85em;
  font-weight: 700;
  line-height: 1.35em;
  text-align: center;
}
ol.steps .do {
  display: block;
  color: var(--navy);
  font-weight: 700;
}
ol.steps p {
  margin: 0.3em 0 0;
}

.badge {
  display: inline-block;
  font-weight: 700;
  font-size: 0.85em;
  color: #fff;
  background: var(--navy);
  padding: 0 0.4em;
  margin-bottom: 0.4em;
}

/* REFERENCE TABLES: fully ruled grid, light-green header row */
.table-scroll {
  overflow-x: auto;
  margin-bottom: 1.5em;
}
.doc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92em;
  line-height: 1.4;
}
.doc-table th,
.doc-table td {
  border: 1px solid var(--ink);
  padding: 0.4em 0.5em;
  text-align: left;
  vertical-align: top;
}
.doc-table thead th {
  background: var(--green-light);
  font-weight: 700;
}
.doc-table tbody th {
  font-weight: 400;
  width: 35%;
}
.doc-table p,
.doc-table ul {
  margin-bottom: 0.4em;
}
.doc-table td > :last-child {
  margin-bottom: 0;
}
.c-num {
  width: 4.5em;
}
.c-name {
  width: 28%;
}

.fine-print {
  font-size: 0.9em;
}
.colophon {
  font-size: 0.85em;
  padding-left: 3em;
  margin-top: 3em;
}

@media (max-width: 900px) {
  .flex-container {
    flex-direction: column;
    padding-left: 0;
  }
  .half-container {
    width: 100%;
    padding: 0;
  }
  nav#side-nav {
    display: none;
  }
  main {
    margin: 0 auto;
    padding: 0 1em 3em;
  }
  #masthead {
    padding: 1.5em 0;
  }
  #masthead > img {
    width: 7em;
  }
  .panel-layout {
    grid-template-columns: 1fr;
  }
  .panel-layout > figure {
    position: static;
    width: 100%;
    max-width: 16em;
    margin: 0 auto;
  }
  /* One block per part, number and name over a full-width explanation:
     three columns squeeze the explanation to a few words a line */
  .panel-table,
  .panel-table tbody {
    display: block;
  }
  .panel-table thead {
    display: none;
  }
  .panel-table tr {
    display: grid;
    grid-template-columns: 2.5em 1fr;
    border: 1px solid var(--ink);
  }
  .panel-table tr + tr {
    margin-top: -1px;
  }
  .panel-table td {
    border: 0;
  }
  .panel-table td:nth-child(2) {
    font-weight: 700;
  }
  .panel-table td:last-child {
    grid-column: 1 / -1;
    padding-top: 0;
  }
  .colophon {
    padding-left: 0;
  }
  #toc-mobile {
    display: block;
    padding: 0 0 1em;
  }
}

/* 901, not 900: both queries match at exactly 900px, and this one comes later,
   so at that width the nav is hidden and the mobile TOC would be too */
@media (min-width: 901px) {
  #toc-mobile {
    display: none;
  }
}
