/*
 * Mobile navigation — Option 1, "one column".
 *
 * Scope: the site header at <=1024 only. ElementsKit keeps the desktop bar
 * (84.4px at 1280) untouched; here its phone bar is forced to the 56px the
 * timetable reads into --wn-nav-h, and its off-canvas panel is replaced by
 * the sheet this theme renders from the WP menu.
 *
 * The sheet is one column: every menu row in menu order, no groups, nothing
 * pinned to the foot, the X in the top row at the right end. Type is fluid —
 * rows carry the desktop navbar's own metrics (15px / 500) instead of a mobile
 * scale of their own.
 *
 * The bar height is a contract: it must not change while scrolling.
 */

/* ── the bar ─────────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
	.ekit-template-content-markup.ekit-template-content-header {
		box-shadow: inset 0 -1px 0 #E3D8C2;
		transition: box-shadow .18s ease;
	}

	.ekit-template-content-markup.ekit-template-content-header.is-scrolled {
		box-shadow: inset 0 -1px 0 #DCD0B7, 0 10px 20px -18px rgba(36, 48, 30, .85);
	}

	/* Container 583e9d4 is the phone bar in header template 107. Forced rather
	   than inherited: Elementor sizes it from its content (62.3px today). */
	.elementor-element-583e9d4 {
		height: calc(56px + env(safe-area-inset-top, 0px)) !important;
		min-height: calc(56px + env(safe-area-inset-top, 0px)) !important;
		padding: env(safe-area-inset-top, 0px) 14px 0 !important;
		align-items: center;
	}

	/* The header template fades this container in from JS (elementor-invisible).
	   Until that runs the bar — and the menu control inside it — is invisible. */
	.elementor-element-583e9d4.elementor-invisible {
		visibility: visible !important;
		opacity: 1 !important;
		animation: none !important;
	}

	/* The nav widget carries the toggle; ElementsKit's own hamburger is hidden,
	   so the widget is only as wide as the 44px button — and the bar's 14px
	   padding is the only gap between it and the screen edge. */
	.elementor-element-899afb7 {
		width: 44px !important;
		min-width: 44px !important;
		max-width: none !important;
		flex: none;
	}

	.elementor-element-899afb7 .elementor-widget-container {
		display: flex;
		align-items: center;
		justify-content: flex-end;
		width: 100%;
		height: 44px;
	}

	.elementor-element-583e9d4 .elementor-element-9f57cfa {
		width: auto !important;
		flex: none;
	}

	.elementor-element-583e9d4 .elementor-element-9f57cfa img {
		width: auto !important;
		max-width: 130px !important;
		height: auto !important;
		max-height: 44px;
	}

	/* Owner change 5: the pill is sage with the deep ink label (5.5:1), not
	   cream on sage (2.15:1, the AA failure). Label text stays
	   "Login / Register" — it is no longer rewritten. */
	/* The toggle is parked at the bar's right edge, so the pill must never
	   claim its 44px: at 320 the label wraps to two lines instead of running
	   under the hamburger. */
	.elementor-element-8895f2c {
		width: auto !important;
		max-width: calc(100% - 46px) !important;
	}

	.elementor-element-8895f2c .elementor-button {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		position: relative;
		/* Colours, padding, radius and weight are left to Elementor so the phone
		   pill is the desktop pill — same #A1AA68 fill, same cream label, same
		   forest hover (--e-global-color-accent). Only the two things Elementor
		   scales down per breakpoint are corrected here: the kit drops the accent
		   typography to 13px on tablet/mobile, and this bar is desktop-sized. */
		min-width: 0;
		font-size: 14px !important;
		text-align: center;
		white-space: normal;
	}

	.elementor-element-8895f2c .elementor-button::after {
		content: "";
		position: absolute;
		inset: -4px -2px;
	}

	/* ElementsKit's own panel and hamburger are replaced, not restyled. */
	.elementor-element-583e9d4 .elementskit-menu-hamburger,
	.ekit-template-content-markup .elementskit-menu-overlay,
	.ekit-template-content-markup .elementskit-nav-identity-panel,
	.ekit-template-content-markup #ekit-megamenu-studio-wellnesia-menu {
		display: none !important;
	}
}

