/*
 * Kennerblick 3.1.0 – Layout-Feinschliff (lädt nach kennerblick-300.css).
 * Ziel: eine gemeinsame linke Kante je Textspalte, ruhige Abstände, keine Versätze in allen Sprachen.
 */

/* ---------- Rechtsseiten (Impressum, Datenschutz, AGB): eine Lesespalte ---------- */
.kw-light > .kw-legal-title,
.kw-light > .wp-block-post-content {
	width: min(100%, 46rem);
	max-width: 46rem !important;
	margin-inline: auto !important;
	box-sizing: border-box;
}
/* Alle Inhalte der Spalte beginnen an derselben Kante (kein automatisches Zentrieren einzelner Blöcke). */
.kw-light > .wp-block-post-content > * {
	max-width: none !important;
	margin-left: 0 !important;
	margin-right: 0 !important;
}
.kw-light > .wp-block-post-content > p,
.kw-light > .wp-block-post-content > ul,
.kw-light > .wp-block-post-content > ol { max-width: 68ch !important; }
.kw-light h2 { max-width: none; text-wrap: balance; }
.kw-light > .kw-legal-title { font-size: clamp(2rem, 3.4vw, 3rem); margin-bottom: 1.25rem; }
.kw-light > .wp-block-post-content > .kw-stand { margin-top: 0; }
.kw-light > .wp-block-post-content > .kw-sprachhinweis { margin: 0 0 1.5rem; }
.kw-light > .wp-block-post-content > h2:first-of-type { margin-top: 1.8rem; }
.kw-light .kw-legal-box { margin-block: 1.25rem; }

/* ---------- Projekt-Fallstudien: Luft zwischen Kartenblock und folgender Zwischenüberschrift ---------- */
.kbp-lernen__schritte + .kbp-lernen__h,
.kbp-mit__karten + .kbp-mit__h { margin-top: clamp(2rem, 4vw, 3rem) !important; }

/* ---------- Kompetenz- und Startseiten (kb3): vollflächige Bänder, Inhalt an der Kopfzeilen-Kante ---------- */
:root { --kb310-rand: var(--wp--style--root--padding-left, clamp(1rem, 4vw, 2rem)); }
#inhalt .entry-content > .kb3,
#inhalt .entry-content > .kb3-case,
#inhalt .entry-content > p.kb3-section,
[dir="rtl"] #inhalt .entry-content > .kb3 {
	width: auto !important;
	max-width: none !important;
	margin-inline: calc(-1 * var(--kb310-rand)) !important;
	margin-block: 0 !important;
	box-sizing: border-box;
}
/* Gleiche Inhaltsbreite wie Kopf- und Fußzeile (1200 px), unabhängig von der Scrollleiste. */
.kb3-hero, .kb3-section, .kb3-method {
	padding-inline: max(var(--kb310-rand), calc((100% - 1200px) / 2)) !important;
}
/* Direkte Kinder des Inhaltsbereichs: Prozentbasis ist die Inhaltsbreite ohne Rand. */
#inhalt .entry-content > .kb3-case, #inhalt .entry-content > p.kb3-section {
	padding-inline: max(var(--kb310-rand), calc((100% + 2 * var(--kb310-rand) - 1200px) / 2)) !important;
}

/* Deko-Kreise in Rechts-nach-links-Sprachen spiegeln (nicht hinter den Text legen). */
[dir="rtl"] .kb3-orbit { right: auto; left: 5%; }
@media (max-width: 800px) { [dir="rtl"] .kb3-orbit { right: auto; left: -100px; } }
[dir="rtl"] .is-style-kw-hero::after { right: auto; left: max(-22vw, -280px); transform: translateY(-50%) scaleX(-1); }
[dir="rtl"] .is-style-kw-hero.kw-hero--small::after { right: auto; left: max(-18vw, -200px); }
@media (max-width: 782px) { [dir="rtl"] .is-style-kw-hero::after { right: auto; left: -70vw; } }
/* Kleine Bühne: Überschrift nicht in die Kreise laufen lassen. */
@media (min-width: 783px) { .is-style-kw-hero.kw-hero--small h1 { max-width: 19ch; text-wrap: balance; } }

