/* RetirementCalculators.uk calculator search. Suite palette: navy #083141, teal #0f766e, slate. */

.rc-search-sr {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	padding: 0 !important;
	margin: -1px !important;
	overflow: hidden !important;
	clip: rect(0, 0, 0, 0) !important;
	white-space: nowrap !important;
	border: 0 !important;
}

/* ---------- header button ---------- */

body .rc-search-trigger {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	min-height: 40px;
	margin: 0 0 0 0.75rem;
	padding: 0.4rem 0.8rem;
	border: 1px solid #cbd5e1;
	border-radius: 999px;
	background: #ffffff;
	color: #083141;
	font: inherit;
	font-size: 0.95rem;
	font-weight: 600;
	line-height: 1;
	cursor: pointer;
	flex-shrink: 0;
	transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}

body .rc-search-trigger:hover,
body .rc-search-trigger:focus-visible {
	border-color: #0f766e;
	color: #0f766e;
	background: #f4f7f8;
}

body .rc-search-trigger:focus-visible {
	outline: 2px solid #0f766e;
	outline-offset: 2px;
}

body .rc-search-trigger .rc-search-icon {
	width: 18px;
	height: 18px;
}

@media (max-width: 781px) {
	body .rc-search-trigger {
		width: 44px;
		height: 44px;
		min-height: 44px;
		padding: 0;
		justify-content: center;
		margin-left: 0.25rem;
		border-color: transparent;
	}
	body .rc-search-trigger__label {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip: rect(0, 0, 0, 0);
	}
	body .rc-search-trigger .rc-search-icon {
		width: 22px;
		height: 22px;
	}
}

/* Header menu: the full menu plus Search does not fit on one row below 1150px, so use the menu button there. */
@media (min-width: 600px) and (max-width: 1149.98px) {
	body header.wp-block-template-part .wp-block-navigation__responsive-container-open:not(.always-shown) {
		display: flex;
	}
	body header.wp-block-template-part .wp-block-navigation__responsive-container:not(.hidden-by-default):not(.is-menu-open) {
		display: none;
	}
}

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

body .rc-search-form {
	position: relative;
	margin: 0;
	width: 100%;
}

body .rc-search-box {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	background: #ffffff;
	border: 2px solid #cbd5e1;
	border-radius: 14px;
	padding: 0 0.5rem 0 1rem;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

body .rc-search-box:focus-within {
	border-color: #0f766e;
	box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.14);
}

body .rc-search-box .rc-search-icon {
	flex-shrink: 0;
	width: 22px;
	height: 22px;
	color: #64748b;
}

body .rc-search-input,
body input[type="search"].rc-search-input {
	flex: 1 1 auto;
	min-width: 0;
	height: 56px;
	margin: 0;
	padding: 0;
	border: 0 !important;
	outline: none !important;
	box-shadow: none !important;
	background: transparent !important;
	color: #0f172a;
	font: inherit;
	font-size: 1.1rem;
	line-height: 1.3;
	-webkit-appearance: none;
	appearance: none;
}

body .rc-search-input::placeholder {
	color: #64748b;
	opacity: 1;
}

body .rc-search-input::-webkit-search-cancel-button {
	-webkit-appearance: none;
}

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

body .rc-search-results {
	margin-top: 0.5rem;
	background: #ffffff;
	border: 1px solid #e2e8f0;
	border-radius: 14px;
	box-shadow: 0 12px 32px rgba(8, 49, 65, 0.14);
	overflow-y: auto;
	overscroll-behavior: contain;
	text-align: left;
}

body .rc-search-results[hidden] {
	display: none !important;
}

body .rc-search-group {
	padding: 0.85rem 1.1rem 0.35rem;
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: #64748b;
}

body a.rc-search-result {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 1rem;
	padding: 0.7rem 1.1rem;
	border-left: 3px solid transparent;
	color: #0f172a;
	text-decoration: none !important;
	cursor: pointer;
}

body a.rc-search-result.is-active,
body a.rc-search-result:focus-visible {
	background: #f4f7f8;
	border-left-color: #0f766e;
	outline: none;
}

body .rc-search-result__main {
	display: flex;
	flex-direction: column;
	gap: 0.15rem;
	min-width: 0;
}

body .rc-search-result__title {
	font-size: 1rem;
	font-weight: 700;
	color: #083141;
	line-height: 1.35;
}

body .rc-search-result__title mark {
	background: transparent;
	color: #0f766e;
	padding: 0;
}