/* ── the toggle (44 × 44, inserted next to the login action) ─────────────── */
.wn-menu-btn {
	display: none;
	align-items: center;
	justify-content: center;
	width: 44px !important;
	min-width: 44px !important;
	height: 44px !important;
	margin: 0 0 0 2px !important;
	padding: 0 !important;
	flex: none;
	box-sizing: border-box;
	background: none !important;
	border: 0 !important;
	border-radius: 10px !important;
	box-shadow: none !important;
	/* Elementor paints every <button> white at (0,1,1); without !important the
	   hamburger was white on cream — invisible until the screenshot showed it. */
	color: #30442C !important;
	font: inherit !important;
	cursor: pointer;
}

.wn-menu-btn:hover,
.wn-menu-btn:focus {
	background: #F4F1E6 !important;
}

.wn-menu-btn svg {
	display: block;
	width: 20px;
	height: 20px;
}

.wn-menu-btn:focus-visible {
	outline: 2px solid #30442C;
	outline-offset: 2px;
}

@media (min-width: 1025px) {
	.wn-sheet {
		display: none !important;
	}
}

@media (max-width: 1024px) {
	.wn-menu-btn {
		display: inline-flex !important;
	}
}

/* ── the sheet: full height, from the top ────────────────────────────────── */
/* Elementor's global kit styles every <button> and <a>; the sheet resets them
   here (ID specificity) and then applies its own component rules. */
#wn-menu-sheet button,
#wn-menu-sheet a {
	appearance: none;
	-webkit-appearance: none;
	width: auto;
	min-height: 0;
	margin: 0;
	padding: 0;
	background: none;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	color: inherit;
	font: inherit;
	letter-spacing: inherit;
	text-transform: none;
	text-decoration: none;
	text-align: left;
	cursor: pointer;
}

#wn-menu-sheet,
#wn-menu-sheet * {
	box-sizing: border-box;
}

#wn-menu-sheet {
	position: fixed;
	/* A left drawer, not a full-screen takeover: the page keeps a quarter of the
	   viewport on the right so the reader never loses where they are. */
	inset: 0 auto 0 0;
	width: min(76vw, 340px);
	z-index: 9999;
	display: flex;
	flex-direction: column;
	background: #F8EFDC;
	color: #2C3B24;
	font-family: "Radio Canada", "Avenir Next", "Helvetica Neue", Helvetica, Arial, sans-serif;
	-webkit-font-smoothing: antialiased;
	visibility: hidden;
	transform: translateX(-100%);
	transition: transform .26s cubic-bezier(.32, .72, 0, 1), visibility 0s linear .26s;
	box-shadow: 12px 0 34px -26px rgba(36, 48, 30, .9);
}

#wn-menu-sheet.is-open {
	visibility: visible;
	transform: translateX(0);
	transition: transform .26s cubic-bezier(.32, .72, 0, 1), visibility 0s;
}

html.wn-nav-locked,
body.wn-nav-locked {
	overflow: hidden !important;
}

/* The top row: wordmark left, the only close control at the right end. */
#wn-menu-sheet .wn-sheet__top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	flex: none;
	height: calc(56px + env(safe-area-inset-top, 0px));
	padding: env(safe-area-inset-top, 0px) 8px 0 14px;
	background: #F7EEDD;
	border-bottom: 1px solid #E3D8C2;
}

#wn-menu-sheet .wn-sheet__brand {
	display: inline-flex;
	align-items: center;
	min-width: 0;
	min-height: 44px;
	font-size: 16px;
	font-weight: 600;
	line-height: 1;
	letter-spacing: .01em;
	color: #30442C;
	text-decoration: none;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

#wn-menu-sheet .wn-sheet__brand img {
	display: block;
	width: auto;
	max-width: 130px;
	max-height: 30px;
}

