/* Northern Sky - Header + Fullscreen Menu
   Structural / layout CSS only. Colors, typography, spacing and sizing
   are controlled per-instance from the Elementor Style tab (see the
   widget's "selectors" in class-header-menu-widget.php) so they can be
   edited responsively without touching this file. */

.nsm-header-menu,
.nsm-header-menu *,
.nsm-header-menu *::before,
.nsm-header-menu *::after {
	box-sizing: border-box;
}

.nsm-header-menu {
	position: relative;
	max-width: 100%;
	overflow-x: hidden;
}

/* Hard reset for the plain <button> elements (menu toggle, overlay close,
   newsletter submit). Some themes / global Elementor Kit settings apply a
   default background + accent color to every raw <button> on the site
   (default state AND :hover/:focus/:active). These widgets are meant to be
   transparent "ghost" buttons whose color is controlled entirely by the
   Style tab controls below, so we explicitly zero out background/border/
   box-shadow here, with enough specificity + !important to win over that
   kind of theme-level button styling. */
.nsm-header-menu button.nsm-menu-toggle,
.nsm-header-menu button.nsm-close-btn,
.nsm-header-menu .nsm-newsletter-form button,
.nsm-header-menu button.nsm-menu-toggle:hover,
.nsm-header-menu button.nsm-menu-toggle:focus,
.nsm-header-menu button.nsm-menu-toggle:active,
.nsm-header-menu button.nsm-close-btn:hover,
.nsm-header-menu button.nsm-close-btn:focus,
.nsm-header-menu button.nsm-close-btn:active,
.nsm-header-menu .nsm-newsletter-form button:hover,
.nsm-header-menu .nsm-newsletter-form button:focus,
.nsm-header-menu .nsm-newsletter-form button:active {
	background-color: transparent !important;
	background-image: none !important;
	border-color: transparent !important;
	box-shadow: none !important;
	text-shadow: none !important;
}

/* Keep a visible, accessible focus indicator for keyboard users, but in
   the element's own color instead of a theme-default accent fill. */
.nsm-header-menu button.nsm-menu-toggle:focus-visible,
.nsm-header-menu button.nsm-close-btn:focus-visible,
.nsm-header-menu .nsm-newsletter-form button:focus-visible {
	outline: 2px solid currentColor !important;
	outline-offset: 3px;
}

/* Accent bar */
.nsm-accent-bar {
	width: 100%;
	display: block;
}

/* Header bar */
.nsm-header {
	position: relative;
	width: 100%;
	z-index: 20;
}

.nsm-header-inner {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: 100%;
}

.nsm-menu-toggle {
	display: inline-flex;
	align-items: center;
	background: none;
	border: none;
	margin: 0;
	cursor: pointer;
	font-family: inherit;
	line-height: 1;
	flex-shrink: 0;
}

.nsm-hamburger-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	line-height: 0;
}

.nsm-hamburger-icon svg,
.nsm-close-icon svg {
	display: block;
}

.nsm-toggle-text,
.nsm-close-text {
	white-space: nowrap;
	line-height: 1;
}

.nsm-logo {
	position: absolute;
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%);
	line-height: 0;
}

.nsm-logo a {
	display: inline-block;
	line-height: 0;
}

.nsm-logo img {
	display: block;
	max-width: none;
}

.nsm-header-cta {
	display: flex;
	align-items: center;
	flex-shrink: 0;
}

.nsm-cta-btn {
	display: inline-block;
	text-decoration: none;
	white-space: nowrap;
	line-height: 1;
	cursor: pointer;
}

/* Fullscreen overlay
   Entry = slides down into place. Exit = slides back up and out ("slide top out").
   .nsm-menu-visible keeps the overlay in the DOM/visible for the full duration of
   both the entry and exit transitions; .nsm-menu-open drives the actual position. */
.nsm-overlay {
	position: fixed;
	inset: 0;
	z-index: 99999;
	visibility: hidden;
	pointer-events: none;
	overflow-y: auto;
	overflow-x: hidden;
	max-width: 100vw;
	transform: translateY(-100%);
	transition: transform var(--nsm-overlay-duration, 0.6s) cubic-bezier(0.65, 0, 0.35, 1);
	-webkit-overflow-scrolling: touch;
	will-change: transform;
}

.nsm-header-menu.nsm-menu-visible .nsm-overlay {
	visibility: visible;
	pointer-events: auto;
}

.nsm-header-menu.nsm-menu-open .nsm-overlay {
	transform: translateY(0);
}

