/**
 * Canopy Hero (inc/elementor/widgets/hero.php), the page hero shared with the stay request
 * (inc/elementor/page-hero.php, .cn-phero) and the booking fields shared with the Stay Search
 * (inc/elementor/booking-form.php, .cn-book-field).
 *
 * Figma: Home "V1 Hero · Find your forest level" (home layout), Lodges / lodge pages /
 * Photographs / The place / Plan your stay "V1 Hero" and "V6 Feature · Leave the road
 * behind" (card layout), "Fixed booking bar" and "Fixed request bar" (phones).
 */

/* ------------------------------------------------------------------ */
/* Booking fields (hero bar and stay search)                          */
/* ------------------------------------------------------------------ */

.cn-book-field {
	position: relative;
	display: flex;
	align-items: center;
	gap: 16px;
	min-width: 0;
	color: var(--cn-c-forest);
}

.cn-book-field__icon,
.cn-book-field__chevron {
	flex: none;
	width: 24px;
	height: 24px;
}

.cn-book-field__chevron {
	pointer-events: none;
}

.cn-book-field__body {
	display: flex;
	flex: 1;
	flex-direction: column;
	min-width: 0;
}

.cn-book-field__label {
	color: inherit;
	cursor: pointer;
}

.cn-book-field__value {
	display: none;
	margin-top: 4px;
	overflow: hidden;
	font-size: 16px;
	line-height: 24px;
	font-weight: 600;
	white-space: nowrap;
	text-overflow: ellipsis;
}

.cn-book-field__note {
	position: relative;
	font-size: var(--cn-fs-small);
	line-height: var(--cn-lh-small);
}

/* Without JavaScript the native controls show as they are. */
.cn-book-field__control {
	max-width: 100%;
	min-height: 32px;
	margin-top: 4px;
	color: inherit;
	font-family: var(--cn-sans);
	font-size: 16px;
	line-height: 24px;
}

/* With JavaScript: the chosen value is shown as text and the native control lies over the box. */
.cn-js .cn-book-field__value {
	display: block;
}

.cn-js .cn-book-field__control {
	position: absolute;
	inset: 0;
	z-index: 1;
	width: 100%;
	height: 100%;
	margin: 0;
	padding: 0;
	border: 0;
	opacity: 0;
	cursor: pointer;
	appearance: none;
	-webkit-appearance: none;
}

.cn-js .cn-book-field__date::-webkit-calendar-picker-indicator {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	opacity: 0;
	cursor: pointer;
}

.cn-book-field:focus-within {
	outline: 2px solid var(--cn-c-forest);
	outline-offset: 2px;
}

/* Small select inside the dates box ("3 nights"); it sits above the date input. */
.cn-book-field__nights {
	z-index: 2;
	align-self: flex-start;
}

.cn-book-field__nights select {
	margin: 0;
	padding: 0 18px 0 0;
	border: 0;
	border-radius: 0;
	background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23173b2a' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9.5 6 5 6-5'/%3E%3C/svg%3E") no-repeat right center;
	color: inherit;
	font-family: var(--cn-sans);
	font-size: inherit;
	line-height: inherit;
	cursor: pointer;
	appearance: none;
	-webkit-appearance: none;
}

.cn-book-field__nights select:hover {
	text-decoration: underline;
}

.cn-book-field__nights select:focus-visible {
	outline: 2px solid var(--cn-c-forest);
	outline-offset: 2px;
}

/* ------------------------------------------------------------------ */
/* Home layout                                                        */
/* ------------------------------------------------------------------ */

.cn-hero--home {
	display: flex;
	flex-direction: column;
	min-height: var(--cn-hero-h, 900px);
	padding-bottom: var(--cn-pad-b, 48px);
	background: var(--cn-c-forest);
	overflow: hidden;
}

.cn-hero__media {
	position: absolute;
	inset: 0;
	overflow: hidden;
	background: var(--cn-c-forest);
}

.cn-hero__media::after,
.cn-hero .cn-phero__media::after {
	content: "";
	position: absolute;
	inset: 0;
	background: var(--cn-hero-overlay, transparent);
	opacity: var(--cn-hero-overlay-o, 0);
	pointer-events: none;
}

.cn-hero .cn-hero__img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
}

.cn-hero__stage {
	position: relative;
	display: flex;
	flex: 1;
	flex-direction: column;
	padding-top: var(--cn-pad-t, 231px);
}

