/* Benchmarking: header, menu, footer, mobile and accessibility refinements (2026-11-03), the same set as on
   government-performance in the Benchmarking colours (#363636 dark grey, #ffb400 theme accent). Loaded after the theme
   styles. Mobile <= 979px matches MOBILEBREAKPOINT in custom.js (where the hamburger menu takes over). */

/* ---------- Social icons (Font Awesome, crisp at any pixel density) ---------- */
#socialimg .social-link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	color: #fff;
	font-size: 26px;
	line-height: 1;
	text-decoration: none;
	transition: color 0.15s;
}
#socialimg .social-link:hover,
#socialimg .social-link:focus-visible { color: #ffb400; }

/* ---------- Desktop menu: show which items have a submenu, open it from keyboard/touch too ---------- */
@media (min-width: 980px) {
	.sf-menu > li.menu-item-has-children > a:after {
		content: "";
		display: inline-block;
		margin-left: 6px;
		border: 4px solid transparent;
		border-top-color: currentColor;
		border-bottom: 0;
		vertical-align: middle;
	}
	.sf-menu li:focus-within > ul { display: block; }

	/* Centre the 36px social icons on the menu text (the theme's offset was for the old 22px PNGs). */
	#socialimg { margin-top: 2px; }
}
@media (min-width: 980px) and (max-width: 1399px) {
	/* Below 1400px the menu column is narrower (grid.css); if the menu wraps to a second row, the black bar grows to
	   hold it instead of letting it hang over the page banner. */
	.whiteheader { height: auto; }
}
@media (min-width: 980px) {
	/* 980-1023px had the desktop menu without the sticky styles (those start at 1024px in the theme). */
	#header { position: relative; top: 0; z-index: 25; }
	/* custom.js fixes the header from page load (.stuck) and adds the shadow once the page scrolls (.scrolled).
	   Only the shadow animates: the theme's "transition: all" also tweened width/top when the header got fixed. */
	#header.stuck {
		position: fixed !important;
		z-index: 1000;
		top: 0;
		width: 100% !important;
		background: #fff;
		transition: box-shadow 0.2s;
	}
	#header.stuck:not(.scrolled) { box-shadow: none; }
	/* The theme's ".stuck .sf-menu a { color: #fff }" also whitened the dropdown links on their white background; keep
	   their own colours (layout.css: .sub-menu li a #303133) now that the header is .stuck from page load. */
	#header.stuck .sf-menu .sub-menu li a { color: #303133; }
	#header.stuck .sf-menu .sub-menu li a:hover { color: #ccc; }
	#header.stuck.scrolled { box-shadow: 0 0 6px rgba(0, 0, 0, 0.5); }
	.admin-bar #header.stuck { top: 32px; }
}

