/* The Help section's own layout, on top of the site's legal column (site.css). A guide or a
   reference page is a reading column with the Help menu beside it at desk width and, where there
   is room, the page's own sections on the other side. The index is the lists of pages as cards. */

/* ---- the reading column -------------------------------------------------------------------- */
.help .help-body {
  min-width: 0;
  max-width: 44rem;
}
.help .help-body h1 {
  max-width: none;
  font-size: clamp(1.875rem, 3.2vw, 2.375rem);
}
.help .help-body .definition,
.help .help-body p,
.help .help-body li {
  max-width: none;
}
.help .help-body .definition {
  font-size: 1.125rem;
}
.help .help-body h2 {
  margin-top: 2.75rem;
  font-size: 1.3125rem;
  scroll-margin-top: calc(var(--top) + 1rem);
}
.help .help-body .help-video {
  max-width: none;
}

/* ---- the Help menu: every page under its list, shown beside the column at desk width -------- */
.help .help-nav {
  display: none;
  font-size: 0.875rem;
}
.help-nav-search {
  display: block;
  margin-bottom: 1.1rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border-strong);
  border-radius: 0.375rem;
  background: var(--panel);
  color: var(--faint);
  text-decoration: none;
}
.help-nav-search:hover {
  border-color: var(--faint);
  color: var(--ink);
}
.help-nav details + details {
  margin-top: 0.7rem;
}
.help-nav summary,
.help .help-toc p {
  color: var(--faint);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.help-nav summary {
  position: relative;
  padding: 0.3rem 1.5rem 0.3rem 0.75rem;
  list-style: none;
  cursor: pointer;
}
.help-nav summary::-webkit-details-marker {
  display: none;
}
.help-nav summary::after {
  content: "+";
  position: absolute;
  right: 0.5rem;
  top: 0.15rem;
  font-size: 0.875rem;
  letter-spacing: 0;
}
.help-nav details[open] > summary::after {
  content: "\2212";
}
.help-nav summary:hover {
  color: var(--ink-2);
}
.help .help-nav ul,
.help .help-toc ul {
  list-style: none;
  margin: 0.15rem 0 0;
  padding: 0;
}
.help .help-nav li,
.help .help-toc li {
  margin: 0;
  max-width: none;
}
.help .help-nav li a,
.help .help-toc a {
  display: block;
  padding: 0.26rem 0.75rem;
  border-radius: 0.3rem;
  color: var(--ink-2);
  line-height: 1.35;
  text-decoration: none;
}
.help .help-nav li a:hover,
.help .help-toc a:hover {
  color: var(--ink);
}
.help .help-nav li a[aria-current="page"] {
  background: var(--panel-2);
  box-shadow: inset 2px 0 0 var(--ink);
  color: var(--ink);
}

/* ---- the page's own sections ---------------------------------------------------------------
   A reference page is long, so below desk width its sections are listed in the column, as a row
   of links. A guide is short and shows the list only in the rail. */
.help-guide .help-toc {
  display: none;
}
.help-ref .help-toc {
  margin-top: 1.25rem;
  padding: 0.9rem 0.25rem 0.75rem;
  border: 1px solid var(--hairline);
  border-radius: 0.375rem;
  font-size: 0.875rem;
}
.help-ref .help-toc p {
  margin: 0;
  padding: 0 0.75rem;
}
.help-ref .help-toc ul {
  display: flex;
  flex-wrap: wrap;
}

@media (min-width: 1040px) {
  .help-guide,
  .help-ref {
    display: grid;
    grid-template-columns: 13.5rem minmax(0, 1fr);
    column-gap: clamp(2rem, 4vw, 4rem);
    align-items: start;
  }
  .help .help-nav {
    display: block;
    grid-column: 1;
    grid-row: 1;
    position: sticky;
    top: calc(var(--top) + 1.5rem);
    max-height: calc(100vh - var(--top) - 3rem);
    overflow-y: auto;
    scrollbar-width: thin;
  }
  .help .help-body {
    grid-column: 2;
    grid-row: 1;
    width: 100%;
  }
}
@media (min-width: 1280px) {
  .help-guide,
  .help-ref {
    position: relative;
    grid-template-columns: 13.5rem minmax(0, 1fr) 11.5rem;
  }
  .help .help-body {
    justify-self: center;
  }
  /* The rail runs the column's height at the page's right edge; the list in it stays in view. */
  .help .help-toc {
    display: block;
    position: absolute;
    top: 8.25rem;
    bottom: 4rem;
    right: var(--gutter);
    width: 11.5rem;
    margin: 0;
    padding: 0;
    border: 0;
    font-size: 0.8125rem;
  }
  .help .help-toc > div {
    position: sticky;
    top: calc(var(--top) + 1.5rem);
    max-height: calc(100vh - var(--top) - 3rem);
    overflow-y: auto;
    scrollbar-width: thin;
  }
  .help .help-toc ul {
    display: block;
    margin-top: 0.4rem;
    border-left: 1px solid var(--hairline);
  }
  .help .help-toc a {
    border-radius: 0;
  }
}

/* ---- a guide's steps: numbered rows -------------------------------------------------------- */
.help .help-body ol[data-testid="help-steps"] {
  list-style: none;
  counter-reset: help-step;
  margin: 0.9rem 0 0;
  padding: 0;
  border-bottom: 1px solid var(--hairline);
}
.help .help-body ol[data-testid="help-steps"] > li {
  counter-increment: help-step;
  position: relative;
  margin: 0;
  padding: 0.95rem 0 0.95rem 3rem;
  border-top: 1px solid var(--hairline);
  line-height: 1.55;
}
.help .help-body ol[data-testid="help-steps"] > li::before {
  content: counter(help-step);
  position: absolute;
  left: 0;
  top: 0.85rem;
  display: grid;
  place-items: center;
  width: 1.875rem;
  height: 1.875rem;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  color: var(--ink);
  font-size: 0.875rem;
  font-weight: 500;
}
.help .help-body strong {
  color: var(--ink);
}
.help-step-do {
  color: var(--ink);
  font-size: 1.0625rem;
}
.help-step-more {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.9375rem;
}

/* ---- pictures: at the column's width, never taller than a screen, never blown up ----------- */
.help .help-body .frame,
.help .help-body .frame.frame-book {
  max-width: none;
  margin: 1rem 0 0;
}
.help .help-body .frame img {
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 42rem;
}
.help .help-body ol[data-testid="help-legend"] {
  margin: 0.9rem 0 0;
  font-size: 0.875rem;
}
.help .help-body ol[data-testid="help-legend"] > li {
  margin: 0 0 0.45rem;
  break-inside: avoid;
}
@media (min-width: 700px) {
  .help .help-body ol[data-testid="help-legend"] {
    columns: 2;
    column-gap: 2.5rem;
  }
}

/* ---- settings and notes: rows under a hairline; a setting's name on its own line ----------- */
.help .help-body ul[data-testid="help-settings"],
.help .help-body ul[data-testid="help-notes"] {
  list-style: none;
  margin: 0.9rem 0 0;
  padding: 0;
  border-bottom: 1px solid var(--hairline);
}
.help .help-body ul[data-testid="help-settings"] > li,
.help .help-body ul[data-testid="help-notes"] > li {
  margin: 0;
  padding: 0.8rem 0;
  border-top: 1px solid var(--hairline);
}
.help .help-body ul[data-testid="help-settings"] > li > strong:first-child {
  display: block;
  margin-bottom: 0.1rem;
  font-weight: 500;
}
/* A note with a heading opens on a click. */
.help .help-body ul[data-testid="help-notes"] > li.help-q {
  padding: 0;
}
.help-q summary {
  position: relative;
  padding: 0.85rem 2rem 0.85rem 0;
  list-style: none;
  color: var(--ink);
  font-weight: 500;
  cursor: pointer;
}
.help-q summary::-webkit-details-marker {
  display: none;
}
.help-q summary::after {
  content: "+";
  position: absolute;
  right: 0.25rem;
  top: 0.7rem;
  color: var(--faint);
  font-size: 1.125rem;
  font-weight: 400;
}
.help-q details[open] > summary::after {
  content: "\2212";
}
.help .help-body .help-q p {
  margin: 0;
  padding-bottom: 1rem;
}

/* ---- the next guide, as a card ------------------------------------------------------------- */
.help .help-body .help-next {
  margin-top: 2.5rem;
}
.help-next a {
  position: relative;
  display: block;
  padding: 1rem 3rem 1.05rem 1.25rem;
  border: 1px solid var(--hairline);
  border-radius: 0.375rem;
  background: var(--panel);
  color: var(--ink);
  font-weight: 500;
  text-decoration: none;
}
.help-next a:hover {
  border-color: var(--border-strong);
  background: var(--panel-2);
}
.help-next a::after {
  content: "\2192";
  position: absolute;
  right: 1.25rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-2);
  font-size: 1.125rem;
  font-weight: 400;
}
.help-next span {
  display: block;
  margin-bottom: 0.2rem;
  color: var(--faint);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ---- the index: a search box, then each list of pages as a plain column of links ---------- */
.help-index .definition {
  max-width: 40rem;
  color: var(--ink-2);
  font-size: 1.125rem;
}
.help-index .help-search {
  margin-top: 1.5rem;
}
.help-index .help-search .field {
  max-width: 40rem;
}
.help-index .help-search .field input {
  padding: 0.85rem 1.1rem;
  border-radius: 0.5rem;
  font-size: 1.0625rem;
}
/* What a search finds: plain rows under the box, not the site's grid of cards. */
.help-index .help-search .term-list {
  display: block;
  max-width: 46rem;
  margin-top: 0.5rem;
  border: 0;
  border-radius: 0;
  background: none;
}
.help-index .help-search .term-list li {
  padding: 0.9rem 0;
  border-top: 1px solid var(--hairline);
  background: none;
}
.help-topics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 2.5rem;
  margin-top: 3rem;
  padding-top: 2.25rem;
  border-top: 1px solid var(--hairline);
}
.help-more {
  margin-top: 2.5rem;
  padding-top: 2.25rem;
  border-top: 1px solid var(--hairline);
}
.help-index .help-topics h2,
.help-index .help-more h2 {
  margin: 0 0 0.7rem;
  color: var(--faint);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.help-index ol {
  list-style: none;
  margin: 0;
  padding: 0;
}
.help-index ol li {
  margin: 0;
  max-width: none;
  break-inside: avoid;
}
.help-index ol a {
  display: block;
  padding: 0.34rem 0;
  color: var(--ink);
  line-height: 1.35;
  text-decoration: none;
}
.help-index ol a:hover {
  text-decoration: underline;
}
.help-more ol {
  columns: 4;
  column-gap: 2.5rem;
}
.help-index .help-more ol a {
  color: var(--ink-2);
}
.help-index .help-more ol a:hover {
  color: var(--ink);
}
/* The headings under the lists (Go deeper, Still stuck?) keep the site's own size. */
.help-index > h2 {
  margin-top: 3rem;
}
@media (max-width: 1000px) {
  .help-topics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .help-more ol {
    columns: 2;
  }
}
@media (max-width: 560px) {
  .help-topics {
    grid-template-columns: minmax(0, 1fr);
    gap: 2rem;
  }
  .help-more ol {
    columns: 1;
  }
}
