/* Screen overrides — enqueued after theme-styles-child so they win the cascade. */

/*
 * "Vertikaler Abstand unten" applies via the next-sibling rule
 * `.has-spacing-bottom-* + *`. When the next sibling is a hidden
 * print-page-break, or the block is the last child of .content, the
 * margin lands on nothing visible. Apply margin-bottom directly to
 * the block in those two specific cases.
 */
.frontend .content > .has-spacing-bottom-md:last-child,
.frontend .content .has-spacing-bottom-md:has(+ .wp-block-theme-print-page-break) {
	margin-bottom: 4rem;
	margin-bottom: var(--spacing-md);
}

.frontend .content > .has-spacing-bottom-lg:last-child,
.frontend .content .has-spacing-bottom-lg:has(+ .wp-block-theme-print-page-break) {
	margin-bottom: 8rem;
	margin-bottom: var(--spacing-lg);
}

/* Homepage hero: stack heading above image, subtitle/button below; align
 * with .content > * children. All rules chain .hero-home with two of the
 * existing layout classes to beat upstream specificity (0,3,0). */
.hero-home.header--content-is-overlay.header--media-align-full .header-mediaContainer {
	position: static;
	height: auto;
	width: auto;
	max-width: var(--theme-container-max-width);
	margin-left: auto;
	margin-right: auto;
	order: 2;
}

.hero-home.header--content-is-overlay.header--media-align-full .header-image img,
.hero-home.header--content-is-overlay.header--media-align-full img.header-image {
	height: auto;
	object-fit: contain;
	width: 100%;
}

/* Flatten the content wrappers so heading/subtitle/button become flex
 * children of .header-container and can be ordered around the image. */
.hero-home.header--content-is-overlay.header--media-align-full .header-contentContainer,
.hero-home.header--content-is-overlay.header--media-align-full .header-contentContainer .header-content {
	display: contents;
}

.hero-home.header--content-is-overlay.header--media-align-full .header-content > * {
	width: 100%;
	max-width: var(--theme-content-max-width);
	margin-left: auto;
	margin-right: auto;
	padding-left: var(--container-padding-left);
	padding-right: var(--container-padding-right);
}

.hero-home.header--content-is-overlay.header--media-align-full .header-content > .heading-1 {
	order: 1;
	padding-top: var(--spacing-md);
	margin-bottom: var(--spacing-md);
}

.hero-home.header--content-is-overlay.header--media-align-full .header-content > :not(.heading-1) {
	order: 3;
}

.hero-home.header--content-is-overlay.header--media-align-full .header-content > .is-style-lead {
	font-size: var(--font-size-base);
}

/* Reset flex-column push-to-bottom from the original overlay layout. */
.hero-home.header--content-is-overlay.header--media-align-full .header-content > .heading-1 + p {
	margin-top: 0;
}

/* Match the nav-side grid offset .main-content > * uses above 1320px. */
@media screen and (min-width: 1320px) {
	body:not(.is-child) .hero-home.header--content-is-overlay.header--media-align-full .header-content > * {
		margin-left: calc(var(--nav-side-width) + (100% - var(--nav-side-width))/12 - var(--container-padding-left));
	}
}

.hero-home.has-hintergrundbild-background-color {
	background-color: transparent;
}
