/**
 * Canopy: tokens, type, layout and shared components.
 *
 * Breakpoints match Elementor's defaults: tablet <= 1024px, mobile <= 767px.
 * Figma frames: desktop 1440, tablet 834, mobile 390.
 * Section styles live in assets/css/parts/<widget>.css.
 */

/* ------------------------------------------------------------------ */
/* Tokens                                                             */
/* ------------------------------------------------------------------ */

:root {
	--cn-c-forest: #173b2a;
	--cn-c-forest-dark: #0f2a1d;
	--cn-c-paper: #f0f2e9;
	--cn-c-sage: #dfe6d0;
	--cn-c-line: #bac8af;
	--cn-c-muted: #536853;
	--cn-c-white: #ffffff;
	--cn-c-error: #b54a28;
	/* Kept for code shared with other Margick themes: "ink" text is the forest green here. */
	--cn-c-ink: var(--cn-c-forest);

	--cn-serif: "Literata", Georgia, "Times New Roman", serif;
	--cn-sans: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

	--cn-max: 1200px;
	--cn-gutter: 120px;
	--cn-section-pad: 96px;
	--cn-radius: 12px;
	--cn-radius-panel: 16px;
	--cn-radius-control: 8px;

	/* Figma text styles: display (hero 72/110%), h1 (section 56/64), h2 (36/44), h3 (28/36). */
	--cn-fs-display: 72px;
	--cn-lh-display: 79px;
	--cn-fs-h1: 56px;
	--cn-lh-h1: 64px;
	--cn-fs-h2: 36px;
	--cn-lh-h2: 44px;
	--cn-fs-h3: 28px;
	--cn-lh-h3: 36px;
	--cn-fs-lead: 20px;
	--cn-lh-lead: 30px;
	--cn-fs-body: 16px;
	--cn-lh-body: 24px;
	--cn-fs-small: 14px;
	--cn-lh-small: 20px;
	--cn-fs-label: 12px;
	--cn-lh-label: 16px;
	/* Big numbers (lodge facts, walking minutes, seasonal rates). */
	--cn-fs-figure: 36px;
	--cn-lh-figure: 44px;
}

@media (max-width: 1279px) {
	:root {
		--cn-gutter: 32px;
	}
}

@media (max-width: 1024px) {
	:root {
		--cn-section-pad: 64px;
		--cn-fs-h1: 36px;
		--cn-lh-h1: 44px;
	}
}

@media (max-width: 767px) {
	:root {
		--cn-gutter: 20px;
		--cn-section-pad: 48px;
		--cn-fs-display: 44px;
		--cn-lh-display: 49px;
		--cn-fs-lead: 16px;
		--cn-lh-lead: 24px;
	}
}

/* Palettes: paper (#f0f2e9), sage (#dfe6d0), forest (dark). Elementor colour controls override them per widget. */
.cn--paper,
.cn--sage,
.cn--forest {
	--cn-heading: var(--cn-c-forest);
	--cn-text: var(--cn-c-forest);
	--cn-muted: var(--cn-c-muted);
	--cn-line: var(--cn-c-line);
	--cn-accent: var(--cn-c-forest);
	--cn-on-accent: var(--cn-c-white);
	--cn-field: var(--cn-c-white);
}

.cn--paper {
	--cn-bg: var(--cn-c-paper);
}

.cn--sage {
	--cn-bg: var(--cn-c-sage);
}

.cn--forest {
	--cn-bg: var(--cn-c-forest);
	--cn-heading: var(--cn-c-white);
	--cn-text: var(--cn-c-white);
	--cn-muted: rgba(255, 255, 255, 0.8);
	--cn-line: var(--cn-c-muted);
	--cn-accent: var(--cn-c-paper);
	--cn-on-accent: var(--cn-c-forest);
	--cn-field: transparent;
}

/* ------------------------------------------------------------------ */
/* Base                                                               */
/* ------------------------------------------------------------------ */

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

html {
	-webkit-text-size-adjust: 100%;
	scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}

	*,
	*::before,
	*::after {
		transition-duration: 0.01ms !important;
		animation-duration: 0.01ms !important;
	}
}

