/* Medien und Text, Stil „Kapitel“: Bild 4:3 mit Radius, Text daneben ohne Fläche.
 * Für Abschnitte auf Inhaltsseiten (Meilensteine, Leistungen im Detail). Mehrere
 * Kapitel hintereinander bekommen automatisch Abstand. */

.wp-block-media-text.is-style-chapter {
	grid-template-columns: 50% 1fr;
	align-items: center;
}

.wp-block-media-text.is-style-chapter.has-media-on-the-right {
	grid-template-columns: 1fr 50%;
}

.is-style-chapter + .is-style-chapter {
	margin-block-start: var(--wp--preset--spacing--60) !important;
}

.is-style-chapter .wp-block-media-text__media {
	overflow: hidden;
	aspect-ratio: 4 / 3;
	border-radius: var(--wp--preset--border-radius--large);
	background: var(--wp--preset--color--grey);
	/* Hellen Bildern (Logos) eine Kante geben, ohne Fotos zu stören. */
	box-shadow: inset 0 0 0 1px var(--wp--preset--color--line);
	isolation: isolate;
}

.is-style-chapter .wp-block-media-text__media img {
	position: relative;
	z-index: -1;
	width: 100%;
	height: 100%;
	border-radius: 0;
	object-fit: cover;
}

.is-style-chapter .wp-block-media-text__content {
	padding: 0 0 0 clamp(28px, 5vw, 72px);
}

.is-style-chapter.has-media-on-the-right .wp-block-media-text__content {
	padding: 0 clamp(28px, 5vw, 72px) 0 0;
}

.is-style-chapter .wp-block-media-text__content > * + * {
	margin-block-start: 16px;
}

.is-style-chapter .wp-block-media-text__content > .is-style-kicker + * {
	margin-block-start: 12px;
}

.is-style-chapter .wp-block-media-text__content > p:not([class*="is-style-"]) {
	max-width: 56ch;
}

@media (max-width: 900px) {
	.wp-block-media-text.is-style-chapter,
	.wp-block-media-text.is-style-chapter.has-media-on-the-right {
		grid-template-columns: 100% !important;
	}

	.is-style-chapter .wp-block-media-text__media {
		grid-row: 1 !important;
		grid-column: 1 !important;
	}

	.is-style-chapter .wp-block-media-text__content,
	.is-style-chapter.has-media-on-the-right .wp-block-media-text__content {
		grid-row: 2 !important;
		grid-column: 1 !important;
		padding: 24px 0 0;
	}
}

/* Medien und Text, Stil „Profil“: Porträt 4:5 neben Name, Rolle, Text und
 * Kontakten. Für Mitarbeitende; mehrere Profile im Raster (Gruppe, Raster). */

.wp-block-media-text.is-style-profile {
	grid-template-columns: clamp(140px, 22%, 240px) 1fr !important;
	align-items: start;
}

.is-style-profile > .wp-block-media-text__media,
.is-style-profile > .wp-block-media-text__content {
	align-self: start;
}

.is-style-profile .wp-block-media-text__media {
	overflow: hidden;
	aspect-ratio: 4 / 5;
	border-radius: var(--wp--preset--border-radius--medium);
	background: var(--wp--preset--color--grey);
}

.is-style-profile .wp-block-media-text__media img {
	width: 100%;
	height: 100%;
	border-radius: 0;
	object-fit: cover;
}

.is-style-profile .wp-block-media-text__content {
	padding: 4px 0 0 clamp(24px, 4vw, 56px);
}

.is-style-profile .wp-block-media-text__content > p:not([class]),
.is-style-profile .wp-block-media-text__content > .himml-profile__note {
	max-width: 66ch;
}

.is-style-profile .wp-block-media-text__content > * {
	margin-block: 0;
}

.is-style-profile .wp-block-media-text__content > * + * {
	margin-block-start: 14px;
}

.is-style-profile h3 {
	font-size: var(--wp--preset--font-size--x-large);
	line-height: 1.2;
}

.is-style-profile .himml-profile__role {
	margin-block-start: 6px;
	color: var(--wp--preset--color--blue);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 500;
	line-height: 1.4;
}

[class*="is-style-section-night"] .is-style-profile .himml-profile__role {
	color: var(--wp--preset--color--pale);
}

.is-style-profile .wp-block-media-text__content > p:not([class]) {
	font-size: 17px;
}

.is-style-profile .wp-block-buttons {
	margin-block-start: 20px;
}

.is-style-profile .himml-profile__note {
	margin-block-start: 10px;
	color: var(--himml-muted, var(--wp--preset--color--muted));
	font-size: 15px;
}

@media (max-width: 600px) {
	.wp-block-media-text.is-style-profile {
		grid-template-columns: 100% !important;
	}

	.is-style-profile .wp-block-media-text__media {
		grid-row: 1 !important;
		width: min(200px, 60%);
	}

	.is-style-profile .wp-block-media-text__content {
		grid-row: 2 !important;
		padding: 20px 0 0;
	}
}
