/* Hilfe zum Filetransfer: Raster aus Kapiteln und Text, Fließtext aus Markdown.
   Übernommen aus der Hilfe des KI-Registers, ergänzt um die Bausteine der alten
   Material-Seite: Hinweiskästen je Art, Zielgruppe, Brotkrume, Suche, Videos,
   Begriffserklärungen, Kacheln, Blättern und Inhaltsverzeichnis.
   Ausschließlich Token des Design-Systems, wie ds/erweiterungen.css. */

.hilfe {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: var(--space-7);
  align-items: start;
  margin-top: var(--space-5);
}

.hilfe__nav ul { list-style: none; margin: 0; padding: 0; }
.hilfe__nav a {
  position: relative;
  display: block;
  padding: var(--space-2) var(--space-3);
  color: var(--fg-1);
  text-decoration: none;
}
.hilfe__nav a:hover { color: var(--umg-logoblau); }
.hilfe__nav ul ul { margin: 0 0 var(--space-2) var(--space-4); }
.hilfe__nav ul ul a { padding-top: var(--space-1); padding-bottom: var(--space-1); font-size: var(--fs-body-sm); }
/* Aktive Seite wie der aktive Link im Kopf von www.umg.eu: Logoblau und das Quadrat in Punkteblau. */
.hilfe__nav a[aria-current="page"] {
  color: var(--umg-logoblau);
  font-weight: var(--fw-medium);
}
.hilfe__nav a[aria-current="page"]::before {
  content: "";
  position: absolute;
  top: calc(var(--space-2) + 0.6875em - 3px);
  left: 0;
  width: 6px;
  height: 6px;
  background: var(--umg-punkteblau);
}
.hilfe__nav ul ul a[aria-current="page"]::before { top: calc(var(--space-1) + 0.6875em - 3px); }
/* Kapitel mit Unterseiten: Überschrift ohne eigene Seite. */
.hilfe__gruppe {
  display: block;
  padding: var(--space-3) var(--space-3) var(--space-1);
  color: var(--fg-2);
  font-family: var(--font-display);
  font-weight: var(--fw-medium);
}
/* Abschnitte der aktuellen Seite unter ihrem Eintrag. */
.hilfe__nav .hilfe__toc { margin: 0 0 var(--space-2) var(--space-3); }
.hilfe__nav .hilfe__toc a {
  padding-top: 2px;
  padding-bottom: 2px;
  color: var(--fg-2);
  font-size: var(--fs-meta);
}
.hilfe__nav .hilfe__toc a:hover { color: var(--umg-logoblau); }

.hilfe__text {
  max-width: 80ch;
  padding: var(--space-6) var(--space-7);
  background: var(--bg-1);
  box-shadow: var(--shadow-card-rest);
}
.hilfe__text > :first-child { margin-top: 0; }
.hilfe__text h2 { margin-top: var(--space-7); margin-bottom: var(--space-3); }
.hilfe__text h3 { margin-top: var(--space-6); margin-bottom: var(--space-2); }
.hilfe__text h4 { margin-top: var(--space-5); margin-bottom: var(--space-2); font-size: var(--fs-body-lg); }
.hilfe__text p { margin: var(--space-3) 0; }
.hilfe__text ul, .hilfe__text ol { margin: var(--space-3) 0; padding-left: var(--space-6); }
.hilfe__text li { margin: var(--space-1) 0; line-height: var(--lh-relaxed); }
.hilfe__text dl { margin: var(--space-3) 0; }
.hilfe__text dt { margin-top: var(--space-3); font-weight: var(--fw-medium); }
.hilfe__text dd { margin: var(--space-1) 0 0 var(--space-5); }
.hilfe__text dd p { margin: 0; }
.hilfe__text img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: var(--space-4) 0 var(--space-5);
  border: 1px solid var(--border-1);
  box-shadow: var(--shadow-card-rest);
}
.hilfe__text a.bild { display: block; cursor: zoom-in; }
.hilfe__text a.bild:focus-visible img { outline: 2px solid var(--umg-punkteblau); outline-offset: 2px; }
/* Symbol im Fließtext, etwa ein Knopf der Oberfläche: ![…](…){ .symbol } */
.hilfe__text img.symbol {
  display: inline-block;
  height: 1.4em;
  width: auto;
  margin: 0 0.1em;
  border: 0;
  box-shadow: none;
  vertical-align: -0.35em;
}
.hilfe__text video {
  display: block;
  width: 100%;
  height: auto;
  margin: var(--space-4) 0 var(--space-5);
  border: 1px solid var(--border-1);
  box-shadow: var(--shadow-card-rest);
  background: var(--bg-2);
}
.hilfe__text table {
  width: 100%;
  margin: var(--space-4) 0;
  border-collapse: collapse;
  font-size: var(--fs-body-sm);
}
.hilfe__text th, .hilfe__text td {
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--border-1);
  text-align: left;
  vertical-align: top;
}
.hilfe__text th { background: var(--bg-2); font-weight: var(--fw-medium); }
.hilfe__text code { font-family: var(--font-mono); font-size: var(--fs-body-sm); }
.hilfe__text .tabelle { margin: var(--space-4) 0; }
.hilfe__text .tabelle table { margin: 0; }
.hilfe__text pre:focus-visible { outline: 2px solid var(--border-focus); outline-offset: 2px; }
.hilfe__text pre {
  margin: var(--space-3) 0;
  padding: var(--space-3) var(--space-4);
  overflow-x: auto;
  background: var(--bg-2);
}
/* Begriffe aus includes/abbreviations.md: Erklärung beim Überfahren, je Seite einmal
   (begriffe_einmal.py). */