body .rc-search-result__desc {
	font-size: 0.9rem;
	line-height: 1.45;
	color: #475569;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

body .rc-search-result__tag {
	flex-shrink: 0;
	margin-top: 0.15rem;
	padding: 0.2rem 0.55rem;
	border: 1px solid #e2e8f0;
	border-radius: 999px;
	font-size: 0.75rem;
	font-weight: 600;
	color: #475569;
	white-space: nowrap;
	max-width: 12rem;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* Before typing: recently viewed rows and popular tiles. */

body .rc-search-recent {
	padding: 0 0 0.25rem;
}

body a.rc-search-shortcut {
	text-decoration: none !important;
	cursor: pointer;
}

body a.rc-search-shortcut--recent {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 1rem;
	padding: 0.55rem 1.1rem;
	border-left: 3px solid transparent;
}

body a.rc-search-shortcut--recent .rc-search-shortcut__title {
	font-size: 0.98rem;
	font-weight: 600;
	color: #083141;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

body a.rc-search-shortcut--recent .rc-search-shortcut__theme {
	flex-shrink: 0;
	font-size: 0.8rem;
	color: #64748b;
	white-space: nowrap;
}

body a.rc-search-shortcut--recent.is-active,
body a.rc-search-shortcut--recent:focus-visible {
	background: #f4f7f8;
	border-left-color: #0f766e;
	outline: none;
}

body .rc-search-popular {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0.5rem;
	padding: 0.15rem 1.1rem 0.9rem;
}

body a.rc-search-shortcut--popular {
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 0.2rem;
	padding: 0.7rem 0.9rem;
	border: 1px solid #e2e8f0;
	border-radius: 10px;
	background: #ffffff;
	transition: border-color 0.15s ease, background-color 0.15s ease;
}

body a.rc-search-shortcut--popular .rc-search-shortcut__title {
	font-size: 0.95rem;
	font-weight: 700;
	line-height: 1.3;
	color: #083141;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

body a.rc-search-shortcut--popular .rc-search-shortcut__theme {
	font-size: 0.78rem;
	color: #64748b;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

body a.rc-search-shortcut--popular.is-active,
body a.rc-search-shortcut--popular:focus-visible {
	border-color: #0f766e;
	background: #f4f7f8;
	outline: none;
}

body a.rc-search-shortcut--popular.is-active .rc-search-shortcut__title {
	color: #0f766e;
}

@media (max-width: 600px) {
	body a.rc-search-shortcut--recent .rc-search-shortcut__theme {
		display: none;
	}
	body .rc-search-popular {
		gap: 0.4rem;
	}
	body a.rc-search-shortcut--popular {
		justify-content: flex-start;
		padding: 0.65rem 0.75rem;
	}
	body a.rc-search-shortcut--popular .rc-search-shortcut__title {
		font-size: 0.9rem;
		-webkit-line-clamp: 3;
	}
	body a.rc-search-shortcut--popular .rc-search-shortcut__theme {
		white-space: normal;
		line-height: 1.3;
	}
}

body .rc-search-empty {
	padding: 1.1rem 1.1rem 0.4rem;
}

body .rc-search-empty__title {
	margin: 0 0 0.35rem;
	font-weight: 700;
	color: #083141;
}

body .rc-search-empty__text {
	margin: 0;
	font-size: 0.95rem;
	color: #475569;
}

body .rc-search-footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	margin-top: 0.4rem;
	padding: 0.75rem 1.1rem;
	border-top: 1px solid #e2e8f0;
	font-size: 0.9rem;
	color: #64748b;
}

body .rc-search-footer__link {
	margin-left: auto;
	font-weight: 700;
	color: #0f766e !important;
	text-decoration: none !important;
}

body .rc-search-footer__link:hover {
	text-decoration: underline !important;
}

/* ---------- homepage box ---------- */

body .rc-search-hero {
	position: relative;
	z-index: 5;
	max-width: 880px;
	margin: 0 auto clamp(2.25rem, 5vw, 3.5rem);
	padding: clamp(1.5rem, 4vw, 2.5rem) clamp(1rem, 3vw, 2rem);
	background: #ffffff;
	border: 1px solid #dbe3ea;
	border-radius: 20px;
	box-shadow: 0 10px 30px rgba(8, 49, 65, 0.07);
	text-align: center;
	box-sizing: border-box;
}

body .rc-search-hero .rc-search-hero__title {
	margin: 0 0 1.1rem !important;
	font-size: clamp(1.6rem, 3.6vw, 2.25rem);
	font-weight: 700;
	line-height: 1.2;
	color: #083141 !important;
	text-align: center;
}

body .rc-search-hero .rc-search-box {
	border-color: #cbd5e1;
	border-radius: 16px;
	padding: 0 0.45rem 0 1.15rem;
	background: #f8fafc;
}

body .rc-search-hero .rc-search-box:focus-within {
	border-color: #0f766e;
	background: #ffffff;
	box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.14);
}

body .rc-search-hero .rc-search-input {
	height: 66px;
	font-size: 1.2rem;
}

body .rc-search-hero .rc-search-box .rc-search-icon {
	width: 26px;
	height: 26px;
	color: #0f766e;
}

body .rc-search-submit {
	flex-shrink: 0;
	min-height: 52px;
	padding: 0 1.5rem;
	border: 0;
	border-radius: 11px;
	background: #0f766e;
	color: #ffffff;
	font: inherit;
	font-size: 1.05rem;
	font-weight: 700;
	cursor: pointer;
	transition: background-color 0.15s ease;
}

body .rc-search-submit:hover,
body .rc-search-submit:focus-visible {
	background: #0c5f59;
}

body .rc-search-submit:focus-visible {
	outline: 2px solid #0f766e;
	outline-offset: 2px;
}

body .rc-search-hero .rc-search-results {
	position: absolute;
	left: 0;
	right: 0;
	top: 100%;
	max-height: min(60vh, 520px);
	z-index: 20;
}

body .rc-search-chips {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.5rem;
	margin-top: 1.1rem;
}

body .rc-search-chip {
	min-height: 40px;
	padding: 0.45rem 1rem;
	border: 1px solid #cbd5e1;
	border-radius: 999px;
	background: #f4f7f8;
	color: #083141;
	font: inherit;
	font-size: 0.95rem;
	font-weight: 600;
	cursor: pointer;
	transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

body .rc-search-chip:hover,
body .rc-search-chip:focus-visible {
	background: #ffffff;
	border-color: #0f766e;
	color: #0f766e;
}

body .rc-search-chip:focus-visible {
	outline: 2px solid #0f766e;
	outline-offset: 2px;
}

body .rc-search-hero .rc-search-hero__hint {
	margin: 0.9rem 0 0 !important;
	font-size: 0.9rem;
	color: #64748b !important;
	text-align: center;
}

@media (max-width: 600px) {
	body .rc-search-hero {
		border-radius: 16px;
	}
	body .rc-search-hero .rc-search-input {
		height: 56px;
		font-size: 1rem;
	}
	body .rc-search-submit {
		display: none;
	}
	body .rc-search-hero .rc-search-box {
		padding-right: 0.75rem;
	}
	body .rc-search-hero .rc-search-results {
		max-height: 65vh;
	}
	body .rc-search-chips {
		flex-wrap: nowrap;
		justify-content: flex-start;
		overflow-x: auto;
		margin-left: calc(-1 * clamp(1rem, 3vw, 2rem));
		margin-right: calc(-1 * clamp(1rem, 3vw, 2rem));
		padding: 0 clamp(1rem, 3vw, 2rem) 2px;
		scrollbar-width: none;
		-webkit-overflow-scrolling: touch;
	}
	body .rc-search-chips::-webkit-scrollbar {
		display: none;
	}
	body .rc-search-chip {
		flex-shrink: 0;
		white-space: nowrap;
	}
	body .rc-search-hero:has(.rc-search-form.is-open) .rc-search-chips {
		visibility: hidden;
	}
	body .rc-search-result__tag {
		display: none;
	}
}

/* ---------- overlay ---------- */

html.rc-search-lock,
html.rc-search-lock body {
	overflow: hidden !important;
}

body .rc-search-overlay {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	justify-content: center;
	align-items: flex-start;
	padding: 10vh 1rem 1rem;
}

body .rc-search-overlay[hidden] {
	display: none !important;
}

body .rc-search-overlay__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(8, 49, 65, 0.55);
}

body .rc-search-overlay__panel {
	position: relative;
	width: 100%;
	max-width: 680px;
	max-height: 80vh;
	display: flex;
	flex-direction: column;
	padding: 1.25rem;
	background: #f4f7f8;
	border-radius: 18px;
	box-shadow: 0 24px 60px rgba(8, 49, 65, 0.35);
	box-sizing: border-box;
}

body .rc-search-overlay__title {
	margin: 0 0 0.8rem !important;
	font-size: 1.15rem;
	font-weight: 700;
	color: #083141;
}

body .rc-search-overlay .rc-search-form {
	display: flex;
	flex-direction: column;
	min-height: 0;
	flex: 1 1 auto;
}

body .rc-search-overlay .rc-search-results {
	flex: 0 1 auto;
	min-height: 0;
	box-shadow: none;
}

body .rc-search-close {
	flex-shrink: 0;
	min-width: 44px;
	min-height: 36px;
	padding: 0 0.6rem;
	border: 1px solid #cbd5e1;
	border-radius: 8px;
	background: #f8fafc;
	color: #475569;
	font: inherit;
	font-size: 0.8rem;
	font-weight: 700;
	cursor: pointer;
}

body .rc-search-close:hover,
body .rc-search-close:focus-visible {
	border-color: #0f766e;
	color: #0f766e;
}

body .rc-search-overlay__keys {
	margin: 0.8rem 0 0 !important;
	font-size: 0.8rem;
	color: #64748b;
}

body .rc-search-overlay__keys kbd {
	display: inline-block;
	min-width: 1.4em;
	margin: 0 0.15rem;
	padding: 0.05rem 0.35rem;
	border: 1px solid #cbd5e1;
	border-bottom-width: 2px;
	border-radius: 5px;
	background: #ffffff;
	font: inherit;
	font-size: 0.75rem;
	text-align: center;
	color: #334155;
}

@media (max-width: 600px) {
	body .rc-search-overlay {
		padding: 0;
	}
	body .rc-search-overlay__panel {
		max-width: none;
		max-height: none;
		height: 100%;
		border-radius: 0;
		padding: 1rem;
	}
	body .rc-search-overlay__keys {
		display: none;
	}
	body .rc-search-input {
		font-size: 16px;
	}
}

@media (prefers-reduced-motion: reduce) {
	body .rc-search-trigger,
	body .rc-search-box,
	body .rc-search-chip,
	body .rc-search-submit {
		transition: none;
	}
}
