/*
 * Thames College – site header (header-transparent.php).
 * Values from Figma "Thames Collage Web Sections" → Home page redesign 2026:
 *   desktop 1920 × 116, content row 1668 px centred · mobile 393 × 70, 24 px side padding.
 * Everything is scoped to header.tch so the old theme header CSS cannot leak in.
 * Note: no transform / filter on the header – the login popup inside it is position:fixed.
 */

header.tch {
	--tch-bg: #273c66;
	--tch-blue: #1480e4;
	--tch-blue-dark: #0f6cc4;
	--tch-icon: #227bc4;
	--tch-ring: #dbdbdb;
	--tch-badge: #ff9c31;
	--tch-hover: #b9d6ff;
	--tch-h: 116px;

	display: block;
	position: absolute; /* Same flow as the previous header: pages already reserve space under it. */
	float: none;
	width: 100%;
	height: var(--tch-h);
	margin: 0;
	padding: 0;
	background: var(--tch-bg);
	z-index: 99;
	transition: none;
	font-family: "Nunito Sans", "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
	-webkit-font-smoothing: antialiased;
}

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

header.tch .screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

header.tch a {
	text-decoration: none;
}

header.tch a:focus-visible,
header.tch button:focus-visible,
header.tch input:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 2px;
}

/* ---------- Bar ---------- */

.tch__bar {
	display: flex;
	align-items: center;
	width: min(1668px, calc(100% - 48px));
	height: 100%;
	margin: 0 auto;
}

.tch__brand {
	flex: 0 0 auto;
	margin: 0;
	padding: 0;
	line-height: 0;
	font-size: 0;
}

.tch__logo {
	display: block;
}

.tch__logo img {
	display: block;
	width: 76px;
	height: 76px;
	max-width: none;
	padding: 0;
	object-fit: contain;
}

/* Desktop: the menu wrapper disappears and its children sit in the bar. */
.tch__menu {
	display: contents;
}

.tch__menu-auth {
	display: none;
}

/* ---------- Search (270 × 40, radius 7, padding 7 24 8 12, gap 16) ---------- */

.tch__search {
	position: relative;
	flex: 0 0 auto;
	width: 270px;
	margin: 0 0 0 118px;
	padding: 0;
}

.tch__search-form {
	display: flex;
	align-items: center;
	gap: 16px;
	width: 100%;
	height: 40px;
	margin: 0;
	padding: 7px 24px 8px 12px;
	background: #fff;
	border: 0;
	border-radius: 7px;
}

.tch__search-icon {
	flex: 0 0 17px;
	color: var(--tch-icon);
}

header.tch .tch__search input[type="search"] {
	flex: 1 1 auto;
	width: 100%;
	min-width: 0;
	height: auto;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: transparent;
	box-shadow: none;
	outline: 0;
	font-family: inherit;
	font-size: 14px;
	font-weight: 400;
	line-height: 1.2;
	color: #1f2937;
	-webkit-appearance: none;
	appearance: none;
}

header.tch .tch__search input[type="search"]::-webkit-search-cancel-button {
	-webkit-appearance: none;
}

header.tch .tch__search input::placeholder {
	color: #6b6b6f;
	opacity: 1;
}

.tch__search-form:focus-within {
	box-shadow: 0 0 0 2px var(--tch-hover);
}

/* Live course search dropdown (includes/course-search). */
header.tch .tch__search .wplms-ls-box {
	position: absolute;
	top: calc(100% + 8px);
	left: 0;
	z-index: 40;
	width: 100%;
	min-width: 340px;
	padding: 12px 15px;
	background: #fff;
	border-radius: 8px;
	box-shadow: 0 12px 32px rgba(15, 30, 61, .2);
	text-transform: none;
}

/* ---------- Main menu (gap 32, Nunito Sans 600 16 uppercase) ---------- */

header.tch .tch__nav { /* The parent theme hides "header nav" on small screens. */
	display: block;
	flex: 0 1 auto;
	align-self: stretch;
	min-width: 0;
	margin-left: auto;
	padding-left: 32px;
}

header.tch .tch__links {
	display: flex;
	align-items: stretch;
	gap: 32px;
	height: 100%;
	margin: 0;
	padding: 0;
	list-style: none;
}

header.tch .tch__links > li {
	position: relative;
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0;
	padding: 0;
	list-style: none;
	float: none;
}

