/*
 * Children's House: Native Header (Phase 2B — architecture only)
 *
 * A deliberately calmer, content-first header: logo + primary
 * navigation only. No cart, account, search, currency, or country
 * controls — those remain part of the separate commerce header.
 *
 * Mobile-first: base rules are the small-screen (collapsed) layout;
 * the min-width query promotes the nav to a horizontal bar and hides
 * the hamburger toggle. No fixed pixel widths are used for layout.
 * Reuses the site's existing Elementor global design tokens where
 * available, matching the same fallback-colour approach already used
 * in native-footer.css.
 */

.chc-native-header {
	background-color: #FFFFFF;
	border-bottom: 1px solid rgba(0, 0, 0, 0.08);
	padding: 1rem 1.25rem;
}

.chc-native-header__inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	max-width: 1200px;
	margin: 0 auto;
	position: relative;
}

.chc-native-header__logo {
	font-family: var(--e-global-typography-primary-font-family, "Poppins"), sans-serif;
	font-weight: 700;
	font-size: 1.25rem;
	color: var(--e-global-color-primary, #b76d9e);
	text-decoration: none;
	display: inline-flex;
}

/*
 * Logo image variant (redesign preview only — see
 * CHC_Native_Header::render()'s $logo_attachment_id arg). Inert on
 * every other page: this class is never present in the DOM unless a
 * caller opts in, so it cannot affect the text-logo pages (including
 * page 126589) that don't pass that argument.
 *
 * Sizing per the 3a design system: 140px desktop / 124px mobile,
 * never below the 120px brand minimum.
 */
.chc-native-header__logo-img {
	display: block;
	width: 124px;
	height: auto;
}

@media (min-width: 62em) {
	.chc-native-header__logo-img {
		width: 140px;
	}
}

/* Mobile hamburger toggle — hidden on desktop */
.chc-native-header__toggle {
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 4px;
	width: 2.25rem;
	height: 2.25rem;
	padding: 0;
	background: none;
	border: 1px solid rgba(0, 0, 0, 0.15);
	border-radius: 4px;
	cursor: pointer;
}

.chc-native-header__toggle-bar {
	display: block;
	width: 1.25rem;
	height: 2px;
	margin: 0 auto;
	background-color: #333333;
}

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

/* Primary nav — collapsed by default on mobile */
.chc-native-header__nav {
	display: none;
	width: 100%;
	order: 3;
	margin-top: 1rem;
}

.chc-native-header__nav.is-open {
	display: block;
}

.chc-native-header__menu {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
}

.chc-native-header__menu > li > a,
.chc-native-header__parent-toggle {
	display: block;
	width: 100%;
	text-align: left;
	padding: 0.6rem 0.25rem;
	font-family: var(--e-global-typography-text-font-family, "Poppins"), sans-serif;
	font-size: 0.95rem;
	color: #333333;
	text-decoration: none;
	background: none;
	border: none;
	cursor: pointer;
}

.chc-native-header__menu > li > a:hover,
.chc-native-header__menu > li > a:focus,
.chc-native-header__parent-toggle:hover,
.chc-native-header__parent-toggle:focus {
	color: var(--e-global-color-primary, #b76d9e);
}

.chc-native-header__caret {
	display: inline-block;
	margin-left: 0.35em;
	border: solid currentColor;
	border-width: 0 2px 2px 0;
	padding: 3px;
	transform: rotate(45deg);
	transition: transform 0.15s ease;
}

.chc-native-header__item--parent.is-open > .chc-native-header__parent-toggle .chc-native-header__caret {
	transform: rotate(-135deg);
}

/* Submenus — collapsed accordion on mobile, no-JS fallback via
   max-height/overflow (not display:none) so items stay keyboard-
   focusable even before JS runs. */
.chc-native-header__submenu {
	max-height: 0;
	overflow: hidden;
	opacity: 0;
	transition: max-height 0.2s ease, opacity 0.2s ease;
}

.chc-native-header__item--parent:hover > .chc-native-header__submenu,
.chc-native-header__item--parent:focus-within > .chc-native-header__submenu,
.chc-native-header__item--parent.is-open > .chc-native-header__submenu {
	max-height: 20em;
	opacity: 1;
}

.chc-native-header__submenu-list {
	list-style: none;
	margin: 0;
	padding: 0 0 0 1rem;
}

.chc-native-header__submenu-list a {
	display: block;
	padding: 0.5rem 0.25rem;
	font-size: 0.9rem;
	color: #555555;
	text-decoration: none;
}

.chc-native-header__submenu-list a:hover,
.chc-native-header__submenu-list a:focus {
	color: var(--e-global-color-primary, #b76d9e);
}

/* Shop Materials CTA — visually distinct from ordinary nav links.
   Selector includes .chc-native-header__menu > li so it naturally
   outranks the generic ".chc-native-header__menu > li > a" rule above
   on specificity, instead of relying on !important. */
.chc-native-header__menu > li.chc-header-cta > a {
	display: inline-block;
	margin-top: 0.5rem;
	padding: 0.6rem 1.25rem;
	background-color: var(--e-global-color-primary, #b76d9e);
	color: #FFFFFF;
	border-radius: 4px;
	text-align: center;
	font-weight: 600;
}

.chc-native-header__menu > li.chc-header-cta > a:hover,
.chc-native-header__menu > li.chc-header-cta > a:focus {
	opacity: 0.9;
	color: #FFFFFF;
}

/* Shop Art Materials — paired second CTA (redesign preview only).
   Deliberately an outline/ghost treatment, not a solid fill, so it
   reads as secondary to the primary green Shop Materials CTA rather
   than competing with it. */
.chc-native-header__menu > li.chc-header-cta--secondary > a {
	display: inline-block;
	margin-top: 0.5rem;
	padding: 0.6rem 1.25rem;
	background-color: transparent;
	border: 1px solid rgba(0, 0, 0, 0.18);
	color: #333333;
	border-radius: 4px;
	text-align: center;
	font-weight: 600;
}

.chc-native-header__menu > li.chc-header-cta--secondary > a:hover,
.chc-native-header__menu > li.chc-header-cta--secondary > a:focus {
	border-color: var(--e-global-color-primary, #b76d9e);
	color: var(--e-global-color-primary, #b76d9e);
}

@media (min-width: 62em) {
	.chc-native-header__toggle {
		display: none;
	}

	.chc-native-header__nav {
		display: block;
		width: auto;
		order: 2;
		margin-top: 0;
	}

	.chc-native-header__menu {
		flex-direction: row;
		align-items: center;
		gap: 1.5rem;
	}

	.chc-native-header__menu > li > a,
	.chc-native-header__parent-toggle {
		width: auto;
		padding: 0.5rem 0.25rem;
	}

	.chc-native-header__item--parent {
		position: relative;
	}

	.chc-native-header__submenu {
		position: absolute;
		top: 100%;
		left: 0;
		max-height: none;
		height: 0;
		width: 14rem;
		background: #FFFFFF;
		border: 1px solid rgba(0, 0, 0, 0.08);
		border-radius: 4px;
		box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
		z-index: 10;
	}

	.chc-native-header__item--parent:hover > .chc-native-header__submenu,
	.chc-native-header__item--parent:focus-within > .chc-native-header__submenu,
	.chc-native-header__item--parent.is-open > .chc-native-header__submenu {
		height: auto;
		max-height: none;
	}

	.chc-native-header__submenu-list {
		padding: 0.5rem;
	}

	.chc-native-header__menu > li.chc-header-cta > a,
	.chc-native-header__menu > li.chc-header-cta--secondary > a {
		margin-top: 0;
	}
}
