/* webapp.css — gemeinsames Stylesheet für Nachschlagewerk + Debattenleitfaden + Anhang.
   Cache-Brecher: ?v=N in index.html/debatte.html/anhang.html bei jeder Änderung hochzählen. */

:root {
  --bg: #f7f5f0;
  --bg-karte: #ffffff;
  --text: #1c1a17;
  --text-mute: #6b6459;
  --border: #ddd7cb;
  --akzent: #7a2e2e;
  --akzent-hell: #f1e2e2;
  --kampfbegriff: #7a2e2e;
  --tarnvokabel: #4a5d3a;
  --chiffre: #3a4a6b;
  --etikett: #8a6d1f;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-serif: Georgia, "Times New Roman", serif;
  --radius: 8px;
  --nav-h: 56px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

a { color: var(--akzent); }

/* --- Kopfzeile / Navigation --- */
header.kopf {
  position: sticky; top: 0; z-index: 20;
  height: var(--nav-h);
  display: flex; align-items: center; gap: 1.5rem;
  padding: 0 1.25rem;
  background: var(--bg-karte);
  border-bottom: 1px solid var(--border);
}
header.kopf .titel { font-weight: 700; font-size: 1.05rem; white-space: nowrap; }
header.kopf .titel small { font-weight: 400; color: var(--text-mute); display: block; font-size: 0.7rem; }
header.kopf nav { display: flex; gap: 1rem; margin-left: auto; }
header.kopf nav a {
  text-decoration: none; color: var(--text-mute); font-size: 0.9rem; padding: 0.4rem 0.6rem; border-radius: 6px;
}
header.kopf nav a.aktiv, header.kopf nav a:hover { color: var(--akzent); background: var(--akzent-hell); }

/* Dezenter Sprachstufen-Schalter (E29, nur im Modus 'wahl' sichtbar) */
.sprachschalter {
  margin-left: 0.9rem; padding: 0.25rem 0.65rem;
  border: 1px solid var(--border); border-radius: 999px;
  background: none; color: var(--text-mute); font: inherit; font-size: 0.78rem;
  cursor: pointer; white-space: nowrap;
}
.sprachschalter:hover { border-color: var(--akzent); color: var(--akzent); }
.sprachschalter.aktiv { background: var(--tarnvokabel); border-color: var(--tarnvokabel); color: #fff; }

main.inhalt { max-width: 980px; margin: 0 auto; padding: 1.5rem 1.25rem 4rem; }

/* --- Suche --- */
.suchleiste { position: relative; margin-bottom: 1rem; }
.suchleiste input[type="search"] {
  width: 100%; padding: 0.85rem 1rem; font-size: 1rem;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg-karte);
}
.suchleiste input:focus { outline: 2px solid var(--akzent); outline-offset: -1px; }
.such-status { font-size: 0.8rem; color: var(--text-mute); margin: 0.35rem 0 0; min-height: 1.1em; }
.such-status--schwach { color: var(--akzent); }

.chip-zeile { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.6rem 0; }
.chip {
  display: inline-flex; align-items: center; gap: 0.3rem;
  background: var(--akzent-hell); color: var(--akzent);
  border-radius: 999px; padding: 0.25rem 0.7rem; font-size: 0.82rem;
}
.chip button { background: none; border: none; color: inherit; cursor: pointer; font-size: 0.9em; padding: 0; }

/* --- Kategorie-Badges --- */
.badge { display: inline-block; padding: 0.1rem 0.55rem; border-radius: 999px; font-size: 0.72rem; color: #fff; }
.badge.kampfbegriff { background: var(--kampfbegriff); }
.badge.tarnvokabel { background: var(--tarnvokabel); }
.badge.chiffre { background: var(--chiffre); }
.badge.etikett { background: var(--etikett); }
.badge.kontrastset { background: #555; }

/* --- Listen / Karten --- */
.begriff-liste { display: grid; gap: 0.6rem; }
.begriff-zeile {
  display: flex; align-items: baseline; gap: 0.6rem;
  padding: 0.7rem 0.9rem; background: var(--bg-karte);
  border: 1px solid var(--border); border-radius: var(--radius);
  text-decoration: none; color: var(--text); cursor: pointer;
}
.begriff-zeile:hover { border-color: var(--akzent); }
.begriff-zeile .label { font-weight: 600; }
.begriff-zeile .klartext { color: var(--text-mute); font-size: 0.88rem; margin-left: auto; text-align: right; max-width: 55%; }

.karte {
  background: var(--bg-karte); border: 1px solid var(--border); border-radius: 12px;
  padding: 1.25rem 1.5rem; margin-bottom: 1.25rem;
}
.karte h2 { margin: 0 0 0.4rem; font-size: 1.3rem; }
.karte .meta-zeile { color: var(--text-mute); font-size: 0.85rem; margin-bottom: 0.8rem; }
.karte .feld-label { font-size: 0.78rem; color: var(--text-mute); text-transform: uppercase; letter-spacing: 0.03em; margin: 0.9rem 0 0.25rem; }
.karte .feld-label:first-of-type { margin-top: 0; }
.karte p { margin: 0.2rem 0 0; }

/* --- Fundstellen-Karte (www-karte.js, geteilt) --- */
.fs-karte { border-top: 1px solid var(--border); padding-top: 0.9rem; margin-top: 0.9rem; }
.fs-zitat {
  font-family: var(--font-serif); font-style: italic; color: var(--text);
  border-left: 3px solid var(--akzent); padding-left: 0.9rem; margin: 0.4rem 0 0.6rem;
}
.fs-quelle { font-size: 0.78rem; color: var(--text-mute); word-break: break-word; }
.fs-tags { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0.4rem 0; }
.tag {
  font-size: 0.74rem; background: #efece4; color: var(--text-mute);
  border-radius: 5px; padding: 0.12rem 0.5rem;
  text-decoration: none; display: inline-block; cursor: pointer;
}
a.tag:hover { background: var(--akzent-hell); color: var(--akzent); }

/* --- Wörterbuch-Eintrag --- */
.wb-eintrag { border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.2rem; margin: 0.7rem 0; background: var(--bg-karte); }
.wb-eintrag .fs-label { font-size: 0.75rem; color: var(--text-mute); margin-bottom: 0.5rem; }
.wb-eintrag .rahmen-formel { font-size: 0.8rem; color: var(--text-mute); margin: 0 0 0.3rem; font-style: italic; }
.wb-eintrag .rekonstruktion { font-family: var(--font-serif); }
/* Analyse und Ich-Rekonstruktion farblich vom Zitat und voneinander abgesetzt (dezent):
   Analyse kühl (Chiffre-Blau), Rekonstruktion warm (Akzent-Rot) — Zitat bleibt weiß. */
.wb-analyse, .wb-rekonstruktion { border-radius: var(--radius); padding: 0.75rem 0.9rem; margin-top: 0.8rem; }
.wb-analyse { background: #eef1f6; border-left: 3px solid var(--chiffre); }
.wb-analyse .feld-label { margin-top: 0; color: var(--chiffre); }
.wb-analyse p { margin: 0; }
.wb-rekonstruktion { background: #f7efe9; border-left: 3px solid var(--akzent); }
.wb-rekonstruktion .rekonstruktion { margin: 0; }

/* --- Positionsbegriffe: Argumentationsstränge --- */
.strang { border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.2rem; margin: 0.9rem 0; background: var(--bg-karte); }
.strang .gegenrede-block { margin-top: 0.7rem; }
.strang .gegenrede-block .feld-label { margin-top: 0; }

/* --- Debattenleitfaden: Topos/Technik-Karten --- */
.thema-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.thema-karte {
  background: var(--bg-karte); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1rem 1.2rem; cursor: pointer; text-decoration: none; color: var(--text);
}
.thema-karte h3 { margin: 0 0 0.35rem; font-size: 1.05rem; }
.thema-karte p { margin: 0; color: var(--text-mute); font-size: 0.88rem; }
.obersatz { font-style: italic; color: var(--akzent); }

.gegenrede-block { background: #f4f8f2; border: 1px solid #cfe0c6; border-radius: var(--radius); padding: 1rem 1.2rem; margin-top: 1rem; }
.gegenrede-block h3 { margin-top: 0; }

/* --- Anhang --- */
.quellen-liste { list-style: none; padding: 0; margin: 0; }
.quellen-liste li { padding: 0.4rem 0; border-bottom: 1px solid var(--border); font-size: 0.88rem; }
.quellen-liste li a { word-break: break-word; }

/* --- Responsiv --- */
@media (max-width: 640px) {
  header.kopf { flex-wrap: wrap; height: auto; padding: 0.6rem 0.9rem; }
  header.kopf nav { margin-left: 0; flex-wrap: wrap; gap: 0.3rem; }
  header.kopf nav a { font-size: 0.82rem; padding: 0.3rem 0.45rem; }
  .begriff-zeile { flex-direction: column; align-items: flex-start; }
  .begriff-zeile .klartext { max-width: 100%; text-align: left; }
}

.leer-hinweis { color: var(--text-mute); padding: 2rem 0; text-align: center; }
.lade-hinweis { color: var(--text-mute); font-size: 0.85rem; }

/* --- Lexikon: Übersichts-Werkzeuge (Filter, Ansichten, A–Z) --- */
.lex-toolbar { display: flex; flex-wrap: wrap; gap: 0.6rem 1.2rem; align-items: center; margin: 0.4rem 0 0.8rem; }
.lex-toolbar[hidden], .az-register[hidden] { display: none; }

button.filter-chip { border: 1px solid var(--border); background: var(--bg-karte); color: var(--text-mute); cursor: pointer; font: inherit; font-size: 0.82rem; }
button.filter-chip:hover { border-color: var(--akzent); color: var(--akzent); }
button.filter-chip.aktiv { background: var(--akzent); border-color: var(--akzent); color: #fff; }
button.filter-chip.aktiv.kat-kampfbegriff { background: var(--kampfbegriff); border-color: var(--kampfbegriff); }
button.filter-chip.aktiv.kat-tarnvokabel { background: var(--tarnvokabel); border-color: var(--tarnvokabel); }
button.filter-chip.aktiv.kat-chiffre { background: var(--chiffre); border-color: var(--chiffre); }
button.filter-chip.aktiv.kat-etikett { background: var(--etikett); border-color: var(--etikett); }

.ansicht-schalter { display: flex; gap: 0; margin-left: auto; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.ansicht-knopf { border: none; background: var(--bg-karte); color: var(--text-mute); cursor: pointer; font: inherit; font-size: 0.82rem; padding: 0.35rem 0.75rem; }
.ansicht-knopf + .ansicht-knopf { border-left: 1px solid var(--border); }
.ansicht-knopf.aktiv { background: var(--akzent-hell); color: var(--akzent); font-weight: 600; }

.az-register { display: flex; flex-wrap: wrap; gap: 0.15rem; margin: 0 0 0.9rem; }
.az-register a, .az-register .fehlt {
  display: inline-block; min-width: 1.6rem; text-align: center; padding: 0.15rem 0.2rem;
  border-radius: 5px; font-size: 0.82rem; text-decoration: none;
}
.az-register a { color: var(--akzent); background: var(--bg-karte); border: 1px solid var(--border); }
.az-register a:hover { background: var(--akzent-hell); }
.az-register .fehlt { color: var(--border); }

.gruppe-kopf { margin: 1.4rem 0 0.5rem; font-size: 1.05rem; }
.gruppe-kopf a { text-decoration: none; }
.gruppe-kopf a:hover { text-decoration: underline; }
.gruppe-zahl { color: var(--text-mute); font-weight: 400; font-size: 0.85rem; }

/* --- Akkordeon (Topos-Ansicht im Lexikon) --- */
.akkordeon { display: grid; gap: 0.5rem; }
.akk-sektion { background: var(--bg-karte); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.akk-kopf {
  display: flex; align-items: baseline; gap: 0.6rem; width: 100%;
  padding: 0.8rem 1rem; border: none; background: none; cursor: pointer;
  font: inherit; font-size: 1.02rem; font-weight: 600; color: var(--text); text-align: left;
}
.akk-kopf:hover { background: var(--akzent-hell); }
.akk-sektion.offen > .akk-kopf { border-bottom: 1px solid var(--border); background: var(--akzent-hell); color: var(--akzent); }
.akk-pfeil::before { content: '▸'; display: inline-block; color: var(--text-mute); transition: transform 0.15s; }
.akk-sektion.offen .akk-pfeil::before { transform: rotate(90deg); color: var(--akzent); }
.akk-inhalt { padding: 0.8rem 1rem 1rem; }
.akk-leitfaden { margin: 0 0 0.8rem; font-size: 0.92rem; }
.akk-inhalt .begriff-liste { gap: 0.45rem; }

/* --- Prinzipien-Akkordeon (»Wie debattieren?«, E33/E36) --- */
.prinzipien-akkordeon .akk-kopf { align-items: center; }
.prinzip-nr {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.6rem; height: 1.6rem; border-radius: 50%;
  background: var(--akzent-hell); color: var(--akzent); font-size: 0.85rem; font-weight: 700;
  flex: none;
}
.prinzip-sektion .akk-inhalt p { margin: 0 0 0.7rem; font-size: 0.95rem; }
.beispiel-block {
  background: #f4f8f2; border: 1px solid #cfe0c6; border-radius: var(--radius);
  padding: 0.8rem 1rem; margin: 0 0 0.7rem;
}
.beispiel-situation { color: var(--text-mute); font-size: 0.9rem; margin: 0 0 0.4rem !important; }
.beispiel-antwort { font-style: italic; margin: 0 !important; }
.prinzip-pointe { font-weight: 600; }

/* --- Klartext-Seite: Sprung-Leiste + Themen-Abschnitte --- */
.klartext-toc { margin: 1.2rem 0; }
.klartext-toc .chip { text-decoration: none; }
.klartext-thema { margin: 2rem 0; scroll-margin-top: calc(var(--nav-h) + 0.8rem); }
.klartext-thema h2 { margin: 0 0 0.8rem; }
.klartext-thema .akkordeon { gap: 0.6rem; }
.wb-akk-kopf { align-items: flex-start; }
.wb-akk-titel { display: flex; flex-direction: column; gap: 0.2rem; min-width: 0; }
.wb-akk-titel .fs-quelle { font-weight: 400; font-size: 0.78rem; }
.wb-akk-zitat {
  font-weight: 600; font-style: italic;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.wb-akk.offen .wb-akk-zitat { -webkit-line-clamp: unset; }
.wb-akk .akk-inhalt .wb-analyse { margin-top: 0; }
.cluster-akk-kopf { font-size: 1.05rem; }
.cluster-akk-titel { flex: 1; }
.cluster-akk .akk-inhalt { padding: 0.6rem 0.8rem 0.8rem; }
.cluster-akk .akk-inhalt .akkordeon { gap: 0.5rem; }
.cluster-akk .wb-akk { background: var(--bg); }

.begriff-zeile .verbreitung { color: var(--text-mute); font-size: 0.8rem; white-space: nowrap; }
.begriff-zeile[id] { scroll-margin-top: calc(var(--nav-h) + 0.8rem); } /* A–Z-Sprungziel nicht unter dem sticky Header verstecken */
@media (max-width: 640px) { .begriff-zeile[id] { scroll-margin-top: 8.5rem; } }
.akk-sektion.machart-sektion[data-akk] { scroll-margin-top: calc(var(--nav-h) + 0.8rem); }

/* --- Machart-Ansicht (E34, Kampffelder/Bildfelder) --- */
.machart-untertitel { font-weight: 400; font-size: 0.88em; color: var(--text-mute); }
.machart-profil { margin: 0 0 0.8rem; font-size: 0.88rem; color: var(--text-mute); }
.machart-profil strong { color: var(--text); font-weight: 600; }
.ziel-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0 0 0.8rem; }
.ziel-unterteilung { margin: 0 0 1.1rem; }
.ziel-unterteilung:last-child { margin-bottom: 0; }
.ziel-titel {
  margin: 0 0 0.4rem; font-size: 0.88rem; font-weight: 600; color: var(--text-mute);
  text-transform: uppercase; letter-spacing: 0.02em;
}
.ziel-titel .gruppe-zahl { text-transform: none; letter-spacing: normal; font-weight: 400; }
.wortfamilien-liste { display: grid; gap: 0.5rem; }
.wortfamilie .varianten {
  display: grid; gap: 0.3rem; margin: 0.3rem 0 0 1.2rem; padding-left: 0.6rem;
  border-left: 2px solid var(--border);
}
.wortfamilie .varianten .begriff-zeile { font-size: 0.92rem; }

/* --- Einführungs-Block (Debattenleitfaden): erster Absatz immer sichtbar, Rest per <details> --- */
.einfuehrung-block {
  background: var(--bg-karte); border: 1px solid var(--border); border-radius: 12px;
  padding: 1.25rem 1.5rem; margin-bottom: 1.5rem;
}
.einfuehrung-block h2 { margin: 0 0 0.6rem; font-size: 1.25rem; }
.einfuehrung-block > p { margin: 0; }
.einfuehrung-mehr summary {
  list-style: none; cursor: pointer; margin-top: 0.8rem;
  color: var(--akzent); font-weight: 600; font-size: 0.92rem;
  display: inline-flex; align-items: center; gap: 0.4rem;
}
.einfuehrung-mehr summary::-webkit-details-marker { display: none; }
.einfuehrung-mehr .akk-pfeil::before { content: '▸'; display: inline-block; color: var(--akzent); transition: transform 0.15s; }
.einfuehrung-mehr[open] .akk-pfeil::before { transform: rotate(90deg); }
.einfuehrung-mehr[open] summary { margin-bottom: 0.4rem; }
.einfuehrung-text { font-size: 0.95rem; }
.einfuehrung-text h3 { font-size: 1.05rem; margin: 1.1rem 0 0.4rem; }
.einfuehrung-text h3:first-child { margin-top: 0.9rem; }
.einfuehrung-text p { margin: 0 0 0.7rem; }
.einfuehrung-text sup { color: var(--akzent); font-size: 0.75em; }
.fussnoten {
  margin: 1.2rem 0 0; padding-top: 0.8rem; border-top: 1px solid var(--border);
  font-size: 0.8rem; color: var(--text-mute); padding-left: 1.2rem;
}
.fussnoten li { margin-bottom: 0.4rem; }

/* --- Ebenen-Startseite (»Mittel der Manipulation«): Teaser + CTA je Ebene --- */
.ebene-block-aktionen {
  display: flex; align-items: baseline; justify-content: space-between;
  flex-wrap: wrap; gap: 0.6rem 1.2rem;
}
.ebene-block-aktionen .einfuehrung-mehr { flex: 1 1 auto; }
.ebene-cta {
  font-weight: 600; font-size: 0.92rem; white-space: nowrap;
  text-decoration: none; color: var(--akzent);
}
.ebene-cta:hover { text-decoration: underline; }

/* --- Startseite --- */
.start-inhalt { max-width: 820px; }
.hero { margin-bottom: 1.5rem; }
.hero h1 { font-size: 1.9rem; margin: 0 0 0.6rem; }
.hero-lead { font-size: 1.05rem; color: var(--text-mute); margin: 0; }

.hinweis-box {
  background: var(--akzent-hell); border: 1px solid var(--akzent);
  border-radius: var(--radius); padding: 1rem 1.25rem; margin-bottom: 1.75rem;
}
.hinweis-box strong { color: var(--akzent); display: block; margin-bottom: 0.4rem; }
.hinweis-box p { margin: 0; font-size: 0.92rem; }

.start-stand { color: var(--text-mute); font-size: 0.82rem; text-align: center; margin: 2rem 0 0; }
.hinweis-box .start-stand { text-align: left; margin: 0.6rem 0 0; }
.start-cta { text-align: center; margin: 1rem 0 0.5rem; }

/* »Über dieses Projekt« — als Fußnote unter dem Seiteninhalt (kleiner, gedämpft,
   durch Linie abgesetzt; Sprungziel #ueber aus der Stand-Box) */
.fussnote {
  margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--border);
  color: var(--text-mute); font-size: 0.88rem;
}
.fussnote h2 { font-size: 1rem; color: var(--text); margin: 0 0 0.6rem; }
.fussnote p { margin: 0 0 0.8rem; }
.fussnote[id] { scroll-margin-top: calc(var(--nav-h) + 0.8rem); }

/* Rechtliches (Impressum/Datenschutz) — schmale Fußzeile auf jeder Seite */
.seiten-fuss {
  margin-top: 2.5rem; padding: 1rem 0 0.5rem; border-top: 1px solid var(--border);
  text-align: center; font-size: 0.8rem; color: var(--text-mute);
}
.seiten-fuss a { color: inherit; }
.fussnote + .seiten-fuss { border-top: none; margin-top: 0.5rem; padding-top: 0; }
.cta-button {
  display: inline-block; background: var(--akzent); color: #fff;
  text-decoration: none; font-weight: 600; padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
}
.cta-button:hover { opacity: 0.9; }
