/* 21consult · Themenseiten Lokale KI (/lokale-ki, /lokale-ki/pakete, /ratgeber/lokale-ki-oder-cloud)
   Baut auf site.css auf und übernimmt deren Tokens und Bausteine (Kopf, Fuß, .innen, .abschnittskopf,
   .einleitung, .legende-liste, .textlink, .knopf, .fragen, .direkt). Hier stehen nur die Teile, die es
   auf der Startseite nicht gibt. Alle Regeln hängen an main.thema, damit nichts auf andere Seiten wirkt.
   Farbgesetz wie überall: Grün nur für „Anfrage schreiben“, Gelb markiert nur (auf Hell nur mit
   Flutkanten-Rand), Flächen aus der Grünfamilie geben den Takt. Abstände nur aus --s1 bis --s9,
   Schriftgrößen nur 14, 16, 20, 24, 32 und die Überschriften aus :root. */

/* ---------- Seitenkopf: Brotkrumen, H1, Einleitung, Knöpfe ---------- */
.thema .seitenkopf { padding-top: var(--s8); }
/* folgt direkt eine getönte Fläche, braucht der Kopf unten den Abstand eines Abschnitts */
.thema .seitenkopf.vor-flaeche { padding-bottom: var(--abschnitt); }
.thema .seitenkopf .innen > * { max-width: 840px; }
.thema .seitenkopf h1 { margin-top: var(--s6); }
.thema .seitenkopf .einleitung { margin-top: var(--s5); }
.thema .seitenkopf .aktion { display: flex; flex-wrap: wrap; gap: var(--s3); margin-top: var(--s6); }
.thema .stand { margin-top: var(--s4); font-size: 14px; line-height: 20px; color: var(--schlick); }
.thema .kurz { margin-top: var(--s6); padding-left: var(--s5); border-left: 2px solid var(--flut); }
/* Fließtext im Kopf auf Lesebreite (DESIGN.md: Einleitung 62ch), gewinnt gegen die 840 px oben */
.thema .seitenkopf .innen > .einleitung, .thema .seitenkopf .innen > .kurz { max-width: 62ch; }
.thema .kurz strong { font-weight: 800; }

.thema .brotkrumen ol { display: flex; flex-wrap: wrap; align-items: center; font-size: 14px; line-height: 20px; color: var(--schlick); }
.thema .brotkrumen li { display: flex; align-items: center; }
.thema .brotkrumen li + li::before { content: "/"; content: "/" / ""; margin: 0 var(--s2); color: var(--schlick); }
.thema .brotkrumen a {
  color: var(--flut); font-weight: 700;
  text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px;
  text-decoration-color: var(--linie); transition: text-decoration-color .2s var(--aus);
}
.thema .brotkrumen a:hover { text-decoration-color: var(--flut); }
.thema .brotkrumen [aria-current="page"] { color: var(--schlick); }

/* Seitenkopf mit Datenweg (nur /lokale-ki): Text auf Spalten 1 bis 5, Datenweg auf 6 bis 8 */
@media (min-width: 1024px) {
  .thema .seitenkopf.mit-datenweg .innen { display: grid; grid-template-columns: repeat(8, 1fr); align-items: end; }
  .thema .seitenkopf.mit-datenweg .innen > * { max-width: none; }
  .thema .seitenkopf.mit-datenweg .seitenkopf-text { grid-column: 1 / span 5; padding-right: var(--s7); }
  .thema .seitenkopf.mit-datenweg .datenweg { grid-column: 6 / span 3; margin-top: 0; }
}

/* ---------- Datenweg: wohin die Daten gehen, Cloud gegen lokal ----------
   Zwei Strecken wie die Halte im Ablauf: Punkte auf einer 2 px Linie. Die gestrichelte Linie ist die
   Grenze des Betriebs. Die lokale Strecke endet davor im KI Rechner (Ring mit gelbem Kern, wie das Ziel
   im Ablauf), die Cloud Strecke läuft darüber hinaus.
   Beide Strecken teilen sich über subgrid dieselben Zeilen (Name, zwei Halte, Grenze, zwei Halte). Wächst
   eine Zeile, weil der Text größer gezoomt ist oder die Spalte schmal wird, wächst sie in beiden Spalten,
   und die Grenze bleibt auf derselben Höhe. Die Punkte sitzen auf der ersten Textzeile, die Linie läuft
   je Halt von seinem Punkt bis zum Punkt des nächsten Halts. */
