/* Main header refresh, UX review 2026-10-25 (_local/ux-header/index.html).
 * Pairs with os-training-snippets front-end/onlysecurity-header-ux.php and
 * assets/js/onlysecurity-header-ux.js, which stay in that plugin (blog 1).
 * Moved into the ksec-training theme for DEV-265 (UX review
 * _local/ux-jobs-subsite-20261110 item JS7), so every site on the theme,
 * jobs.onlysecurity.com included, gets the same header. Enqueued by the
 * theme's functions.php under the same handle the plugin used. */

/* ---- Basket: count only (d4) ---------------------------------------- */
.site-header-cart .cart-contents > .amount {
	display: none;
}

/* ---- Basket and Checkout only with items in the basket ----------------
 * d2 (2026-10-25) hid the top bar Checkout link; OT-B1 (2026-11-02,
 * _local/ux-os-nav-thm) hides the basket icon too, in the nav bar and the
 * phone header, and the phone drawer's Checkout row. Hidden by default,
 * because most visitors have an empty basket and the page is cached for
 * guests. The JS adds `os-cart-full` to <html> from the
 * woocommerce_items_in_cart cookie at once, then keeps it in step with the
 * basket badge. */
html:not(.os-cart-full) .site-header-cart,
html:not(.os-cart-full) li.os-nav-ico-checkout {
	/* !important: the drawer's own row rules set display on its items. */
	display: none !important;
}

/* ---- Menu panel headings are labels (OT-N2) ---------------------------
 * onlysecurity-header-ux.php prints a sub-menu item whose link is # with
 * no href, so it is not a link; keep the arrow cursor on it. */
.main-navigation ul.menu ul a:not([href]) {
	cursor: default;
}

/* ---- Account cluster icons (d1) --------------------------------------
 * Replace the three stock circle icons on the desktop top bar. The drawer
 * has its own icons (onlysecurity-menu-enhancements.css) and is untouched. */
@media (min-width: 993px) {
	.secondary-navigation ul.menu > li:is(.os-nav-ico-login, .os-nav-ico-dashboard, .os-nav-ico-support, .os-nav-ico-checkout) > a .icon-wrapper svg {
		display: none;
	}
	.secondary-navigation ul.menu > li:is(.os-nav-ico-login, .os-nav-ico-dashboard, .os-nav-ico-support, .os-nav-ico-checkout) > a .icon-wrapper {
		display: flex;
		justify-content: center;
	}
	.secondary-navigation ul.menu > li:is(.os-nav-ico-login, .os-nav-ico-dashboard, .os-nav-ico-support, .os-nav-ico-checkout) > a .icon-wrapper::before {
		content: "";
		display: block;
		width: 26px;
		height: 26px;
		background: currentColor;
		-webkit-mask: var(--os-hdr-icon) center / contain no-repeat;
		mask: var(--os-hdr-icon) center / contain no-repeat;
	}
	/* User: Log in and Dashboard. */
	.secondary-navigation ul.menu > li.os-nav-ico-login > a .icon-wrapper::before,
	.secondary-navigation ul.menu > li.os-nav-ico-dashboard > a .icon-wrapper::before {
		--os-hdr-icon: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="8" r="4"/><path d="M4 21c0-4 4-6 8-6s8 2 8 6"/></svg>');
	}
	/* Lifebuoy: Support. */
	.secondary-navigation ul.menu > li.os-nav-ico-support > a .icon-wrapper::before {
		--os-hdr-icon: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="9"/><circle cx="12" cy="12" r="3.5"/><path d="M5.6 5.6l3.9 3.9M14.5 14.5l3.9 3.9M18.4 5.6l-3.9 3.9M9.5 14.5l-3.9 3.9"/></svg>');
	}
	/* Signed in with a profile photo: the photo replaces the user icon. */
	.secondary-navigation ul.menu > li.os-nav-ico-dashboard > a.os-hdr-has-avatar .icon-wrapper::before {
		-webkit-mask: none;
		mask: none;
		width: 26px;
		height: 26px;
		border-radius: 50%;
		/* Solid disc first, so a photo file that is missing still leaves a mark. */
		background: var(--os-hdr-avatar) center / cover no-repeat, #9aa3b5;
	}
	/* Card: Checkout. */
	.secondary-navigation ul.menu > li.os-nav-ico-checkout > a .icon-wrapper::before {
		--os-hdr-icon: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><rect x="2" y="5" width="20" height="14" rx="2"/><path d="M2 10h20"/></svg>');
	}
}