/* Kompetenzkarten: Titel, Nummer und Text je Reihe auf gleicher Höhe (Subgrid). */
@supports (grid-template-rows: subgrid) {
	.kb3-fields { grid-auto-rows: auto; }
	.kb3-fields article { grid-row: span 3; grid-template-rows: subgrid; row-gap: 0; }
}
.kb3-fields h3 { text-wrap: balance; }

/* „Im Detail“ / „Einordnung und Vorgehen“: einheitliche Linien, keine dunklen Fugen zwischen hellen Bändern. */
.kb3-case > div, .kb3-case > div:nth-of-type(even) { border-color: #c3ccd9 !important; }
/* Zwei Detailblöcke hintereinander: gleichmäßiger Abstand, keine Fuge. */
#inhalt .entry-content > .kb3-case:has(+ .kb3-case) { padding-bottom: clamp(2rem, 4vw, 3.5rem) !important; }
#inhalt .entry-content > .kb3-case + .kb3-case { padding-top: clamp(2rem, 4vw, 3.5rem) !important; border-top: 0 !important; box-shadow: none !important; }
#inhalt .entry-content > .kb3-case + .kb3-case::before, #inhalt .entry-content > .kb3-case + .kb3-case::after { display: none !important; }
/* Schaltfläche direkt unter der Tabelle (gleiche Spalte), ohne eigenes Band. */
#inhalt .entry-content > .kb3-case:has(+ p.kb3-section) { padding-bottom: 0 !important; }
#inhalt .entry-content > .kb3-case + p.kb3-section { padding-top: 2.25rem !important; border-top: 0 !important; box-shadow: none !important; }
.kb3-case h2 { font-size: clamp(1.8rem, 2.8vw, 2.6rem); line-height: 1.12; text-wrap: balance; max-width: 22ch; }
@media (min-width: 960px) {
	#inhalt .entry-content > .kb3-case {
		display: grid;
		grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
		column-gap: clamp(2.5rem, 6vw, 6rem);
		row-gap: 0;
		align-items: start;
	}
	/* Dachzeile und Überschrift teilen sich die linke Spalte und bleiben oben. */
	.kb3-case > .kb3-label { grid-column: 1; grid-row: 1 / span 40; align-self: start; margin: 0; position: sticky; top: 7.5rem; }
	.kb3-case > h2 { grid-column: 1; grid-row: 1 / span 40; align-self: start; margin: 2.1rem 0 0; position: sticky; top: calc(7.5rem + 2.1rem); }
	.kb3-case > div { grid-column: 2; }
	.kb3-case > div:first-of-type { border-top-color: #c3ccd9; }
	.kb3-case > div { grid-template-columns: minmax(10rem, .75fr) minmax(0, 2fr) !important; }
}
/* Allein stehende Schaltfläche nach den Detailtabellen: als ruhiger Abschluss des hellen Bandes. */
#inhalt .entry-content > p.kb3-section {
	background: #f1f4f8;
	padding-top: 0 !important;
	padding-bottom: clamp(3.5rem, 7vw, 6rem) !important;
}
#inhalt .entry-content > p.kb3-section::before { display: none !important; }
@media (min-width: 960px) {
	#inhalt .entry-content > .kb3-case + p.kb3-section {
		display: grid;
		grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
		column-gap: clamp(2.5rem, 6vw, 6rem);
	}
	#inhalt .entry-content > .kb3-case + p.kb3-section > a { grid-column: 2; justify-self: start; }
}


