/* Spartan AI redesign: header.
   Announcement bar, main header, dropdown, sticky state, search overlay,
   off-canvas panel (desktop) and mobile navigation.
   Parent breakpoints: the horizontal menu and the fixed header exist from 1201px up;
   below that the theme shows the logo plus search/menu buttons only. */

body.sprt {
	--sprt-bar-h: 40px;      /* announcement bar */
	--sprt-head-h: 64px;     /* main header row */
}

@media only screen and (min-width: 1201px) {
	body.sprt {
		--sprt-head-h: 72px;
	}
}

/* ---------- 1. Shell and page offset ---------- */

body.sprt #firwlHeaderBar,
body.sprt #firwlHeaderBarContent {
	background-color: var(--sprt-paper);
	color: var(--sprt-ink);
}

@media only screen and (min-width: 1201px) {
	/* Fixed header: bar + row + hairline. Scrolled state drops the bar. */
	body.sprt #firwlGlobal.firwl-global__sticky,
	body.sprt #firwlGlobal.firwl-global__sticky__sec-h {
		padding-top: calc(var(--sprt-bar-h) + var(--sprt-head-h) + 1px);
	}

	body.sprt #firwlHeaderBar.firwl-headerbar__sticky .firwl-secondaryhead {
		max-height: var(--sprt-bar-h);
		transition: max-height 0.25s ease;
	}

	body.sprt #firwlHeaderBar.firwl-headerbar__sticky__s .firwl-secondaryhead {
		max-height: 0;
	}
}

/* ---------- 2. Announcement bar ---------- */

body.sprt #firwlSecondaryHeader {
	display: block;
	background-color: var(--sprt-ink);
	color: var(--sprt-on-ink);
	clip-path: none;
	overflow: hidden;
	font-family: var(--sprt-mono);
	text-transform: none;
}

body.sprt #firwlSecondaryHeader .firwl-secondaryhead__cont {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	max-width: none;
	min-height: var(--sprt-bar-h);
	margin: 0;
	padding: 6px var(--sprt-gutter);
	line-height: 1.35;
}

body.sprt #firwlSecondaryHeader .firwl-sos {
	display: block;
	max-width: 100%;
	margin: 0;
	font-family: var(--sprt-mono);
	font-size: var(--sprt-fs-label);
	font-weight: 400;
	letter-spacing: 0;
	line-height: 1.35;
	text-align: center;
	text-transform: none;
	color: var(--sprt-on-ink);
}

body.sprt #firwlSecondaryHeader .firwl-sos a {
	display: inline-block;
	padding: 4px 0;
	color: var(--sprt-on-ink);
	text-decoration: none;
}

/* Stock contact-card icon: decoration only */
body.sprt #firwlSecondaryHeader .firwl-sos i {
	display: none;
}

body.sprt #firwlSecondaryHeader .firwl-sos span {
	opacity: 1;
	white-space: nowrap;
	color: var(--sprt-lilac);
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
}

body.sprt #firwlSecondaryHeader .firwl-sos a:hover span {
	color: var(--sprt-on-ink);
}


/* Social icons sit at the right edge; the message stays centred */
body.sprt #firwlSecondaryHeader .firwl-social {
	display: none;
}

@media only screen and (min-width: 993px) {
	body.sprt #firwlSecondaryHeader .firwl-secondaryhead__cont {
		padding-left: calc(var(--sprt-gutter) + 88px);
		padding-right: calc(var(--sprt-gutter) + 88px);
	}

	body.sprt #firwlSecondaryHeader .firwl-social {
		display: flex;
		align-items: center;
		gap: 4px;
		float: none !important; /* parent .firwl-right is !important */
		position: absolute;
		top: 50%;
		right: var(--sprt-gutter);
		transform: translateY(-50%);
		line-height: 1;
	}

	body.sprt #firwlSecondaryHeader .firwl-social a {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		width: 28px;
		height: 28px;
		margin: 0;
		padding: 0;
		border-radius: var(--sprt-radius-pill);
		font-size: 13px;
		color: var(--sprt-on-ink-soft);
		opacity: 1;
		transition: color 0.2s ease;
	}

	body.sprt #firwlSecondaryHeader .firwl-social a:hover {
		color: var(--sprt-on-ink);
	}
}