.thema .datenweg { margin: var(--s7) 0 0; --zh: 24px; }
.thema .datenweg figcaption { font-size: 14px; line-height: 20px; font-weight: 700; color: var(--schlick); margin-bottom: var(--s4); }
.thema .wege {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: var(--s5);
  grid-template-rows: auto minmax(56px, auto) minmax(56px, auto) minmax(40px, auto) minmax(56px, auto) minmax(56px, auto);
}
.thema .weg { display: grid; grid-row: 1 / -1; grid-template-rows: subgrid; min-width: 0; }
.thema .weg-lokal { grid-column: 1; }
.thema .weg-cloud { grid-column: 2; }
.thema .weg-name { grid-row: 1; padding-bottom: var(--s3); font-weight: 700; line-height: 24px; }
.thema .weg-halte { display: grid; grid-row: 2 / -1; grid-template-rows: subgrid; }
.thema .weg-halte li { position: relative; padding: var(--s4) 0 var(--s4) var(--s6); font-size: 16px; line-height: var(--zh); }
/* Bei 200 % Textgröße auf schmalen Fenstern passt ein langes Wort nicht in die halbe Breite. Unter 600 px trennt
   der Browser dann nach deutscher Silbentrennung (lang="de", in Chromium erst ab 7 Buchstaben, damit kurze
   Wörter wie „deinem“ ganz bleiben). Darüber sind die Spalten breit genug; dort trennt nichts, weil WebKit
   die Grenze von 7 Buchstaben nicht kennt und sonst schon in normaler Größe „dei-nem“ setzt. Reicht beides
   nicht, bricht das Wort ohne Trennstrich, statt in die Nachbarspalte zu laufen. */
.thema .datenweg figcaption, .thema .weg-name, .thema .weg-halte li, .thema .grenze span { overflow-wrap: anywhere; }
@media (max-width: 599px) {
  .thema .datenweg figcaption, .thema .weg-name, .thema .weg-halte li, .thema .grenze span { -webkit-hyphens: auto; hyphens: auto; hyphenate-limit-chars: 7 3 3; }
}
.thema .weg-halte li::before {
  content: ""; position: absolute; z-index: 1; left: 4px; top: calc(var(--s4) + var(--zh) / 2 - 6px); width: 12px; height: 12px;
  box-sizing: border-box; border: 2px solid var(--flut); border-radius: 50%; background: var(--watt);
}
.thema .weg-halte li:not(:last-child)::after {
  content: ""; position: absolute; left: 9px; width: 2px;
  top: calc(var(--s4) + var(--zh) / 2); bottom: calc(-1 * (var(--s4) + var(--zh) / 2)); background: var(--flut);
}
.thema .weg-cloud .weg-halte li::after { background: var(--schlick); }
.thema .weg-halte .draussen::before { border-color: var(--schlick); }
.thema .weg-halte .draussen { color: var(--schlick); }
.thema .weg-halte .im-haus { font-weight: 700; }
.thema .weg-halte .im-haus::before {
  left: -1px; top: calc(var(--s4) + var(--zh) / 2 - 11px); width: 22px; height: 22px;
  background: radial-gradient(circle, var(--gelb) 0 5px, var(--watt) 5.5px);
}
.thema .weg-lokal .h-1 { grid-row: 1; }
.thema .weg-lokal .h-2 { grid-row: 2; }
.thema .weg-cloud .h-1 { grid-row: 1 / 4; }
.thema .weg-cloud .h-2 { grid-row: 4; }
.thema .weg-cloud .h-3 { grid-row: 5; }
.thema .grenze { position: relative; grid-row: 4; grid-column: 1 / -1; display: flex; align-items: center; pointer-events: none; }
.thema .grenze::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; border-top: 2px dashed var(--flut); }
/* das Label bleibt in der linken Spalte, rechts ist die gestrichelte Linie mit der Cloud Strecke immer zu sehen */
.thema .grenze span { position: relative; max-width: calc(50% - var(--s5) / 2); padding-right: var(--s2); background: var(--watt); font-size: 14px; line-height: 20px; font-weight: 700; }
@media (max-width: 599px) {
  .thema .datenweg { --zh: 20px; }
  .thema .weg-halte li { font-size: 14px; }
}

