/* ============================================================================
   SCB Inhaltsfluss – gemeinsam für Frontend UND Block-Editor (Theme 0.10.0)
   ----------------------------------------------------------------------------
   Typografie und Abstände für Fließtext-Inhalte (Seiten, Beiträge), angelehnt
   an die bisherige ClubDesk-Website (im Browser gemessen 20.10.2026):
     Fließtext 18 px / Zeilenhöhe ≈ 1.3, Absatzabstand 10 px,
     Überschriften mit klarem Abstand oben/unten, Listen ≈ 40 px Einzug,
     Textbreite ≈ 850 px.

   Geltungsbereich:
     Frontend  → .scb-entry__content (single/page/Bewerb/Galerie/Startseite), .entry-content
     Editor    → .is-root-container (add_editor_style() stellt automatisch
                 .editor-styles-wrapper voran)
   Ziel: Was im Editor steht, sieht im Frontend gleich aus.

   Spezifität: :is(Container) + Element/Klasse = (0,2,1) → schlägt die
   Design-Kit-Resets aus tokens.css (.scb h2 / .scb p { margin: 0 }), die den
   Textfluss im Frontend bisher auf 0 gesetzt haben. Eigene Klassen der
   Plugin-Blöcke (News-Karten, Termine …) bleiben unberührt, weil hier nur
   Core-Blöcke (wp-block-heading/-paragraph/-list) bzw. klassenlose
   Elemente angesprochen werden.
   ============================================================================ */

:root {
	--scb-flow-text:         18px;
	--scb-flow-lh:           1.35;
	--scb-flow-p:            10px;   /* Abstand zwischen Absätzen */
	--scb-flow-h2-top:       44px;
	--scb-flow-h2-bottom:    14px;
	--scb-flow-h3-top:       30px;
	--scb-flow-h3-bottom:    10px;
	--scb-flow-h4-top:       22px;
	--scb-flow-h4-bottom:    8px;
	--scb-flow-list-indent:  2.2em;  /* ≈ 40 px bei 18 px */
	--scb-flow-list-gap:     14px;   /* Abstand vor/nach Listen */
	--scb-flow-block:        24px;   /* Abstand vor/nach Bildern, Tabellen, Galerien */
}

/* ---- Grundschrift im Inhaltsbereich ------------------------------------- */
:is(.scb-entry__content, .entry-content, .is-root-container) {
	font-size: var(--scb-flow-text);
	line-height: var(--scb-flow-lh);
}

/* ---- Absätze ------------------------------------------------------------- */
:is(.scb-entry__content, .entry-content, .is-root-container) :is(p.wp-block-paragraph, p:not([class])) {
	margin: var(--scb-flow-p) 0;
	line-height: var(--scb-flow-lh);
}
/* Schriftgröße nur, wenn im Editor keine eigene Größe gewählt wurde. */
:is(.scb-entry__content, .entry-content, .is-root-container) p:not([class*="-font-size"]) {
	font-size: var(--scb-flow-text);
}

/* ---- Überschriften ------------------------------------------------------- */
/* Schrift wie im Frontend (Barlow Semi Condensed, fett) – editor.css setzte im
   Editor bisher die schmalere Barlow Condensed. */