/* ---------- 3. Main header row ---------- */

body.sprt #firwlMenu {
	display: block;
	width: 100%;
	height: auto;
	min-height: 0;
	padding: 0;
	overflow: visible;
	background-color: var(--sprt-paper);
	border-bottom: 1px solid var(--sprt-line);
	color: var(--sprt-ink);
	font-family: var(--sprt-sans);
	line-height: 1.2;
	text-align: left;
	text-transform: none;
}

body.sprt #firwlMenu .firwl-menu__cont {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	max-width: calc(var(--sprt-maxw) + 2 * var(--sprt-gutter));
	height: var(--sprt-head-h);
	margin: 0 auto;
	padding: 0 var(--sprt-gutter);
	text-align: left;
}

/* Logo */
body.sprt #firwlMenu .firwl-menu__logo {
	display: flex;
	align-items: center;
	float: none !important; /* parent .firwl-left is !important */
	flex: 0 0 auto;
	height: auto;
	max-width: none;
	margin: 0;
	line-height: 1;
}

body.sprt #firwlMenu .firwl-logolink {
	display: flex;
	align-items: center;
	height: auto;
	line-height: 1;
	border-radius: var(--sprt-radius-control);
}

body.sprt #firwlMenu .firwl-menu__logo img {
	width: auto;
	height: 46px;
	max-height: 46px;
}

body.sprt #firwlMenu .firwl-logo_header_mob {
	display: block;
}

body.sprt #firwlMenu .firwl-logo_header {
	display: none;
}

/* Search and menu buttons: plain round icon buttons */
body.sprt #firwlMenu .firwl-menubtns {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 4px;
	flex: 0 0 auto;
	padding: 0;
	line-height: 1;
}

body.sprt #firwlMenu .firwl-btn__r,
body.sprt #firwlOverlay .firwl-overlay__closebar .firwl-btn__r {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	min-width: 40px;
	height: 40px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: var(--sprt-radius-pill);
	background: none;
	clip-path: none;
	color: var(--sprt-ink);
	line-height: 1;
	transition: background-color 0.2s ease;
}

body.sprt #firwlMenu .firwl-btn__r::before,
body.sprt #firwlMenu .firwl-btn__r::after,
body.sprt #firwlOverlay .firwl-overlay__closebar .firwl-btn__r::before,
body.sprt #firwlOverlay .firwl-overlay__closebar .firwl-btn__r::after {
	display: none;
}

body.sprt #firwlMenu .firwl-btn__r:hover,
body.sprt #firwlOverlay .firwl-overlay__closebar .firwl-btn__r:hover {
	background-color: var(--sprt-line);
	color: var(--sprt-ink);
}

body.sprt #firwlMenu .firwl-btn__r i,
body.sprt #firwlOverlay .firwl-overlay__closebar .firwl-btn__r i {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	margin: 0;
	font-size: 22px;
	line-height: 1;
	border-radius: var(--sprt-radius-pill);
}

/* Sliding block indicator the theme script appends to the header */
body.sprt #firwlMenu #firwlIndx {
	display: none;
}

/* ---------- 4. Primary navigation (1201px and up) ---------- */

