/**
 * WRC global site search — nav icon and full-screen overlay.
 */

:root {
	--wrc-blue:  #094E9C;
	--wrc-cyan:  #09AEEF;
	--wrc-green: #A9CC4F;
	--wrc-grey:  #858585;
	--wrc-pale:  #EDFAFF;
}

/* ==========================================================================
 * Nav icon
 * ========================================================================== */

.wrc-search-item {
	display: flex;
	align-items: center;
}

.wrc-search-toggle {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	padding: 8px 12px;
	border: 0;
	background: transparent;
	color: inherit;          /* inherit the menu's colour scheme */
	font: inherit;
	line-height: 1;
	cursor: pointer;
	transition: color 0.18s ease, opacity 0.18s ease;
}

.wrc-search-toggle:hover,
.wrc-search-toggle:focus-visible {
	color: var( --wrc-cyan );
	opacity: 1;
}

.wrc-search-toggle svg {
	display: block;
	flex: 0 0 auto;
}

/* The word "Search" is redundant next to the icon on desktop, but useful in
   the stacked mobile menu where icons alone are ambiguous. */
.wrc-search-toggle__label {
	display: none;
	font-size: 0.9em;
}

@media ( max-width: 1024px ) {
	.wrc-search-toggle {
		padding: 12px 16px;
	}

	.wrc-search-toggle__label {
		display: inline;
	}
}

/* ==========================================================================
 * Overlay
 * ========================================================================== */

.wrc-gsearch {
	position: fixed;
	inset: 0;
	z-index: 100001;
	display: flex;
	align-items: flex-start;
	justify-content: center;
	padding: 8vh 20px 20px;
	background: rgba( 9, 30, 56, 0.72 );
	backdrop-filter: blur( 3px );
	-webkit-backdrop-filter: blur( 3px );
}

.wrc-gsearch[hidden] {
	display: none;
}

.wrc-gsearch__panel {
	position: relative;
	display: flex;
	flex-direction: column;
	width: min( 780px, 100% );
	max-height: 84vh;
	background: #fff;
	border-radius: 14px;
	box-shadow: 0 26px 70px rgba( 0, 0, 0, 0.35 );
	overflow: hidden;
}

.wrc-gsearch .wrc-gsearch__close {
	position: absolute;
	top: 10px;
	right: 12px;
	width: 36px !important;
	height: 36px !important;
	min-width: 0 !important;
	padding: 0 !important;
	display: flex !important;
	align-items: center;
	justify-content: center;
	border: 1px solid #d8e0e8 !important;
	border-radius: 50% !important;
	background: #fff !important;
	background-image: none !important;
	color: var( --wrc-blue ) !important;
	font-size: 24px !important;
	font-weight: 400 !important;
	line-height: 1 !important;
	text-indent: 0 !important;
	box-shadow: none !important;
	cursor: pointer;
}

.wrc-gsearch .wrc-gsearch__close:hover,
.wrc-gsearch .wrc-gsearch__close:focus-visible {
	background: var( --wrc-pale ) !important;
}

/* ------------------------------------------------------------------- form */

.wrc-gsearch__form {
	display: flex;
	align-items: stretch;
	gap: 10px;
	padding: 22px 60px 18px 22px;
	border-bottom: 1px solid #e6ebf0;
}

.wrc-gsearch .wrc-gsearch__input {
	flex: 1 1 auto;
	min-width: 0;             /* lets the field shrink inside the flex row */
	padding: 13px 16px !important;
	border: 1px solid #d8e0e8 !important;
	border-radius: 8px !important;
	font-size: 16px !important;   /* 16px avoids the iOS focus zoom */
	font-family: inherit !important;
	color: #1d2b3a !important;
	background: #fff !important;
	box-shadow: none !important;
}

.wrc-gsearch__input:focus {
	outline: none;
	border-color: var( --wrc-cyan );
	box-shadow: 0 0 0 3px rgba( 9, 174, 239, 0.18 );
}

