/* ═══════════════════════════════════════════════════════════
   Styles für die Link-Seiten (links.html und links-en.html).
   Beide Seiten baut build_links.py aus den Kuratierungs-Listen
   von awesome-long-covid-mecfs – Änderungen an diesen Klassen
   immer zusammen mit dem Skript.

   Ergänzt style.css (Design-Tokens, Navigation, Dark-Mode) und
   stellen.css (.wrap, .page-hero, .btn, .section, .apply).
   Alle Farben kommen aus den Tokens aus style.css, damit Hell,
   Dunkel und Sehr dunkel automatisch funktionieren.
   ═══════════════════════════════════════════════════════════ */

/* ─── HINWEIS OBEN (keine medizinische Beratung) ───────────── */
.lc-notice {
  border: 1px solid var(--gray-200);
  border-left: 4px solid var(--gray-500);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 14px 18px;
  margin-bottom: 18px;
  font-size: .95rem;
  color: var(--gray-700);
}

.lc-text {
  color: var(--gray-700);
  max-width: 60rem;
  margin-bottom: 22px;
}

/* ─── SPRACHE DER ANDEREN SAMMLUNG ─────────────────────────── */
/* Steht im Seitenkopf und am Seitenende: „🇩🇪 Deutsch · 🇬🇧 English“.
   Die andere Sprache ist eine eigene Sammlung, deshalb führt der Verweis
   auf die andere Seite – und die eigene Sprache ist nur markiert. */
.lc-lang {
  font-size: .95rem;
  color: var(--gray-600);
}

.lc-lang a {
  color: var(--link-color);
  text-decoration: none;
}

