/**
 * STAR FDS — Header, Ratings & Schema Manager
 * Hero styles. Everything is scoped to .starfds-hero / .starfds-hero-inline
 * so BeTheme styles are not affected. Override any token on .starfds-hero.
 */

.starfds-hero,
.starfds-hero-inline {
	/* Brand */
	--starfds-green: #17392c;
	--starfds-olive: #78844a;
	--starfds-gold: #c5a15a;
	--starfds-ivory: #f5f1e7;
	--starfds-text: #2f3a33;
	--starfds-muted: #4d574f;

	/* Typography */
	--starfds-font-serif: "Playfair Display", "DM Serif Display", "Cormorant Garamond", Georgia, "Times New Roman", serif;
	--starfds-font-sans: inherit;
	--starfds-h1-size: clamp(2.25rem, 1.2rem + 3.4vw, 4.25rem);
	--starfds-h1-leading: 1.04;
	--starfds-desc-size: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
	--starfds-eyebrow-size: 0.8125rem;
	--starfds-crumb-size: 0.8125rem;

	/* Spacing & layout */
	--starfds-hero-min-height: clamp(360px, 30vw, 520px);
	--starfds-hero-pad-block: clamp(2rem, 1rem + 3vw, 4rem);
	--starfds-hero-pad-inline: clamp(1.25rem, 6vw, 7.5rem);
	--starfds-hero-container: 1240px; /* text aligns with the site grid on wide screens */
	--starfds-hero-content-width: 34rem;
	--starfds-gap: 1rem;

	/* Background */
	--starfds-hero-position: 75% center;
	--starfds-hero-position-mobile: 70% center;
	--starfds-hero-overlay: 0.85;
	--starfds-hero-fade-end: 62%;
	--starfds-hero-ornament: none; /* e.g. url(olive-branch.png) for the left-edge art */
}

.starfds-hero {
	position: relative;
	isolation: isolate;
	display: flex;
	align-items: center;
	width: 100%;
	min-height: var(--starfds-hero-min-height);
	margin: 0;
	overflow: hidden;
	background-color: var(--starfds-ivory);
	color: var(--starfds-text);
	font-family: var(--starfds-font-sans);
	box-sizing: border-box;
}

.starfds-hero *,
.starfds-hero *::before,
.starfds-hero *::after {
	box-sizing: border-box;
}

/* Full page width: break out of BeTheme / BeBuilder containers.
   Uses 100% of the viewport minus the scrollbar (100vw would add a horizontal scrollbar). */
.starfds-hero.starfds-hero--full {
	--starfds-viewport: 100vw;
	width: var(--starfds-viewport);
	max-width: none;
	margin-left: calc(50% - var(--starfds-viewport) / 2);
	margin-right: calc(50% - var(--starfds-viewport) / 2);
}

@supports (width: 100dvw) {
	.starfds-hero.starfds-hero--full {
		--starfds-viewport: 100dvw;
	}
}

/* Do not let BeBuilder wrappers clip the breakout. */
.mcb-section:has(> .section_wrapper .starfds-hero--full),
.section_wrapper:has(.starfds-hero--full),
.mcb-wrap:has(.starfds-hero--full),
.mcb-wrap-inner:has(.starfds-hero--full),
.mcb-column:has(.starfds-hero--full),
.mcb-column-inner:has(.starfds-hero--full),
.column_attr:has(.starfds-hero--full),
.column:has(> .starfds-hero--full),
#Content:has(.starfds-hero--full) {
	overflow: visible !important; /* BeTheme sets overflow:hidden on some wrappers */
}

/* The viewport-width trick can exceed the scroll width by the scrollbar; clip it on hero pages only. */
html:has(.starfds-hero--full),
body:has(.starfds-hero--full),
body.starfds-has-hero {
	overflow-x: clip;
}

/* Fit to image (default when the photo size is known): from tablet up the hero
   uses the photo's aspect ratio, so the photo is shown edge to edge without
   cropping its left/right. It still grows if the text needs more height. */
@media (min-width: 768px) {
	.starfds-hero.starfds-hero--fit-image {
		min-height: 0;
		aspect-ratio: var(--starfds-hero-ratio);
	}
}

