/* 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;
}

.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: 60px;
	width: 100%;
}

.nsm-nav {
	flex: 1 1 320px;
	display: flex;
	flex-direction: column;
}

.nsm-nav-list {
	list-style: none;
	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 {
	flex: 1 1 320px;
	display: flex;
	flex-direction: column;
	gap: 24px;
}

/* 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;
	gap: 20px 40px;
	width: 100%;
}

/* 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;
	border-top-color: rgba(255, 255, 255, 0.15);
	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 {
	flex: 1 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 {
	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;
	margin-top: 16px;
}

.nsm-newsletter-form input {
	flex: 1 1 auto;
	min-width: 0;
	background: none;
	border: none;
	outline: 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;
}

.nsm-overlay-bottom {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 20px;
	margin-top: 60px;
	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;
}

/* Tablet */
@media (max-width: 1024px) {
	.nsm-overlay-content {
		gap: 40px;
	}
}

/* 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;
		gap: 32px;
		text-align: center;
	}

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

	.nsm-nav {
		align-items: center;
	}

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

	/* Logo + Contact + Location share a single compact row on mobile only;
	   the logo shown up in .nsm-overlay-header on desktop is swapped out
	   for this in-row copy instead. */
	.nsm-footer-top-row {
		flex-wrap: nowrap;
		align-items: flex-start;
		justify-content: center;
		gap: 14px;
	}

	.nsm-overlay-header .nsm-overlay-logo-desktop {
		display: none;
	}

	.nsm-overlay-logo-mobile {
		display: block;
		flex: 0 0 auto;
	}

	.nsm-overlay-logo-mobile img {
		max-height: 32px;
		width: auto;
	}

	/* 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%;
		margin-left: auto;
		margin-right: auto;
	}

	/* Social icons + copyright share a single centered row on mobile
	   instead of the desktop's edge-to-edge space-between layout. */
	.nsm-overlay-bottom {
		flex-direction: row;
		flex-wrap: wrap;
		justify-content: center;
		text-align: center;
	}

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

/* Extra-narrow phones: Contact/Location text can get tight in a 2-up row
   next to the logo, so drop back to a stacked layout below 420px. */
@media (max-width: 420px) {
	.nsm-footer-top-row {
		flex-wrap: wrap;
		justify-content: center;
	}

	.nsm-overlay-logo-mobile {
		flex: 1 1 100%;
	}

	.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;
	}
}