@media only screen and (min-width: 1201px) {
	/* logo | centred nav | buttons */
	body.sprt #firwlMenu .firwl-menu__cont {
		display: grid;
		grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
		gap: 24px;
	}

	body.sprt #firwlMenu .firwl-menu__logo {
		justify-self: start;
	}

	body.sprt #firwlMenu .firwl-menubtns {
		justify-self: end;
	}

	body.sprt #firwlMenu .firwl-menu__logo img {
		height: 56px;
		max-height: 56px;
	}

	body.sprt #firwlMenu .firwl-logo_header_mob {
		display: none;
	}

	body.sprt #firwlMenu .firwl-logo_header {
		display: block;
	}

	body.sprt #firwlMenuNav {
		display: flex;
		align-self: stretch;
		justify-content: center;
		min-height: 0;
		line-height: 1.2;
		transform: none;
	}

	body.sprt #firwlMenuNav .firwl-menu-horizontal_c {
		display: flex;
	}

	body.sprt #firwlMenuBar {
		display: flex;
		align-items: stretch;
		gap: 2px;
		margin: 0;
		padding: 0;
		font-family: var(--sprt-sans);
		text-transform: none;
	}

	/* Items fill the row height so the dropdown hangs from the header edge */
	body.sprt #firwlMenuBar > li {
		display: flex;
		align-items: center;
		float: none;
		height: auto;
		margin: 0;
		padding: 0;
		line-height: 1.2;
	}

	body.sprt #firwlMenuBar li::before,
	body.sprt #firwlMenuBar li a::before,
	body.sprt #firwlMenuBar li a::after {
		display: none;
	}

	body.sprt #firwlMenuBar > li > a {
		display: block;
		float: none;
		height: auto;
		max-width: none;
		padding: 8px 12px;
		border-radius: var(--sprt-radius-pill);
		font-family: var(--sprt-sans);
		font-size: var(--sprt-fs-small);
		font-weight: 500;
		letter-spacing: 0;
		line-height: 1.25;
		text-transform: none;
		color: var(--sprt-ink-soft);
		opacity: 1;
		transition: color 0.2s ease, background-color 0.2s ease;
	}

	body.sprt #firwlMenuBar > li:hover > a,
	body.sprt #firwlMenuBar > li > a:focus-visible,
	body.sprt #firwlMenuBar > li.current-menu-item > a,
	body.sprt #firwlMenuBar > li.current-menu-ancestor > a {
		color: var(--sprt-ink);
	}

	body.sprt #firwlMenuBar > li.current-menu-item > a {
		cursor: pointer;
	}

	/* Parent item: small chevron instead of the stock "+" */
	body.sprt #firwlMenuBar > li.menu-item-has-children {
		padding-right: 0;
	}

	body.sprt #firwlMenuBar > li.menu-item-has-children > a {
		padding-right: 28px;
	}

	body.sprt #firwlMenuBar > li.menu-item-has-children::after {
		content: "";
		position: absolute;
		top: 50%;
		right: 13px;
		width: 6px;
		height: 6px;
		margin-top: -5px;
		border-right: 1.5px solid var(--sprt-ink-soft);
		border-bottom: 1.5px solid var(--sprt-ink-soft);
		font-size: 0;
		opacity: 1;
		pointer-events: none;
		transform: rotate(45deg);
		transition: transform 0.2s ease, margin-top 0.2s ease;
	}

	body.sprt #firwlMenuBar > li.menu-item-has-children:hover::after,
	body.sprt #firwlMenuBar > li.menu-item-has-children:focus-within::after {
		margin-top: -2px;
		border-color: var(--sprt-ink);
		transform: rotate(225deg);
	}

	/* Dropdown panel */
	body.sprt #firwlMenuBar > li ul {
		width: 280px;
		padding: 8px;
		background-color: var(--sprt-surface);
		border: 1px solid var(--sprt-line);
		border-radius: 0 0 var(--sprt-radius-panel) var(--sprt-radius-panel);
		box-shadow: none;
		color: var(--sprt-ink);
		transform: translateY(8px);
		white-space: normal;
	}

	body.sprt #firwlMenuBar > li > ul {
		left: -8px;
		border-top-color: var(--sprt-line);
	}

	body.sprt #firwlMenuBar > li.firwl-iright > ul {
		left: auto;
		right: -8px;
	}

	body.sprt #firwlMenuBar > li:hover > ul,
	body.sprt #firwlMenuBar > li:focus-within > ul {
		position: absolute;
		top: 100%;
		margin-top: 0;
		border-color: var(--sprt-line);
		opacity: 1;
		transform: translateY(0);
	}

	body.sprt #firwlMenuBar > li ul li:focus-within > ul {
		position: absolute;
		top: -9px;
		opacity: 1;
	}

	body.sprt #firwlMenuBar > li ul li {
		line-height: 1.3;
	}

	body.sprt #firwlMenuBar > li ul li a,
	body.sprt #firwlMenuBar > li ul li:last-child > a {
		display: block;
		padding: 10px 12px;
		border: 0;
		border-radius: var(--sprt-radius-control);
		background-image: none;
		font-family: var(--sprt-sans);
		font-size: var(--sprt-fs-small);
		font-weight: 500;
		letter-spacing: 0;
		line-height: 1.3;
		text-transform: none;
		color: var(--sprt-ink);
		transition: background-color 0.2s ease;
	}

	body.sprt #firwlMenuBar > li ul li:hover > a,
	body.sprt #firwlMenuBar > li ul li > a:focus-visible {
		background-color: var(--sprt-paper);
		background-image: none;
		color: var(--sprt-violet-deep);
	}

	body.sprt #firwlMenuBar > li ul li > a:focus-visible {
		outline-offset: -2px;
	}
}