.nsm-overlay-inner {
	position: relative;
	min-height: 100%;
	width: 100%;
	max-width: 100%;
	overflow-x: hidden;
	display: flex;
	flex-direction: column;
}

/* Row containing the optional in-menu logo + the close button. With no logo,
   the close button sits on the left (matches the original reference). With
   a logo shown (.nsm-has-overlay-logo), it spreads logo-left / close-right. */
.nsm-overlay-header {
	display: flex;
	align-items: center;
	justify-content: flex-start;
	width: 100%;
	margin-bottom: 40px;
	flex-shrink: 0;
}

.nsm-header-menu.nsm-has-overlay-logo .nsm-overlay-header {
	justify-content: space-between;
}

/* "Show Logo On" style control: when restricted to Desktop Only, the logo
   is hidden once the mobile breakpoint kicks in (see the 767px media query
   below). .nsm-overlay-header still has justify-content:space-between from
   above, but with only the close button left in the flex row (the logo's
   display:none removes it from layout entirely), space-between resolves to
   a single item at the start - so the close button lands back on the left
   on its own, matching the "no logo at all" layout, no extra override
   needed here. */
@media (min-width: 768px) {
	.nsm-header-menu.nsm-overlay-logo-mobile-only .nsm-overlay-logo-desktop {
		display: none;
	}
}

.nsm-overlay-logo {
	line-height: 0;
}

.nsm-overlay-logo a {
	display: inline-block;
	line-height: 0;
}

.nsm-overlay-logo img {
	display: block;
	max-width: none;
}

.nsm-close-btn {
	display: inline-flex;
	align-items: center;
	background: none;
	border: none;
	margin: 0;
	padding: 0;
	cursor: pointer;
	font-family: inherit;
	line-height: 1;
}

.nsm-close-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	line-height: 0;
	/* background-color, padding and border-radius are set entirely by the
	   Style tab controls (Close Button section) in class-header-menu-widget.php,
	   including their defaults. */
}

.nsm-overlay-content {
	flex: 1 0 auto;
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	/* gap is set entirely by the "Gap Between Nav & Footer" style control
	   (overlay_columns_gap - Overlay section), including its own
	   responsive defaults, so there's nothing to repeat here or in the
	   tablet/mobile media queries below. */
	width: 100%;
}

.nsm-nav {
	/* No flex-grow: the nav links are short words, and with grow:1 this
	   column was matching .nsm-overlay-footer's grow 1-for-1, splitting
	   the row exactly in half - which left a big dead gap between "Home"
	   etc. and the Contact Us column, since the links themselves never
	   came close to filling that much width. Capping it at its own
	   (generous, for the underline/hover width) basis and leaving all the
	   grow to the footer means Contact Us now starts shortly after the
	   nav column's actual content instead of at the row's midpoint. */
	flex: 0 1 380px;
	display: flex;
	flex-direction: column;
}

.nsm-nav-list {
	list-style: none;
	/* margin-top is set by the "Top Offset" style control (nav_list_top_offset
	   - Navigation List section). Its default (-18px) cancels out "Item
	   Vertical Padding"'s own default (18px) landing on the first item too,
	   which would otherwise push "Home" down from the top of the column
	   while .nsm-overlay-footer's h4 (no top margin) stays flush at the
	   top of its own column - the two are meant to start level with each
	   other. Both controls are independently adjustable (and responsive),
	   so changing one doesn't auto-correct the other. */
	margin: 0;
	padding: 0;
	width: 100%;
}

.nsm-nav-list li {
	border-bottom-style: solid;
	border-bottom-width: 1px;
	opacity: 0;
	transform: translateY(calc(var(--nsm-item-offset, 16px) * -1));
	transition: opacity var(--nsm-item-duration, 0.5s) ease-out,
		transform var(--nsm-item-duration, 0.5s) ease-out;
}

.nsm-nav-list li:first-child {
	border-top-style: solid;
	border-top-width: 1px;
}

.nsm-header-menu.nsm-menu-open .nsm-nav-list li {
	opacity: 1;
	transform: translateY(0);
	transition-delay: calc( var(--nsm-item-delay, 0.25s) + ( var(--nsm-i, 0) * var(--nsm-item-stagger, 70ms) ) );
}

.nsm-nav-list a {
	display: block;
	text-decoration: none;
	transition: color 0.25s ease;
}