/* ---------- Mobile header: one compact sticky row (logo, social links, menu button) ---------- */
@media (max-width: 979px) {
	html { scroll-padding-top: 64px; }
	body { padding-top: 64px; }

	#header {
		position: fixed !important;
		top: 0;
		left: 0;
		right: 0;
		z-index: 1000;
		height: 64px;
		background: #fff;
		box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
	}
	#header .whiteback { height: 64px; }
	#header #navimg {
		min-height: 0 !important;
		margin: 0 !important;
		padding: 6px 0 0 12px;
		width: auto;
	}
	#header #navimg > a { display: block; width: 117px; height: 52px; }
	#header #navimg .logou {
		float: none;
		width: 117px;
		height: 52px;
		margin: 0;
	}
	#header .whiteheader {
		position: absolute;
		top: 0;
		right: 0;
		width: auto;
		height: 64px;
		background: transparent;
	}
	#header .whiteheader:after { display: none; }
	#header .whiteheader > .nfw-row {
		display: flex;
		flex-direction: row-reverse;
		align-items: center;
		width: auto;
		height: 64px;
		margin: 0;
		padding: 0 6px 0 0;
	}
	#header .whiteheader .nfw-span9,
	#header .whiteheader .nfw-span2 {
		float: none;
		width: auto;
		margin: 0;
		padding: 0;
	}
	#header #socialimg { display: flex; gap: 0; }
	#header #socialimg .social-link {
		width: 44px;
		height: 44px;
		color: #363636;
		font-size: 28px;
	}
	#mobile-menu-trigger,
	#header #mobile-menu-trigger {
		position: static;
		display: flex;
		align-items: center;
		justify-content: center;
		width: 48px;
		height: 48px;
		margin: 0;
		padding: 0;
		color: #363636;
		font-size: 28px;
		touch-action: manipulation;
	}

	/* Menu panel under the fixed header; scrolls on its own when taller than the screen. */
	#mobile-menu {
		position: fixed;
		top: 64px;
		left: 0;
		right: 0;
		z-index: 999;
		max-height: calc(100vh - 64px);
		max-height: calc(100dvh - 64px);
		overflow-y: auto;
		-webkit-overflow-scrolling: touch;
		box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
	}
	/* Same dark tone as the desktop menu bar (the theme's amber with white text was 1.7:1 contrast). */
	#mobile-menu { background-color: #1b1b1b; border-bottom: 0; }
	#mobile-menu li a {
		color: #fff;
		font-size: 15px;
		line-height: 20px;
		padding-top: 14px;
		padding-bottom: 14px;
		border-top: 1px solid rgba(255, 255, 255, 0.1);
	}
	#mobile-menu ul { background-color: #262626; }
	#mobile-menu li a:hover,
	#mobile-menu li a:focus-visible { background-color: #363636; color: #fff; }
	#mobile-menu .current-menu-item > a,
	#mobile-menu .current-menu-ancestor > a { box-shadow: inset 4px 0 0 #ffb400; }
	#mobile-menu .mobile-menu-submenu-arrow {
		line-height: 48px;
		color: #fff;
		border-left: 1px solid rgba(255, 255, 255, 0.1);
	}
	#mobile-menu .mobile-menu-submenu-arrow:hover { background-color: #363636; }
	#back-to-top { z-index: 900; }
}

/* ---------- Mobile footer: 44px tap targets, tidy legal row ---------- */
@media (max-width: 767px) {
	#footer-bottom .widget { margin-bottom: 28px; }
	#footer-bottom .widget-title { margin-bottom: 8px; }
	#footer-bottom .footer-list li { margin: 0; line-height: 1.4; }
	#footer-bottom .footer-list a,
	#footer-bottom .textwidget a {
		display: inline-block;
		min-height: 44px;
		padding: 11px 0;
		box-sizing: border-box;
	}
	.bg-footer .copyright { line-height: 1.5; padding: 0 16px 16px; }
	.bg-footer .copyright .copyright-text { display: block; margin-bottom: 8px; }
	.bg-footer .copyright .footer-sep { display: none; }
	.bg-footer .copyright a {
		display: inline-block;
		min-height: 44px;
		padding: 11px 10px;
		box-sizing: border-box;
	}
}

/* ---------- Mobile content: text sizes and 44px tap targets ---------- */
@media (max-width: 979px) {
	/* Blog meta and sidebar were 12-14px; 14px is the floor for secondary text, 16px for headings. */
	.post-meta, .post-meta *, article h6, article h6 *, .blog-post h6, .blog-post h6 *,
	.widget small, article small, .post small { font-size: 14px !important; }
	#content .widget-title, .sidebar .widget-title, aside .widget-title { font-size: 16px; }
	.alert.info strong { font-size: 14px; }
	.blog-post-date small { font-size: 14px; }
	/* Sidebar lists (categories, archives, meta): full-width rows of 44px. */
	#content .widget ul li a { display: inline-block; min-height: 44px; line-height: 44px; }

	/* Form fields and buttons. */
	#content input[type="text"], #content input[type="email"], #content input[type="search"], #content input[type="url"],
	#content input[type="tel"], #content select, .wpcf7 input.wpcf7-text, .wpcf7 input.wpcf7-email,
	#s, #author, #email, #url, #subject { min-height: 44px; font-size: 16px; box-sizing: border-box; }
	#searchsubmit { min-height: 44px; min-width: 44px; }
	#content input[type="checkbox"], #content input[type="radio"] { width: 20px; height: 20px; }
	#content a.btn, .wpb_wrapper a.btn, #content .load-more {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		min-height: 44px;
		box-sizing: border-box;
	}

	/* Small inline links (tags, categories, share icons, slider dots): larger invisible hit area, same look. */
	article .post-meta a, #content h6 a, a[rel="tag"], .post-tags a, .tagcloud a, a.social-icon, .bx-pager-link { position: relative; }
	article .post-meta a:after, #content h6 a:after, a[rel="tag"]:after, .post-tags a:after, .tagcloud a:after, a.social-icon:after, .bx-pager-link:after {
		content: "";
		position: absolute;
		top: 50%;
		left: 50%;
		width: 44px;
		height: 44px;
		min-width: 100%;
		transform: translate(-50%, -50%);
	}

	/* Blog, post, archive, search and 404 templates: the 128px gap was room for the old absolute header. */
	#page-header { margin-top: 0 !important; }
}