header.tch .tch__links > li > a {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 0;
	color: #fff;
	font-family: inherit;
	font-size: 16px;
	font-weight: 600;
	line-height: 1;
	letter-spacing: 0;
	text-transform: uppercase;
	white-space: nowrap;
	background: none;
	transition: color .15s ease;
}

header.tch .tch__links a strong {
	font-weight: inherit;
}

/* The theme draws borders on menu items; this menu has none. */
header.tch .tch__links li,
header.tch .tch__links a {
	border: 0;
}

header.tch .tch__links li::before,
header.tch .tch__links li::after,
header.tch .tch__links .sub-menu::before,
header.tch .tch__links .sub-menu::after {
	display: none;
}

header.tch .tch__links > li > a:hover,
header.tch .tch__links > li:hover > a,
header.tch .tch__links > li.current-menu-item > a,
header.tch .tch__links > li.current-menu-ancestor > a {
	color: var(--tch-hover);
}

.tch__sub-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 16px;
	height: 16px;
	margin: 0 0 0 -3px; /* 10px gap to the chevron, as in Figma. */
	padding: 0;
	border: 0;
	background: none;
	color: #fff;
	cursor: pointer;
	transition: transform .2s ease, color .15s ease;
}

header.tch .tch__links > li:hover > .tch__sub-toggle {
	color: var(--tch-hover);
}

header.tch .tch__links > li.is-open > .tch__sub-toggle {
	transform: rotate(180deg);
}

/* Desktop dropdown */
header.tch .tch__links .sub-menu {
	position: absolute;
	top: 100%;
	left: -16px;
	z-index: 20;
	display: block;
	min-width: 240px;
	margin: 0;
	padding: 8px;
	list-style: none;
	background: #fff;
	border-radius: 8px;
	box-shadow: 0 12px 32px rgba(15, 30, 61, .18);
	opacity: 0;
	visibility: hidden;
	transform: none;
	transition: opacity .15s ease, visibility 0s linear .15s;
}

header.tch .tch__links > li:hover > .sub-menu,
header.tch .tch__links > li:focus-within > .sub-menu,
header.tch .tch__links > li.is-open > .sub-menu {
	opacity: 1;
	visibility: visible;
	transition-delay: 0s;
}

header.tch .tch__links .sub-menu li {
	display: block;
	margin: 0;
	padding: 0;
	float: none;
}

header.tch .tch__links .sub-menu a {
	display: block;
	padding: 10px 14px;
	border-radius: 6px;
	color: var(--tch-bg);
	font-size: 15px;
	font-weight: 600;
	line-height: 1.3;
	text-transform: none;
	white-space: nowrap;
	background: none;
}

header.tch .tch__links .sub-menu a:hover,
header.tch .tch__links .sub-menu a:focus-visible,
header.tch .tch__links .sub-menu .current-menu-item > a {
	background: #f0f5ff;
	color: var(--tch-blue);
	outline: 0;
}

/* ---------- Right side: cart (59 frame, 38 ring), 24 gap, Log in 96 × 42, 24 gap, Sign Up 108 × 42 ---------- */

.tch__actions {
	display: flex;
	align-items: center;
	flex: 0 0 auto;
	gap: 24px;
	margin-left: 28px;
}

.tch__cart {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 59px;
	height: 59px;
	color: #fff;
	cursor: pointer;
}

.tch__cart-ring {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	border: 1px solid var(--tch-ring);
	border-radius: 50%;
	transition: background-color .15s ease;
}

.tch__cart:hover .tch__cart-ring {
	background: rgba(255, 255, 255, .1);
}

header.tch .tch__count {
	position: absolute;
	top: 2px;
	left: 40px;
	display: flex;
	align-items: center;
	justify-content: center;
	min-width: 17px;
	height: 17px;
	padding: 0 4px;
	border-radius: 9px;
	background: var(--tch-badge);
	color: #fff;
	font-family: Roboto, "Nunito Sans", Arial, sans-serif;
	font-size: 9px;
	font-weight: 800;
	line-height: 1;
	text-transform: uppercase;
}

header.tch .tch__count[hidden] {
	display: none;
}

.tch__account {
	position: relative;
	display: flex;
	align-items: center;
	gap: 24px;
}

header.tch .tch-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: 42px;
	margin: 0;
	padding: 0 24px;
	border: 1px solid transparent;
	border-radius: 7px;
	color: #fff;
	font-family: "Work Sans", "Nunito Sans", Arial, sans-serif;
	font-size: 16px;
	font-weight: 500;
	line-height: 1;
	letter-spacing: 0;
	text-transform: none;
	white-space: nowrap;
	cursor: pointer;
	transition: background-color .15s ease, border-color .15s ease;
}

