/* StitchLab Help (help.html): the app's tokens (style.css :root, light / dark), no colors of its own. */

body.help { display: block; height: auto; min-height: 100%; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.help-top {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  padding: 0.6rem 1rem; background: var(--paper); border-bottom: 1px solid var(--rule);
}
.help-brand { font-weight: 700; font-size: 1.15rem; color: var(--ink); text-decoration: none; }
.help-brand span { font-weight: 400; color: var(--muted); }
.help-search { flex: 1 1 18rem; max-width: 34rem; }
.help-search input {
  width: 100%; box-sizing: border-box; padding: 0.45rem 0.7rem; border: 1px solid var(--rule);
  border-radius: var(--radius-m); background: var(--surface);
}
.help-actions { display: flex; gap: 0.4rem; margin-left: auto; }

.help-body { display: grid; grid-template-columns: minmax(12rem, 17rem) minmax(0, 1fr); gap: 0; align-items: start; }
.help-nav {
  position: sticky; top: 3.4rem; max-height: calc(100vh - 3.6rem); overflow-y: auto;
  padding: 0.8rem 0.6rem 2rem 1rem; border-right: 1px solid var(--rule); box-sizing: border-box;
}
.help-nav a { display: block; color: var(--ink); text-decoration: none; padding: 0.18rem 0.4rem; border-radius: var(--radius-s); }
.help-nav a:hover { background: var(--paper-2); }
.help-nav .chapter { font-weight: 600; margin-top: 0.5rem; }
.help-nav .chapter[aria-current="true"] { color: var(--accent-text); }
.help-nav ul { list-style: none; margin: 0.1rem 0 0.3rem; padding: 0 0 0 0.7rem; font-size: 0.9rem; }
.help-nav ul a { color: var(--muted); }
.help-nav ul a[aria-current="true"] { color: var(--ink); background: var(--paper-2); }

.help-main { padding: 1rem 2rem 4rem; max-width: 52rem; line-height: 1.55; outline: none; }
.help-main h1 { font-size: 1.7rem; margin: 0.4rem 0 0.6rem; }
.help-main h2 { font-size: 1.25rem; margin: 2rem 0 0.4rem; padding-top: 0.6rem; border-top: 1px solid var(--rule); }
.help-main section:first-of-type h2 { border-top: none; }
.help-main h3 { font-size: 1.02rem; margin: 1.2rem 0 0.3rem; }
.help-main p, .help-main li { max-width: 46rem; }
.help-main a { color: var(--complement); }
.help-main code, .help-main kbd {
  font-family: Consolas, "Cascadia Mono", monospace; font-size: 0.88em;
  background: var(--paper-2); border: 1px solid var(--rule); border-radius: var(--radius-s); padding: 0 0.3em;
}
.help-main kbd { white-space: nowrap; }
.help-main table { border-collapse: collapse; margin: 0.6rem 0 1rem; font-size: 0.93rem; }
.help-main th, .help-main td { border: 1px solid var(--rule); padding: 0.3rem 0.6rem; text-align: left; vertical-align: top; }
.help-main th { background: var(--paper-2); }
.help-main figure { margin: 0.8rem 0 1.2rem; }
.help-main figure img { max-width: 100%; border: 1px solid var(--rule); border-radius: var(--radius-m); }
.help-main figcaption { font-size: 0.88rem; color: var(--muted); margin-top: 0.25rem; }
.help-main .tip, .help-main .fabric, .help-main .note {
  border-left: 4px solid var(--brass); background: var(--paper-2); padding: 0.5rem 0.8rem; margin: 0.8rem 0;
  border-radius: 0 var(--radius-s) var(--radius-s) 0;
}
.help-main .fabric { border-left-color: var(--ok); }
.help-main .note { border-left-color: var(--complement); }
.help-main .tip::before { content: "Tip: "; font-weight: 600; }
.help-main .fabric::before { content: "On fabric: "; font-weight: 600; }
.help-main .note::before { content: "Note: "; font-weight: 600; }
.help-main .chapter-next { margin-top: 2.5rem; padding-top: 0.8rem; border-top: 1px solid var(--rule); }
.help-loading, .help-empty { color: var(--muted); }

.help-results h1 { font-size: 1.3rem; }
.help-results ol { padding-left: 1.2rem; }
.help-results li { margin: 0 0 0.8rem; }
.help-results .where { font-size: 0.85rem; color: var(--muted); }
.help-results mark { background: var(--own-bg); color: var(--ink); border-radius: 2px; }

@media (max-width: 760px) {
  .help-body { grid-template-columns: 1fr; }
  .help-nav { position: static; max-height: none; border-right: none; border-bottom: 1px solid var(--rule); }
  .help-main { padding: 1rem; }
}

@media print {
  .help-top, .help-nav { display: none; }
  .help-body { display: block; }
  .help-main { max-width: none; padding: 0; }
  .help-main a { color: inherit; text-decoration: none; }
  .help-main h1.chapter-title { break-before: page; }
  .help-main h1.chapter-title:first-child { break-before: auto; }
  .help-main figure, .help-main table, .help-main .tip, .help-main .fabric, .help-main .note { break-inside: avoid; }
  .help-main .chapter-next { display: none; }
}

.help-main code { overflow-wrap: anywhere; }
.help-main section { scroll-margin-top: 4.2rem; }   /* a linked section's title clear of the sticky top bar */

/* Credits: a license name stays on one line */
.credits td:last-child { white-space: nowrap; }