.hilfe__text abbr[title] {
  text-decoration: underline dotted var(--umg-punkteblau);
  text-underline-offset: 3px;
  cursor: help;
}
/* In Kacheln liegt der Link darüber, die Erklärung wäre nicht erreichbar. */
.hilfe__text .kachel abbr[title] { text-decoration: none; cursor: inherit; }
.hilfe__text h2 .badge, .hilfe__text h3 .badge { vertical-align: 0.2em; margin-left: var(--space-2); }

/* Hinweiskästen: !!! info, note, tip, success, warning, danger. Wie die Kacheln von www.umg.eu
   mit der Leiste unten, hier dauerhaft in der Farbe der Art; Symbol vor dem Titel. */
.hilfe__text .admonition {
  --hinweis-farbe: var(--umg-punkteblau);
  --hinweis-symbol: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 16v-4'/%3E%3Cpath d='M12 8h.01'/%3E%3C/svg%3E");
  margin: var(--space-4) 0 var(--space-5);
  padding: var(--space-4) var(--space-4) var(--space-3);
  border-bottom: 10px solid var(--hinweis-farbe);
  background: var(--bg-2);
}
.hilfe__text .admonition.info { --hinweis-farbe: var(--umg-logoblau); }
.hilfe__text .admonition.success {
  --hinweis-farbe: var(--umg-green-success);
  --hinweis-symbol: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='m9 12 2 2 4-4'/%3E%3C/svg%3E");
}
.hilfe__text .admonition.warning {
  --hinweis-farbe: var(--umg-amber-warn);
  --hinweis-symbol: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3'/%3E%3Cpath d='M12 9v4'/%3E%3Cpath d='M12 17h.01'/%3E%3C/svg%3E");
}
.hilfe__text .admonition.danger {
  --hinweis-farbe: var(--umg-red-notfall);
  --hinweis-symbol: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolygon points='7.86 2 16.14 2 22 7.86 22 16.14 16.14 22 7.86 22 2 16.14 2 7.86 7.86 2'/%3E%3Cpath d='M12 8v4'/%3E%3Cpath d='M12 16h.01'/%3E%3C/svg%3E");
}
.hilfe__text .admonition-title {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  margin: 0 0 var(--space-1);
  font-weight: var(--fw-medium);
}
.hilfe__text .admonition-title::before {
  content: "";
  flex: none;
  width: 1em;
  height: 1em;
  align-self: center;
  background: var(--hinweis-farbe);
  -webkit-mask: var(--hinweis-symbol) center / contain no-repeat;
  mask: var(--hinweis-symbol) center / contain no-repeat;
}
/* Gelb trägt als Symbolfarbe auf Grau nicht: Symbol in der Textfarbe der Warnung. */
.hilfe__text .admonition.warning > .admonition-title::before { background: #875e00; }
.hilfe__text .admonition > :last-child { margin-bottom: 0; }
.hilfe__text .admonition p { margin: var(--space-2) 0; }
.hilfe__text .admonition .admonition { background: var(--bg-1); }

/* Kacheln der Startseite: Die ganze Kachel ist der Link ihrer Überschrift. */
.hilfe__text .kacheln { margin: var(--space-4) 0 var(--space-5); }
.hilfe__text .kachel {
  position: relative;
  padding: var(--space-4) var(--space-4) var(--space-3);
  background: var(--bg-2);
  border-bottom: 10px solid transparent;
  transition: border-color 0.2s ease-in-out;
}
.hilfe__text .kachel:hover, .hilfe__text .kachel:focus-within { border-bottom-color: var(--umg-gelb); }
.hilfe__text .kachel h3 { margin: 0 0 var(--space-2); font-size: var(--fs-h4); }
.hilfe__text .kachel h3 a { color: var(--umg-dunkelblau); text-decoration: none; }
.hilfe__text .kachel h3 a::after { content: ""; position: absolute; inset: 0; }
.hilfe__text .kachel:hover h3 a { text-decoration: underline; text-underline-offset: 2px; }
.hilfe__text .kachel p { margin: 0; color: var(--fg-2); font-size: var(--fs-body-sm); line-height: 1.5; }

/* Zurück und Weiter am Ende jeder Seite. */
.blaettern {
  display: flex;
  justify-content: space-between;
  gap: var(--space-4);
  margin-top: var(--space-7);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border-1);
}
.blaettern a { display: flex; flex-direction: column; gap: 2px; max-width: 48%; text-decoration: none; }
.blaettern span { color: var(--fg-3); font-size: var(--fs-meta); }
.blaettern .blaettern__titel {
  color: var(--fg-link);
  font-size: var(--fs-body);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}