.lc-lang a:hover,
.lc-lang a:focus-visible {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Im bunten Seitenkopf gilt die Textfarbe des Kopfes – seine Linkfarbe wäre
   auf dem Verlauf nicht zu lesen, und im sehr dunklen Modus ist der Kopf
   schwarz mit gedämpfter Schrift. */
.page-hero .lc-lang {
  margin-top: 16px;
  color: inherit;
}

.page-hero .lc-lang a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Auch die übrigen Verweise im Seitenkopf: die übliche Linkfarbe ist auf dem
   Farbverlauf kaum zu lesen (auf der Umleitungs-Seite ist es der wichtigste
   Link der Seite). */
.page-hero a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ─── THEMENVERZEICHNIS ────────────────────────────────────── */
/* style.css klebt jedes <nav> oben an (für die Kopfzeile). Das Themenverzeichnis
   ist aber auch ein <nav>: ohne diese Zeile bleibt der große Kasten beim Scrollen
   auf halber Höhe stehen und liegt über der Suchleiste. Nur die Kopfzeile klebt. */
.lc-toc {
  position: static;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 20px 22px;
  margin-bottom: 22px;
}

.lc-toc-title {
  font-size: 1rem;
  letter-spacing: .02em;
  text-transform: uppercase;
  color: var(--gray-500);
  margin-bottom: 12px;
}

.lc-toc-list,
.lc-toc-sub {
  list-style: none;
}

/* Mehrspaltig statt Raster: sonst reißen unterschiedlich hohe Themen Lücken */
.lc-toc-list {
  columns: 260px;
  column-gap: 32px;
}

.lc-toc-list li {
  break-inside: avoid;
}

.lc-toc-list a {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  padding: 4px 0;
  color: var(--link-color);
  text-decoration: none;
}

.lc-toc-list a:hover {
  text-decoration: underline;
}

.lc-toc-sub {
  margin: 0 0 6px 14px;
  padding-left: 12px;
  border-left: 1px solid var(--gray-200);
  font-size: .92rem;
}

.lc-toc-count {
  color: var(--gray-500);
  font-size: .8rem;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

/* ─── LEGENDE DER KENNZEICHNUNGEN ──────────────────────────── */
.lc-legend {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 0;
  margin-bottom: 22px;
}

.lc-legend > summary {
  padding: 12px 18px;
  cursor: pointer;
  font-weight: 600;
  color: var(--gray-800);
  list-style: none;
  border-radius: var(--radius);
}

.lc-legend > summary::-webkit-details-marker {
  display: none;
}

.lc-legend > summary::before {
  content: "+";
  display: inline-block;
  width: 1.2em;
  color: var(--gray-500);
}

.lc-legend[open] > summary::before {
  content: "–";
}

.lc-legend > summary:hover {
  background: var(--gray-50);
}

.lc-legend-list {
  list-style: none;
  border-top: 1px solid var(--gray-200);
  padding: 10px 18px 16px;
  columns: 340px;
  column-gap: 28px;
}

.lc-legend-list li {
  break-inside: avoid;
  font-size: .9rem;
  line-height: 1.9;
  color: var(--gray-700);
  padding: 2px 0;
}

/* Kennzeichen und Erklärung laufen in einem Fluss, damit lange Erklärungen
   unter der nächsten Zeile weiterschreiben und nicht alone stehen */
.lc-legend-list .lc-tag {
  margin-right: 8px;
}

/* ─── SUCHEN UND FILTERN ───────────────────────────────────── */
/* Klebt unter der Kopfzeile (65px). Der Rand soll oben und unten gleich sein,
   deshalb zwei Pixel tiefer als die Kopfzeile hoch ist. */
.lc-tools {
  position: sticky;
  top: 67px;
  z-index: 60;
  background: var(--page-bg);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 12px 18px;
  margin-bottom: 14px;
}

/* Wer nach oben scrollt, will meist etwas lesen, was gerade unter der Leiste
   liegt. links.js nimmt in dem Moment lc-pinned weg: ohne die Klasse steht die
   Leiste wieder ganz normal im Text und wandert mit. Abwärts kommt sie wieder. */
.lc-tools:not(.lc-pinned) {
  position: static;
}

/* Sprungziele (Inhaltsverzeichnis) müssen unterklebt bleiben */
html {
  scroll-padding-top: 200px;
}

.lc-cat {
  scroll-margin-top: 200px;
}

/* Aufklebende Leiste: oben darf sie mehr Platz haben, beim Scrollen nicht */
.lc-tools.lc-compact {
  padding-top: 8px;
  padding-bottom: 8px;
}

.lc-tools.lc-compact .lc-tool-row {
  gap: 8px 10px;
}

.lc-tools.lc-compact input[type="search"],
.lc-tools.lc-compact select {
  padding: 5px 8px;
}

/* Der Hinweis steht nur ganz oben; beim Scrollen wäre er Platz in der klebenden
   Leiste, und gelesen ist er ohnehin schon. Das !important ist nötig, weil
   style.css im Textmodus „Kurz & einfach" jedes p[data-kurz] mit
   display: block wieder zeigt – sonst steht der Hinweis in der schmalen Leiste. */
.lc-tools.lc-compact .lc-hint {
  display: none !important;
}

.lc-tool-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
}

.lc-tool-row + .lc-tool-row {
  margin-top: 10px;
}

/* Auf-/Zuklappen steht außerhalb der klebenden Leiste */
.lc-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 22px;
}

/* Den zweiten Satz Knöpfe gibt es am Ende der Themen: sonst läge der einzige
   weit über der langen Liste und wäre nicht zu erreichen, wo man ihn braucht. */
.lc-cat + .lc-controls,
.lc-group + .lc-controls {
  margin-top: 26px;
}

.lc-controls button,
.lc-tools button {
  font: inherit;
  font-size: .9rem;
  color: var(--gray-700);
  background: var(--surface);
  border: 1px solid var(--gray-300);
  border-radius: 8px;
  padding: 7px 12px;
  cursor: pointer;
}

.lc-controls button:hover,
.lc-tools button:hover {
  border-color: var(--link-color);
  color: var(--link-color);
}

.lc-tools label {
  font-size: .9rem;
  font-weight: 600;
  color: var(--gray-700);
}

