/**
 * Bilder aus dem CKEditor 5 im Frontend (Seiten, News, Mitgliederprofile)
 *
 * Gleiche Regeln wie im Editor (ckeditor5-content.css), aber ohne den
 * Container .ck-content. Bilder aus dem alten FCKeditor (align="left",
 * style="float:…") sind davon nicht betroffen.
 */
figure.image {
	display: table;
	clear: both;
	margin: .9em auto;
	text-align: center;
	min-width: 50px;
}
figure.image img {
	display: block;
	margin: 0 auto;
	max-width: 100%;
	min-width: 100%;
	height: auto;
}
figure.image > figcaption {
	display: table-caption;
	caption-side: bottom;
	padding: .6em;
	font-size: .75em;
	word-break: normal;
	overflow-wrap: anywhere;
}
figure.image.image_resized {
	display: block;
	box-sizing: border-box;
	max-width: 100%;
}
figure.image.image_resized img {
	width: 100%;
}
figure.image.image_resized > figcaption {
	display: block;
}
img.image_resized {
	height: auto;
}
.image-inline {
	display: inline-flex;
	align-items: flex-start;
	max-width: 100%;
}
.image-inline img {
	flex-grow: 1;
	flex-shrink: 1;
	max-width: 100%;
}

/* Ausrichtung: links/rechts mit Textumfluss, zentriert ohne */
.image-style-align-left,
figure.image.image-style-align-left {
	float: left;
	clear: none;
	margin: .3em 1.5em .9em 0;
}
.image-style-align-right,
figure.image.image-style-align-right,
figure.image.image-style-side {
	float: right;
	clear: none;
	margin: .3em 0 .9em 1.5em;
}
figure.image.image-style-side {
	max-width: 50%;
}
.image-style-align-center,
figure.image.image-style-align-center {
	margin-left: auto;
	margin-right: auto;
}
figure.image.image-style-block-align-left {
	margin-left: 0;
	margin-right: auto;
}
figure.image.image-style-block-align-right {
	margin-left: auto;
	margin-right: 0;
}

/* Umfliessende Bilder nicht ueber das Ende des Inhalts hinausragen lassen */
#content::after,
.cms-text::after {
	content: "";
	display: table;
	clear: both;
}

/*
 * Smartphones (bis 480 px): kein Text mehr neben Bildern - das Bild steht
 * darueber bzw. darunter.
 *  - Bilder aus CKEditor 5 (figure): Rahmen ueber die volle Breite; das Bild
 *    selbst so gross wie die Datei, hoechstens volle Breite (kleine Bilder
 *    werden nicht hochgerechnet und bleiben scharf).
 *  - Alte Bilder aus dem FCKeditor (Klassen lc/rc/cbc aus main.css,
 *    align="left|right", style="float:...") genauso.
 * !important ist noetig, weil Breite und float teils als Inline-Style oder
 * Attribut im HTML stehen. Tablets und Desktop bleiben unveraendert.
 */
@media only screen and (max-width: 480px) {
	.cms-text figure.image.image-style-align-left,
	.cms-text figure.image.image-style-align-right,
	.cms-text figure.image.image-style-side,
	.cms-text figure.image.image_resized {
		float: none;
		display: block;
		width: 100% !important;
		max-width: 100%;
		margin: .9em 0;
	}
	.cms-text figure.image img {
		width: auto !important;
		max-width: 100%;
		height: auto !important;
	}
	.cms-text img.lc,
	.cms-text img.rc,
	.cms-text img.cbc,
	.cms-text img[align="left" i],
	.cms-text img[align="right" i],
	.cms-text img[style*="float"],
	.cms-text img.image-style-align-left,
	.cms-text img.image-style-align-right {
		float: none !important;
		display: block;
		width: auto !important;
		max-width: 100% !important;
		height: auto !important;
		margin: .9em auto !important;
	}
}
