/* The user manual: manual.html and every manual-*.html page.

   Loaded after css/site.css and css/pages.css. The manual reuses the page
   shell, the NOTE aside (.install-note) and the command block (.install-code)
   from pages.css. This file adds what a reference manual needs and a one-column
   page does not: a wider shell, the chapter list at the side, figures with
   captions, settings tables and key caps.

   The chapter list is plain markup, repeated on each page. The site has no
   build step, so a new chapter means one new <li> in each manual page. */

/* ---------------------------------------------------------------------------
   Shell: wider than the other pages, because the chapter list takes a column.
   --------------------------------------------------------------------------- */

.manual .wrap,
.manual .container {
  max-width: 1120px;
}

.manual-layout {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 56px;
  align-items: start;
}

/* The page title sits on the light page, as on the install pages. A chapter
   page puts its back link above it. */
.manual .install-back:has(+ .install-title) {
  margin-bottom: 22px;
}

/* The prose column keeps a reading measure, however wide the window is. Its
   text has the size of the install pages' text. */
.manual-body {
  max-width: 720px;
  font-size: 15.5px;
  line-height: 1.85;
}

/* ---------------------------------------------------------------------------
   Chapter list
   --------------------------------------------------------------------------- */

.manual-nav {
  position: sticky;
  top: 24px;
  font-size: 14px;
  line-height: 1.5;
}

.manual-nav__group + .manual-nav__group {
  margin-top: 22px;
}

.manual-nav__label {
  font: 600 13px var(--mono);
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--red);
  margin: 0 0 10px;
}

.manual-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 1px solid var(--rule);
}

/* .page-content .manual-nav li a: pages.css colors and underlines each link in
   a list (.page-content li a), and this list is navigation, not prose. The li
   gives this rule the same specificity, and manual.css loads later. */
.page-content .manual-nav li a {
  display: block;
  border-bottom: 0;
  padding: 4px 0 4px 14px;
  margin-left: -1px;
  border-left: 1px solid transparent;
  color: var(--muted);
}

.page-content .manual-nav li a:hover {
  color: var(--ink);
}

.page-content .manual-nav li a[aria-current="page"] {
  color: var(--ink);
  font-weight: 600;
  border-left-color: var(--red);
}

/* ---------------------------------------------------------------------------
   Headings and sections
   --------------------------------------------------------------------------- */

/* h2 is .install-method-title, h3 is .install-step__title (pages.css). The
   hairline of .install-method-title is under the title, not above it. */
.manual-body h2 {
  font-size: 26px;
  letter-spacing: -.6px;
  line-height: 1.25;
  margin: 44px 0 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--rule);
}

.manual-body > h2:first-child,
.manual-body > .manual-toc + h2 {
  margin-top: 0;
}

/* The last section of a chapter. A link to it (the contents list, "see Get
   help") must bring its heading to the top of the window. A short section at
   the end of the page cannot scroll that far, so the link stops at the bottom
   of the page and the heading stays low in the window. The height gives the
   page the length to scroll; 30px is the scroll-padding-top of site.css. */
.manual-end {
  min-height: calc(100vh - 30px);
}

.manual-body h3 {
  font-size: 21px;
  letter-spacing: -.3px;
  line-height: 1.35;
  margin: 38px 0 8px;
}

.manual-body h4 {
  font-size: 17px;
  font-weight: 500;
  margin: 28px 0 6px;
}

/* site.css sets no paragraph margin, so two paragraphs would touch. */
.manual-body p {
  margin: 14px 0;
}

.manual-body ul,
.manual-body ol {
  padding-left: 22px;
}

.manual-body li + li {
  margin-top: 4px;
}

/* "On this page": the list of h2 anchors at the top of a long chapter. The
   chapter list in the side column gives its look. */
.manual-toc {
  margin: 0 0 40px;
  font-size: 14px;
  line-height: 1.5;
}

/* .manual-body .manual-toc__label: .manual-body p gives each paragraph a
   14px margin, and this rule must have more specificity. */
.manual-body .manual-toc__label {
  font: 600 13px var(--mono);
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--red);
  margin: 0 0 10px;
}

.manual-toc ul {
  columns: 2;
  column-gap: 32px;
  list-style: none;
  padding: 0;
  margin: 0;
}

/* The rule is on each item, not on the list, thus each column has its rule. */
.manual-toc li {
  border-left: 1px solid var(--rule);
  break-inside: avoid;
}

.manual-toc li + li {
  margin-top: 0;
}

/* .page-content .manual-toc li a: the same override as .manual-nav li a. */
.page-content .manual-toc li a {
  display: block;
  border-bottom: 0;
  padding: 4px 0 4px 14px;
  color: var(--muted);
}

.page-content .manual-toc li a:hover {
  color: var(--ink);
}

/* ---------------------------------------------------------------------------
   Procedures: a numbered list of actions. The layout of .install-step in
   pages.css: the numbers run down a dashed hairline, and the last step stops
   the line. A step is one sentence, not a title and a description, thus its
   text has the size of the body text, and the square and the number are
   smaller than in .install-step.
   --------------------------------------------------------------------------- */

.manual-steps {
  counter-reset: step;
  list-style: none;
  padding-left: 0 !important;
  margin: 26px 0;
}

.manual-steps > li {
  counter-increment: step;
  position: relative;
  min-height: 32px;
  padding-left: 46px;
  padding-top: 2px;
  padding-bottom: 24px;
}

.manual-body .manual-steps > li + li {
  margin-top: 0;
}

.manual-steps > li:before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--paper);
  border: 1px solid #c6cebd;
  font: 700 16px var(--mono);
  color: var(--red);
}