.wrc-gsearch .wrc-gsearch__submit {
	flex: 0 0 auto;
	width: auto !important;
	min-width: 0 !important;
	padding: 0 22px !important;
	border: 0 !important;
	border-radius: 8px !important;
	background: var( --wrc-blue ) !important;
	background-image: none !important;
	color: #fff !important;
	font-family: inherit !important;
	font-size: 0.9rem !important;
	font-weight: 600 !important;
	line-height: 1 !important;
	letter-spacing: normal !important;
	text-indent: 0 !important;
	box-shadow: none !important;
	cursor: pointer;
	transition: background-color 0.18s ease;
}

.wrc-gsearch .wrc-gsearch__submit:hover,
.wrc-gsearch .wrc-gsearch__submit:focus-visible {
	background: var( --wrc-cyan ) !important;
}

/* ---------------------------------------------------------------- results */

.wrc-gsearch__results {
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
}

.wrc-gsearch__group + .wrc-gsearch__group {
	border-top: 1px solid #eef1f4;
}

.wrc-gsearch .wrc-gsearch__group-title {
	margin: 0 !important;
	padding: 14px 22px 7px !important;
	font-size: 11px !important;
	line-height: 1.4 !important;
	font-weight: 700 !important;
	letter-spacing: 0.09em !important;
	text-transform: uppercase !important;
	color: var( --wrc-grey ) !important;
}

.wrc-gsearch .wrc-gsearch__item {
	display: flex !important;
	align-items: baseline;
	justify-content: space-between;
	gap: 14px;
	padding: 10px 22px !important;
	color: #1d2b3a !important;
	font-size: 0.94rem !important;
	font-weight: 500 !important;
	line-height: 1.4 !important;
	text-decoration: none !important;
	text-transform: none !important;
	transition: background-color 0.14s ease;
}

.wrc-gsearch .wrc-gsearch__item:hover,
.wrc-gsearch .wrc-gsearch__item:focus-visible {
	background: var( --wrc-pale ) !important;
	color: var( --wrc-blue ) !important;
	text-decoration: none !important;
}

.wrc-gsearch__item-title {
	flex: 1 1 auto;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	overflow-wrap: anywhere;
}

.wrc-gsearch .wrc-gsearch__item-meta {
	flex: 0 0 auto;
	font-size: 11px !important;
	font-weight: 600 !important;
	letter-spacing: 0.03em !important;
	text-transform: uppercase !important;
	color: var( --wrc-grey ) !important;
	white-space: nowrap;
}

.wrc-gsearch .wrc-gsearch__all {
	display: block;
	padding: 13px 22px !important;
	border-top: 1px solid #eef1f4;
	background: #fafbfc !important;
	font-size: 13px !important;
	font-weight: 600 !important;
	text-transform: none !important;
	color: var( --wrc-blue ) !important;
	text-decoration: none !important;
}

.wrc-gsearch__all:hover,
.wrc-gsearch__all:focus-visible {
	background: var( --wrc-pale );
	text-decoration: underline;
}

.wrc-gsearch .wrc-gsearch__status {
	margin: 0 !important;
	font-size: 0.92rem !important;
	padding: 22px !important;
	color: var( --wrc-grey ) !important;
}

.wrc-gsearch__status--error {
	color: #b3261e;
}

/* ----------------------------------------------------------------- mobile */

@media ( max-width: 767px ) {
	.wrc-gsearch {
		padding: 0;
	}

	.wrc-gsearch__panel {
		width: 100%;
		height: 100%;
		max-height: 100%;
		border-radius: 0;
	}

	.wrc-gsearch__form {
		flex-wrap: wrap;
		padding: 18px 54px 14px 16px;
	}

	.wrc-gsearch .wrc-gsearch__submit {
		padding: 12px 22px !important;
	}

	.wrc-gsearch .wrc-gsearch__item,
	.wrc-gsearch .wrc-gsearch__group-title,
	.wrc-gsearch .wrc-gsearch__all,
	.wrc-gsearch .wrc-gsearch__status {
		padding-left: 16px !important;
		padding-right: 16px !important;
	}

	.wrc-gsearch .wrc-gsearch__item {
		/* Stack the type label under the title rather than squeezing it. */
		flex-direction: column;
		gap: 3px;
		align-items: flex-start;
	}
}