.blaettern a:hover .blaettern__titel { color: var(--fg-link-hover); text-decoration-thickness: 2px; }
.blaettern__weiter { margin-left: auto; text-align: right; }

/* Brotkrume im weißen Band über dem Seitenkopf. */
.app-content > .breadcrumb { padding-top: var(--space-4); }

/* Suche im Kopf (suche.js). Treffer legen sich als Blatt über die Seite. */
.suche[hidden], .suche__treffer[hidden] { display: none; }
.suche { position: relative; }
.suche__feld {
  width: 16rem;
  padding: 4px 10px 2px;
  font-size: var(--fs-body-sm);
  line-height: 19px;
}
.suche__treffer {
  position: absolute;
  top: calc(100% + var(--space-1));
  right: 0;
  z-index: var(--z-overlay);
  width: min(28rem, calc(100vw - 32px));
  max-height: 70vh;
  overflow-y: auto;
  margin: 0;
  padding: var(--space-1) 0;
  list-style: none;
  background: var(--bg-1);
  border: 1px solid var(--border-1);
  box-shadow: var(--shadow-popover);
}
.suche__treffer a {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: var(--space-2) var(--space-4);
  color: var(--fg-1);
  text-decoration: none;
}
.suche__treffer a:hover, .suche__treffer a:focus { background: var(--bg-2); outline: none; }
.suche__treffer a:focus-visible { outline: 2px solid var(--border-focus); outline-offset: -2px; }
.suche__titel { font-family: var(--font-display); font-weight: var(--fw-medium); color: var(--umg-logoblau); }
.suche__ort { font-size: var(--fs-meta); color: var(--fg-3); }
.suche__auszug { font-size: var(--fs-body-sm); color: var(--fg-2); line-height: 1.4; }
.suche__treffer mark { background: #fdf0d6; color: inherit; }
.suche__leer { padding: var(--space-2) var(--space-4); color: var(--fg-3); font-size: var(--fs-body-sm); }

/* Bildbetrachter (betrachter.js): Der Dialog deckt die ganze Seite ab. */
.betrachter {
  width: 100vw;
  height: 100vh;
  max-width: 100vw;
  max-height: 100vh;
  margin: 0;
  padding: var(--space-6);
  border: 0;
  background: color-mix(in srgb, var(--umg-dunkelblau) 92%, transparent);
  cursor: zoom-out;
}
.betrachter[open] {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
}
.betrachter::backdrop { background: transparent; }
.betrachter__bild {
  max-width: 100%;
  max-height: calc(100vh - 7rem);
  background: var(--bg-1);
  box-shadow: var(--shadow-modal);
}
.betrachter__text { margin: 0; color: var(--fg-inverse); font-size: var(--fs-body-sm); }
.betrachter__schliessen {
  position: absolute;
  top: var(--space-4);
  right: var(--space-5);
  padding: 0 var(--space-2);
  border: 0;
  background: transparent;
  color: var(--fg-inverse);
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
}
.betrachter__schliessen:focus-visible { outline: 2px solid var(--umg-gelb); outline-offset: 2px; }

@media (max-width: 960px) {
  .hilfe { grid-template-columns: minmax(0, 1fr); gap: var(--space-5); }
  /* Auf schmalen Fenstern zuerst der Text, die Kapitel darunter; die Brotkrume gibt den Ort an. */
  .hilfe__nav { order: 2; }
  .hilfe__text { padding: var(--space-5); }
  .hilfe__nav .hilfe__toc { display: none; }
  .suche { flex: 1 1 12rem; }
  .suche__feld { width: 100%; }
  .suche__treffer { left: 0; right: auto; }
}
@media (max-width: 640px) {
  .hilfe__text { padding: var(--space-4); overflow-wrap: break-word; }
  .hilfe__text ul, .hilfe__text ol { padding-left: var(--space-5); }
  .blaettern { flex-direction: column; }
  .blaettern a { max-width: none; }
}
