/* Home banner, version 2 (includes/hero-v2.php): only on <body class="bi-hero-v2">.
   The photo section is the one holding .bi-hero-fader; the text section is the one right after it. No layout change:
   from 981 px the two share one grid cell, so the text sits on the photo's lower left; below 981 px the text follows
   the photo on Linen. The caption (.bi-hero-caption) is added by hero-v2.js. */

/* Photo height: the first screen less the header and promotion strip (--bi-hero-top, measured by hero-v2.js). */
body.bi-hero-v2 #page-container .bi-hero-fader img {
	height: clamp(560px, calc(100svh - var(--bi-hero-top, 132px)), 1000px) !important;
}
body.bi-hero-v2 #page-container .et_pb_section:has(> .et_pb_row > .bi-hero-fader) {
	position: relative;
}

/* Shade so the white text reads on any photo: dark at the lower left, clear at the top right. */
body.bi-hero-v2 #page-container .et_pb_section:has(> .et_pb_row > .bi-hero-fader)::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 3;
	pointer-events: none;
	background:
		linear-gradient(90deg, color-mix(in srgb, var(--gcid-bi-ink, #231F20) 72%, transparent) 0, color-mix(in srgb, var(--gcid-bi-ink, #231F20) 30%, transparent) 45%, transparent 72%),
		linear-gradient(0deg, color-mix(in srgb, var(--gcid-bi-ink, #231F20) 45%, transparent) 0, transparent 45%);
}

/* Caption: what the current photo shows. */
.bi-hero-caption {
	position: absolute;
	z-index: 5;
	display: flex;
	align-items: center;
	gap: 14px;
	max-width: 420px;
	padding: 12px 18px;
	background: var(--gcid-bi-linen, #F5F1EA);
	color: var(--gcid-bi-ink, #231F20) !important;
	font-size: 15px;
	line-height: 1.35;
	text-decoration: none !important;
	transition: opacity .4s ease;
}
.bi-hero-caption.is-changing {
	opacity: 0;
}
.bi-hero-caption[hidden] {
	display: none;
}
.bi-hero-caption small {
	flex: none;
	color: var(--gcid-bi-copper, #96694C);
	font-size: 11px;
	font-weight: 500;
	letter-spacing: .14em;
	text-transform: uppercase;
}
.bi-hero-caption b {
	flex: none;
	margin-left: auto;
	font-weight: 400;
	transition: transform .2s ease;
}
a.bi-hero-caption:hover b,
a.bi-hero-caption:focus-visible b {
	transform: translateX(4px);
}
a.bi-hero-caption:focus-visible {
	outline: 2px solid var(--gcid-bi-copper-light, #E2C7AE);
	outline-offset: 3px;
}

@media (min-width: 981px) {
	body.bi-hero-v2 #page-container .et_builder_inner_content:has(> .et_pb_section > .et_pb_row > .bi-hero-fader) {
		display: grid;
		grid-template-columns: minmax(0, 1fr);
	}
	body.bi-hero-v2 #page-container .et_pb_section:has(> .et_pb_row > .bi-hero-fader) {
		grid-area: 1 / 1;
	}
	body.bi-hero-v2 #page-container .et_pb_section:has(> .et_pb_row > .bi-hero-fader) + .et_pb_section {
		grid-area: 1 / 1;
		align-self: end;
		z-index: 4;
		pointer-events: none;
		background: none !important;
		padding: 0 0 clamp(40px, 7vh, 80px) !important;
	}
	body.bi-hero-v2 #page-container .et_pb_section:has(> .et_pb_row > .bi-hero-fader) + .et_pb_section .et_pb_row {
		margin-top: 0 !important;
		pointer-events: auto;
	}
	body.bi-hero-v2 #page-container .et_pb_section:has(> .et_pb_row > .bi-hero-fader) + .et_pb_section .et_pb_column {
		background: none !important;
		max-width: 620px;
		padding: 0 !important;
		text-shadow: 0 1px 14px color-mix(in srgb, var(--gcid-bi-ink, #231F20) 45%, transparent);
	}
	body.bi-hero-v2 #page-container .et_pb_section:has(> .et_pb_row > .bi-hero-fader) + .et_pb_section .et_pb_button {
		text-shadow: none;
	}
	/* The text section's bottom padding used to make the gap above "Explore by space"; now that it lies over the
	   photo, the next section takes that space as top padding (the same section-spacing variable). */
	body.bi-hero-v2 #page-container .et_pb_section:has(> .et_pb_row > .bi-hero-fader) + .et_pb_section + .et_pb_section {
		padding-top: var(--gvid-bi-section-sm, 64px) !important;
	}
	/* Lined up with the text row's right edge (rows are 80 % wide, at most 1280 px). */
	.bi-hero-caption {
		right: max(10%, calc((100% - 1280px) / 2));
		bottom: clamp(40px, 7vh, 80px);
	}
}

/* Narrow PCs and tablets in landscape: the caption moves to the top right, clear of the text. */
@media (min-width: 981px) and (max-width: 1239px) {
	.bi-hero-caption {
		top: 28px;
		bottom: auto;
	}
}

@media (max-width: 980px) {
	body.bi-hero-v2 #page-container .bi-hero-fader img {
		height: clamp(260px, 42svh, 520px) !important;
	}
	body.bi-hero-v2 #page-container .et_pb_section:has(> .et_pb_row > .bi-hero-fader)::after {
		background: linear-gradient(0deg, color-mix(in srgb, var(--gcid-bi-ink, #231F20) 40%, transparent) 0, transparent 40%);
	}
	body.bi-hero-v2 #page-container .et_pb_section:has(> .et_pb_row > .bi-hero-fader) + .et_pb_section {
		background: var(--gcid-bi-linen, #F5F1EA) !important;
		padding: 24px 0 max(56px, var(--gvid-bi-section-sm, 56px)) !important;
	}
	body.bi-hero-v2 #page-container .et_pb_section:has(> .et_pb_row > .bi-hero-fader) + .et_pb_section .et_pb_row {
		margin-top: 0 !important;
	}
	body.bi-hero-v2 #page-container .et_pb_section:has(> .et_pb_row > .bi-hero-fader) + .et_pb_section .et_pb_column {
		background: none !important;
		padding: 0 !important;
	}
	body.bi-hero-v2 #page-container .et_pb_section:has(> .et_pb_row > .bi-hero-fader) + .et_pb_section .et_pb_text:first-child p {
		color: var(--gcid-bi-copper, #96694C) !important;
	}
	body.bi-hero-v2 #page-container .et_pb_section:has(> .et_pb_row > .bi-hero-fader) + .et_pb_section :is(h1, h1 *) {
		color: var(--gcid-bi-ink, #231F20) !important;
	}
	body.bi-hero-v2 #page-container .et_pb_section:has(> .et_pb_row > .bi-hero-fader) + .et_pb_section .et_pb_text:not(:first-child) p {
		color: var(--gcid-bi-ink, #231F20) !important;
	}
	body.bi-hero-v2 #page-container .et_pb_section:has(> .et_pb_row > .bi-hero-fader) + .et_pb_section .preset--module--divi-button--bi-button-light {
		color: var(--gcid-bi-ink, #231F20) !important;
		border-color: var(--gcid-bi-ink, #231F20) !important;
	}
	.bi-hero-caption {
		left: 16px;
		right: 16px;
		bottom: 16px;
		max-width: none;
		font-size: 14px;
		padding: 10px 14px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.bi-hero-caption,
	.bi-hero-caption b {
		transition: none;
	}
}