.cn-hero__copy {
	width: 560px;
	max-width: 100%;
	margin-left: auto;
	color: var(--cn-c-white);
}

.cn-hero .cn-hero__title {
	color: var(--cn-hero-text, var(--cn-c-white));
}

.cn-hero__text {
	max-width: 520px;
	margin-top: 20px;
	color: var(--cn-hero-text, var(--cn-c-white));
}

.cn-hero__more {
	margin-top: 20px;
}

.cn-hero .cn-hero__link {
	color: var(--cn-c-paper);
}

.cn-hero .cn-hero__credit {
	margin-top: auto;
	padding-top: 64px;
	color: var(--cn-c-white);
}

.cn-hero__booking {
	position: relative;
	margin-top: 16px;
}

/* Quick booking bar (Figma "M16 Quick booking"). */
.cn-hero__bar {
	display: flex;
	align-items: center;
	padding: 23px 23px 23px 7px;
	border: 1px solid var(--cn-c-line);
	border-radius: var(--cn-radius-panel);
	background: var(--cn-c-white);
	color: var(--cn-c-forest);
}

.cn-hero__fields {
	display: flex;
	flex: 1;
	min-width: 0;
}

.cn-hero__field {
	flex: 1 1 0;
	min-height: 80px;
	padding: 8px 16px;
}

.cn-hero__field + .cn-hero__field::before {
	content: "";
	position: absolute;
	top: 12px;
	bottom: 12px;
	left: 0;
	width: 1px;
	background: var(--cn-c-line);
}

.cn-hero .cn-hero__submit {
	flex: none;
	width: 220px;
}

.cn-hero__note {
	flex-basis: 100%;
}

/* ------------------------------------------------------------------ */
/* Card layout (.cn-phero, also used by the stay request)             */
/* ------------------------------------------------------------------ */

.cn-phero {
	--cn-phero-h: 960px;
	--cn-phero-h-t: 640px;
	--cn-phero-h-m: 520px;
	position: relative;
	display: flex;
	min-height: var(--cn-hero-h, var(--cn-phero-h));
	background: var(--cn-c-forest);
}

.cn-phero--h-medium {
	--cn-phero-h: 800px;
	--cn-phero-h-t: 600px;
	--cn-phero-h-m: 480px;
}

.cn-phero--h-band {
	--cn-phero-h: 800px;
	--cn-phero-h-t: 520px;
	--cn-phero-h-m: 360px;
}

.cn-phero--h-short {
	--cn-phero-h: 760px;
	--cn-phero-h-t: 480px;
	--cn-phero-h-m: 320px;
}

.cn-phero--h-compact {
	--cn-phero-h: 640px;
	--cn-phero-h-t: 520px;
	--cn-phero-h-m: 420px;
}

.cn-phero__media {
	position: absolute;
	inset: 0;
	overflow: hidden;
	background: var(--cn-c-forest);
}

.cn-phero .cn-phero__img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
}

.cn-phero__inner {
	position: relative;
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 40px;
	padding: 80px 0;
}

.cn-phero__card {
	display: flex;
	flex-direction: column;
	gap: 20px;
	min-width: 0;
}

.cn-phero__back {
	display: flex;
}

.cn-phero__back-link--small {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	color: var(--cn-text);
	font-size: var(--cn-fs-small);
	line-height: var(--cn-lh-small);
	text-decoration: none;
}

.cn-phero__back-link--small:hover {
	text-decoration: underline;
	text-underline-offset: 3px;
}

.cn-phero .cn-phero__title {
	color: var(--cn-heading);
}

.cn-phero__text {
	color: var(--cn-text);
}

.cn-phero__stats {
	display: flex;
	flex-wrap: wrap;
	gap: 16px 40px;
	margin: 0;
}

.cn-phero__stat {
	display: flex;
	flex-direction: column-reverse;
	justify-content: flex-end;
	min-width: 0;
}

.cn-phero__stat-label {
	margin: 4px 0 0;
	color: var(--cn-text);
}

.cn-phero__stat-value {
	margin: 0;
	color: var(--cn-heading);
}

.cn-phero__caption {
	color: var(--cn-muted);
}

.cn-phero__aside {
	flex: none;
	width: 416px;
	max-width: 100%;
}