/* ---- Support opens in a new tab (d7): visible marker ------------------ */
.secondary-navigation ul.menu > li.os-nav-ico-support > a[target="_blank"]::after {
	content: "\2197";
	content: "\2197" / "";
	margin-left: 3px;
	font-size: 11px;
	opacity: .6;
}

/* ---- Sign up free button in the nav bar (d3) -------------------------- */
a.os-hdr-signup {
	display: none;
	align-items: center;
	align-self: center;
	margin: 0 14px 0 auto;
	padding: 7px 16px;
	border-radius: 999px;
	background: #f5b50a;
	color: #111;
	font-weight: 700;
	font-size: 14px;
	line-height: 1.2;
	text-decoration: none;
	white-space: nowrap;
}
a.os-hdr-signup:hover,
a.os-hdr-signup:focus-visible {
	background: #ffc933;
	color: #111;
}
@media (min-width: 993px) {
	a.os-hdr-signup {
		display: inline-flex;
	}
}
/* The theme gives the basket an automatic left margin too, so the two split the
 * free space and the button floats mid-bar. With the button before it, the
 * basket takes none and the button sits beside it. */
.os-hdr-signup + .site-header-cart {
	margin-left: 0 !important;
}

/* Visually hidden but still read by screen readers. The theme's .screen-reader-text sets
 * visibility:hidden, which hides the text from the accessibility tree as well. */
.os-sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

/* Early access reviewer page (10599): brand teal strong text in the steps list was 2.4:1 on white. Light mode only. */
:root:not([data-tutor-theme="dark"]) .post-10599 .entry-content li a strong {
	color: #0b7a7a;
}

/* ---- Site switcher (DEV-271, UX review _local/ux-jobs-dashboard-20261111 H2) ----
 * "Switch to Jobs" on onlysecurity.com, "Switch to Training" on jobs., just
 * before the account icons. Phones: at the right of the header, name only. */
.os-site-switch {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin: 0 22px 0 auto;
	padding: 7px 14px;
	border: 1px solid #d6dde6;
	border-radius: 999px;
	background: #fff;
	font-size: 14px;
	font-weight: 600;
	line-height: 1;
	color: #1e293b;
	white-space: nowrap;
}
.os-site-switch .lbl {
	color: #64748b;
	font-weight: 500;
}
.os-site-switch a {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	color: #1e293b;
	text-decoration: none;
}
.os-site-switch a:hover,
.os-site-switch a:focus-visible {
	color: #244c87;
	text-decoration: underline;
}
.os-site-switch .arr {
	color: #0e7490;
	font-size: 12px;
}
.os-site-switch .sep {
	width: 1px;
	height: 14px;
	background: #d6dde6;
}
.site-search + .os-site-switch {
	margin-left: 22px;
}
@media (min-width: 993px) {
	/* The account icons push themselves right; with the switcher in front, it does that instead. */
	.os-site-switch + .secondary-navigation {
		margin-left: 0;
	}
}
@media (max-width: 992px) {
	.os-site-switch {
		position: absolute;
		right: 14px;
		top: 50%;
		transform: translateY(-50%);
		margin: 0;
		padding: 7px 11px;
		font-size: 13px;
	}
	.os-site-switch .lbl {
		display: none;
	}
}
@media (max-width: 374px) {
	.os-site-switch {
		right: 8px;
		padding: 6px 8px;
		font-size: 12px;
	}
}

/* ---- Two or more other sites on phones (DEV-585 item I) ----
 * With Jobs and the marketplace the pill covers the logo at 390, so below
 * 600 px it hides and the drawer lists the sites (inc/site-switch.php). */
.os-drawer-sites {
	display: none;
}
@media (max-width: 600px) {
	.os-site-switch--multi {
		display: none;
	}
	.os-drawer-sites {
		display: block;
		margin: 12px 0 0;
		padding: 12px 0 0;
		border-top: 1px solid #e5e7eb;
	}
	.os-drawer-sites__h {
		display: block;
		margin: 0 0 6px;
		font-size: 12px;
		font-weight: 600;
		letter-spacing: .04em;
		text-transform: uppercase;
		color: #64748b;
	}
	.os-drawer-sites ul {
		list-style: none;
		margin: 0;
		padding: 0;
	}
	.os-drawer-sites a {
		display: block;
		padding: 8px 0;
		font-weight: 600;
		color: #1e293b;
		text-decoration: none;
	}
}
