/* The help pages (/help). Loaded after app.css and built on its colours, so the help reads as part of VSTA.
   Type is the map's: Source Sans 3 for text and Source Serif 4 for headings, self-hosted in the map bundle
   (npm run build:maps writes them to /maps/assets). Without them the page falls back to app.css's system fonts.
   The one strong element is the numbered steps: a column of numbered stops joined by a line, like stages on a route. */

@font-face { font-family: "Source Sans 3"; font-style: normal; font-weight: 400; font-display: swap;
  src: url(/maps/assets/source-sans-3-latin-400-normal.woff2) format("woff2"), url(/maps/assets/source-sans-3-latin-400-normal.woff) format("woff"); }
@font-face { font-family: "Source Sans 3"; font-style: normal; font-weight: 500; font-display: swap;
  src: url(/maps/assets/source-sans-3-latin-500-normal.woff2) format("woff2"), url(/maps/assets/source-sans-3-latin-500-normal.woff) format("woff"); }
@font-face { font-family: "Source Serif 4"; font-style: normal; font-weight: 400; font-display: swap;
  src: url(/maps/assets/source-serif-4-latin-400-normal.woff2) format("woff2"), url(/maps/assets/source-serif-4-latin-400-normal.woff) format("woff"); }

body.help {
  --surface: rgba(127, 127, 127, 0.07);
  --rule: var(--border);
  --sans: "Source Sans 3", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: "Source Serif 4", Georgia, serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, monospace;
  font: 400 1.0625rem/1.6 var(--sans);
}

/* app.css sizes <main> for the narrow form pages; the help lays out its own. */
body.help main { max-width: none; margin: 0; padding: 0; }
/* Source Sans 3 is loaded at 400 and 500 only, so emphasis is 500 and the browser never fakes a bold. */
body.help :is(strong, b, th) { font-weight: 500; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link { position: absolute; left: 1rem; top: -3rem; padding: 0.5rem 0.75rem; background: var(--bg); z-index: 10; }
.skip-link:focus { top: 0.5rem; }

/* The bar across the top: the way home, and search on every page. */
.help-bar {
  display: flex; flex-wrap: wrap; gap: 0.75rem 2rem; align-items: center; justify-content: space-between;
  max-width: 72rem; margin: 0 auto; padding: 1rem 1.5rem; border-bottom: 1px solid var(--rule);
}
.help-brand { font: 400 1.25rem/1.2 var(--serif); color: var(--text); text-decoration: none; }
.help-brand:hover { color: var(--accent); }
.help-search { display: flex; gap: 0.5rem; margin: 0; flex: 0 1 26rem; }
.help-search input { flex: 1; min-width: 0; }
.help-search button { font-weight: 500; }

.help-content { max-width: 72rem; margin: 0 auto; padding: 2rem 1.5rem 4rem; }
.help-content:focus { outline: none; }

.help h1 { font: 400 2.25rem/1.15 var(--serif); margin: 0.5rem 0 0.75rem; letter-spacing: -0.005em; }
.help h2 { font: 400 1.45rem/1.25 var(--serif); margin: 2.5rem 0 0.75rem; }
.lead { font-size: 1.2rem; line-height: 1.5; color: var(--muted); margin: 0 0 2rem; max-width: 40rem; }

.crumbs { font-size: 0.95rem; color: var(--muted); }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--accent); }

/* Home: one tile per topic. */
.topics { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr)); }
.topic-tile {
  display: grid; gap: 0.4rem; height: 100%; box-sizing: border-box; padding: 1.25rem 1.25rem 1rem;
  border: 1px solid var(--rule); border-top: 4px solid var(--accent); border-radius: 6px; color: var(--text); text-decoration: none;
}
.topic-tile:hover { background: var(--surface); }
.topic-name { font: 400 1.4rem/1.2 var(--serif); color: var(--accent); }
.topic-summary { line-height: 1.5; }
.topic-count { font-size: 0.95rem; color: var(--muted); }

/* A topic's articles, and search results. */
.article-list { margin: 0; padding: 0 0 0 1.75rem; max-width: 42rem; }
.article-list li { margin: 0 0 1.25rem; padding-left: 0.25rem; }
.article-list li::marker { color: var(--muted); }
.article-list a { font-size: 1.15rem; font-weight: 500; }
.article-list p { margin: 0.2rem 0 0; color: var(--muted); }
.result-topic { color: var(--text); }

