/* Kluane Hero — replaces the Slider Revolution hero module
 *
 * Layout matches the SR7 module at desktop:
 *   - 50% black band behind the title
 *   - subtitle with hard shadow in the open space
 *   - 64% white band at the bottom holding the laurels
 *
 * Laurels are a wrapping flex row: 11 per row on desktop, 8 / 6 / 4 / 3 on
 * narrower screens, always at a legible size (never the old 55px).
 *
 * Text aligns to the theme's 1200px content column (1248 incl. gutters);
 * the laurel band is allowed a wider 1400px like the original module.
 */

.kluane-hero {
	--kh-inner: 1248px;
	--kh-laurels: 1400px;
	--kh-gutter: 24px;
	--kh-laurel-gap: 10px;
	--kh-per-row: 11;

	position: relative;
	display: flex;
	flex-direction: column;
	width: 100%;
	min-height: clamp(560px, 54vw, 800px);
	margin: 0;
	background-color: #2f3538;
	background-position: center center;
	background-size: cover;
	background-repeat: no-repeat;
	color: #fff;
	font-family: Roboto, "Helvetica Neue", Helvetica, Arial, sans-serif;
	overflow: hidden;
}

/* Full-bleed: break out of the Cornerstone row (max-width 1200px) to the
   viewport edges, like SR's "fullwidth" layout did. --kh-sb is the
   scrollbar width, set by the plugin's inline script, so the hero is
   centred exactly rather than 100vw/2 off. Falls back to 0 without JS. */
.kluane-hero--bleed {
	width: calc(100vw - var(--kh-sb, 0px));
	max-width: none;
	margin-left: calc(50% - 50vw + var(--kh-sb, 0px) / 2);
	margin-right: 0;
}

.kluane-hero__inner {
	width: 100%;
	max-width: var(--kh-inner);
	margin: 0 auto;
	padding: 0 var(--kh-gutter);
	box-sizing: border-box;
}

/* ---- Title band ------------------------------------------------------ */

.kluane-hero__title-band {
	width: 100%;
	margin-top: clamp(40px, 7vw, 86px);
	padding: clamp(16px, 3vw, 40px) 0;
	background: rgba(0, 0, 0, 0.5);
}

.kluane-hero__title {
	margin: 0;
	padding: 0;
	font-family: inherit;
	font-weight: 400;
	font-size: clamp(2rem, 5.6vw, 90px);
	line-height: 1.1;
	letter-spacing: 0;
	text-transform: uppercase;
	color: #fff;
	text-align: left;
}

/* ---- Subtitle -------------------------------------------------------- */

.kluane-hero__body {
	flex: 1 1 auto;
	display: flex;
	align-items: center;
	padding-top: clamp(24px, 4vw, 48px);
	padding-bottom: clamp(24px, 4vw, 48px);
}

.kluane-hero__subtitle {
	margin: 0;
	padding: 0;
	font-family: inherit;
	font-weight: 400;
	font-size: clamp(1.5rem, 3.75vw, 60px);
	line-height: 1.1;
	color: #fff;
	text-shadow: 4px 3px 3px #000;
	text-align: left;
}

/* ---- Laurel band ----------------------------------------------------- */

.kluane-hero__laurel-band {
	width: 100%;
	padding: clamp(14px, 2vw, 24px) var(--kh-gutter);
	box-sizing: border-box;
	background: rgba(255, 255, 255, 0.64);
}

.kluane-hero__laurels {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	align-items: center;
	gap: var(--kh-laurel-gap);
	max-width: var(--kh-laurels);
	margin: 0 auto;
	padding: 0;
	list-style: none;
}

.kluane-hero__laurel {
	/* Fixed share of the row so the wrap point is predictable */
	flex: 0 0 calc((100% - (var(--kh-per-row) - 1) * var(--kh-laurel-gap)) / var(--kh-per-row));
	max-width: 130px;
	margin: 0;
	padding: 0;
	display: flex;
	align-items: center;
	justify-content: center;
}

.kluane-hero__laurel img {
	display: block;
	width: 100%;
	height: auto;      /* laurels have mixed aspect ratios — never force a box */
	max-width: 100%;
	margin: 0;
	border: 0;
	box-shadow: none;
}

/* ---- Breakpoints ----------------------------------------------------- */

@media (max-width: 1100px) {
	.kluane-hero { --kh-per-row: 8; }
}

@media (max-width: 820px) {
	.kluane-hero { --kh-per-row: 6; }
	.kluane-hero__subtitle { text-shadow: 3px 2px 3px #000; }
}

@media (max-width: 560px) {
	.kluane-hero {
		--kh-per-row: 4;
		--kh-gutter: 16px;
		--kh-laurel-gap: 8px;
		min-height: 0;
	}
	.kluane-hero__subtitle { text-shadow: 2px 2px 2px #000; }
}

@media (max-width: 380px) {
	.kluane-hero { --kh-per-row: 3; }
}

/* ---- Entrance animation (CSS only) ----------------------------------- */
/* Sequence:  0.0s title band drops in
 *            0.5s subtitle slides in from the left
 *            0.9s white laurel band fades in
 *            1.1s laurels ripple in left→right (row 1, then row 2),
 *                 55ms apart via the --kh-i index set on each <li>
 * animation-fill-mode: both keeps elements hidden during their delay.
 * Only transform/opacity are animated, so it stays on the compositor. */

@keyframes kh-drop-in {
	from { opacity: 0; transform: translate3d(0, -24px, 0); }
	to   { opacity: 1; transform: translate3d(0, 0, 0); }
}
@keyframes kh-slide-in {
	from { opacity: 0; transform: translate3d(-40px, 0, 0); }
	to   { opacity: 1; transform: translate3d(0, 0, 0); }
}
@keyframes kh-fade-in {
	from { opacity: 0; }
	to   { opacity: 1; }
}
@keyframes kh-rise-in {
	from { opacity: 0; transform: translate3d(0, 28px, 0); }
	to   { opacity: 1; transform: translate3d(0, 0, 0); }
}

.kluane-hero--animate .kluane-hero__title-band {
	animation: kh-drop-in 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0s both;
}
.kluane-hero--animate .kluane-hero__subtitle {
	animation: kh-slide-in 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.5s both;
}
.kluane-hero--animate .kluane-hero__laurel-band {
	animation: kh-fade-in 0.6s ease-out 0.9s both;
}
.kluane-hero--animate .kluane-hero__laurel {
	animation: kh-rise-in 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
	animation-delay: calc(1.1s + var(--kh-i, 0) * 55ms);
}

@media (prefers-reduced-motion: reduce) {
	.kluane-hero--animate .kluane-hero__title-band,
	.kluane-hero--animate .kluane-hero__subtitle,
	.kluane-hero--animate .kluane-hero__laurel-band,
	.kluane-hero--animate .kluane-hero__laurel {
		animation: none;
	}
}

/* Cornerstone / Pro theme adds its own margins to h1/p inside content
   areas; keep the hero self-contained. */
.kluane-hero h1.kluane-hero__title,
.kluane-hero p.kluane-hero__subtitle {
	margin-bottom: 0;
}