header.tch .tch-btn--ghost {
	border-color: #fff;
	background: transparent;
}

header.tch .tch-btn--ghost:hover {
	background: rgba(255, 255, 255, .1);
	color: #fff;
}

header.tch .tch-btn--solid {
	background: var(--tch-blue);
}

header.tch .tch-btn--solid:hover {
	background: var(--tch-blue-dark);
	color: #fff;
}

.tch-btn__short {
	display: none;
}

/* Logged-in account button (same height and radius as the buttons it replaces). */
header.tch .tch__user {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	height: 42px;
	max-width: 220px;
	padding: 0 14px 0 4px;
	border: 1px solid rgba(255, 255, 255, .5);
	border-radius: 7px;
	color: #fff;
	font-family: "Work Sans", "Nunito Sans", Arial, sans-serif;
	font-size: 16px;
	font-weight: 500;
	line-height: 1;
	transition: background-color .15s ease;
}

header.tch .tch__user:hover,
header.tch .tch__user[aria-expanded="true"] {
	background: rgba(255, 255, 255, .1);
	color: #fff;
}

.tch__avatar {
	flex: 0 0 32px;
	width: 32px;
	height: 32px;
	overflow: hidden;
	border-radius: 50%;
	background: rgba(255, 255, 255, .2);
}

header.tch .tch__avatar img {
	display: block;
	width: 100%;
	height: 100%;
	margin: 0;
	border: 0;
	border-radius: 50%;
	object-fit: cover;
}

.tch__user-name {
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.tch__user-chev {
	flex: 0 0 auto;
}

/* Logged-in account menu (theme template login/pop_login.php → #sidebar-me). */
header.tch.tch--in #vibe_bp_login {
	top: calc(100% + 14px);
	right: 0;
	width: 260px;
	padding: 0;
	overflow: hidden;
	background: #fff;
	border-radius: 10px;
	box-shadow: 0 16px 40px rgba(15, 30, 61, .22);
	text-transform: none;
	font-family: "Nunito Sans", Arial, sans-serif;
}

header.tch.tch--in #vibe_bp_login::after {
	display: none;
}

header.tch.tch--in #vibe_bp_login #sidebar-me {
	padding: 0;
	background: #fff;
}

header.tch.tch--in #vibe_bp_login #bpavatar {
	float: left;
	width: 48px;
	height: 48px;
	margin: 16px 12px 16px 16px;
	overflow: hidden;
	border-radius: 50%;
}

header.tch.tch--in #vibe_bp_login #bpavatar img {
	width: 48px;
	height: 48px;
	margin: 0;
	border-radius: 50%;
	object-fit: cover;
}

header.tch.tch--in #vibe_bp_login ul {
	margin: 0;
	padding: 0;
	list-style: none;
	background: #fff;
}

header.tch.tch--in #vibe_bp_login #bpavatar + ul {
	min-height: 80px;
	padding: 16px 16px 16px 0;
	background: transparent;
}

header.tch.tch--in #vibe_bp_login ul li {
	float: none;
	display: block;
	width: auto;
	margin: 0;
	padding: 0;
	border: 0;
}

header.tch.tch--in #vibe_bp_login ul li a {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 4px 0;
	color: var(--tch-bg);
	font-size: 14px;
	font-weight: 600;
	line-height: 1.35;
	text-transform: none;
	background: none;
}

header.tch.tch--in #vibe_bp_login #bpavatar + ul li#username a {
	font-size: 16px;
	font-weight: 700;
}

header.tch.tch--in #vibe_bp_login #bpavatar + ul li#vbplogout a {
	color: #d93025;
	font-size: 13px;
}

header.tch.tch--in #vibe_bp_login ul + ul {
	clear: both;
	padding: 8px;
	border-top: 1px solid #e5eaf3;
}

header.tch.tch--in #vibe_bp_login ul + ul li a {
	padding: 10px 12px;
	border-radius: 6px;
	text-transform: none;
	font-size: 15px;
}

header.tch.tch--in #vibe_bp_login ul + ul li a:hover,
header.tch.tch--in #vibe_bp_login #bpavatar + ul li a:hover {
	color: var(--tch-blue);
}

header.tch.tch--in #vibe_bp_login ul + ul li a:hover {
	background: #f0f5ff;
}

header.tch.tch--in #vibe_bp_login ul li a i {
	width: 18px;
	color: var(--tch-icon);
	text-align: center;
}