.nsm-overlay-footer {
	/* No flex-grow (desktop/tablet - the mobile media query below switches
	   this to flex:1 1 auto/width:100% once nav+footer stack). With
	   grow:1 this box used to stretch to fill 100% of the row's remaining
	   width, but its own contents (Contact Us/Location/newsletter) stayed
	   left-aligned *inside* that oversized box instead of actually
	   reaching the right edge - leaving a large dead gap between the
	   visible footer text and the overlay's right padding, so the footer
	   never looked right-aligned to match .nsm-nav's left alignment.
	   Shrinking to the content's own natural width instead means the box
	   ends exactly where its content does, so .nsm-overlay-content's
	   justify-content:space-between can push it flush against the right
	   padding - the same distance from the right edge as "Home" sits from
	   the left. */
	flex: 0 1 auto;
	display: flex;
	flex-direction: column;
	gap: 24px;
	/* margin-top is set by the "Top Offset" style control
	   (footer_top_offset - Footer Headings section), default 0 - the
	   column already sits flush with its own top (the Contact Us/Location
	   h4s have no top margin of their own), so this exists purely so it
	   can be nudged to re-match .nsm-nav-list's own Top Offset control if
	   that one, or the nav item padding it's meant to cancel, ever
	   changes. */
}

/* Row holding the optional mobile-only logo copy + the Contact and
   Location blocks. On desktop this is just Contact + Location wrapping
   to two columns (the logo stays up in .nsm-overlay-header instead). */
.nsm-footer-top-row {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	/* Row-gap (space between wrapped lines) stays a fixed 20px - only the
	   column-gap (the actual "gap between the two items", Contact Us vs
	   Location) is a style control: footer_items_gap, Footer Headings
	   section, responsive. */
	row-gap: 20px;
	column-gap: 40px;
	width: 100%;
	/* Desktop/tablet only (zeroed out in the mobile media query below) -
	   a little extra breathing room so "Location"'s own text doesn't sit
	   flush against the overlay's right padding edge, now that the footer
	   column hugs its content instead of stretching full-width. */
	padding-right: 80px;
}

/* Hidden by default (desktop uses .nsm-overlay-logo-desktop, up next to
   the close button); enabled inside the mobile row via the media query
   below. */
.nsm-overlay-logo-mobile {
	display: none;
}

.nsm-footer-divider {
	width: 100%;
	max-width: 100%;
	height: 0;
	border: none;
	border-top-style: solid;
	border-top-width: 1px;
	/* Matches the "Footer Divider" Style control's own default - was 0.15
	   (too faint to notice against the ~0.97-opacity dark overlay
	   background), bumped to 0.3 to match the newsletter underline's own
	   default so the divider is actually visible at a glance. */
	border-top-color: rgba(255, 255, 255, 0.3);
	margin: 0;
	opacity: 0;
	transition: opacity var(--nsm-item-duration, 0.5s) ease-out;
}

.nsm-header-menu.nsm-menu-open .nsm-footer-divider {
	opacity: 1;
	transition-delay: calc( var(--nsm-item-delay, 0.25s) + 0.15s );
}

.nsm-contact-block,
.nsm-location-block,
.nsm-newsletter-block {
	opacity: 0;
	transform: translateY(calc(var(--nsm-item-offset, 16px) * -1));
	transition: opacity var(--nsm-item-duration, 0.5s) ease-out,
		transform var(--nsm-item-duration, 0.5s) ease-out;
}

.nsm-header-menu.nsm-menu-open .nsm-contact-block,
.nsm-header-menu.nsm-menu-open .nsm-location-block,
.nsm-header-menu.nsm-menu-open .nsm-newsletter-block {
	opacity: 1;
	transform: translateY(0);
	transition-delay: calc( var(--nsm-item-delay, 0.25s) + 0.15s + ( var(--nsm-i, 0) * var(--nsm-item-stagger, 70ms) ) );
}

.nsm-contact-block,
.nsm-location-block {
	/* No flex-grow (desktop/tablet only - the mobile media query below
	   deliberately switches this to flex:1 1 0 once the two share a full-
	   width row). The same equal-grow issue as the nav/footer columns:
	   with grow:1 these two short blocks were each stretching to half of
	   .nsm-footer-top-row's own width - which, now that .nsm-overlay-footer
	   itself absorbs all the space the nav column doesn't use, can be very
	   wide - leaving a large dead gap between "Contact Us"'s own text and
	   wherever "Location" happened to start. Capping the grow means the
	   two sit right next to each other, the "Gap Between Items" style
	   control (footer_items_gap) between them. */
	flex: 0 1 200px;
	min-width: 180px;
}

.nsm-contact-block h4,
.nsm-location-block h4 {
	margin: 0;
}