body {
	margin: 0;
	background: var(--cn-c-paper);
	color: var(--cn-c-forest);
	font-family: var(--cn-sans);
	font-size: var(--cn-fs-body);
	line-height: var(--cn-lh-body);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

img,
svg,
video {
	max-width: 100%;
}

/* Library images carry width/height attributes; keep their ratio wherever CSS sets only a width. */
img {
	height: auto;
}

a {
	color: inherit;
}

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

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

.cn-skip-link {
	position: absolute;
	top: -100px;
	left: 16px;
	z-index: 1000;
	padding: 12px 16px;
	border-radius: var(--cn-radius-control);
	background: var(--cn-c-forest);
	color: var(--cn-c-white);
	font-weight: 600;
	text-decoration: none;
}

.cn-skip-link:focus {
	top: 16px;
}

/* A section rendered by a Canopy widget. */
.cn {
	/* Reset, so a section placed inside a narrow column (e.g. inside a post) keeps its 1200 container. */
	--cn-max: 1200px;
	position: relative;
	background: var(--cn-bg);
	color: var(--cn-text);
	font-family: var(--cn-sans);
	font-size: var(--cn-fs-body);
	line-height: var(--cn-lh-body);
}

/* Zero specificity, so a section's own margins (".cn-heading__text { margin-top }") always win. */
:where(.cn) :where(h1, h2, h3, h4, p, ul, ol, figure, blockquote, dl, dd) {
	margin: 0;
}

:where(.cn) :where(ul, ol) {
	list-style: none;
	padding: 0;
}

/* Vertical rhythm: every section uses these, Elementor "Padding" controls override them. */
.cn-pad {
	padding-top: var(--cn-pad-t, var(--cn-section-pad));
	padding-bottom: var(--cn-pad-b, var(--cn-section-pad));
}

.cn-container {
	width: min(var(--cn-max), 100% - 2 * var(--cn-gutter));
	margin-inline: auto;
}

/* Wider container (64px gutters at 1440). */
.cn-container--wide {
	--cn-max: 1312px;
	width: min(var(--cn-max), 100% - 2 * min(var(--cn-gutter), 64px));
}

.cn-container--narrow {
	--cn-max: 760px;
}

/* ------------------------------------------------------------------ */
/* Type                                                               */
/* ------------------------------------------------------------------ */

.cn-display,
.cn-h1,
.cn-h2,
.cn-h3,
.cn-figure-value {
	font-family: var(--cn-serif);
	font-weight: 400;
	color: var(--cn-heading, var(--cn-c-ink));
	letter-spacing: 0;
}

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

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

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

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

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

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

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

.cn-label {
	font-family: var(--cn-sans);
	font-size: var(--cn-fs-label);
	line-height: var(--cn-lh-label);
	font-weight: 600;
	text-transform: uppercase;
}

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

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

/* Section heading: title then one line of text 16px under it. */
.cn-heading {
	margin-bottom: 40px;
}

.cn-heading .cn-eyebrow {
	margin-bottom: 32px;
}

.cn-heading__text {
	margin-top: 16px;
	color: var(--cn-text);
}

@media (max-width: 767px) {
	.cn-heading {
		margin-bottom: 32px;
	}

	.cn-heading .cn-eyebrow {
		margin-bottom: 24px;
	}
}

/* ------------------------------------------------------------------ */
/* Buttons and links                                                  */
/* ------------------------------------------------------------------ */

.cn-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 48px;
	padding: 0 24px;
	border: 1px solid transparent;
	border-radius: var(--cn-radius-control);
	font-family: var(--cn-sans);
	font-size: 16px;
	line-height: 24px;
	font-weight: 600;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
	transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.cn .cn-btn--primary,
.cn-btn--primary {
	background: var(--cn-accent, var(--cn-c-forest));
	color: var(--cn-on-accent, var(--cn-c-white));
}

.cn .cn-btn--primary:hover,
.cn-btn--primary:hover {
	background: var(--cn-c-forest-dark);
	color: var(--cn-c-white);
}

.cn--forest .cn-btn--primary:hover {
	background: var(--cn-c-white);
	color: var(--cn-c-forest);
}

.cn .cn-btn--outline,
.cn-btn--outline {
	background: var(--cn-c-paper);
	border-color: var(--cn-c-line);
	color: var(--cn-c-forest);
}

.cn .cn-btn--outline:hover,
.cn-btn--outline:hover {
	border-color: var(--cn-c-forest);
	color: var(--cn-c-forest);
}

.cn-btn--block {
	width: 100%;
}

.cn .cn-link,
.cn-link {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	color: var(--cn-heading, var(--cn-c-ink));
	font-size: 16px;
	line-height: 24px;
	font-weight: 600;
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
}

.cn .cn-link:hover,
.cn-link:hover {
	text-decoration-thickness: 2px;
}

.cn-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 16px 32px;
}

/* ------------------------------------------------------------------ */
/* Form fields (booking bars, enquiry form, newsletter)               */
/* ------------------------------------------------------------------ */

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

.cn-field__label {
	color: var(--cn-text, var(--cn-c-ink));
}

/* Boxed control: 48px, 1px rule, white. Selects and the date field share it. */
.cn-control {
	position: relative;
	display: flex;
	align-items: center;
	gap: 8px;
	min-height: 48px;
	padding: 0 14px;
	border: 1px solid var(--cn-c-line);
	border-radius: var(--cn-radius-control);
	background: var(--cn-field, var(--cn-c-white));
	color: var(--cn-c-ink);
}