:is(.scb-entry__content, .entry-content, .is-root-container) :is(h1, h2, h3, h4, h5, h6):is(.wp-block-heading, :not([class])) {
	font-family: var(--wp--preset--font-family--barlow-semi-condensed, "Barlow Semi Condensed", "Helvetica Neue", Arial, sans-serif);
	font-weight: 700;
	color: var(--scb-text, #353238);
	/* 0.11.3: lange Wörter („Herbstmeisterschaften") am Handy trennen statt überlaufen. */
	overflow-wrap: break-word;
	hyphens: auto;
}
:is(.scb-entry__content, .entry-content, .is-root-container) :is(h2.wp-block-heading, h2:not([class])) {
	margin: var(--scb-flow-h2-top) 0 var(--scb-flow-h2-bottom);
	line-height: 1.2;
}
:is(.scb-entry__content, .entry-content, .is-root-container) :is(h3.wp-block-heading, h3:not([class])) {
	margin: var(--scb-flow-h3-top) 0 var(--scb-flow-h3-bottom);
	line-height: 1.25;
}
:is(.scb-entry__content, .entry-content, .is-root-container) :is(h4.wp-block-heading, h4:not([class]), h5.wp-block-heading, h6.wp-block-heading) {
	margin: var(--scb-flow-h4-top) 0 var(--scb-flow-h4-bottom);
	line-height: 1.25;
}
:is(.scb-entry__content, .entry-content, .is-root-container) :is(h1.wp-block-heading, h1:not([class])) {
	margin: 0 0 var(--scb-flow-h2-bottom);
	line-height: 1.15;
}

/* Größen wie theme.json (Presets), außer im Editor wurde eine eigene Größe gewählt. */
:is(.scb-entry__content, .entry-content, .is-root-container) h2:is(.wp-block-heading, :not([class])):not([class*="-font-size"]) {
	font-size: var(--wp--preset--font-size--h2, 32px);
}
:is(.scb-entry__content, .entry-content, .is-root-container) h3:is(.wp-block-heading, :not([class])):not([class*="-font-size"]) {
	font-size: var(--wp--preset--font-size--h3, 24px);
}
:is(.scb-entry__content, .entry-content, .is-root-container) h4:is(.wp-block-heading, :not([class])):not([class*="-font-size"]) {
	font-size: var(--wp--preset--font-size--lead, 22px);
}

/* ---- Listen -------------------------------------------------------------- */
:is(.scb-entry__content, .entry-content, .is-root-container) :is(ul, ol):is(.wp-block-list, :not([class])) {
	--scb-list-pad: var(--scb-flow-list-indent); /* von der Block-Breitenregel in style.css addiert */
	box-sizing: border-box; /* Editor zentriert Blöcke auf die Inhaltsbreite – Einzug darf nicht verbreitern */
	margin: var(--scb-flow-list-gap) 0;
	padding-left: var(--scb-flow-list-indent);
	line-height: var(--scb-flow-lh);
}
:is(.scb-entry__content, .entry-content, .is-root-container) ul:is(.wp-block-list, :not([class])) {
	list-style: disc;
}
:is(.scb-entry__content, .entry-content, .is-root-container) ol:is(.wp-block-list, :not([class])) {
	list-style: decimal;
}
:is(.scb-entry__content, .entry-content, .is-root-container) :is(.wp-block-list, ul:not([class]), ol:not([class])) > li {
	margin: 4px 0;
	padding-left: 2px;
}
:is(.scb-entry__content, .entry-content, .is-root-container) li > :is(ul, ol) {
	margin: 4px 0;
}

/* ---- Zitate, Trenner, Medien, Tabellen ---------------------------------- */
:is(.scb-entry__content, .entry-content, .is-root-container) .wp-block-quote {
	margin: var(--scb-flow-block) 0;
	padding: 4px 0 4px 18px;
	border-left: 4px solid var(--scb-red, #C42119);
	font-style: normal;
}
:is(.scb-entry__content, .entry-content, .is-root-container) .wp-block-quote > p {
	margin: 6px 0;
}
:is(.scb-entry__content, .entry-content, .is-root-container) :is(.wp-block-image, .wp-block-table, .wp-block-gallery, .wp-block-embed, .wp-block-separator, .wp-block-file) {
	margin-top: var(--scb-flow-block);
	margin-bottom: var(--scb-flow-block);
}
:is(.scb-entry__content, .entry-content, .is-root-container) .wp-block-table :is(th, td) {
	padding: 6px 10px;
	line-height: 1.3;
}

/* ---- Erster/letzter Block ohne Außenabstand ------------------------------ */
/* 0.11.2: Spezifität (0,2,1) + später im File → schlägt die Überschriften-/
   Absatzregeln oben (sonst bekam eine H2 als erster Block 44 px Abstand). */
:is(.scb-entry__content, .entry-content, .is-root-container) > :is(h1, h2, h3, h4, h5, h6, p, ul, ol, figure, div, blockquote, table):first-child,
:is(.scb-entry__content, .entry-content) > :first-child,
.is-root-container > :first-child {
	margin-top: 0;
}
:is(.scb-entry__content, .entry-content) > :is(h1, h2, h3, h4, h5, h6, p, ul, ol, figure, div, blockquote, table):last-child,
:is(.scb-entry__content, .entry-content) > :last-child {
	margin-bottom: 0;
}

/* ---- Import-Reste aus ClubDesk ------------------------------------------- */
/* Leere ClubDesk-Hintergrundflächen aus übernommenem HTML (verursachten
   horizontales Überlaufen, z. B. auf der Datenschutz-Seite). */
:is(.scb-entry__content, .entry-content, .is-root-container) .cd-backgroundPane {
	display: none !important;
}