/* ---------- Abschnitte: Kopf links (Spalten 1 bis 3), Inhalt rechts (4 bis 8), wie Fragen und Anfrage ---------- */
.thema .zweispaltig .innen { display: grid; grid-template-columns: repeat(8, 1fr); align-items: start; }
.thema .zweispaltig .abschnittskopf { grid-column: 1 / span 3; margin-bottom: 0; padding-right: var(--s7); position: sticky; top: calc(var(--kopf-hoehe) + var(--s7)); }
.thema .zweispaltig .inhalt { grid-column: 4 / span 5; }
.thema .inhalt > * + * { margin-top: var(--s4); }
.thema .inhalt > p, .thema .inhalt > ul, .thema .inhalt > ol { max-width: 66ch; }
.thema .inhalt > h3 { margin-top: var(--s7); }
.thema .inhalt > h3 + p { margin-top: var(--s3); }
.thema .inhalt > .legende-liste { margin-top: var(--s5); }
.thema .inhalt > .legende-liste + p, .thema .inhalt > .textlink-zeile { margin-top: var(--s5); }
.thema .inhalt .lead { font-size: 20px; line-height: 30px; }
.thema .textlink-zeile .textlink { margin-top: 0; }

/* Flächen aus der Grünfamilie, nur Takt, keine Bedeutung */
.thema .flaeche-seegras { background: var(--seegras); }
.thema .flaeche-seegras .legende-liste li, .thema .flaeche-seegras .legende-liste li:last-child { border-color: var(--seegras-linie); }
.thema .flaeche-priel { background: var(--priel); color: var(--watt); }
.thema .flaeche-priel ::selection { background: var(--watt); color: var(--flut); }
.thema .flaeche-priel :focus-visible { outline-color: var(--watt); }
.thema .flaeche-priel h2, .thema .flaeche-priel h3, .thema .flaeche-priel .lead { color: var(--watt); }
.thema .flaeche-priel p:not(.lead), .thema .flaeche-priel li { color: var(--linie); }
.thema .flaeche-priel .legende-liste li, .thema .flaeche-priel .legende-liste li:last-child { border-color: var(--linie); }
.thema .flaeche-priel .legende-liste strong { color: var(--watt); }
.thema .flaeche-priel .textlink { color: var(--watt); text-decoration-color: var(--linie); }
.thema .flaeche-priel .textlink:hover { text-decoration-color: var(--watt); }

.thema .legende-liste strong { font-weight: 700; }

/* ---------- Wofür: ein Hauptfall groß, drei weitere als Zeilen ---------- */
.thema .hauptfall { padding-bottom: var(--s6); }
.thema .hauptfall h3 { font-size: 32px; line-height: 40px; letter-spacing: -.02em; }
.thema .hauptfall p { margin-top: var(--s4); font-size: 20px; line-height: 30px; max-width: 56ch; }
.thema .nebenfaelle li { display: block; }
.thema .nebenfaelle h3 { font-size: 20px; line-height: 28px; }
.thema .nebenfaelle p { margin-top: var(--s2); max-width: 60ch; }