.nsm-contact-block p,
.nsm-location-block p {
	margin: 0 0 6px;
}

.nsm-contact-block p:last-child,
.nsm-location-block p:last-child {
	margin-bottom: 0;
}

.nsm-contact-block a,
.nsm-location-block a {
	color: inherit;
	text-decoration: none;
}

.nsm-newsletter-block {
	width: 100%;
	margin-top: 10px;
}

.nsm-newsletter-label {
	display: block;
	text-transform: uppercase;
}

.nsm-newsletter-form {
	display: flex;
	align-items: flex-end;
	gap: 16px;
	max-width: 420px;
	border-bottom-style: solid;
	border-bottom-width: 1px;
	/* Matches the "Input Border Color" Style tab control's own default -
	   invisible unless that control is explicitly given a color. */
	border-bottom-color: transparent;
	margin-top: 16px;
}

.nsm-newsletter-form input {
	flex: 1 1 auto;
	min-width: 0;
	background: none;
	border: none;
	outline: none;
	/* Some mobile/OS browser chrome still draws its own default box around
	   a plain text input unless explicitly told not to. */
	appearance: none;
	-webkit-appearance: none;
	/* On Windows, "forced colors" / high-contrast browser modes override an
	   author's border/outline on form fields with the OS's own system-UI
	   box outline, regardless of border: none above - this is the thick
	   white box some users see wrapping just the input. Opting the field
	   out of that override is the only way to keep it borderless there. */
	forced-color-adjust: none;
	padding: 8px 0;
	font-family: inherit;
}

.nsm-newsletter-form button {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	background: none;
	border: none;
	cursor: pointer;
	white-space: nowrap;
	padding: 8px 0;
	font-family: inherit;
	transition: color 0.25s ease;
}

/* Optional line above the social icons / copyright row, separating it from
   the Newsletter section above - same shape as .nsm-footer-divider, just a
   different insertion point and its own "Bottom Divider" Style controls. */
.nsm-bottom-divider {
	width: 100%;
	max-width: 100%;
	height: 0;
	border: none;
	border-top-style: solid;
	border-top-width: 1px;
	border-top-color: rgba(255, 255, 255, 0.3);
	margin: 24px 0;
	opacity: 0;
	transition: opacity var(--nsm-item-duration, 0.5s) ease-out;
}

.nsm-header-menu.nsm-menu-open .nsm-bottom-divider {
	opacity: 1;
	transition-delay: calc( var(--nsm-item-delay, 0.25s) + 0.25s );
}

.nsm-overlay-bottom {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 20px;
	/* Baseline gap above this row, whether or not the Bottom Divider above
	   is turned on - the divider's own "Spacing" control adds further gap
	   on top of this when it's shown, it doesn't replace it. */
	margin-top: 36px;
	width: 100%;
}

.nsm-socials,
.nsm-copyright {
	opacity: 0;
	transform: translateY(calc(var(--nsm-item-offset, 16px) * -1));
	transition: opacity var(--nsm-item-duration, 0.5s) ease-out,
		transform var(--nsm-item-duration, 0.5s) ease-out;
}

.nsm-header-menu.nsm-menu-open .nsm-socials,
.nsm-header-menu.nsm-menu-open .nsm-copyright {
	opacity: 1;
	transform: translateY(0);
	transition-delay: calc( var(--nsm-item-delay, 0.25s) + 0.3s );
}

.nsm-socials {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
}

.nsm-socials a {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.6em;
	height: 2.6em;
	text-decoration: none;
	line-height: 1;
	transition: background-color 0.25s ease, color 0.25s ease;
}

.nsm-copyright {
	line-height: 1;
}

/* Prevent background scroll while overlay is open */
body.nsm-no-scroll {
	overflow: hidden;
}

