/*
 * Header photo cover
 * ------------------
 * Home already lets its hero photograph run behind the navigation. Every other
 * menu page (Shop, Collections, Ingredients, Journal, About, Contact) keeps a
 * solid black bar instead, so the navigation jumps between pages.
 *
 * This layer puts the header back on top of each page's own first photograph:
 *  - the header leaves the flow and becomes transparent,
 *  - a soft scrim keeps the gold menu legible on light photographs,
 *  - each page's hero copy is pushed below the header so nothing collides.
 *
 * Scoped to body.ae-cover-header (added in functions.php) so pages without a
 * hero photograph are untouched.
 */

body.ae-cover-header {
	--ae-hdr-h: 166px;
}

@media (max-width: 1200px) {
	body.ae-cover-header { --ae-hdr-h: 150px; }
}

@media (max-width: 1024px) {
	body.ae-cover-header { --ae-hdr-h: 128px; }
}

@media (max-width: 781px) {
	body.ae-cover-header { --ae-hdr-h: 96px; }
}

/* 1. the header floats over the first photograph */
body.ae-theme.ae-v3.ae-cover-header .ae-site-header {
	position: absolute;
	inset: 0 0 auto;
	background: transparent;
	border: 0;
	box-shadow: none;
	z-index: 120;
}

body.ae-theme.ae-v3.ae-cover-header .ae-site-header.is-scrolled {
	background: #070707;
}

/* 2. scrim: keeps the menu readable over bright photographs */
body.ae-theme.ae-v3.ae-cover-header .ae-site-header::before {
	content: "";
	position: absolute;
	inset: 0;
	pointer-events: none;
	z-index: -1;
	background: linear-gradient(
		180deg,
		rgba(7, 7, 7, 0.80) 0%,
		rgba(7, 7, 7, 0.55) 58%,
		rgba(7, 7, 7, 0.22) 100%
	);
}

body.ae-theme.ae-v3.ae-cover-header .ae-utility-bar {
	background: transparent;
	border-bottom-color: rgba(224, 195, 147, 0.12);
}

/* 3. the page background must not paint over the photograph */
body.ae-theme.ae-v3.ae-cover-header main#main {
	background: transparent !important;
}

/* 4. keep every hero copy clear of the navigation */
body.ae-theme.ae-v3.ae-cover-header .ae3-collections .aec-scene--hero .aec-copy {
	padding-top: calc(var(--ae-hdr-h) + 44px);
}

body.ae-theme.ae-v3.ae-cover-header .ae3-about .ae-primary-block--the-origin .ae3-visual-block__inner {
	padding-top: calc(var(--ae-hdr-h) + 26px);
}

body.ae-theme.ae-v3.ae-cover-header .ae3-ingredients .ia-the-science-within .ia-copy {
	top: calc(var(--ae-hdr-h) + 30px);
}

body.ae-theme.ae-v3.ae-cover-header .ae3-journal-edit .ae-journal-scene--journal-hero .ae-journal-copy {
	top: clamp(104px, 10.8vw, 205px);
}

/* Keep the text proportional once the banner stops growing on wide screens. */
@media (min-width: 1921px) {
	body.ae-theme.ae-v3 .ae-journal-scene--journal-hero .ae-journal-line {
		zoom: calc(1920px / 100vw);
	}
}

body.ae-theme.ae-v3.ae-cover-header .ae-shop-page .sa-scene:first-of-type .sa-copy {
	top: calc(var(--ae-hdr-h) + 30px);
}

body.ae-theme.ae-v3.ae-cover-header .ae3-contact .ac-hero-copy {
	padding-top: calc(var(--ae-hdr-h) + 44px);
}

/* 5. mobile: the menu is a drawer, keep the header on one row over the photo */
@media (max-width: 781px) {
	body.ae-theme.ae-v3.ae-cover-header .ae-site-header::before {
		background: linear-gradient(
			180deg,
			rgba(7, 7, 7, 0.88) 0%,
			rgba(7, 7, 7, 0.62) 70%,
			rgba(7, 7, 7, 0.30) 100%
		);
	}
}
