/* The user manual (EAR-500): a contents list and a search box down the left, the chapters
   beside it. It borrows the site's colours and letters (styles.css) and adds only what a long
   page of reading needs. */

.manual-page .top .wordmark {
  text-decoration: none;
}

.manual {
  display: grid;
  grid-template-columns: 17rem minmax(0, 1fr);
  gap: 2.5rem;
  max-width: 76rem;
  margin: 0 auto;
  padding: 1rem 1.5rem 4rem;
}

/* The contents stay in sight while the chapters scroll. */
.contents {
  position: sticky;
  top: 1rem;
  align-self: start;
  max-height: calc(100vh - 2rem);
  overflow: auto;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgb(7 10 16 / 0.75);
}

.search span {
  display: block;
  margin-bottom: 0.35rem;
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.85rem;
  color: var(--ice);
}

.search input {
  width: 100%;
  padding: 0.55rem 0.7rem;
  border: 1px solid rgb(127 212 255 / 0.5);
  border-radius: 8px;
  background: rgb(127 212 255 / 0.06);
  color: var(--text);
  font: inherit;
}

.search input:focus {
  outline: 2px solid var(--ice-strong);
  outline-offset: 1px;
}

.count {
  min-height: 1.4em;
  margin: 0.4rem 0 0.2rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.contents ol {
  margin: 0.4rem 0 0;
  padding: 0;
  list-style: none;
}

.contents a {
  display: block;
  padding: 0.3rem 0.4rem;
  border-radius: 6px;
  color: var(--text);
  text-decoration: none;
}

.contents a:hover {
  background: rgb(127 212 255 / 0.12);
  color: var(--ice);
}

/* A chapter with nothing in it that matches the search. */
.contents li.empty a {
  color: #56667c;
}

.manual main h1 {
  margin: 0.5rem 0 0.6rem;
  font-family: var(--display);
  font-size: 3rem;
  line-height: 1.05;
  color: var(--ice);
}

.edition {
  max-width: 46rem;
  margin: 0 0 1rem;
  padding: 0.7rem 1rem;
  border-left: 3px solid var(--brand);
  background: rgb(95 245 226 / 0.06);
  color: var(--muted);
}

.none {
  padding: 1rem;
  border: 1px dashed var(--border);
  border-radius: 8px;
  color: var(--muted);
}

.chapter {
  margin-top: 3rem;
  scroll-margin-top: 1rem;
}

.chapter > h2 {
  margin: 0 0 0.8rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--border);
  font-family: var(--display);
  font-size: 2.1rem;
  color: var(--ice-strong);
}

.topic {
  max-width: 48rem;
  margin: 1.6rem 0 0;
  scroll-margin-top: 1rem;
}

.topic h3 {
  margin: 0 0 0.4rem;
  font-family: var(--display);
  font-size: 1.45rem;
  color: var(--text);
}

.topic p,
.chapter > p {
  margin: 0.5rem 0;
}

.lead {
  max-width: 48rem;
  color: var(--muted);
}

.topic a,
.chapter > p a {
  color: var(--ice-strong);
}

.topic ul,
.topic ol {
  margin: 0.5rem 0;
  padding-left: 1.3rem;
}

.topic li + li {
  margin-top: 0.3rem;
}

/* A name and what it is: the name stands out, the words sit under it. */
.topic dl {
  margin: 0.6rem 0;
}

.topic dt {
  margin-top: 0.6rem;
  font-weight: 600;
  color: var(--ice);
}

.topic dd {
  margin: 0.1rem 0 0;
  color: var(--text);
}

.chapter figure {
  max-width: 62rem;
  margin: 1rem 0;
}

.chapter figure.narrow {
  max-width: 16rem;
}

.chapter figure img {
  display: block;
  max-width: 100%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.chapter figcaption {
  margin-top: 0.35rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.topic table {
  width: 100%;
  margin: 0.6rem 0;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.topic th {
  padding: 0.4rem 0.6rem;
  border-bottom: 1px solid rgb(127 212 255 / 0.5);
  text-align: left;
  font-family: var(--display);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 0.85rem;
  color: var(--ice);
}

.topic td {
  padding: 0.35rem 0.6rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

/* A word the search found. */
mark {
  padding: 0 0.1em;
  border-radius: 3px;
  background: var(--brand);
  color: #06202f;
}

.manual-foot {
  padding: 1.5rem;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 0.9rem;
  color: var(--muted);
}

/* A narrow window: the contents go on top and stop following. */
@media (max-width: 860px) {
  .manual {
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
  }

  .contents {
    position: static;
    max-height: none;
  }
}
