/**
 * Mapping der WordPress-Standardblöcke auf die Original-Optik.
 * Die Inhalte liegen seit dem Block-Umbau als core/paragraph, core/heading,
 * core/list, core/separator, core/image und core/buttons vor; dieses Stylesheet
 * bildet das Verhalten des früheren TYPO3-Markups nach. wp-block-library ist
 * dequeued — hier steht alles, was die core-Blöcke an CSS brauchen.
 */

/* Bild-Blöcke: Verhalten wie die FSC-ce-gallery — die Figure schrumpft auf die
   Bildbreite (display: table), ist horizontal zentriert, die Bildunterschrift
   läuft in Bildbreite um (table-caption, wie content-element.css).
   margin-top/bottom MUSS auf 0: der Browser-Default für <figure> ist margin-block
   1em (= 18 px), das Original setzt `.ce-gallery figure { margin: 0 }`. */
.content .wp-block-image {
	display: table;
	margin-top: 0;
	margin-bottom: 0;
	margin-left: auto;
	margin-right: auto;
}

.content .wp-block-image img {
	display: block;
	max-width: 100%;
	height: auto;
}

/* Bildblöcke in Textabschnitten (die früheren RTE-Bilder: c2 Startseite, c45
   /geschichten) standen im Original in einem Absatz — Abstand nach unten deshalb
   wie .content p (style.css). Bild-CEs (frame-type-image) bleiben bei margin 0. */
.content .frame-type-text figure.wp-block-image {
	margin-bottom: 28px;
}

/* Ausgerichtete Bilder (Block-Seitenleiste links/zentriert/rechts): Ohne theme.json
   legt WordPress sie beim Rendern in einen Wrapper — div.wp-block-image >
   figure.alignright (wp_restore_image_outer_container). Der Wrapper darf keine
   Tabelle sein, sonst umschließt er den Float und der Text fließt nicht herum. */
.content div.wp-block-image {
	display: block;
	margin: 0;
}

.content .wp-block-image .aligncenter {
	display: table;
	margin: 0 auto;
}

/* Links/rechts: Text umfließt das Bild wie bei span.float-right/.float-left im
   RTE-Original; 20 px Abstand zum Text wie .entryDetail .float-right (style.css).
   Unter 750 px steht das Bild zentriert über dem Text — neben einer schmalen
   Spalte bliebe kein Platz. */
.content .wp-block-image .alignright {
	display: table;
	float: right;
	margin: 0 0 0 20px;
}

.content .wp-block-image .alignleft {
	display: table;
	float: left;
	margin: 0 20px 0 0;
}

@media only screen and (max-width: 750px) {
	.content .wp-block-image .alignright,
	.content .wp-block-image .alignleft {
		float: none;
		margin: 0 auto 28px;
	}
}

.content .wp-block-image figcaption {
	display: table-caption;
	caption-side: bottom;
	font-size: 15px; /* wie figcaption.image-caption (style.css) */
	margin: 0;
}

/* Netzwerk-Logos auf /projekt (.image-box): Kasten mit Schatten, Logo vertikal
   zentriert, max. 60 % Breite — ersetzt die ce-outer/ce-inner-Regeln aus style.css */
.image-box .wp-block-image {
	display: block;
	position: absolute;
	top: 50%;
	left: 0;
	width: 100%;
	transform: translate(0, -50%);
	text-align: center;
	margin: 0;
}

.image-box .wp-block-image img {
	display: inline-block;
	width: auto;
	max-width: 60%;
}

/* Buttons: Blockabstand wie der Original-Absatz (.content p, style.css) —
   die .button-Optik selbst kommt über den Render-Filter (Klasse .button)
   aus den unveränderten Original-Stylesheets. Flex + Ausrichtungsklassen
   ersetzen die entfernten Layout-Basis-Styles der Global-Styles. */
.content .wp-block-buttons {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5em;
	margin-bottom: 28px;
}

.content .wp-block-buttons.is-content-justification-center {
	justify-content: center;
}

.content .wp-block-buttons.is-content-justification-right {
	justify-content: flex-end;
}