header.tch.tch--in #vibe_bp_login span {
	margin-left: auto;
	padding: 2px 7px;
	border-radius: 10px;
	background: var(--tch-badge) !important;
	color: #fff !important;
	font-size: 11px;
}

header.tch.tch--in #vibe_bp_login li#admin_panel_icon {
	position: absolute;
	top: 12px;
	right: 12px;
}

/* ---------- Hamburger (hidden on desktop) ---------- */

.tch__toggle {
	display: none;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	width: 28px;
	height: 28px;
	margin: 0;
	padding: 0;
	border: 1px solid #fff;
	border-radius: 50%;
	background: var(--tch-bg);
	color: #fff;
	cursor: pointer;
}

.tch__toggle-lines {
	position: relative;
	display: block;
	width: 12px;
	height: 10px;
}

.tch__toggle-lines span {
	position: absolute;
	left: 0;
	width: 100%;
	height: 1.5px;
	border-radius: 2px;
	background: currentColor;
	transition: transform .2s ease, opacity .2s ease, top .2s ease;
}

.tch__toggle-lines span:nth-child(1) { top: 0; }
.tch__toggle-lines span:nth-child(2) { top: 4.25px; }
.tch__toggle-lines span:nth-child(3) { top: 8.5px; }

.tch__toggle[aria-expanded="true"] .tch__toggle-lines span:nth-child(1) { top: 4.25px; transform: rotate(45deg); }
.tch__toggle[aria-expanded="true"] .tch__toggle-lines span:nth-child(2) { opacity: 0; }
.tch__toggle[aria-expanded="true"] .tch__toggle-lines span:nth-child(3) { top: 4.25px; transform: rotate(-45deg); }

/* ================================================================
 * Smaller desktops
 * ============================================================== */

@media (max-width: 1600px) {
	.tch__search { margin-left: 56px; }
	header.tch .tch__links { gap: 24px; }
	.tch__nav { padding-left: 24px; }
	.tch__actions { margin-left: 20px; gap: 16px; }
	.tch__account { gap: 14px; }
}

@media (max-width: 1520px) {
	header.tch { --tch-h: 96px; }
	.tch__logo img { width: 64px; height: 64px; }
	.tch__search { width: 220px; margin-left: 32px; }
	.tch__search-form { height: 38px; padding-right: 14px; gap: 12px; }
	header.tch .tch__links { gap: 18px; }
	header.tch .tch__links > li,
	header.tch .tch__links > li > a { gap: 6px; }
	header.tch .tch__links > li > a { font-size: 14px; }
	.tch__nav { padding-left: 18px; }
	.tch__actions { margin-left: 14px; gap: 10px; }
	.tch__cart { width: 44px; height: 44px; }
	header.tch .tch__count { left: 28px; top: -1px; }
	.tch__account { gap: 10px; }
	header.tch .tch-btn,
	header.tch .tch__user { height: 38px; font-size: 14px; }
	header.tch .tch-btn { padding: 0 18px; }
	header.tch .tch__user { max-width: 180px; }
	.tch__avatar { flex-basis: 28px; width: 28px; height: 28px; }
}

@media (max-width: 1360px) {
	.tch__search { width: 180px; margin-left: 24px; }
	header.tch .tch__links { gap: 14px; }
	header.tch .tch__links > li > a { font-size: 13px; }
	header.tch .tch-btn { padding: 0 14px; }
	.tch__user-name { display: none; }
}

/* ================================================================
 * Tablet & mobile: menu button + dropdown panel
 * Figma mobile: 393 × 70, padding 7 / 24, logo 55 × 56,
 * cart 32, LOGIN pill 67 × 28 (Poppins 13), menu button 28, gap 8.
 * ============================================================== */