/* Mobile - stack and center everything, matching the reference layout */
@media (max-width: 767px) {
	/* Mobile header bar: logo left, hamburger right (no absolute centering),
	   matching the reference mobile design. Only applied when the "Logo
	   Position on Mobile" style control is set to Left (the default). */
	.nsm-header-menu.nsm-mobile-logo-left .nsm-header-inner {
		justify-content: space-between;
	}

	.nsm-header-menu.nsm-mobile-logo-left .nsm-logo {
		position: static;
		top: auto;
		left: auto;
		transform: none;
		order: -1;
	}

	.nsm-header-menu.nsm-mobile-logo-left .nsm-menu-toggle {
		order: 1;
	}

	/* Optionally hide the header CTA button on mobile (the reference mobile
	   header only shows the logo + hamburger). */
	.nsm-header-menu.nsm-hide-cta-mobile .nsm-header-cta {
		display: none;
	}

	/* Optionally hide the "Menu" / "CLOSE" text labels on mobile, leaving
	   icon-only buttons. */
	.nsm-header-menu.nsm-hide-toggle-text-mobile .nsm-toggle-text {
		display: none;
	}

	.nsm-header-menu.nsm-hide-close-text-mobile .nsm-close-text {
		display: none;
	}

	.nsm-overlay-content {
		flex-direction: column;
		flex-wrap: nowrap;
		/* Left-aligned per the revised design (nav links, Contact/Location,
		   the newsletter row and the social/copyright row all read from the
		   left edge on mobile now, instead of centering). */
		text-align: left;
	}

	.nsm-nav,
	.nsm-overlay-footer {
		flex: 1 1 auto;
		width: 100%;
		max-width: 100%;
	}

	.nsm-nav {
		align-items: flex-start;
	}

	.nsm-overlay-footer {
		text-align: left;
		gap: 20px;
	}

	.nsm-footer-top-row {
		flex-wrap: nowrap;
		align-items: flex-start;
		justify-content: flex-start;
		column-gap: 14px;
		padding-right: 0;
	}

	/* Mobile keeps the logo up in .nsm-overlay-header (same element as
	   desktop, just at the mobile "Width (in Menu)" control's own size) -
	   logo left, close button right, via the existing
	   .nsm-has-overlay-logo rule above (not mobile-specific, so it applies
	   here too as long as this element stays visible). The separate
	   in-footer-row logo copy below is unused on mobile now; it stays
	   hidden the same way it already is on desktop. */
	.nsm-overlay-logo-mobile {
		display: none;
	}

	/* "Show Logo On" style control: Desktop Only hides it again once we're
	   in this same mobile breakpoint (see justify-content comment above
	   .nsm-overlay-logo-mobile-only's desktop-side rule, further up). */
	.nsm-header-menu.nsm-overlay-logo-desktop-only .nsm-overlay-logo-desktop {
		display: none;
	}

	/* Reset the desktop flex-basis/min-width (200px/180px) so these blocks
	   can never force the overlay wider than the viewport, while still
	   sharing the row - they flex evenly instead of each going full-width. */
	.nsm-contact-block,
	.nsm-location-block {
		flex: 1 1 0;
		width: auto;
		max-width: 100%;
		min-width: 0;
	}

	.nsm-newsletter-block {
		width: 100%;
		max-width: 100%;
	}

	.nsm-newsletter-form {
		width: 100%;
		max-width: 100%;
		/* No longer auto-centering the form block itself - it now hugs the
		   same left edge as everything else above it. */
		margin-left: 0;
		margin-right: 0;
	}

	/* Social icons left, copyright right - same edge-to-edge layout as
	   desktop, just wrapping to two lines if a row gets too narrow. */
	.nsm-overlay-bottom {
		flex-direction: row;
		flex-wrap: wrap;
		justify-content: space-between;
		text-align: left;
	}

	.nsm-overlay-header {
		margin-bottom: 24px;
	}
}

/* Extra-narrow phones: Contact/Location text can get tight in a 2-up row,
   so drop back to a stacked layout below 420px. (The logo no longer
   shares this row - see the 767px block above - so there's no logo width
   to reset here any more.) */
@media (max-width: 420px) {
	.nsm-footer-top-row {
		flex-wrap: wrap;
		justify-content: flex-start;
	}

	.nsm-contact-block,
	.nsm-location-block {
		flex: 1 1 auto;
		width: 100%;
	}
}

/* Respect the user's motion preference: skip the slide/fade choreography,
   just show/hide the overlay instantly. */
@media (prefers-reduced-motion: reduce) {
	.nsm-overlay,
	.nsm-nav-list li,
	.nsm-contact-block,
	.nsm-location-block,
	.nsm-newsletter-block,
	.nsm-footer-divider,
	.nsm-socials,
	.nsm-copyright {
		transition: none !important;
	}

	.nsm-overlay {
		transform: none !important;
		opacity: 0;
	}

	.nsm-header-menu.nsm-menu-visible .nsm-overlay {
		opacity: 1;
	}

	.nsm-nav-list li,
	.nsm-contact-block,
	.nsm-location-block,
	.nsm-newsletter-block,
	.nsm-footer-divider,
	.nsm-socials,
	.nsm-copyright {
		transform: none !important;
		opacity: 1 !important;
	}
}