#wn-menu-sheet .wn-sheet__close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	min-width: 44px;
	height: 44px;
	padding: 0;
	flex: none;
	background: none;
	border: 0;
	border-radius: 10px;
	color: #30442C;
	cursor: pointer;
}

#wn-menu-sheet .wn-sheet__close:hover {
	background: #F4F1E6;
}

#wn-menu-sheet .wn-sheet__close svg {
	width: 16px;
	height: 16px;
}

/* The list is the whole sheet: it scrolls, and it owns the safe-area pad so
   nothing is pinned underneath it. */
#wn-menu-sheet .wn-sheet__nav {
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
	overscroll-behavior: contain;
	-webkit-overflow-scrolling: touch;
	padding: 4px 0 calc(18px + env(safe-area-inset-bottom, 0px));
}

#wn-menu-sheet ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

#wn-menu-sheet .wn-sheet__list > li {
	margin: 0;
	padding: 0;
}

/* One row, set in the desktop navbar's own metrics — 15px, weight 500 — so the
   sheet reads as the same navigation, not a bigger mobile edition. 48px keeps a
   44px touch target with 4px of air. */
#wn-menu-sheet .wn-sheet__item {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	width: 100%;
	min-height: 48px;
	padding: 0 16px;
	font-family: inherit;
	font-size: 15px;
	font-weight: 500;
	line-height: 1.25;
	letter-spacing: -.005em;
	color: #2C3B24;
	text-align: left;
	text-decoration: none;
	background: none;
	border: 0;
	cursor: pointer;
}

#wn-menu-sheet .wn-sheet__label {
	flex: 1 1 auto;
	min-width: 0;
	overflow-wrap: break-word;
	word-break: break-word;
}

#wn-menu-sheet a.wn-sheet__item:hover,
#wn-menu-sheet button.wn-sheet__item:hover {
	background: #F4F1E6;
}

#wn-menu-sheet .wn-sheet__item.is-current {
	background: #F4F1E6;
	box-shadow: inset 3px 0 0 #55662F;
	font-weight: 600;
	color: #24301E;
}

#wn-menu-sheet .wn-sheet__here {
	font-size: 9px;
	font-weight: 600;
	line-height: 1;
	letter-spacing: .1em;
	text-transform: uppercase;
	color: #5F5F52;
	white-space: nowrap;
}

#wn-menu-sheet .wn-sheet__chev {
	width: 16px;
	height: 16px;
	flex: none;
	color: #55662F;
	transition: transform .18s ease;
}

#wn-menu-sheet .wn-sheet__item[aria-expanded="true"] .wn-sheet__chev {
	transform: rotate(180deg);
}

/* Children stay in the column: indented rows inside the same list. */
#wn-menu-sheet .wn-sheet__sub {
	margin: 0 0 6px 16px;
	padding: 0 0 0 14px;
	border-left: 1px solid #E3D8C2;
}

#wn-menu-sheet .wn-sheet__sub[hidden] {
	display: none;
}

#wn-menu-sheet .wn-sheet__sub .wn-sheet__item {
	min-height: 44px;
	padding: 0 10px 0 8px;
	font-size: 14px;
	font-weight: 400;
	line-height: 1.3;
	border-radius: 6px;
}

#wn-menu-sheet .wn-sheet__sub .wn-sheet__item.is-current {
	font-weight: 600;
}

#wn-menu-sheet .wn-sheet__sub .wn-sheet__item--self {
	font-weight: 600;
}

#wn-menu-sheet a:focus-visible,
#wn-menu-sheet button:focus-visible {
	outline: 2px solid #30442C;
	outline-offset: 2px;
	border-radius: 6px;
}

#wn-menu-sheet .wn-sheet__item:focus-visible {
	outline-offset: -3px;
}

@media (prefers-reduced-motion: reduce) {
	#wn-menu-sheet,
	#wn-menu-sheet.is-open,
	#wn-menu-sheet .wn-sheet__chev,
	.ekit-template-content-markup.ekit-template-content-header {
		transition: none !important;
	}
}
