.test-hero-header {
	display: flex;
	flex-direction: column;
}
.test-hero-header .header-bar { order: 1; }
.test-hero {
	order: 2;
	width: 100%;
	min-height: 90px;
	overflow: hidden;
	background: #555;
}
.test-hero:not(.test-hero--compact) {
    aspect-ratio: 9034 / 2678;
}
.test-hero {
    position: relative;
}
.test-hero-photo {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 45%;
}
.test-hero-brand {
    position: absolute;
    inset: 0 auto 0 0;
    width: clamp(118px, 20%, 340px);
    container-type: inline-size;
}
.test-hero-brand::before {
    content: "";
    position: absolute;
    inset: 0;
    background: url("../../fmsg/img/hero-20261130/verlauf-1.png") top left / 100% 145% no-repeat;
}
.test-hero-logo {
    position: absolute;
    top: calc(clamp(2%, calc(10% - 7px), 9%) + var(--hero-logo-scroll-offset, 0px));
    left: 4%;
    width: auto;
    max-width: none;
    /* The PNG's visible artwork occupies 75% of its height. */
    height: min(126%, calc(90px + 27%), 205px);
    /* Keep the visible PNG artwork inside the gradient, including its left inset. */
    max-height: 72cqw;
    transform: translateY(-10.5%);
}
.test-hero-header .header-navigation { order: 3; }
.test-hero-header .logo { display: none; }

@media screen and (min-width: 901px) {
	.test-hero-header .main-navigation {
		float: none;
		width: max-content;
		margin-right: auto;
		margin-left: auto;
		padding-right: 2.75em;
		padding-left: 2.75em;
	}
}

/* Unterseiten: kompakter Bildkopf, Startseite behält die volle Bildhöhe. */
.test-hero--compact {
    height: clamp(64px, 12vw, 160px);
    min-height: 0;
}
.test-hero:focus-visible {
    outline: 3px solid #f79f3e;
    outline-offset: -3px;
}

/* Tao setzt den mobilen Menüknopf direkt unter .page ein. */
@media screen and (max-width: 599px) {
    .page > .main-navigation-mobile-open {
        left: auto;
        right: 6.6666666667%;
        margin-right: -11px;
        margin-left: 0;
    }
}

/* Feste Desktop-Menüleiste in Taos kompakter Scroll-Höhe. */
@media screen and (min-width: 901px) {
    .test-hero-header .header-navigation-inner {
        /* Tao setzt beim Scrollen eine Inline-Höhe; diese bleibt ebenfalls kompakt. */
        height: 3.125em !important;
    }
}

/* Allow Tao to collapse the contact bar to zero without a visible border. */
@media screen and (min-width: 901px) {
    .test-hero-header:has(.test-hero:not(.test-hero--compact)) .header-bar {
        border-bottom: 0;
    }
}

/* Match the reserved space to the actual fixed test header. */
@media screen and (min-width: 901px) {
    .page:has(> .test-hero-header.is-fixed > .test-hero:not(.test-hero--compact)) {
        padding-top: var(--test-hero-reserved-height) !important;
    }
}

/* Keep the full desktop home crop anchored to the bottom as the hero closes. */
.test-hero:not(.test-hero--compact) > .test-hero-photo {
    object-position: center 42%;
}
@media screen and (min-width: 901px) {
    .test-hero:not(.test-hero--compact) > .test-hero-photo {
        top: auto;
        height: var(--test-hero-open-height, 100%);
    }
}

/* The desktop home hero now reserves at least 184px when collapsed. */
@media screen and (min-width: 901px) {
    .test-hero .test-hero-logo {
        height: 205px;
    }
}

/* Unterseiten zeigen direkt den zusammengeschrumpften Desktop-Kopf. */
@media screen and (min-width: 901px) {
    .test-hero-header:has(> .test-hero--compact) .header-bar {
        display: none;
    }
    .page:has(> .test-hero-header > .test-hero--compact) {
        --subpage-hero-height: 184px;
        /* Tao reserves space for a fixed header; sticky stays in the flow. */
        padding-top: 0 !important;
    }
    .test-hero-header:has(> .test-hero--compact) {
        position: sticky !important;
        top: calc(-1 * var(--subpage-hero-height)) !important;
    }
    .test-hero--compact {
        height: var(--subpage-hero-height);
        container-type: inline-size;
    }
    .test-hero--compact > .test-hero-photo {
        top: auto;
        height: calc(100cqw * 2678 / 9034);
        object-position: center 42%;
    }
}

/* Center the visible artwork, accounting for the PNG's asymmetric padding. */
@media screen and (min-width: 901px) {
    .test-hero .test-hero-logo {
        left: 50%;
        /* Increase the top inset only as the desktop hero becomes compact. */
        top: calc(clamp(2%, calc(10% - 7px), 9%) + clamp(0px, 33px - 12%, 12px));
        transform: translate(-52.96%, -10.5%);
    }
}

@media screen and (min-width: 901px) {
    .test-hero-brand {
        width: clamp(260px, 20%, 340px);
    }
}

/* Center the visible PNG artwork in the gradient on phones. */
@media screen and (max-width: 599px) {
    .test-hero-brand .test-hero-logo {
        top: 50%;
        left: 50%;
        transform: translate(-52.96%, -48.04%);
    }
}

/* Match the original phone homepage hero on subpages. */
@media screen and (max-width: 599px) {
    .test-hero--compact {
        height: auto;
        min-height: 90px;
        aspect-ratio: 9034 / 2678;
    }
    .test-hero--compact > .test-hero-photo {
        object-position: center 42%;
    }
}

/* Keep the same bottom crop throughout the wide hero's scroll range. */
@media screen and (min-width: 1600px) {
    .test-hero-header {
        container-type: inline-size;
    }
    .test-hero {
        --hero-wide-bottom-crop: 60px;
    }
    .test-hero:not(.test-hero--compact) {
        height: calc(100cqw * 2678 / 9034 - var(--hero-wide-bottom-crop));
    }
    .test-hero:not(.test-hero--compact) > .test-hero-photo {
        height: calc(100cqw * 2678 / 9034);
    }
    .test-hero > .test-hero-photo {
        bottom: calc(-1 * var(--hero-wide-bottom-crop));
    }
}