/* ---------- Schritte (was ich mache): Nummer links, Text rechts, ungleich lang wie echte Arbeit ---------- */
.thema .schritte { counter-reset: schritt; }
.thema .schritte li {
  display: grid; grid-template-columns: var(--s8) 1fr; column-gap: var(--s4);
  padding: var(--s5) 0; border-top: 2px solid var(--linie);
}
.thema .schritte li:last-child { border-bottom: 2px solid var(--linie); }
.thema .schritte .nr { grid-row: 1 / span 2; font-size: 32px; line-height: 40px; font-weight: 800; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.thema .schritte h3 { font-size: 20px; line-height: 28px; padding-top: var(--s1); }
.thema .schritte p { grid-column: 2; margin-top: var(--s2); max-width: 60ch; }

/* ---------- Pakete: drei Stufen als Zeilen auf dem 8 Spalten Raster ---------- */
.thema .paket { display: grid; grid-template-columns: repeat(8, 1fr); align-items: start; padding: var(--s7) 0; border-top: 2px solid var(--seegras-linie); }
.thema .paket:last-child { border-bottom: 2px solid var(--seegras-linie); }
.thema .paket-kopf { grid-column: 1 / span 3; padding-right: var(--s7); }
.thema .paket-drin { grid-column: 4 / span 3; padding-right: var(--s7); }
.thema .paket-nicht { grid-column: 7 / span 2; }
.thema .stufe { font-size: 14px; line-height: 20px; font-weight: 700; color: var(--schlick); font-variant-numeric: tabular-nums; }
.thema .paket h3 { margin-top: var(--s2); font-size: 32px; line-height: 40px; letter-spacing: -.02em; }
.thema .paket-zeile { margin-top: var(--s2); font-size: 20px; line-height: 30px; font-weight: 700; }
.thema .paket-fuer { margin-top: var(--s4); max-width: 46ch; }
/* Preis als Vermerk: fett in Flutkante und eine Stufe größer als die Hinweise darüber (14/20 in Schlick),
   damit er nicht untergeht, aber ohne Rahmen und Fläche, damit er nicht wie ein Knopf aussieht */
.thema .preis { margin-top: var(--s5); font-size: 16px; line-height: 24px; font-weight: 700; color: var(--flut); }
.thema .paket-hinweis { margin-top: var(--s4); font-size: 14px; line-height: 20px; color: var(--schlick); max-width: 46ch; }
.thema .paket .legende-liste li { padding: var(--s3) 0; }
.thema .paket-nicht .legende-liste li { color: var(--schlick); }

/* ---------- Marktstand des Geräts: eine Spanne mit Datum ---------- */
.thema .spanne-wert { display: block; font-size: 32px; line-height: 40px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.thema .spanne-text { display: block; margin-top: var(--s1); font-size: 14px; line-height: 20px; font-weight: 700; color: var(--schlick); }

/* ---------- Tabelle: Vergleich im Ratgeber ---------- */
.thema .tabelle { max-width: 100%; overflow-x: auto; }
.thema .tabelle table { width: 100%; border-collapse: collapse; font-size: 16px; line-height: 24px; }
.thema .tabelle caption { text-align: left; padding-bottom: var(--s4); font-size: 20px; line-height: 28px; font-weight: 700; }
.thema .tabelle th, .thema .tabelle td { text-align: left; vertical-align: top; padding: var(--s3) var(--s4) var(--s3) 0; border-top: 2px solid var(--linie); }
.thema .tabelle th:last-child, .thema .tabelle td:last-child { padding-right: 0; }
.thema .tabelle tbody tr:last-child > * { border-bottom: 2px solid var(--linie); }
.thema .tabelle thead th { border-top: 0; padding-top: 0; font-size: 14px; line-height: 20px; color: var(--schlick); }
.thema .tabelle tbody th { font-weight: 700; }
.thema .flaeche-seegras .tabelle th, .thema .flaeche-seegras .tabelle td { border-color: var(--seegras-linie); }
.thema .quelle { margin-top: var(--s4); font-size: 14px; line-height: 20px; color: var(--schlick); max-width: 66ch; }

/* ---------- Entscheidungshilfe: drei Fälle als Zeilen, der gemischte Weg zuletzt ---------- */
.thema .fall + .fall { margin-top: var(--s7); }
.thema .fall h3 { font-size: 24px; line-height: 32px; }
.thema .fall .legende-liste { margin-top: var(--s4); }

/* ---------- Aufruf am Ende: Flutkante wie die Anfrage der Startseite ---------- */
.thema .aufruf { background: var(--flut); color: var(--watt); border-bottom: 2px solid var(--priel); }
.thema .aufruf ::selection { background: var(--watt); color: var(--flut); }
.thema .aufruf :focus-visible { outline-color: var(--watt); }
.thema .aufruf .innen { display: grid; grid-template-columns: repeat(8, 1fr); align-items: start; }
.thema .aufruf-text { grid-column: 1 / span 5; padding-right: var(--s7); }
.thema .aufruf-text p { margin-top: var(--s4); color: var(--linie); max-width: 56ch; }
.thema .aufruf-wege { grid-column: 6 / span 3; }
.thema .aufruf .knopf.anfragen { background: var(--steuerbord-hell); border-color: var(--steuerbord-hell); color: var(--flut); }
.thema .aufruf .knopf.anfragen:hover { background: var(--watt); border-color: var(--watt); }
.thema .aufruf .knopf.anfragen:focus-visible { outline-color: var(--steuerbord-hell); }
.thema .aufruf .direkt { margin-top: var(--s5); }

/* ---------- Umbrüche ---------- */
/* Tablet quer: der Kopf auf drei Spalten ist nur rund 310 px breit, ein langes Wort wie
   „Entscheidungshilfe“ passt in 40 px nicht hinein. Alle H2 der Themenseiten dort wie ab 1280 px in 32/40,
   damit sie untereinander gleich groß sind, dazu etwas mehr Satzbreite im Kopf. */
@media (min-width: 1024px) and (max-width: 1279px) {
  .thema .zweispaltig .abschnittskopf { padding-right: var(--s5); }
  .thema h2 { font-size: 32px; line-height: 40px; }
}
/* Von 1024 bis 1359 px ist die H2 32/40: die großen H3 (Hauptfall, Paketname) eine Stufe darunter */
@media (min-width: 1024px) and (max-width: 1359px) {
  .thema .hauptfall h3, .thema .paket h3, .thema .spanne-wert { font-size: 24px; line-height: 32px; }
}
@media (max-width: 1023px) {
  .thema .zweispaltig .innen, .thema .aufruf .innen { display: block; }
  .thema .zweispaltig .abschnittskopf { position: static; padding: 0; margin-bottom: var(--s6); }
  .thema .aufruf-text { padding: 0; }
  .thema .aufruf-wege { margin-top: var(--s6); }
  .thema .paket { display: block; }
  .thema .paket-kopf, .thema .paket-drin { padding-right: 0; }
  .thema .paket-drin, .thema .paket-nicht { margin-top: var(--s6); }
}
@media (max-width: 767px) {
  .thema .seitenkopf { padding-top: var(--s6); }
  .thema .hauptfall h3, .thema .paket h3 { font-size: 24px; line-height: 32px; }
  .thema .spanne-wert { font-size: 24px; line-height: 32px; }
  .thema .hauptfall p, .thema .inhalt .lead { font-size: 16px; line-height: 26px; }
  .thema .schritte li { grid-template-columns: var(--s7) 1fr; column-gap: var(--s3); }
  .thema .schritte .nr { font-size: 24px; line-height: 32px; }
  .thema .schritte h3 { padding-top: 0; }
  .thema .aufruf .knopf.anfragen { width: 100%; }
  .thema .tabelle table { font-size: 14px; line-height: 20px; }
}
/* Schmale Handys wie in site.css: das längste Wort einer H2 („Entscheidungshilfe“, rund 9,3 em) passt
   auf die Satzbreite (100vw minus 2 x 16 px), Teiler mit kleiner Reserve 9,6; passt in 32 px ab 340 px. */
@media (max-width: 339px) {
  .thema h2 { font-size: min(var(--h2), calc((100vw - 32px) / 9.6)); overflow-wrap: break-word; }
}
/* Tippflächen bis 1024 px: Brotkrumen mindestens 44 px, das Bild bleibt gleich */
@media (max-width: 1024px) {
  .thema .brotkrumen a { display: inline-block; padding: var(--s3) 0; margin: calc(var(--s3) * -1) 0; }
  .thema .brotkrumen ol { row-gap: var(--s5); }
}
@media print {
  .thema .zweispaltig .abschnittskopf { position: static; }
}