/* Rechts-nach-links: Lichtverlauf der Bühne und goldener Akzent an die gespiegelte Seite. */
[dir="rtl"] .kb3-hero { background: radial-gradient(circle at 17% 44%, #233b60 0, transparent 32%), #0a1424; }
[dir="rtl"] .kb3-section:not(.kb3-close)::before { right: auto; left: 0; }

/* ---------- Karten: Maße inkl. Innenabstand, klare Schrifthierarchie, Status unten bündig ---------- */
.is-style-kw-card { box-sizing: border-box; }
#inhalt .is-style-kw-card :is(h3, h4) { font-size: clamp(1.15rem, 1.4vw, 1.3rem); line-height: 1.3; text-wrap: balance; }
/* Fließtext in Karten kleiner als der Kartentitel (vorher 21 px Text unter 20 px Titel). */
#inhalt .is-style-kw-card p:not(.kw-num):not(.kw-eyebrow):not(.kw-folge-status):not(.kw-meta):not(.kw-small):not(.kw-level):not(.kw-prompt):not([class*="kbp-"]), #inhalt .is-style-kw-card li { font-size: 1.05rem; line-height: 1.6; }
.is-style-kw-card:has(> .kw-folge-status) { display: flex; flex-direction: column; }
.is-style-kw-card > .kw-folge-status { margin-top: auto !important; align-self: flex-start; }

/* ---------- Raster ohne verwaiste Einzelkarten (Desktop) ---------- */
@media (min-width: 1000px) {
	.kw-grid:has(> :nth-child(5):last-child), .kw-grid:has(> :nth-child(6):last-child) { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
	.kw-grid:has(> :nth-child(7):last-child), .kw-grid:has(> :nth-child(8):last-child) { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }
	.kw-stolper:has(> li:nth-child(6):last-child) { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
}
/* Zweispaltige Listen mit ungerader Anzahl: letzte Karte über die ganze Breite. */
@media (min-width: 700px) {
	.kbp-empf > li:last-child:nth-child(odd),
	.kbp-ausblick__ebene--morgen > ol > li:last-child:nth-child(odd) { grid-column: 1 / -1; }
}
.kbp-ausblick__ebenen { align-items: start; }

/* ---------- Projekt-Cockpit ---------- */
.kbp-vier + .kbp-details { margin-top: 1.5rem; }
.kbp-zwei { align-items: start; row-gap: 1.5rem; }
.kbp-fragen + .kbp-lernen, .kbp-zwei + * { margin-top: clamp(1.5rem, 3vw, 2.5rem); }
/* Reiterleiste: sichtbarer Hinweis, dass sie seitlich weiterläuft. */
.kbp-bereiche { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 2.5rem), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 2.5rem), transparent); padding-inline-end: 2.5rem; }
[dir="rtl"] .kbp-bereiche { -webkit-mask-image: linear-gradient(to left, #000 calc(100% - 2.5rem), transparent); mask-image: linear-gradient(to left, #000 calc(100% - 2.5rem), transparent); }
/* Nummernkreise der Empfehlungen in RTL an den Zeilenanfang (rechts). */
[dir="rtl"] .kbp-empf > li::before { left: auto; right: 14.4px; }
/* Sprachhinweis am Ende der Fallstudien: lesbare Links, kompakter Abstand. */
aside.kb3-case { padding-block: clamp(1.75rem, 3vw, 2.5rem) !important; }
aside.kb3-case a { color: #1e3152; text-decoration: underline; text-underline-offset: .2em; font-weight: 700; }
aside.kb3-case a:hover { color: #7a5c22; }

/* ---------- Tabellen mobil: alle als gestapelte Karten, Beschriftung aus der Kopfzeile ---------- */
@media (max-width: 700px) {
	.kw-table { overflow: visible; }
	.kw-table table, .kw-table tbody, .kw-table tr, .kw-table td { display: block; min-width: 0 !important; width: auto; }
	.kw-table thead { display: none; }
	.kw-table tr { padding: 1rem 1.1rem; border-bottom: 1px solid var(--kw-linie); }
	.kw-table tbody tr:last-child { border-bottom: 0; }
	.kw-table td, .kw-table tbody tr:nth-child(even) td { border: 0; padding: 0.15rem 0 0.55rem; background: none; }
	.kw-table tbody tr:nth-child(even) { background: rgba(30, 49, 82, 0.35); }
	.kw-table td:first-child { font-family: var(--wp--preset--font-family--serif); font-size: 1.2rem; padding-bottom: 0.4rem; }
	.kw-table td:not(:first-child)::before { display: block; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--kw-gold-hell); content: attr(data-label) !important; }
	.kw-table td:not(:first-child):not([data-label])::before { content: none !important; }
}

/* ---------- Hinweisbalken (Creme): Radius wie Karten, Text über die Breite ---------- */
.is-style-kw-callout { border-radius: var(--kw-radius) !important; }
.is-style-kw-callout p { max-width: none !important; }

/* ---------- Listen: an der Textkante, Marker hängt in den Rand ---------- */
.kw-main .wp-block-list:not(.kw-steps):not([class*="kw-"]) { padding-inline-start: 1.15em; }
.kw-light .wp-block-list li { font-size: inherit; }
.kw-light > .wp-block-post-content > .wp-block-list { max-width: 68ch !important; }

/* ---------- Kontaktformular: Absenden mobil vollbreit wie die übrigen Handlungsaufrufe ---------- */
@media (max-width: 600px) { .kw-form button[type="submit"] { width: 100%; } }

/* ---------- Überschriften: ausgewogene Umbrüche überall ---------- */
.kw-main h1, .kw-main h2, .kw-main h3 { text-wrap: balance; }
/* Zwischenüberschriften nicht zu früh umbrechen lassen (vorher 24ch). */
.kw-main h2 { max-width: 30ch; }
/* Mobil: Kreismotiv dezenter hinter Überschriften. */
@media (max-width: 782px) { .is-style-kw-hero::after { opacity: .2; } }

/* ---------- Feinschliff Runde 2 ---------- */
/* Kompetenzkarten: Höhenangleich nur im mehrspaltigen Raster; unten keine doppelte Luft. */
@media (max-width: 800px) { .kb3-fields article { grid-row: auto !important; grid-template-rows: none !important; } }
.kb3-fields { margin-bottom: 0 !important; }
.kb3-section > .kb3-fields:last-child article:nth-last-child(-n+3) { padding-bottom: 0; }
/* Statusplakette: immer mindestens 1 rem Luft zum Kartentext. */
.is-style-kw-card:has(> .kw-folge-status) > :nth-last-child(2) { margin-bottom: 1rem !important; }
/* Zitat-/Vorlagenblöcke: Akzent am Zeilenanfang, in RTL rechts; nicht-lateinische Schriften nicht kursiv. */
.kw-prompt { border-left-width: 0 !important; border-inline-start: 4px solid var(--kw-gold, #c2a060) !important; text-align: start; }
:is(:lang(ar), :lang(he), :lang(ja), :lang(zh)) :is(.kw-prompt, em, i, blockquote, cite) { font-style: normal; }
/* Arabische/hebräische Dachzeilen lesbar: größer, ohne Sperrung, ohne Versalien. */
:is(:lang(ar), :lang(he)) :is(.kw-eyebrow, .kb3-label, .kw-level) { font-size: .92rem !important; letter-spacing: 0 !important; text-transform: none !important; }
/* Einheitliche Schaltflächenschrift (mobil vorher teils 13 px). */
.kw-main .wp-block-button__link, .kw-main .kb3-button { font-size: clamp(1rem, 1.1vw, 1.05rem) !important; }
/* Aktiver Bereich im Hauptmenü auch auf Unterseiten. */
.kw-nav a[aria-current="true"] { color: var(--kw-gold-hell); box-shadow: inset 0 -2px 0 var(--kw-gold); border-radius: 8px 8px 0 0; }
.kw-nav__list .kw-nav__cta a[aria-current="true"] { box-shadow: none; border-radius: 8px; }
/* Alter Vollbreiten-Trick (box-shadow-Spreizung) erzeugt bei echten Vollbreiten-Bändern feine Fugen – entfernen. */
#inhalt .entry-content > .kb3-case, #inhalt .entry-content > p.kb3-section, #inhalt .entry-content > aside.kb3-case { box-shadow: none !important; clip-path: none !important; }
.kb3-section, .kb3-case, .kb3-close, .kb3-method { box-shadow: none !important; clip-path: none !important; }

/* ---------- Feinschliff Runde 3 ---------- */
/* RTL: Nummernkreise der Empfehlungen und Zeitstrahl vollständig spiegeln, Diagramme links-nach-rechts. */
[dir="rtl"] .kbp-empf > li { padding-left: 1rem !important; padding-right: 3.1rem !important; }
[dir="rtl"] .kbp-nb-zeit { padding-left: 0 !important; padding-right: 2.4rem !important; }
[dir="rtl"] .kw-main svg { direction: ltr; }
/* Mobil: Karte-in-Karte nicht doppelt polstern (Textspalte sonst nur ~230 px). */
@media (max-width: 600px) {
	.is-style-kw-card .is-style-kw-card, .kbp-lernen .is-style-kw-card, .kbp-empf > li { padding: .95rem !important; }
	.kbp-lernen { padding: 1rem !important; }
	[dir="rtl"] .kbp-empf > li { padding-right: 2.9rem !important; }
	.kbp-empf > li { padding-left: 2.9rem !important; }
	[dir="rtl"] .kbp-empf > li { padding-left: .95rem !important; }
}
/* „Das kann das Projekt heute“: beim Scrollen neben der längeren Spalte stehen bleiben. */
@media (min-width: 900px) { .kbp-ausblick__ebene--heute { position: sticky; top: 7.5rem; } }
/* Aufklappleisten im Cockpit: erkennbares Plus wie auf den übrigen Seiten. */
.kbp-details > summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 1rem; cursor: pointer; }
.kbp-details > summary::-webkit-details-marker { display: none; }
.kbp-details > summary::after { content: "+"; font-size: 1.3em; line-height: 1; color: var(--kw-gold-hell, #d9be7e); flex: none; }
.kbp-details[open] > summary::after { content: "–"; }
/* NACHT BLUT Zeitstrahl: Bildhöhe begrenzen, damit kurze Texte keine großen Leerflächen erzeugen. */
@media (min-width: 700px) { .kbp-nb-zeit img { max-height: 260px; width: auto; max-width: 100%; object-fit: contain; } }
/* Reiterleiste: auf breiten Bildschirmen umbrechen statt abschneiden. */
@media (min-width: 1000px) { .kbp-bereiche { flex-wrap: wrap; overflow: visible !important; -webkit-mask-image: none; mask-image: none; padding-inline-end: 0; } }
/* Listen auf dunklen Seiten: angenehme Zeilenlänge. */
.kw-main .wp-block-list:not(.kw-steps) { max-width: 72ch; }

/* 3.1.0b: Sehr schmale Bildschirme (bis 360 px): lange deutsche Wörter in Überschriften („Datenschutzerklärung“,
   „Verbraucherstreitbeilegung“, „Geschäftsbedingungen“) passen sonst nicht in die Zeile. Silbentrennung bleibt
   bewusst aus (3.0-Gestaltung); stattdessen wird die Schrift nur hier etwas kleiner. */
@media (max-width: 360px) {
	body h1 { font-size: min(2rem, 8vw) !important; }
	body h2 { font-size: min(1.5rem, 6.6vw) !important; }
	body h3 { font-size: min(1.25rem, 6vw) !important; }
}

/* 30.11.2026: Kanal-Schaltflächen mit Symbol (Fußbereich, Kontakt). Mindesthöhe 44 px für die Bedienung am Handy. */
.kw-social a { display: inline-flex; align-items: center; gap: .45rem; min-height: 44px; box-sizing: border-box; }
.kw-social__symbol { flex: none; }
