/* Die Hilfeseite.
 *
 * Sie erbt Farben, Schrift und Radien aus style.css — dieselbe Sprache wie
 * der Editor, nur zum Lesen gesetzt: eine schmale Spalte, links das
 * Inhaltsverzeichnis, das mitscrollt.
 */

body.help-page {
  height: auto;
  min-height: 100vh;
  display: block;
}

.help {
  display: grid;
  grid-template-columns: 200px minmax(0, 700px);
  gap: 48px;
  justify-content: center;
  padding: 40px 24px 100px;
}

/* Das Inhaltsverzeichnis bleibt stehen, während der Text läuft. */
.toc {
  position: sticky;
  top: 40px;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 12.5px;
}
.toc a {
  color: var(--muted);
  text-decoration: none;
  padding: 3px 10px;
  border-left: 2px solid transparent;
  border-radius: 0 var(--radius) var(--radius) 0;
}
.toc a:hover {
  color: var(--ink);
  background: var(--panel);
  border-left-color: var(--accent);
}

/* Lesetext: ruhige Zeilenlänge, großzügige Durchschüsse. */
.help article {
  font-size: 14.5px;
  line-height: 1.65;
}
.help h1 {
  font-size: 30px;
  font-weight: 650;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
}
.help .lead {
  font-size: 16px;
  color: var(--muted);
  margin: 0 0 40px;
  max-width: 56ch;
}
.help h2 {
  font-size: 19px;
  font-weight: 650;
  letter-spacing: -0.01em;
  margin: 44px 0 10px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}
.help section:first-of-type h2 { border-top: 0; padding-top: 0; }
.help h3 {
  font-size: 14.5px;
  font-weight: 650;
  margin: 26px 0 6px;
}
.help p { margin: 0 0 14px; max-width: 68ch; }
.help a { color: var(--accent); }

/* Ein Hinweis, der nebenherläuft — nicht wichtiger als der Text, aber
   erkennbar als Randbemerkung. */
.help .note {
  color: var(--muted);
  font-size: 13.5px;
  border-left: 2px solid var(--line);
  padding-left: 12px;
}

/* Beispiele: Typst-Quelltext in derselben Schrift wie im Editor. */
.help pre {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  overflow-x: auto;
  margin: 0 0 16px;
}
.help pre code {
  font: 12.5px/1.6 ui-monospace, "SF Mono", Menlo, monospace;
  color: var(--ink);
}
.help p code,
.help td code {
  font: 12.5px/1.4 ui-monospace, "SF Mono", Menlo, monospace;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 0 4px;
}

/* Zweispaltige Tabellen für Syntax und Tastenkürzel: links die Form,
   rechts, was sie bedeutet. */
.help table.syntax {
  border-collapse: collapse;
  margin: 0 0 18px;
  width: 100%;
  max-width: 68ch;
}
.help table.syntax td {
  padding: 6px 12px 6px 0;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.help table.syntax td:first-child {
  white-space: nowrap;
  width: 1%;
  padding-right: 20px;
}
.help table.syntax.wide td:first-child { white-space: normal; width: 30%; }
.help table.syntax tr:last-child td { border-bottom: 0; }

.help kbd {
  font: 11.5px/1.4 ui-monospace, monospace;
  background: var(--panel);
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 4px;
  padding: 1px 5px;
}

.help-footer {
  display: flex;
  justify-content: center;
  gap: 10px;
  padding: 0 24px 40px;
  color: var(--muted);
  font-size: 12.5px;
}
.help-footer a { color: var(--muted); }
.help-footer a:hover { color: var(--accent); }

/* Schmale Fenster: das Inhaltsverzeichnis wandert nach oben. */
@media (max-width: 820px) {
  .help {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
    padding: 24px 18px 60px;
  }
  .toc {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 4px;
  }
  .toc a {
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 3px 10px;
  }
  .help h1 { font-size: 25px; }
}