/* Desktop: the card sits on the photo. */
@media (min-width: 1025px) {
	.cn-phero__card {
		width: var(--cn-phero-card-w, 680px);
		max-width: 100%;
		padding: 40px;
		border-radius: var(--cn-radius-panel);
		background: var(--cn-phero-card, var(--cn-c-forest));
		--cn-heading: var(--cn-c-white);
		--cn-text: var(--cn-c-white);
		--cn-muted: var(--cn-c-white);
		color: var(--cn-c-white);
	}

	.cn-phero__card .cn-link {
		color: var(--cn-c-paper);
	}

	/* A right column (booking card) takes the space the card leaves. */
	.cn-phero--aside .cn-phero__card {
		flex: 0 1 var(--cn-phero-card-w, 680px);
	}
}

/* ------------------------------------------------------------------ */
/* Booking card (lodge pages)                                         */
/* ------------------------------------------------------------------ */

.cn-hero__stay {
	--cn-heading: var(--cn-c-forest);
	--cn-text: var(--cn-c-forest);
	--cn-muted: var(--cn-c-muted);
	--cn-accent: var(--cn-c-forest);
	--cn-on-accent: var(--cn-c-white);
	display: flex;
	flex-direction: column;
	padding: 28px;
	border: 1px solid var(--cn-c-line);
	border-radius: var(--cn-radius-panel);
	background: var(--cn-c-paper);
	color: var(--cn-c-forest);
}

.cn-hero__rows {
	display: flex;
	flex-direction: column;
	gap: 16px;
	margin: 16px 0 0;
}

.cn-hero__row {
	display: grid;
	grid-template-columns: 72px minmax(0, 1fr);
	gap: 12px;
	align-items: baseline;
}

.cn-hero__row-label {
	color: var(--cn-c-muted);
}

.cn-hero__row-value {
	margin: 0;
}

.cn-hero__total {
	display: flex;
	justify-content: space-between;
	gap: 16px;
	margin-top: 16px;
	padding-top: 16px;
	border-top: 1px solid var(--cn-c-line);
	font-weight: 600;
}

.cn-hero__total-value {
	white-space: nowrap;
}

.cn-hero .cn-hero__stay-button {
	margin-top: 16px;
}

.cn-hero .cn-hero__stay-link {
	align-self: flex-start;
	margin-top: 16px;
	color: var(--cn-c-forest);
}

/* Fixed phone bar: shown by assets/js/parts/hero.js on phones only. */
.cn-hero__phonebar {
	display: none;
}

/* ------------------------------------------------------------------ */
/* Tablet                                                             */
/* ------------------------------------------------------------------ */

@media (max-width: 1024px) {
	/* Home */
	.cn-hero--home {
		min-height: var(--cn-hero-h, 980px);
		padding-bottom: var(--cn-pad-b, 32px);
	}

	.cn-hero__stage {
		justify-content: flex-end;
		padding-top: var(--cn-pad-t, 96px);
	}

	.cn-hero__copy {
		width: auto;
		margin-left: 0;
	}

	.cn-hero__text {
		max-width: none;
	}

	.cn-hero .cn-hero__credit {
		margin-top: 32px;
		padding-top: 0;
	}

	.cn-hero__bar {
		flex-direction: column;
		align-items: stretch;
		gap: 8px;
		padding: 15px;
	}

	.cn-hero__fields {
		display: grid;
		grid-template-columns: repeat(3, minmax(0, 240px));
		gap: 8px;
	}

	.cn-hero__field {
		gap: 12px;
		min-height: 58px;
		padding: 8px 12px;
	}

	.cn-hero__field + .cn-hero__field::before,
	.cn-hero__field .cn-book-field__chevron {
		display: none;
	}

	.cn-hero__field .cn-book-field__label {
		color: var(--cn-c-muted);
	}

	.cn-hero__field .cn-book-field__value {
		margin-top: 2px;
		font-weight: 400;
	}

	.cn-hero .cn-hero__submit {
		width: 100%;
	}

	/* Card layout: the photo, then the card's content on the section background. */
	.cn-phero {
		display: block;
		min-height: 0;
		background: var(--cn-bg, var(--cn-c-paper));
	}

	.cn-phero__media {
		position: relative;
		height: var(--cn-hero-h, var(--cn-phero-h-t));
	}

	.cn-phero__inner {
		display: block;
		padding: var(--cn-pad-t, 16px) 0 var(--cn-pad-b, 64px);
	}

	.cn-phero__card {
		gap: var(--cn-phero-gap, 20px);
	}

	.cn-phero--back {
		--cn-phero-gap: 24px;
	}

	.cn-phero--h1-back {
		--cn-phero-gap: 32px;
		/* The stay request keeps its 56px title on tablets (36px on phones). */
		--cn-fs-h1: 56px;
		--cn-lh-h1: 64px;
	}

	.cn-phero--caption-top .cn-phero__caption {
		order: -1;
	}

	.cn-phero__text {
		color: var(--cn-muted);
	}

	/* On a dark band (forest palette) the text and caption stay white. */
	.cn--forest .cn-phero__text,
	.cn--forest .cn-phero__caption {
		color: var(--cn-text);
	}

	.cn-phero__stats {
		display: grid;
		grid-template-columns: repeat(4, minmax(0, 1fr));
		gap: 24px;
		text-align: center;
	}

	.cn-phero__stat {
		align-items: center;
	}

	.cn-phero__aside {
		width: auto;
		margin-top: var(--cn-phero-gap, 24px);
	}
}