/* ---------- Home hero on phones (it was hidden with .hidden-phone, so phones lost the main message) ---------- */
@media (max-width: 767px) {
	.home .fullwidth-section.hidden-phone {
		display: block !important;
		position: relative;
		padding-top: 0 !important;
		padding-bottom: 28px !important;
		background-position: 50% center !important;
	}
	/* The black text sits on the sky between the two towers; a light veil keeps it readable over the buildings. */
	.home .fullwidth-section.hidden-phone:before {
		content: "";
		position: absolute;
		top: 0; right: 0; bottom: 0; left: 0;
		background: rgba(255, 255, 255, 0.6);
	}
	.home .fullwidth-section.hidden-phone > * { position: relative; }
	.home #sub-head .vc_custom_1464696082101 { margin-top: 28px !important; }
	.home #sub-head .head-title { font-size: 22px !important; }
	.home #sub-head .head-join { font-size: 20px !important; }
	.home #sub-head .vc_custom_1464789155771 { margin-top: 20px !important; }
	.home #sub-head .vc_custom_1464789164780 { padding-top: 8px !important; }
	.home #sub-head a.btn {
		float: none !important;
		display: flex;
		width: 100%;
		margin: 0 0 12px !important;
		justify-content: center;
	}
	/* Stats band: on desktop it overlaps the bottom of the hero (-45px) on a half-transparent grey; on phones it is
	   its own solid band (white on the 50% grey over white was 2.3:1), right under the hero. */
	.home .fullwidth-section.vc_custom_1464853607629 {
		margin-top: 0 !important;
		padding: 18px 0 6px;
		background-color: #363636 !important;
	}
	.home .vc_custom_1463753531154 { margin-top: 0 !important; }
	.home .vc_custom_1463753531154 > .wpb_column { margin-bottom: 0; }
	/* One shared grid: numbers right-aligned in a fixed column, labels left-aligned next to them. */
	.home .vc_custom_1463753531154 p {
		display: flex !important;
		align-items: center;
		width: 320px;
		max-width: calc(100vw - 24px);
		height: auto !important;
		margin: 0 0 12px 50%;
		transform: translateX(-50%); /* centred on the screen, not limited by the padded column */
		text-align: left !important;
	}
	.home .vc_custom_1463753531154 p span:first-child {
		flex: 0 0 150px;
		padding-right: 16px !important;
		text-align: right;
		line-height: 1.1;
	}
	.home .vc_custom_1463753531154 p span:last-child { flex: 1; text-align: left; line-height: 1.35; }
}
@media (max-width: 359px) {
	.home .vc_custom_1463753531154 p span:first-child { flex-basis: 120px; padding-right: 12px !important; font-size: 1.6em !important; }
}

/* ---------- Home "Some organisations that participated in our research" on phones: a 2-column logo grid ---------- */
@media (max-width: 767px) {
	.home .vc_custom_1464352417763 .vc_custom_1464352508471,
	.home .vc_custom_1464352417763 .wpb_wrapper > .nfw-row {
		display: flex;
		flex-wrap: wrap;
		margin: 0 !important;
	}
	.home .vc_custom_1464352417763 .wpb_wrapper > .nfw-row:before,
	.home .vc_custom_1464352417763 .wpb_wrapper > .nfw-row:after { display: none; }
	.home .vc_custom_1464352417763 .wpb_wrapper > .nfw-row > .wpb_column {
		width: 50% !important;
		float: none;
		padding: 6px;
		box-sizing: border-box;
	}
	.home .vc_custom_1464352417763 .wpb_single_image { margin: 0; text-align: center; }
	.home .vc_custom_1464352417763 .vc_single_image-wrapper { display: block; }
	.home .vc_custom_1464352417763 img { width: 100%; max-width: 150px; height: auto; margin: 0 auto; }
}