.lc-tools input[type="search"],
.lc-tools select {
  font: inherit;
  color: var(--gray-800);
  background: var(--surface);
  border: 1px solid var(--gray-300);
  border-radius: 8px;
  padding: 8px 10px;
}

.lc-tools input[type="search"] {
  flex: 1 1 240px;
  min-width: 0;
}

.lc-tools select {
  flex: 0 0 auto;
}

.lc-tools input:focus-visible,
.lc-tools select:focus-visible,
.lc-controls button:focus-visible,
.lc-cat summary:focus-visible,
.lc-toc a:focus-visible,
.lc-item-title:focus-visible {
  outline: 2px solid var(--link-color);
  outline-offset: 2px;
}

.lc-count {
  margin-left: auto;
  font-size: .85rem;
  color: var(--gray-500);
  font-variant-numeric: tabular-nums;
}

.lc-hint {
  font-size: .88rem;
  color: var(--gray-500);
  margin-top: 10px;
}

.lc-empty {
  font-size: .95rem;
  color: var(--gray-700);
  background: var(--surface);
  border: 1px dashed var(--gray-300);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-top: 14px;
}

/* ─── THEMEN-ABSCHNITTE (aufklappbar) ──────────────────────── */
.lc-cat {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  background: var(--surface);
  margin-bottom: 12px;
}

.lc-cat > summary {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 10px;
  padding: 14px 18px;
  cursor: pointer;
  list-style: none;
  border-radius: var(--radius);
}

.lc-cat > summary::-webkit-details-marker {
  display: none;
}

.lc-cat > summary::before {
  content: "▸";
  color: var(--gray-500);
  font-size: .9rem;
  transform: translateY(-1px);
}

.lc-cat[open] > summary::before {
  content: "▾";
}

.lc-cat > summary:hover {
  background: var(--gray-50);
}

.lc-cat-title {
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--gray-900);
}

.lc-cat-crumb {
  font-size: .82rem;
  color: var(--gray-500);
}

.lc-cat-crumb::before {
  content: "·";
  margin-right: 8px;
  color: var(--gray-300);
}

.lc-cat-count {
  margin-left: auto;
  font-size: .82rem;
  color: var(--gray-500);
  font-variant-numeric: tabular-nums;
}

.lc-cat-body {
  border-top: 1px solid var(--gray-200);
  padding: 6px 18px 14px;
}

/* ─── ZURÜCK NACH OBEN ─────────────────────────────────────── */
/* Steht nach jedem Thema. Die Themen bleiben standardmäßig zugeklappt –
   wer sie einzeln öffnet, soll nicht bis zum Seitenanfang scrollen müssen,
   um das nächste zu erreichen. */
.lc-back {
  text-align: right;
  margin-top: 12px;
}

.lc-back a {
  font-size: .85rem;
  color: var(--gray-500);
  text-decoration: none;
}