@media (max-width: 1279px) {
	header.tch { --tch-h: 70px; }

	.tch__bar { width: calc(100% - 48px); }

	.tch__logo img { width: 55px; height: 56px; }

	.tch__actions {
		gap: 8px;
		margin-left: auto;
	}

	.tch__cart { width: 32px; height: 32px; }
	.tch__cart-ring { width: 32px; height: 32px; }
	.tch__cart-ring svg { width: 15px; height: 15px; }
	header.tch .tch__count { top: -5px; left: auto; right: -5px; min-width: 15px; height: 15px; font-size: 8px; padding: 0 3px; }

	.tch__account { gap: 8px; }

	header.tch .tch-btn--signup { display: none; }

	header.tch .tch-btn--login {
		height: 28px;
		padding: 0 14px;
		border-radius: 42px;
		font-family: Poppins, "Nunito Sans", Arial, sans-serif;
		font-size: 13px;
		font-weight: 400;
		text-transform: uppercase;
	}

	.tch-btn--login .tch-btn__long { display: none; }
	.tch-btn--login .tch-btn__short { display: inline; }

	header.tch .tch__user {
		width: 32px;
		height: 32px;
		padding: 0;
		border: 1px solid #fff;
		border-radius: 50%;
		justify-content: center;
	}

	header.tch .tch__user .tch__avatar { flex-basis: 30px; width: 30px; height: 30px; }
	.tch__user-name,
	.tch__user-chev { display: none; }

	/* Align the account menu with the bar's right edge (menu button 28 + gap 8) and the header's bottom edge. */
	header.tch.tch--in #vibe_bp_login { top: calc(100% + 19px); right: -36px; width: min(260px, calc(100vw - 32px)); }

	.tch__toggle { display: inline-flex; }

	/* Dropdown panel */
	.tch__menu {
		position: absolute;
		top: 100%;
		left: 0;
		right: 0;
		z-index: 30;
		display: none;
		flex-direction: column;
		gap: 8px;
		max-height: calc(100vh - var(--tch-h));
		max-height: calc(100dvh - var(--tch-h));
		overflow-y: auto;
		overscroll-behavior: contain;
		padding: 16px 24px 24px;
		background: var(--tch-bg);
		border-top: 1px solid rgba(255, 255, 255, .12);
		box-shadow: 0 12px 24px rgba(0, 0, 0, .18);
	}

	header.tch.is-menu-open .tch__menu { display: flex; }

	.tch__search { width: 100%; margin: 0 0 8px; }
	.tch__search-form { height: 44px; padding: 0 14px; }
	header.tch .tch__search input[type="search"] { font-size: 16px; } /* 16px stops iOS zooming in. */
	header.tch .tch__search .wplms-ls-box { min-width: 0; }

	.tch__nav { align-self: auto; margin: 0; padding: 0; }

	header.tch .tch__links {
		flex-direction: column;
		align-items: stretch;
		gap: 0;
		height: auto;
	}

	header.tch .tch__links > li {
		flex-wrap: wrap;
		align-items: center;
		gap: 0;
		border-bottom: 1px solid rgba(255, 255, 255, .1);
	}

	header.tch .tch__links > li > a {
		flex: 1 1 auto;
		min-height: 48px;
		padding: 14px 4px;
		font-size: 15px;
		white-space: normal;
	}

	.tch__sub-toggle {
		width: 44px;
		height: 44px;
		margin: 0 -10px 0 0;
	}

	header.tch .tch__links .sub-menu {
		position: static;
		display: none;
		flex: 0 0 100%;
		min-width: 0;
		margin: 0 0 10px;
		padding: 4px 0 4px 12px;
		background: transparent;
		border-left: 2px solid rgba(255, 255, 255, .18);
		border-radius: 0;
		box-shadow: none;
		opacity: 1;
		visibility: visible;
		transition: none;
	}

	header.tch .tch__links > li:hover > .sub-menu,
	header.tch .tch__links > li:focus-within > .sub-menu { display: none; }
	header.tch .tch__links > li.is-open > .sub-menu { display: block; }

	header.tch .tch__links .sub-menu a {
		padding: 10px 8px;
		color: #fff;
		font-size: 14px;
		white-space: normal;
	}

	header.tch .tch__links .sub-menu a:hover,
	header.tch .tch__links .sub-menu a:focus-visible,
	header.tch .tch__links .sub-menu .current-menu-item > a {
		background: rgba(255, 255, 255, .08);
		color: var(--tch-hover);
	}

	.tch__menu-auth {
		display: flex;
		gap: 12px;
		margin-top: 16px;
	}

	header.tch .tch__menu-auth .tch-btn {
		flex: 1 1 0;
		height: 44px;
		font-size: 15px;
	}
}

@media (max-width: 360px) {
	.tch__bar { width: calc(100% - 32px); }
	.tch__logo img { width: 46px; height: 47px; }
	header.tch .tch-btn--login { padding: 0 10px; }
	.tch__menu { padding-left: 16px; padding-right: 16px; }
	.tch__menu-auth { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
	header.tch *,
	header.tch *::before,
	header.tch *::after {
		transition: none !important;
	}
}