.cn-control:focus-within {
	border-color: var(--cn-c-ink);
}

.cn-control select,
.cn-control input {
	flex: 1;
	min-width: 0;
	height: 46px;
	margin: 0;
	padding: 0;
	border: 0;
	outline: 0;
	background: transparent;
	color: inherit;
	font-family: var(--cn-sans);
	font-size: 16px;
	line-height: 24px;
	appearance: none;
	-webkit-appearance: none;
}

.cn-control select {
	padding-right: 28px;
	cursor: pointer;
}

.cn-control__icon {
	position: absolute;
	right: 14px;
	top: 50%;
	transform: translateY(-50%);
	pointer-events: none;
}

.cn-control__lead {
	flex: none;
}

/* Date: native input under the formatted text; theme.js opens the picker. */
.cn-control--date {
	cursor: pointer;
}

.cn-control__value {
	display: none;
	flex: 1;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.cn-js .cn-control--date .cn-control__value {
	display: block;
}

.cn-js .cn-control--date input {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	opacity: 0;
	cursor: pointer;
}

.cn-js .cn-control--date input::-webkit-calendar-picker-indicator {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	opacity: 0;
	cursor: pointer;
}

/* Plain text input (enquiry form, newsletter). */
.cn-input {
	width: 100%;
	min-height: 48px;
	padding: 12px;
	border: 1px solid var(--cn-c-line);
	border-radius: var(--cn-radius-control);
	background: var(--cn-c-paper);
	color: var(--cn-c-forest);
	font-family: var(--cn-sans);
	font-size: 16px;
	line-height: 24px;
}

.cn-input::placeholder {
	color: var(--cn-c-muted);
	opacity: 1;
}

.cn-input:focus {
	outline: 0;
	border-color: var(--cn-c-ink);
}

.cn-form-note {
	color: var(--cn-muted);
	font-size: var(--cn-fs-small);
	line-height: var(--cn-lh-small);
}

.cn-form-note:empty {
	display: none;
}

/* ------------------------------------------------------------------ */
/* FAQ accordion                                                      */
/* ------------------------------------------------------------------ */

.cn-faq__item {
	border-bottom: 1px solid var(--cn-line);
}

.cn-faq__q {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	min-height: 48px;
	padding: 12px 0;
	list-style: none;
	cursor: pointer;
}

.cn-faq__q::-webkit-details-marker {
	display: none;
}

.cn-faq__question {
	color: var(--cn-heading);
	font-size: 16px;
	line-height: 24px;
	font-weight: 600;
}

.cn-faq__icon {
	flex: none;
	width: 24px;
	height: 24px;
	color: var(--cn-heading);
	transition: transform 0.2s ease;
}

.cn-faq__item[open] .cn-faq__icon {
	transform: rotate(45deg);
}

.cn-faq__a {
	padding: 0 64px 20px 0;
	color: var(--cn-text);
	font-size: var(--cn-fs-body);
	line-height: var(--cn-lh-body);
}

@media (max-width: 767px) {
	.cn-faq__a {
		padding-right: 0;
	}
}

.cn-faq__a p + p {
	margin-top: 12px;
}

/* ------------------------------------------------------------------ */
/* Photos with captions                                               */
/* ------------------------------------------------------------------ */

.cn-figure {
	margin: 0;
	min-width: 0;
}

.cn-figure__media {
	overflow: hidden;
	border-radius: var(--cn-radius);
	background: var(--cn-c-line);
}

.cn .cn-figure__media img,
.cn-figure__media img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
}

.cn-figure__caption {
	margin-top: 8px;
	color: var(--cn-muted);
}

/* Photo credit on a full-bleed photo. */
.cn-credit {
	color: rgba(255, 255, 255, 0.9);
	font-size: var(--cn-fs-small);
	line-height: var(--cn-lh-small);
}

/* Horizontal scroll rows (tablet and phone card rows, photo strips). */
.cn-scroll {
	display: flex;
	gap: 24px;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scroll-padding-inline: var(--cn-gutter);
	scrollbar-width: none;
}

.cn-scroll::-webkit-scrollbar {
	display: none;
}

.cn-scroll > * {
	flex: none;
	scroll-snap-align: start;
}

/* Bleeds a scroll row to the viewport edge while its first item lines up with the container. */
.cn-bleed {
	margin-inline: calc(-1 * var(--cn-gutter));
	padding-inline: var(--cn-gutter);
}

/* ------------------------------------------------------------------ */
/* Elementor integration                                              */
/* ------------------------------------------------------------------ */

/* Canopy widgets bring their own spacing; remove wrapper gaps around them. */
.elementor-widget[class*="elementor-widget-cn-"],
.elementor-widget[class*="elementor-widget-cn-"] > .elementor-widget-container {
	margin: 0;
	padding: 0;
}
