/**
 * Home hero – see inc/home-hero.php.
 *
 * Height: viewport minus the header (--bb-header-h, measured by the inline script),
 * never below --bb-hero-min so short/wide screens keep the layout.
 * style.css sets global h1/p sizes with !important, so text sizes here need it too.
 */

.bb-hero {
	--bb-hero-min: 560px;
	--bb-hero-h: max(var(--bb-hero-min), calc(100svh - var(--bb-header-h, 140px)));
	overflow: hidden;
	background: #f5f7f7; /* site background; the hero image is transparent */
}

.bb-hero__inner {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	align-items: center;
	gap: 40px;
	box-sizing: border-box;
	max-width: 1200px;
	min-height: var(--bb-hero-h);
	margin: 0 auto;
	padding: 32px 24px 0;
}

/* Text column (right in RTL) */
.bb-hero__content {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 18px;
	padding-bottom: 32px;
	text-align: right;
}

.bb-hero .bb-hero__title {
	margin: 0;
	color: var(--fs-color-primary, #006344);
	font-size: clamp(36px, 4.2vw, 60px) !important;
	font-weight: 800 !important;
	line-height: 1.05;
}

.bb-hero .bb-hero__subtitle {
	margin: 0;
	color: #2b2f2d;
	font-size: clamp(18px, 1.75vw, 24px) !important;
	font-weight: 500;
	line-height: 1.3;
}

/* Two-column layout: title and subtitle stay on one line (sizes scale with vw to fit the column). */
@media (min-width: 850px) {
	.bb-hero .bb-hero__title,
	.bb-hero .bb-hero__subtitle {
		white-space: nowrap;
	}
}

.bb-hero .bb-hero__text {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin: 0 !important;
	padding: 0 !important;
	list-style: none !important;
}

.bb-hero .bb-hero__text li {
	position: relative;
	margin: 0 !important;
	padding-right: 22px;
	color: #444;
	font-size: clamp(16px, 1.4vw, 19px) !important;
	line-height: 1.5;
	list-style: none !important;
}

.bb-hero .bb-hero__text li::before {
	content: "";
	position: absolute;
	top: 0.6em;
	right: 0;
	width: 9px;
	height: 9px;
	border-radius: 99px;
	background: var(--fs-color-secondary, #72bf44);
}

.bb-hero__buttons {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	margin-top: 8px;
}

/* Width follows the label (style.css gives .hero-button min-width: 200px). */
.bb-hero .bb-hero__buttons .button {
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	gap: 8px;
	width: auto !important;
	min-width: 0 !important;
	margin: 0;
	padding: 0 28px;
	border-radius: 99px;
	white-space: nowrap;
}

/* Image column (left in RTL), sits on the bottom edge. The figure is sized by the
   hero height, not the column width; extra width bleeds out on the left (white
   margin of the photo) and is clipped by .bb-hero. */
.bb-hero__media {
	display: flex;
	align-self: end;
	justify-content: flex-start; /* RTL: start = text side, overflow goes left */
	justify-content: safe center;
	min-width: 0;
	height: calc(var(--bb-hero-h) - 32px);
}

.bb-hero__img {
	display: block;
	flex: none;
	width: auto;
	max-width: none;
	height: 100%;
	max-height: 100%;
	object-fit: contain;
	object-position: bottom;
}

/* Tablet / phone: image on top, centered text, still one screen high */
@media (max-width: 849px) {
	.bb-hero {
		--bb-hero-min: 520px;
	}

	.bb-hero__inner {
		grid-template-columns: minmax(0, 1fr);
		grid-template-rows: minmax(0, 1fr) auto;
		gap: 0;
		padding: 16px 14px 14px;
	}

	/* The figure fills the free height above the text (up to 60% of the hero); on
	   narrow phones it may run wider than the screen – the photo's sides are
	   transparent and .bb-hero clips them. */
	.bb-hero__media {
		order: -1;
		align-self: stretch;
		justify-content: center;
		height: auto;
		min-height: 0;
	}

	.bb-hero__img {
		width: auto;
		max-width: 125%;
		height: 100%;
		max-height: calc(var(--bb-hero-h) * 0.6);
		margin: auto auto 0;
		object-fit: contain;
		object-position: bottom;
	}

	/* Text in a white card that overlaps the bottom of the figure and hides where the
	   photo is cut (at the hips). Not in the card layout, which has its own card. */
	.bb-hero:not(.bb-hero--card) .bb-hero__content {
		position: relative;
		z-index: 1;
		align-items: center;
		gap: 12px;
		margin-top: -64px;
		padding: 24px 18px 20px;
		border-radius: 26px;
		background: #fff;
		box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.06);
		text-align: center;
	}

	.bb-hero .bb-hero__text {
		align-items: center;
	}

	.bb-hero .bb-hero__text li {
		padding-right: 0;
	}

	.bb-hero .bb-hero__text li::before {
		display: none;
	}

	.bb-hero__buttons {
		justify-content: center;
	}
}

@media (max-width: 549px) {
	.bb-hero .bb-hero__buttons .button {
		padding: 0 18px;
		font-size: 15px;
	}
}

/* ==========================================================================
   Card layout – [bb_home_hero layout="card"]
   White card on the site background; the figure stands on the card's bottom
   edge and rises above its top edge.
   ========================================================================== */

.bb-hero--card {
	--bb-card-gap: 40px;   /* space under the card */
	--bb-card-rise: 140px; /* space above the card the figure grows into */
}

.bb-hero--card .bb-hero__inner {
	display: flex;
	align-items: flex-end;
	gap: 0;
	max-width: 1248px;
	padding: 0 24px var(--bb-card-gap);
}

.bb-hero__card {
	position: relative;
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	align-items: center;
	gap: 40px;
	width: 100%;
	min-height: calc(var(--bb-hero-h) - var(--bb-card-gap) - var(--bb-card-rise));
	padding: 48px 56px;
	border-radius: 32px;
	background: #fff;
}

.bb-hero--card .bb-hero__content {
	gap: 18px;
	padding-bottom: 0;
}

.bb-hero--card .bb-hero__title {
	font-size: clamp(36px, 4.2vw, 58px) !important;
}

.bb-hero--card .bb-hero__subtitle {
	font-size: clamp(18px, 1.75vw, 23px) !important;
}

/* Tiles */
.bb-hero .bb-hero__tiles {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 10px;
	width: 100%;
	margin: 0 !important;
	padding: 0 !important;
	list-style: none !important;
}

.bb-hero .bb-hero__tiles li {
	display: flex;
	flex-direction: column;
	gap: 2px;
	margin: 0 !important;
	padding: 14px 12px;
	border-radius: 14px;
	background: #f5f7f7;
	line-height: 1.35;
	list-style: none !important;
}

.bb-hero__tiles strong {
	color: var(--fs-color-primary, #006344);
	font-size: 16px;
}

.bb-hero__tiles span {
	color: #444;
	font-size: 14px;
}

.bb-hero--card .bb-hero__buttons {
	margin-top: 4px;
}

.bb-hero--card .bb-hero__video {
	gap: 8px;
}

/* Figure: bottom on the card's bottom edge, top close to the hero's top. */
.bb-hero--card .bb-hero__media {
	position: relative;
	align-self: stretch;
	height: auto;
	container-type: inline-size;
}

.bb-hero--card .bb-hero__img {
	position: absolute;
	bottom: -48px; /* card padding-bottom */
	left: 50%;
	width: auto;
	max-width: none;
	/* hero height minus the gap under the card and 32px air on top; never wider than
	   the column + 100px, so it doesn't run into the text */
	height: min(calc(var(--bb-hero-h) - var(--bb-card-gap) - 32px), calc((100cqi + 100px) * 0.88));
	max-height: none;
	transform: translateX(-50%);
	object-fit: contain;
	object-position: bottom;
}

.bb-hero__rating {
	position: absolute;
	bottom: -12px;
	left: 0;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 10px 16px;
	border-radius: 99px;
	background: #fff;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
	color: #2b2f2d;
	font-size: 15px;
	font-weight: 600;
	white-space: nowrap;
}

.bb-hero__stars {
	color: #e8a200;
	letter-spacing: 1px;
}

/* Tablet / phone: figure on top, rising out of the card */
@media (max-width: 849px) {
	.bb-hero--card {
		--bb-card-gap: 14px;
		--bb-img-h: min(calc(var(--bb-hero-h) * 0.46), 360px);
		--bb-card-rise: calc(var(--bb-img-h) * 0.33);
	}

	.bb-hero--card .bb-hero__inner {
		grid-template-columns: none;
		grid-template-rows: none;
		padding: 0 14px var(--bb-card-gap);
	}

	.bb-hero__card {
		grid-template-columns: minmax(0, 1fr);
		gap: 0;
		padding: calc(var(--bb-img-h) - var(--bb-card-rise) + 16px) 18px 20px;
		border-radius: 26px;
	}

	.bb-hero--card .bb-hero__media {
		position: absolute;
		top: calc(var(--bb-card-rise) * -1);
		right: 0;
		left: 0;
		order: 0;
		height: var(--bb-img-h);
	}

	.bb-hero--card .bb-hero__img {
		top: 0;
		bottom: auto;
		height: var(--bb-img-h);
		max-width: 100%;
		margin: 0;
	}

	.bb-hero__rating {
		bottom: 8px;
		left: 10px;
		padding: 6px 12px;
		font-size: 13px;
	}

	.bb-hero__stars {
		display: none;
	}

	.bb-hero__rating::before {
		content: "★";
		color: #e8a200;
	}

	.bb-hero--card .bb-hero__content {
		align-items: center;
		gap: 12px;
		text-align: center;
	}

	.bb-hero .bb-hero__tiles {
		gap: 6px;
	}

	.bb-hero .bb-hero__tiles li {
		padding: 10px 6px;
		border-radius: 12px;
	}

	.bb-hero__tiles strong {
		font-size: 13px;
	}

	.bb-hero__tiles span {
		display: none;
	}

	/* CTA stretches, video becomes a round icon button */
	.bb-hero--card .bb-hero__buttons {
		flex-wrap: nowrap;
		width: 100%;
	}

	.bb-hero--card .bb-hero__cta {
		flex: 1 1 auto !important;
		justify-content: center;
	}

	.bb-hero--card .bb-hero__video {
		width: 52px !important;
		height: 52px;
		padding: 0 !important;
		justify-content: center;
	}

	.bb-hero__video-label {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip: rect(0 0 0 0);
	}
}

/* Promo banner – image proportions, full width */
.bb-promo,
.bb-promo a,
.bb-promo picture {
	display: block;
}

.bb-promo img {
	display: block;
	width: 100%;
	height: auto;
}