/* ---------- 5. Search overlay (covers the header row) ---------- */

body.sprt #firwlSearchBar {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	max-width: 100%;
	height: 100%;
	padding: 0;
	overflow: hidden;
	background-color: var(--sprt-paper);
	color: var(--sprt-ink);
	line-height: 1.2;
	opacity: 0;
	visibility: hidden;
	transform: none;
	transition: opacity 0.2s ease, visibility 0s linear 0.2s;
}

body.sprt #firwlSearchBar.open {
	padding: 0;
	opacity: 1;
	visibility: visible;
	transform: none;
	transition: opacity 0.2s ease, visibility 0s;
}

body.sprt #firwlSearchBar .firwl-searchbar__cont {
	display: flex;
	align-items: center;
	gap: 8px;
	max-width: calc(var(--sprt-maxw) + 2 * var(--sprt-gutter));
	height: 100%;
	margin: 0 auto;
	padding: 0 var(--sprt-gutter);
}

body.sprt #firwlSearchBar form {
	display: flex;
	align-items: center;
	gap: 12px;
	flex: 1 1 auto;
	float: none;
	width: auto;
	min-width: 0;
	height: auto;
	margin: 0;
}

body.sprt #firwlSearchBar form input {
	flex: 1 1 auto;
	float: none;
	width: auto;
	min-width: 0;
	height: 44px;
	margin: 0;
	padding: 0 16px;
	background-color: var(--sprt-surface);
	border: 1px solid var(--sprt-line);
	border-radius: var(--sprt-radius-pill);
	box-shadow: none;
	font-family: var(--sprt-sans);
	font-size: 1rem;
	line-height: 1.2;
	color: var(--sprt-ink);
}

body.sprt #firwlSearchBar form input::placeholder {
	color: var(--sprt-ink-soft);
	opacity: 1;
}

body.sprt #firwlSearchBar form input:focus {
	border-color: var(--sprt-violet);
	outline: 2px solid var(--sprt-violet) !important;
	outline-offset: 1px;
}

/* iOS zooms the page when a field under 16px takes focus */
@media (max-width: 600px) {
	body.sprt #firwlSearchBar form input {
		font-size: 16px;
	}
}

/* Submit: primary pill */
body.sprt #firwlSearchBar form button.firwl-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	flex: 0 0 auto;
	height: 44px;
	padding: 0 20px;
	/* the customizer prints !important colour and gradient on .firwl-btn-primary */
	background-color: var(--sprt-ink) !important;
	background-image: none !important;
	border: 0;
	border-radius: var(--sprt-radius-pill);
	clip-path: none;
	font-family: var(--sprt-mono);
	font-size: var(--sprt-fs-label);
	font-weight: 400;
	letter-spacing: 0;
	line-height: 1;
	text-transform: none;
	color: var(--sprt-on-ink);
	transition: background-color 0.2s ease;
}