/* An article: the text, with the topic's other articles alongside on a wide screen and after it on a narrow one. */
.help-article { display: grid; gap: 2.5rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 60rem) {
  .help-article { grid-template-columns: 15rem minmax(0, 42rem); gap: 4rem; }
  .in-topic { grid-column: 1; grid-row: 1; position: sticky; top: 1.5rem; align-self: start; padding-top: 2.4rem; }
  .article-main { grid-column: 2; }
}
.in-topic { font-size: 0.975rem; border-top: 1px solid var(--rule); }
@media (min-width: 60rem) { .in-topic { border-top: 0; } }
.in-topic-title { margin: 0.75rem 0 0.5rem; font: 400 1.15rem/1.3 var(--serif); }
.in-topic-title a { color: var(--text); text-decoration: none; }
.in-topic ol { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--rule); }
.in-topic li a { display: block; padding: 0.35rem 0 0.35rem 0.9rem; margin-left: -2px; border-left: 2px solid transparent; color: var(--text); text-decoration: none; line-height: 1.35; }
.in-topic li a:hover { color: var(--accent); }
.in-topic li a[aria-current="page"] { border-left-color: var(--accent); color: var(--accent); font-weight: 500; }

.article-body { max-width: 42rem; }
.article-body p, .article-body ul { margin: 0 0 1rem; }
.article-body ul { padding-left: 1.25rem; }
.article-body li { margin: 0.3rem 0; }
.article-body img {
  display: block; max-width: min(100%, 32rem); height: auto; margin: 0.75rem 0 0.25rem; border: 1px solid var(--rule); border-radius: 6px;
}
.article-body code { font: 0.9em var(--mono); padding: 0.1em 0.3em; border-radius: 4px; background: var(--surface); overflow-wrap: anywhere; }
.article-body pre { margin: 0.5rem 0 1rem; padding: 0.75rem 1rem; border: 1px solid var(--rule); border-radius: 6px; background: var(--surface); overflow-x: auto; }
.article-body pre code { padding: 0; background: none; overflow-wrap: normal; }
/* Tables, such as the roles and the relations: ruled rows, and a sideways scroll on a phone instead of a wide page. */
.article-body table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; margin: 0.5rem 0 1.5rem; font-size: 0.95rem; }
.article-body th, .article-body td { padding: 0.45rem 0.9rem 0.45rem 0; border-bottom: 1px solid var(--rule); text-align: left; vertical-align: top; }
.article-body th { font-weight: 600; }

/* Numbered steps: each number is a stop, and a line runs down to the next one. */
.article-body ol { list-style: none; counter-reset: step; margin: 1.5rem 0 2rem; padding: 0; }
.article-body ol > li { counter-increment: step; position: relative; margin: 0; padding: 0.15rem 0 1.5rem 3.25rem; }
.article-body ol > li::before {
  content: counter(step); position: absolute; left: 0; top: 0; box-sizing: border-box; width: 2.1rem; height: 2.1rem;
  display: grid; place-items: center; border: 2px solid var(--accent); border-radius: 50%; background: var(--bg);
  color: var(--accent); font-weight: 500; font-size: 1rem; line-height: 1;
}
.article-body ol > li::after {
  content: ""; position: absolute; left: calc(1.05rem - 1px); top: 2.35rem; bottom: 0.25rem; width: 2px; background: var(--rule);
}
.article-body ol > li:last-child { padding-bottom: 0.25rem; }
.article-body ol > li:last-child::after { display: none; }
.article-body ol > li > p:last-child { margin-bottom: 0; }

.related { max-width: 42rem; margin-top: 3rem; padding-top: 0.5rem; border-top: 1px solid var(--rule); }
.related h2 { margin-top: 1.25rem; font-size: 1.2rem; }
.related ul { margin: 0; padding-left: 1.25rem; }
.related li { margin: 0.35rem 0; }

@media (max-width: 40rem) {
  .help-bar { padding: 0.75rem 1rem; }
  .help-search { flex-basis: 100%; }
  .help-content { padding: 1.5rem 1rem 3rem; }
  .help h1 { font-size: 1.85rem; }
  .article-body ol > li { padding-left: 2.75rem; }
}
