.search-modal {
	position: fixed;
	inset: 0;
	z-index: 200;
	display: flex;
	align-items: flex-start;
	justify-content: center;
	padding: clamp(1rem, 4vw, 2rem);
}

.search-modal[hidden] {
	display: none;
}

.search-modal__overlay {
	position: absolute;
	inset: 0;
	background: rgba(38, 43, 74, 0.72);
}

.search-modal__dialog {
	position: relative;
	width: min(100%, 40rem);
	margin-top: clamp(3rem, 12vh, 6rem);
	padding: clamp(1.5rem, 4vw, 2rem);
	border-radius: 1rem;
	background: #ffffff;
	box-shadow: 0 1.5rem 3rem rgba(38, 43, 74, 0.24);
	color: var(--hr-color-nav, #262b4a);
}

.search-modal__close {
	position: absolute;
	top: 1rem;
	right: 1rem;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.5rem;
	height: 2.5rem;
	padding: 0;
	border: 0;
	border-radius: 999px;
	background: transparent;
	color: inherit;
	cursor: pointer;
	transition: color 0.2s ease, background-color 0.2s ease;
}

.search-modal__close:hover,
.search-modal__close:focus-visible {
	background: rgba(38, 43, 74, 0.08);
	color: var(--hr-color-accent, #A32D59);
}

.search-modal__close-icon {
	display: inline-flex;
	width: 1.25rem;
	height: 1.25rem;
}

.search-modal__close-icon svg {
	display: block;
	width: 100%;
	height: 100%;
}

.search-modal__title {
	margin: 0 2.5rem 1.25rem 0;
	font-size: clamp(1.5rem, 3vw, 2rem);
	font-weight: 600;
	line-height: 1.2;
}

.search-modal__form {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
}

.search-modal__input {
	width: 100%;
	padding: 0.875rem 1rem;
	border: 1px solid rgba(38, 43, 74, 0.16);
	border-radius: 999px;
	background: #ffffff;
	box-shadow: 0 1px 2px rgba(38, 43, 74, 0.08);
	color: inherit;
	font: inherit;
}

.search-modal__input::placeholder {
	color: #9aa0b5;
}

.search-modal__input:focus-visible {
	outline: 2px solid var(--hr-color-accent, #A32D59);
	outline-offset: -2px;
}

.search-modal__submit {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	align-self: flex-start;
	padding: 0.875rem 2.5rem;
	border: 0;
	border-radius: 999px;
	background: var(--hr-gradient-accent);
	color: #ffffff;
	font: inherit;
	font-weight: 600;
	cursor: pointer;
	transition: filter 0.2s ease, box-shadow 0.2s ease;
}

.search-modal__submit:hover,
.search-modal__submit:focus-visible {
	filter: brightness(1.1);
	box-shadow: var(--hr-shadow-accent);
}

.search-modal__submit-icon {
	display: inline-flex;
	width: 1.125rem;
	height: 1.125rem;
}

.search-modal__submit-icon svg {
	display: block;
	width: 100%;
	height: 100%;
}

.search-modal__dialog.is-loading .search-modal__submit {
	opacity: 0.7;
	cursor: wait;
}

.search-modal__results {
	margin-top: 1.5rem;
}

.search-modal__results[hidden] {
	display: none;
}

.search-modal__status {
	margin: 0 0 0.75rem;
	color: #5c637a;
	font-size: 0.875rem;
	line-height: 1.4;
}

.search-modal__list {
	margin: 0;
	padding: 0;
	list-style: none;
	max-height: min(50vh, 24rem);
	overflow-y: auto;
}

.search-modal__result + .search-modal__result {
	margin-top: 0.375rem;
}

.search-modal__result-link {
	display: block;
	padding: 0.75rem 1rem;
	border-radius: 0.75rem;
	color: inherit;
	font-size: 1rem;
	line-height: 1.4;
	text-decoration: none;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.search-modal__result-link:hover,
.search-modal__result-link:focus-visible {
	background: rgba(38, 43, 74, 0.06);
	color: var(--hr-color-accent, #A32D59);
}

body.is-search-modal-open {
	overflow: hidden;
}

@media (min-width: 640px) {
	.search-modal__form {
		flex-direction: row;
		align-items: stretch;
	}

	.search-modal__input {
		flex: 1 1 auto;
	}

	.search-modal__submit {
		flex: 0 0 auto;
	}
}

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