body.sprt #firwlSearchBar form button.firwl-btn:hover {
	background-color: var(--sprt-violet-deep) !important;
}

body.sprt #firwlSearchBar form button.firwl-btn::before,
body.sprt #firwlSearchBar form button.firwl-btn::after {
	display: none;
}

body.sprt #firwlSearchBar form button.firwl-btn i {
	margin: 0;
	font-size: 18px;
	line-height: 1;
}

@media only screen and (max-width: 600px) {
	body.sprt #firwlSearchBar form button.firwl-btn {
		display: none;
	}
}

body.sprt #firwlSearchBar a.firwl-btn__r {
	flex: 0 0 auto;
	cursor: pointer;
}

/* ---------- 6. Off-canvas panel and mobile navigation ---------- */

body.sprt #firwlOverlay {
	background-color: var(--sprt-paper);
	box-shadow: none;
	color: var(--sprt-ink);
	font-family: var(--sprt-sans);
	visibility: hidden;
	transition: transform 0.4s cubic-bezier(0.1, 0, 0.3, 1), visibility 0s linear 0.4s;
}

body.sprt.firwl-overlayopen #firwlOverlay {
	visibility: visible;
	transition: transform 0.4s cubic-bezier(0.1, 0, 0.3, 1), visibility 0s;
}

@media only screen and (min-width: 601px) {
	body.sprt #firwlOverlay {
		width: min(420px, 100vw);
		border-left: 1px solid var(--sprt-line);
	}
}

body.sprt .firwl-overlay__pagemask {
	background: var(--sprt-ink);
}

body.sprt.firwl-overlayopen .firwl-overlay__pagemask {
	opacity: 0.45;
}

body.sprt #firwlOverlay .firwl-overlay__closebar {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	min-height: var(--sprt-head-h);
	padding: 0 24px;
	border-bottom: 1px solid var(--sprt-line);
	line-height: 1;
}

body.sprt #firwlOverlay .firwl-overlay__closebar .firwl-btn__r {
	cursor: pointer;
}

/* Menu tree */
body.sprt #firwlOverlay .firwl-menu-tree {
	margin: 0;
	padding: 16px 24px 8px;
	font-family: var(--sprt-sans);
	font-size: 1.125rem;
	line-height: 1.3;
	text-transform: none;
}

body.sprt #firwlOverlay .firwl-menu-tree li {
	border-top: 0;
	border-bottom: 1px solid var(--sprt-line);
	font-size: inherit;
	text-transform: none;
}

body.sprt #firwlOverlay .firwl-menu-tree li:last-child {
	border-bottom: 0;
}

body.sprt #firwlOverlay .firwl-menu-tree li a {
	font-family: var(--sprt-sans);
	font-size: inherit;
	font-weight: 500;
	letter-spacing: 0;
	text-transform: none;
	color: var(--sprt-ink);
	text-decoration: none;
}

body.sprt #firwlOverlay .firwl-menu-tree li > a {
	min-height: 52px;
	padding: 0;
	line-height: 52px;
}

body.sprt #firwlOverlay .firwl-menu-tree li > a:hover,
body.sprt #firwlOverlay .firwl-menu-tree li.current-menu-item > a {
	color: var(--sprt-violet-deep);
}

/* Sub-items: indented, no dash */
body.sprt #firwlOverlay .firwl-menu-tree li ul {
	padding: 0;
}

body.sprt #firwlOverlay .firwl-menu-tree li ul li {
	border-bottom: 0;
	border-top: 1px solid var(--sprt-line);
}

body.sprt #firwlOverlay .firwl-menu-tree li ul li a {
	min-height: 44px;
	padding-left: 16px;
	font-size: 1rem;
	font-weight: 400;
	line-height: 44px;
	color: var(--sprt-ink-soft);
}