/* One photograph spanning the whole hero. */
.starfds-hero__media,
.starfds-hero__media picture {
	position: absolute;
	inset: 0;
	z-index: -2;
	display: block;
	margin: 0;
}

.starfds-hero .starfds-hero__img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
	object-position: var(--starfds-hero-position);
}

/* Cream fade on the left so the text stays readable. */
.starfds-hero__overlay {
	position: absolute;
	inset: 0;
	z-index: -1;
	pointer-events: none;
	background:
		var(--starfds-hero-ornament) left center / auto 100% no-repeat,
		linear-gradient(
			90deg,
			rgba(245, 241, 231, var(--starfds-hero-overlay)) 0%,
			rgba(245, 241, 231, calc(var(--starfds-hero-overlay) * 0.94)) 32%,
			rgba(245, 241, 231, calc(var(--starfds-hero-overlay) * 0.55)) 46%,
			rgba(245, 241, 231, 0) var(--starfds-hero-fade-end)
		);
}

.starfds-hero--no-image {
	background-image: linear-gradient(110deg, var(--starfds-ivory) 0%, #ece5d3 100%);
}

.starfds-hero__inner {
	position: relative;
	width: 100%;
	padding-block: var(--starfds-hero-pad-block);
	padding-inline: max(var(--starfds-hero-pad-inline), calc((100% - var(--starfds-hero-container)) / 2));
}

.starfds-hero__content {
	max-width: var(--starfds-hero-content-width);
}

/* Breadcrumb ---------------------------------------------------------- */
.starfds-hero .starfds-breadcrumb,
.starfds-hero-inline .starfds-breadcrumb {
	margin: 0 0 calc(var(--starfds-gap) * 1.75);
	font-size: var(--starfds-crumb-size);
	line-height: 1.4;
	color: var(--starfds-muted);
}

.starfds-hero .starfds-breadcrumb p,
.starfds-hero-inline .starfds-breadcrumb p {
	margin: 0;
}

.starfds-hero .starfds-breadcrumb__list,
.starfds-hero-inline .starfds-breadcrumb__list {
	display: flex;
	flex-wrap: wrap;
	gap: 0 0.5em;
	margin: 0;
	padding: 0;
	list-style: none;
}

.starfds-hero .starfds-breadcrumb__item,
.starfds-hero-inline .starfds-breadcrumb__item {
	margin: 0;
	padding: 0;
}

.starfds-hero .starfds-breadcrumb__item + .starfds-breadcrumb__item::before,
.starfds-hero-inline .starfds-breadcrumb__item + .starfds-breadcrumb__item::before {
	content: "/";
	margin-right: 0.5em;
	opacity: 0.6;
}

.starfds-hero .starfds-breadcrumb a,
.starfds-hero-inline .starfds-breadcrumb a {
	color: inherit;
	text-decoration: none;
}

.starfds-hero .starfds-breadcrumb a:hover,
.starfds-hero .starfds-breadcrumb a:focus-visible,
.starfds-hero-inline .starfds-breadcrumb a:hover,
.starfds-hero-inline .starfds-breadcrumb a:focus-visible {
	color: var(--starfds-green);
	text-decoration: underline;
}

/* Eyebrow / title / description -------------------------------------- */
.starfds-hero .starfds-hero__eyebrow {
	margin: 0 0 calc(var(--starfds-gap) * 0.75);
	font-size: var(--starfds-eyebrow-size);
	font-weight: 700;
	letter-spacing: 0.16em;
	line-height: 1.3;
	text-transform: uppercase;
	color: var(--starfds-gold);
}

.starfds-hero .starfds-hero__title {
	margin: 0 0 var(--starfds-gap);
	padding: 0;
	font-family: var(--starfds-font-serif);
	font-size: var(--starfds-h1-size);
	font-weight: 700;
	line-height: var(--starfds-h1-leading);
	letter-spacing: -0.01em;
	color: var(--starfds-green);
	text-wrap: balance;
}

.starfds-hero .starfds-hero__description {
	max-width: 30rem;
	font-size: var(--starfds-desc-size);
	line-height: 1.55;
	color: var(--starfds-text);
}

.starfds-hero .starfds-hero__description > :first-child { margin-top: 0; }
.starfds-hero .starfds-hero__description > :last-child { margin-bottom: 0; }
.starfds-hero .starfds-hero__description p { margin: 0 0 0.75em; }
.starfds-hero .starfds-hero__description a { color: var(--starfds-green); text-decoration: underline; }

/* Rating: [ 4.7/5 + stars ] | [ count + label ] ----------------------- */
.starfds-hero .starfds-rating,
.starfds-hero-inline .starfds-rating {
	display: inline-flex;
	align-items: center;
	gap: 0 1.5rem;
	margin-top: calc(var(--starfds-gap) * 1.5);
	line-height: 1.15;
	color: var(--starfds-text);
}

.starfds-rating__score {
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
}

.starfds-rating__number {
	display: inline-flex;
	align-items: baseline;
	line-height: 1;
}

.starfds-rating__value {
	font-size: 2.25rem;
	font-weight: 700;
	letter-spacing: -0.01em;
	color: var(--starfds-green);
}

.starfds-rating__max {
	margin-left: 0.15em;
	font-size: 1.05rem;
	font-weight: 500;
	color: var(--starfds-muted);
}

.starfds-rating__stars {
	position: relative;
	display: inline-block;
	align-self: flex-start;
	font-size: 1.2rem;
	letter-spacing: 0.08em;
	line-height: 1;
	font-family: Arial, sans-serif; /* consistent star glyph */
}

.starfds-rating__stars::before {
	content: "\2605\2605\2605\2605\2605";
	color: rgba(197, 161, 90, 0.3);
}

.starfds-rating__stars::after {
	content: "\2605\2605\2605\2605\2605";
	position: absolute;
	inset: 0 auto 0 0;
	width: var(--starfds-rating-pct, 0%);
	overflow: hidden;
	white-space: nowrap;
	color: var(--starfds-gold);
}

.starfds-rating__divider {
	align-self: stretch;
	width: 1px;
	min-height: 3rem;
	background: rgba(23, 57, 44, 0.22);
}

.starfds-rating__meta {
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
}

.starfds-rating__count {
	font-size: 1.25rem;
	font-weight: 700;
	color: var(--starfds-green);
	white-space: nowrap;
}

.starfds-rating__label {
	font-size: 0.9375rem;
	color: var(--starfds-muted);
}

.starfds-rating__note {
	margin: 0.75rem 0 0;
	font-size: 0.875rem;
	font-style: italic;
	line-height: 1.4;
	color: var(--starfds-muted);
}

/* Narrow phones: stack the two halves, divider becomes a short line. */
@media (max-width: 420px) {
	.starfds-hero .starfds-rating,
	.starfds-hero-inline .starfds-rating {
		flex-direction: column;
		align-items: flex-start;
		gap: 0.75rem;
	}

	.starfds-rating__divider {
		width: 3rem;
		min-height: 0;
		height: 1px;
	}
}

.starfds-sr-only {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* Tablet ---------------------------------------------------------------- */
@media (max-width: 1024px) {
	.starfds-hero {
		--starfds-hero-content-width: 30rem;
		--starfds-hero-fade-end: 75%;
	}
}

/* Mobile: text over a stronger, top-weighted cream wash. ---------------- */
@media (max-width: 767px) {
	.starfds-hero {
		--starfds-hero-min-height: 0;
		--starfds-hero-pad-inline: 1.25rem;
		align-items: flex-start;
	}

	.starfds-hero .starfds-hero__img {
		object-position: var(--starfds-hero-position-mobile);
	}

	.starfds-hero__overlay {
		background:
			linear-gradient(
				180deg,
				rgba(245, 241, 231, var(--starfds-hero-overlay)) 0%,
				rgba(245, 241, 231, calc(var(--starfds-hero-overlay) * 0.92)) 70%,
				rgba(245, 241, 231, calc(var(--starfds-hero-overlay) * 0.75)) 100%
			);
	}
}

@media (prefers-reduced-motion: reduce) {
	.starfds-hero *,
	.starfds-hero-inline * {
		transition: none !important;
		animation: none !important;
		scroll-behavior: auto !important;
	}
}

/* Hide BeTheme's title bar only on pages that render a STAR FDS hero. */
body.starfds-hide-theme-title #Subheader {
	display: none;
}