/* ------------------------------------------------------------------ */
/* Phone                                                              */
/* ------------------------------------------------------------------ */

@media (max-width: 767px) {
	/* Home: the photo ends under the booking card. */
	.cn-hero--home {
		min-height: 0;
		padding-bottom: var(--cn-pad-b, 16px);
		background: var(--cn-bg, var(--cn-c-paper));
	}

	.cn-hero--home > .cn-hero__media {
		bottom: auto;
		height: var(--cn-hero-h, 688px);
	}

	.cn-hero__stage {
		flex: none;
		min-height: var(--cn-hero-h, 688px);
		padding-top: var(--cn-pad-t, 56px);
		padding-bottom: 40px;
	}

	.cn-hero .cn-hero__credit {
		position: absolute;
		top: 16px;
		left: 0;
		right: 0;
		margin: 0;
	}

	.cn-hero--home .cn-hero__booking {
		margin-top: -15px;
	}

	.cn-hero__fields {
		grid-template-columns: minmax(0, 1fr);
	}

	.cn-hero__field {
		min-height: 56px;
	}

	.cn-phero__media {
		height: var(--cn-hero-h, var(--cn-phero-h-m));
	}

	.cn-phero--h1-back {
		--cn-fs-h1: 36px;
		--cn-lh-h1: 44px;
	}

	.cn-phero__stats {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 24px 20px;
	}

	.cn-phero__stat-value {
		font-size: var(--cn-fs-h3);
		line-height: var(--cn-lh-h3);
	}

	.cn-hero__stay {
		padding: 20px;
	}

	/* Fixed booking bar (Figma "Fixed booking bar" / "Fixed request bar"). */
	.cn-js .cn-hero__phonebar {
		display: flex;
		align-items: center;
		gap: 12px;
		position: fixed;
		left: 0;
		right: 0;
		bottom: 0;
		z-index: 40;
		min-height: 72px;
		padding: 12px 20px calc(12px + env(safe-area-inset-bottom, 0px));
		border-top: 1px solid var(--cn-c-line);
		background: var(--cn-c-paper);
		color: var(--cn-c-forest);
		transition: transform 0.25s ease, visibility 0.25s;
	}

	.cn-js .cn-hero__phonebar.is-hidden {
		visibility: hidden;
		transform: translateY(100%);
	}

	.cn-hero__phonebar-price {
		display: flex;
		flex: none;
		flex-direction: column;
		margin: 0;
	}

	.cn-hero__phonebar-price strong {
		font-size: 16px;
		line-height: 24px;
		font-weight: 600;
	}

	.cn-hero__phonebar-price span {
		color: var(--cn-c-muted);
		font-size: var(--cn-fs-small);
		line-height: var(--cn-lh-small);
	}

	.cn-hero .cn-hero__phonebar .cn-btn {
		flex: 1;
		background: var(--cn-c-forest);
		color: var(--cn-c-white);
	}

	html.cn-phonebar-shown body {
		padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
	}

	html.cn-menu-open .cn-hero__phonebar {
		visibility: hidden;
	}
}

/* Never in the Elementor editor. */
.elementor-editor-active .cn-hero__phonebar {
	display: none !important;
}
