/* =========================================
   HCRJ Header Search
   Swap the color variables for HCRJ tokens as needed.
   ========================================= */
.hcrj-search {
	position: relative;
	display: inline-flex;
	align-items: center;
}

.hcrj-search__toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	background: transparent;
	border: 0;
	border-radius: 50%;
	color: var(--contrast, #1b2a4a);
	cursor: pointer;
	transition: background-color 0.2s ease;
}

.hcrj-search__toggle:hover,
.hcrj-search__toggle:focus-visible,
.hcrj-search.is-open .hcrj-search__toggle {
	background-color: rgba(0, 0, 0, 0.06);
}

.hcrj-search__toggle:focus-visible,
.hcrj-search__input:focus-visible,
.hcrj-search__submit:focus-visible,
.hcrj-search__close:focus-visible {
	outline: 2px solid var(--accent, #1b2a4a);
	outline-offset: 2px;
}

.hcrj-search__panel {
	position: absolute;
	top: calc(100% + 0.5rem);
	right: 0;
	z-index: 1000;
	width: min(420px, calc(100vw - 2rem));
	padding: 0.75rem;
	background: var(--base-3, #fff);
	border-radius: 6px;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.hcrj-search__panel[hidden] {
	display: none;
}

.hcrj-search__form {
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.hcrj-search__input {
	flex: 1 1 auto;
	min-width: 0;
	height: 44px;
	padding: 0 0.75rem;
	font-size: 16px; /* prevents iOS zoom on focus */
	border: 1px solid rgba(0, 0, 0, 0.2);
	border-radius: 4px;
}

.hcrj-search__submit {
	flex: 0 0 auto;
	height: 44px;
	padding: 0 1rem;
	background: var(--contrast, #1b2a4a);
	color: var(--base-3, #fff);
	border: 0;
	border-radius: 4px;
	cursor: pointer;
}

.hcrj-search__close {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 44px;
	padding: 0;
	background: transparent;
	border: 0;
	color: var(--contrast, #1b2a4a);
	cursor: pointer;
}

/* Hide native clear "x" so it doesn't compete with the close button */
.hcrj-search__input::-webkit-search-cancel-button {
	-webkit-appearance: none;
}

/* Fallback in case the theme doesn't provide it */
.hcrj-search .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;
}