.lc-back a:hover,
.lc-back a:focus-visible {
  color: var(--link-color);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Unterthemen ein Stück einrücken */
.lc-level-3,
.lc-level-4 {
  margin-left: 16px;
}

.lc-group {
  margin: 26px 0 12px;
}

.lc-group-title {
  font-size: 1.15rem;
  color: var(--gray-900);
  border-bottom: 1px solid var(--gray-200);
  padding-bottom: 6px;
}

.lc-intro {
  color: var(--gray-700);
  font-size: .95rem;
  margin: 10px 0 4px;
  max-width: 60rem;
}

.lc-note {
  font-size: .9rem;
  color: var(--gray-700);
  border-left: 3px solid var(--gray-300);
  padding: 4px 0 4px 12px;
  margin: 10px 0;
  max-width: 60rem;
}

/* ─── LINK-LISTE ───────────────────────────────────────────── */
.lc-items {
  list-style: none;
}

.lc-item {
  padding: 14px 0;
  border-top: 1px solid var(--gray-100);
}

.lc-items > .lc-item:first-child {
  border-top: none;
}

.lc-item-title {
  font-weight: 600;
  color: var(--link-color);
  text-decoration: none;
}

.lc-item-title:hover {
  text-decoration: underline;
}

.lc-tags {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.lc-tag {
  font-size: .76rem;
  line-height: 1.4;
  color: var(--gray-600);
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: 999px;
  padding: 2px 9px;
  white-space: nowrap;
}

.lc-item-desc {
  font-size: .93rem;
  color: var(--gray-700);
  margin-top: 6px;
  max-width: 60rem;
}

.lc-sub {
  list-style: disc;
  margin: 8px 0 0 20px;
  font-size: .9rem;
}

.lc-sub li {
  margin-top: 3px;
}

/* ─── SUCHERGEBNIS ─────────────────────────────────────────── */
.lc-hidden {
  display: none !important;
}

/* Der Treffer im Suchfeld wird im langen Text leicht markiert */
.lc-cat > summary.lc-match {
  background: var(--blue-50);
}

/* ─── DRUCK ────────────────────────────────────────────────── */
@media print {
  /* Ohne JavaScript bleiben zugeklappte Themen sonst leer */
  .lc-cat > .lc-cat-body,
  .lc-legend > .lc-legend-list {
    display: block !important;
    content-visibility: visible !important;
  }

  .lc-tools,
  .lc-controls,
  .lc-empty,
  .lc-hint,
  .lc-back,
  .lc-lang {
    display: none !important;
  }

  .lc-cat,
  .lc-notice,
  .lc-toc {
    break-inside: avoid;
    border-color: #bbb;
    box-shadow: none;
  }

  .lc-cat > summary::before {
    content: "";
  }

  .lc-tag {
    background: none;
    padding: 0;
    border: none;
  }
}

/* ─── KLEINE BILDSCHIRME ───────────────────────────────────── */
@media screen and (max-width: 720px) {
  /* Die Leiste bleibt auf kleinen Bildschirmen kleben – Suchen soll auch
     mitten in der langen Liste möglich sein. Sie wird dafür so schmal wie
     möglich; die Beschriftungen bleiben für Screenreader erhalten. */
  .lc-tools {
    padding: 8px 12px;
  }

  .lc-tools .lc-tool-row {
    gap: 8px;
  }

  .lc-tools label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .lc-tools input[type="search"] {
    flex: 1 1 130px;
    min-width: 0;
  }

  .lc-tools select {
    flex: 0 1 auto;
    min-width: 0;
    max-width: 100%;
  }

  .lc-tools input[type="search"],
  .lc-tools select,
  .lc-tools .lc-count {
    font-size: .95rem;
    padding: 6px 8px;
  }

  .lc-tools .lc-hint {
    display: none !important;
  }

  .lc-count {
    margin-left: 0;
  }

  .lc-level-3,
  .lc-level-4 {
    margin-left: 0;
  }
}

/* Sehr schmal (Telefon): Suchfeld allein, Auswahl und Treffer-Zahl daneben.
   Sonst stehen drei Zeilen in der klebenden Leiste – zu viel vom Bildschirm.
   Das Suchfeld füllt die ganze erste Zeile: sonst bleibt davon kaum 160px übrig
   und man sieht nicht, was man tippt. */
@media screen and (max-width: 480px) {
  .lc-tools input[type="search"] {
    flex: 1 1 100%;
  }

  .lc-tools select {
    flex: 1 1 110px;
  }

  /* Die Treffer-Zahl darf hier nicht wachsen: sonst nimmt sie der Auswahl
     den Platz und rutscht in eine dritte Zeile. */
  .lc-tools .lc-count {
    flex: 0 1 auto;
    font-size: .78rem;
    padding: 4px 6px;
    white-space: nowrap;
  }
}

/* Bewegung mögen reizempfindliche Menschen nicht */
@media (prefers-reduced-motion: reduce) {
  .lc-cat,
  .lc-cat > summary,
  .lc-controls button {
    transition: none;
  }
}