.manual-steps > li:after {
  content: "";
  position: absolute;
  left: 15px;
  top: 35px;
  bottom: 0;
  border-left: 1px dashed #c9cdc0;
}

.manual-steps > li:last-child {
  padding-bottom: 0;
}

.manual-steps > li:last-child:after {
  display: none;
}

/* ---------------------------------------------------------------------------
   Asides. .install-note (from pages.css) is the NOTE. A CAUTION tells you
   about a result that you cannot easily undo.
   --------------------------------------------------------------------------- */

.install-note.manual-caution {
  background: #f3e6e1;
  border-color: #e6cbc3;
  color: #5e4a44;
}

.install-note.manual-caution:before {
  content: "CAUTION";
  color: #a33b2b;
}

.install-note.manual-tip:before {
  content: "TIP";
}

.manual-body .install-note {
  font-size: 14.5px;
}

/* ---------------------------------------------------------------------------
   Figures. The three widths stop a phone screenshot from being drawn as wide
   as the column.
   --------------------------------------------------------------------------- */

.manual-shot {
  margin: 24px 0;
}

.manual-shot img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--rule);
  background: var(--paper-deep);
  box-shadow: 0 18px 30px -22px rgba(28, 40, 37, .45);
}

.manual-shot--phone img {
  max-width: 300px;
}

.manual-shot--tablet img {
  max-width: 560px;
}

.manual-shot--window img {
  max-width: 520px;
}

.manual-shot--dialog img {
  max-width: 380px;
}

/* The QR shot is small. At its natural width it stays sharp. */
.manual-shot--qr {
  text-align: center;
}

.manual-shot--qr img {
  max-width: 340px;
  margin: 0 auto;
}

/* A button or an icon in the text: a crop of the app, the height of a line. */
.manual-icon {
  display: inline-block;
  width: auto;
  height: 1.7em;
  margin: -0.2em 0.1em 0;
  vertical-align: middle;
  border-radius: 5px;
}

/* The power button: two crops of the top of the window, one above the other. */
.manual-shot--power img + img {
  margin-top: 12px;
}

.manual-shot figcaption {
  margin-top: 10px;
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.6;
}

/* Two figures side by side: for example portrait and landscape. */
.manual-shot-row {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: flex-start;
  margin: 24px 0;
}

.manual-shot-row .manual-shot {
  margin: 0;
}

/* ---------------------------------------------------------------------------
   Tables: settings, gestures, limits.
   --------------------------------------------------------------------------- */

.manual-table {
  width: 100%;
  border-collapse: collapse;
  margin: 18px 0 8px;
  font-size: 14.5px;
  line-height: 1.65;
}

.manual-table th,
.manual-table td {
  text-align: left;
  vertical-align: top;
  padding: 9px 12px 9px 0;
  border-bottom: 1px solid var(--rule);
}

.manual-table th {
  font: 11px var(--mono);
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: normal;
  border-bottom-color: var(--ink);
}

.manual-table td:first-child {
  font-weight: 600;
  white-space: nowrap;
  padding-right: 20px;
}

/* A key on a keyboard, or a button on a controller. */
.manual-body kbd {
  display: inline-block;
  min-width: 20px;
  padding: 0 6px;
  font: 13px/20px var(--mono);
  text-align: center;
  background: #fff;
  border: 1px solid var(--rule);
  border-bottom-width: 2px;
  border-radius: 3px;
}

/* ---------------------------------------------------------------------------
   The chapter cards on manual.html.
   --------------------------------------------------------------------------- */

.manual-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin: 20px 0;
}

.manual-card {
  display: block;
  padding: 16px 18px;
  border: 1px solid var(--rule);
  background: var(--paper);
  transition: border-color .15s;
}

.manual-card:hover {
  border-color: var(--red);
}

.manual-card__title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 17px;
  font-weight: 500;
  color: var(--ink);
}

/* The mode marks are the files in icons/ that the App Store panels use. */
.manual-card__icon {
  width: 20px;
  height: 20px;
}

.manual-card__desc {
  display: block;
  margin-top: 4px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--muted);
}

/* The previous and next chapter, at the foot of each page. */
.manual-pager {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-top: 64px;
  padding-top: 20px;
  border-top: 1px solid var(--rule);
  font-size: 14.5px;
}

.manual-pager a {
  color: var(--red);
}

.manual-pager__next {
  margin-left: auto;
  text-align: right;
}

/* ---------------------------------------------------------------------------
   Narrow screens: the chapter list moves above the text.
   --------------------------------------------------------------------------- */

@media (max-width: 860px) {
  .manual-layout {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .manual-nav {
    position: static;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
    padding-bottom: 22px;
    border-bottom: 1px solid var(--rule);
  }

  .manual-nav__group + .manual-nav__group {
    margin-top: 0;
  }

  .manual-cards,
  .manual-toc ul {
    grid-template-columns: 1fr;
    columns: 1;
  }

  .manual-table td:first-child {
    white-space: normal;
  }
}

/* The phone sizes of .install-step and .install-method-title. */
@media (max-width: 650px) {
  .manual-body h2 {
    font-size: 22px;
  }

  .manual-body h3 {
    font-size: 19px;
  }

  .manual-steps > li {
    min-height: 28px;
    padding-left: 40px;
    padding-top: 0;
    padding-bottom: 20px;
  }

  .manual-steps > li:before {
    width: 28px;
    height: 28px;
    font-size: 14px;
  }

  .manual-steps > li:after {
    left: 13px;
    top: 31px;
  }
}

@media (max-width: 560px) {
  .manual-nav {
    grid-template-columns: 1fr;
  }
}