/* ---------- Other mobile layout fixes from the page-by-page review ---------- */
@media (max-width: 767px) {
	/* Contact: offices one under the other (two 46% columns were 150px wide on a phone). */
	.page-id-173 .wpb_text_column div[style*="float: left"] {
		float: none !important;
		width: 100% !important;
		margin-left: 0 !important;
		margin-bottom: 8px;
	}
	.page-id-173 .wpb_text_column div[style*="float: left"] p { padding-top: 16px !important; }
	/* Home sections written right-aligned for the desktop layout read left-aligned on phones. */
	.home #content [style*="text-align: right"] { text-align: left !important; }
	/* Breathing room between stacked images and text. */
	#content .wpb_single_image { margin-top: 16px; margin-bottom: 16px; }
	/* Text lists (History timeline, Research sectors): hanging indent, so wrapped lines start under the text and
	   not under the bullet (the theme puts bullets inside the text box). */
	#content .wpb_text_column ul { list-style-position: outside; padding-left: 20px; }
	#content .wpb_text_column ul li { margin-bottom: 4px; }
}

/* ---------- Contact form ---------- */
/* The "required" message of the acceptance checkbox goes under the whole line instead of splitting
   "I accept the" from "terms and conditions". */
.wpcf7 .wpcf7-form-control-wrap[data-name="checkbox-739"] { position: relative; }
.wpcf7 .wpcf7-form-control-wrap[data-name="checkbox-739"] .wpcf7-not-valid-tip {
	position: absolute;
	top: 100%;
	left: 0;
	margin-top: 6px;
	white-space: nowrap;
}
/* Room for that message above the Send button. */
.wpcf7 p:has([data-name="checkbox-739"] .wpcf7-not-valid-tip) { margin-bottom: 44px; }
/* The response box sat over the floated Send button on desktop. */
.wpcf7 .wpcf7-response-output { clear: both; margin: 16px 0 0; }

/* ---------- SEO headings: the banner title (and the home hero title) became each page's H1 ---------- */
/* Same look as the former div.section-title / p.head-title: body font metrics; their inline styles still apply. */
h1.section-title,
h1.head-title {
	font-family: 'Open Sans', Arial, sans-serif;
	font-size: 14px;
	font-weight: 400;
	line-height: 24px;
	color: #4b4b4b;
	letter-spacing: normal;
}
h1.head-title { margin-top: 0; }

/* ---------- Accessibility and performance ---------- */
/* Footer widget titles are now <h2> (heading order); same look as the theme's #footer-bottom h5. */
#footer-bottom h2.widget-title {
	color: #fff;
	font-size: 18px;
	font-weight: bold;
	line-height: 18px;
	min-height: 37px;
}
/* Links inside running text were told apart by colour alone; underline them. */
#content p a:not(.btn),
#content li a:not(.btn) { text-decoration: underline; text-underline-offset: 2px; }
/* Footer legal links sit inside the copyright sentence: underline them too. */
#footer-bottom .copyright a, .bg-footer .copyright a { text-decoration: underline; text-underline-offset: 2px; }
/* Icon font: show the page text at once instead of waiting for the icons. */
@font-face {
	font-family: 'FontAwesome';
	src: url('fontawesome/font/fontawesome-webfont.woff?v=4.2.0-swap') format('woff'); /* own URL, so this rule is the one used */
	font-weight: normal;
	font-style: normal;
	font-display: swap;
}
/* Required-field markers and the acceptance label: #ff0000 was 4.0:1 on white, #d40000 is 5.5:1. */
label span { color: #d40000; }

/* Grey "Sign up now" / "Read more" buttons (.btn.alt): white on #999 was 2.8:1; #767676 is the lightest grey with 4.5:1.
   Hover goes darker instead of lighter (#bebebe was 1.8:1). */
.btn.alt,
.parallax.full-screen .btn.alt { background-color: #767676; }
.btn.alt:hover { background-color: #5c5c5c; }

/* Contact form acceptance on phones: the label (checkbox + "I accept the") is the tap target; 44px tall. */
@media (max-width: 979px) {
	.wpcf7 .wpcf7-list-item label { display: inline-flex; align-items: center; min-height: 44px; }
}