body.sprt #firwlOverlay .firwl-menu-tree li ul li a::before {
	display: none;
}

/* Expand toggle the theme script inserts after parent links */
body.sprt #firwlOverlay .firwl-menu-tree .firwl-openthis {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	float: right;
	width: 44px;
	min-height: 0;
	height: 44px;
	margin-top: 4px;
	padding: 0;
	border-radius: var(--sprt-radius-pill);
	line-height: 1;
	color: var(--sprt-ink);
	cursor: pointer;
}

body.sprt #firwlOverlay .firwl-menu-tree .firwl-openthis:hover {
	background-color: var(--sprt-line);
}

/* Widgets inside the panel */
body.sprt #firwlSidebarOffcanvas {
	padding: 24px;
	border-top: 1px solid var(--sprt-line);
	color: var(--sprt-ink-soft);
	font-size: var(--sprt-fs-small);
}

body.sprt #firwlSidebarOffcanvas .firwl-row {
	margin: 0;
	padding: 0;
	list-style: none;
}

body.sprt #firwlSidebarOffcanvas .firwl-widget {
	float: none;
	width: 100%;
	margin: 0 0 32px;
	padding: 0;
	list-style: none;
}

body.sprt #firwlSidebarOffcanvas h2,
body.sprt #firwlSidebarOffcanvas h3,
body.sprt #firwlSidebarOffcanvas h4,
body.sprt #firwlSidebarOffcanvas h5,
body.sprt #firwlSidebarOffcanvas h6 {
	margin: 0 0 12px;
	font-family: var(--sprt-mono);
	font-size: var(--sprt-fs-label);
	font-weight: 400;
	letter-spacing: 0;
	line-height: 1.4;
	text-transform: none;
	color: var(--sprt-ink-soft);
}

body.sprt #firwlSidebarOffcanvas ul ul,
body.sprt #firwlSidebarOffcanvas .wp-block-group ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

body.sprt #firwlSidebarOffcanvas .wp-block-group li {
	margin: 0;
	padding: 0;
	border: 0;
	list-style: none;
	font-size: var(--sprt-fs-small);
	line-height: 1.4;
}

body.sprt #firwlSidebarOffcanvas .wp-block-group li::before {
	display: none;
}

body.sprt #firwlSidebarOffcanvas .wp-block-group li a {
	display: inline-flex;
	align-items: center;
	min-height: 40px; /* tap target: the archive list is long and tightly stacked */
	padding: 6px 0;
	letter-spacing: 0;
	color: var(--sprt-ink);
	text-decoration: none;
	text-transform: none;
}

body.sprt #firwlSidebarOffcanvas .wp-block-group li a:hover {
	color: var(--sprt-violet-deep);
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* ---------- 7. Mega menu container (no menu item opens it at present) ---------- */

body.sprt #qt-megamenu .qt-megamenu__item {
	background-color: var(--sprt-paper);
	border-bottom: 0 solid var(--sprt-line);
}

body.sprt #qt-megamenu .qt-megamenu__item.open {
	border-bottom-width: 1px;
}

/* Collapsed to height 0 by the plugin, but its links stayed in the tab order */
body.sprt #qt-megamenu .qt-megamenu__item:not(.open) {
	visibility: hidden;
}

/* ---------- 8. Keyboard focus ---------- */

/* The parent theme sets `outline: none !important` on * and on a,
   so the focus ring has to be !important to show at all. */
body.sprt #firwlHeaderBar :focus-visible,
body.sprt #firwlOverlay :focus-visible {
	outline: 2px solid var(--sprt-violet) !important;
	outline-offset: 2px;
}

body.sprt #firwlSecondaryHeader :focus-visible {
	outline-color: var(--sprt-lilac) !important;
}

body.sprt #firwlMenuBar > li ul li > a:focus-visible {
	outline-offset: -2px;
}
