/* Both segments ship in the same list; only the inactive half is hidden. Items that switch
   segment carry neither class, so they stay visible whichever segment is active.

   Hiding rather than showing keeps the theme's own display value intact — the header menu is
   a flex row on desktop and a stacked list in the off-canvas drawer, and forcing a display
   value here would break one of the two. */

html:not([data-nx-segment="bedrift"]) .nx-seg--bedrift {
	display: none !important;
}

html[data-nx-segment="bedrift"] .nx-seg--privat {
	display: none !important;
}

/* Before the inline head script runs — or with JavaScript switched off — the Bedrift items
   would otherwise appear alongside the Privat ones for one frame. */
html:not([data-nx-segment]) .nx-seg--bedrift {
	display: none !important;
}

/* The segment the visitor is currently in, inside the switcher dropdown. */
.nx-seg-switch .nx-seg-current > .menu-link,
.nx-seg-switch .nx-seg-current > a {
	font-weight: 700;
}

/* The switch item sits between the two segments in the markup, so hiding the Privat half
   would otherwise leave it first in the row. The header menu is a flex container, so `order`
   keeps it last without moving anything in the DOM. */
.main-header-menu > .nx-seg-switch {
	order: 99;
}

/* Desktop: the switch has its own menu (secondary_menu, Astra's menu-2) beside the language
   flags and the login link. It is a setting rather than a page, so it borrows the login link's
   look — white Roboto 14px — and a thin rule sets it apart from the page menu. No media query:
   menu-2 only exists in the desktop header, and Astra's CSS can show that header down to 921px
   for a moment while a window is resized, which left the switch in the theme's blue link colour. */
.ast-builder-menu-2 {
	position: relative;
	margin-left: 8px;
	padding-left: 16px;
}

/* A short rule rather than a border: the menu is as tall as the header bar. */
.ast-builder-menu-2::before {
	content: "";
	position: absolute;
	top: 50%;
	left: 0;
	height: 22px;
	border-left: 1px solid rgba(255, 255, 255, 0.35);
	transform: translateY(-50%);
}

/* Astra marks the switch and the active segment as current-menu-*, which would otherwise
   give them the menu's dark active colour. */
.ast-builder-menu-2 .main-header-menu .menu-item > .menu-link {
	padding: 0 8px;
	font-family: Roboto, sans-serif;
	font-size: 14px;
	font-weight: 400;
	color: #fff;
}

.ast-builder-menu-2 .menu-item > .menu-link .dropdown-menu-toggle,
.ast-builder-menu-2 .menu-item > .menu-link .ast-icon {
	color: #fff;
	fill: #fff;
}

.ast-builder-menu-2 .main-header-menu .menu-item:hover > .menu-link,
.ast-builder-menu-2 .main-header-menu .menu-item > .menu-link:focus {
	color: var(--ast-global-color-0);
}

/* The dropdown matches the page menu's: dark panel, rounded corners, white links. */
.ast-builder-menu-2 .sub-menu {
	width: auto;
	min-width: 160px;
	padding: 8px 0;
	border: 0;
	border-radius: 6px;
	background: var(--ast-global-color-8);
}

.ast-builder-menu-2 .main-header-menu .sub-menu .menu-link {
	padding: 10px 20px;
	color: var(--ast-global-color-4);
}

.ast-builder-menu-2 .main-header-menu .sub-menu .menu-item:hover > .menu-link,
.ast-builder-menu-2 .main-header-menu .sub-menu .nx-seg-current > .menu-link {
	color: var(--ast-global-color-0);
}


/* Astra's CSS still switches headers at its tablet breakpoint (921px); its script uses the raised
   one. Between the two, Astra marks the body ast-header-break-point but leaves the desktop
   header showing too, so hide it here. */
.ast-header-break-point #masthead #ast-desktop-header {
	display: none !important;
}

/* Astra's tablet spacing for the mobile header also stops at 921px, so from there up to the
   raised breakpoint the logo and the menu toggle sat flush against the edges. Same 32px as
   Astra gives them on tablets. */
@media (min-width: 922px) and (max-width: 1260px) {
	.ast-header-break-point #masthead #ast-mobile-header .site-primary-header-wrap {
		padding-left: 32px;
		padding-right: 32px;
	}
}

/* Just above the breakpoint the full header is tight: closer menu items keep it on one row. */
@media (min-width: 1261px) and (max-width: 1440px) {
	.ast-builder-menu-1 .main-header-menu > .menu-item > .menu-link {
		padding-left: 9px;
		padding-right: 9px;
	}

	.ast-builder-menu-2 {
		margin-left: 0;
		padding-left: 10px;
	}
}
