/* Search modal. Visual language follows the quote flow popup (hqf-popup.css). */

body.hls_modal_is_open {
	overflow: hidden;
}

.hls_modal,
.hls_modal * {
	box-sizing: border-box;
}

/* The theme dims every button on hover (button:hover { opacity: .8 }) — the modal opts out. */
.hls_modal button:hover,
.hls_modal button:focus,
.hls_modal button:active {
	opacity: 1;
}

.hls_modal[hidden] {
	display: none !important;
}

.hls_modal {
	--hls-color-dark: #122239;
	--hls-color-body: #6B7585;
	--hls-color-border: #D6DBE3;
	--hls-color-red: #d92128;
	--hls-color-red-dark: #bb151c;
	--hls-color-white: #ffffff;
	--hls-color-hover: #f7f8fa;
	position: fixed;
	z-index: 100000;
	inset: 0;
	display: flex;
	align-items: flex-start;
	justify-content: center;
	width: 100%;
	height: 100%;
	padding: 10vh 16px 16px;
	overflow-y: auto;
	overscroll-behavior: contain;
	font-family: var(--hpb-font-family-base, 'Be Vietnam Pro', sans-serif);
	color: var(--hls-color-dark);
}

.hls_modal__backdrop {
	position: fixed;
	inset: 0;
	background: #0B1421E5;
	cursor: pointer;
	animation: hls-backdrop-enter 180ms ease-out both;
}

.hls_modal__dialog {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	width: min(680px, 100%);
	max-height: calc(90vh - 16px);
	padding: 32px 40px 36px;
	background: var(--hls-color-white);
	border-radius: 8px;
	box-shadow: 0 24px 64px 0 #00000059;
	animation: hls-dialog-enter 220ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.hls_modal__close {
	position: absolute;
	top: 38px;
	right: 35px;
	z-index: 2;
	display: inline-grid;
	width: 24px;
	height: 24px;
	padding: 0;
	place-items: center;
	color: var(--hls-color-body);
	font: inherit;
	line-height: 1;
	background: transparent;
	border: 0;
	border-radius: 3px;
	box-shadow: none;
	cursor: pointer;
	transition: color 160ms ease, background-color 160ms ease;
}

.hls_modal__close span {
	display: flex;
}

.hls_modal__close:hover {
	color: var(--hls-color-red);
	background: var(--hls-color-hover);
}

.hls_modal__close:focus-visible {
	outline: 2px solid var(--hls-color-red);
	outline-offset: 2px;
}

.hls_modal__title {
	margin: 0 34px 20px 0;
	padding: 0;
	color: var(--hls-color-dark);
	font-family: var(--hpb-font-family-heading, 'Bebas Neue', sans-serif);
	font-size: 32px;
	font-weight: 400;
	line-height: 36px;
	letter-spacing: 0;
	text-transform: uppercase;
}

/* Form */

.hls_form {
	flex: 0 0 auto;
	margin: 0;
}

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

.hls_form__row {
	display: flex;
	gap: 8px;
}

.hls_form__input {
	flex: 1 1 auto;
	min-width: 0;
	height: 56px;
	margin: 0;
	padding: 12px 16px 12px 44px;
	color: var(--hls-color-dark);
	font: inherit;
	font-size: 15px;
	line-height: 22px;
	background-color: var(--hls-color-white);
	/* Magnifier glyph; color is baked in because it is a background-image. */
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 18 18' fill='none'%3E%3Ccircle cx='7.5' cy='7.5' r='6.25' stroke='%236B7585' stroke-width='2'/%3E%3Cpath d='M12 12L16.5 16.5' stroke='%236B7585' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: left 16px center;
	background-size: 18px 18px;
	border: 1px solid var(--hls-color-border);
	border-radius: 3px;
	box-shadow: none;
	-webkit-appearance: none;
	appearance: none;
	transition: border-color 160ms ease, box-shadow 160ms ease;
}

.hls_form__input::placeholder {
	color: var(--hls-color-body);
	opacity: 1;
}

/* Native clear button recolored to the body gray (red on hover). */
.hls_form__input::-webkit-search-cancel-button {
	width: 12px;
	height: 12px;
	margin-left: 8px;
	background-color: var(--hls-color-body);
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 13 13'%3E%3Cpath d='M0.864021 12.288L2.10404e-05 11.424L5.24802 6.14401L2.10404e-05 0.864006L0.864021 5.72205e-06L6.11202 5.28001L11.328 5.72205e-06L12.192 0.864006L6.94402 6.14401L12.192 11.424L11.328 12.288L6.11202 7.04001L0.864021 12.288Z'/%3E%3C/svg%3E") no-repeat center / contain;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 13 13'%3E%3Cpath d='M0.864021 12.288L2.10404e-05 11.424L5.24802 6.14401L2.10404e-05 0.864006L0.864021 5.72205e-06L6.11202 5.28001L11.328 5.72205e-06L12.192 0.864006L6.94402 6.14401L12.192 11.424L11.328 12.288L6.11202 7.04001L0.864021 12.288Z'/%3E%3C/svg%3E") no-repeat center / contain;
	-webkit-appearance: none;
	appearance: none;
	cursor: pointer;
}

.hls_form__input::-webkit-search-cancel-button:hover {
	background-color: var(--hls-color-red);
}

.hls_form__input:hover {
	border-color: #aeb8c6;
}

.hls_form__input:focus {
	border-color: var(--hls-color-dark);
	outline: 0;
	box-shadow: inset 0 0 0 1px var(--hls-color-dark);
}

.hls_form__submit {
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	min-width: 112px;
	min-height: 56px;
	margin: 0;
	padding: 18px 32px;
	color: var(--hls-color-white);
	font: inherit;
	font-size: 14px;
	font-weight: 700;
	line-height: 20px;
	letter-spacing: 0.7px;
	text-transform: uppercase;
	background: var(--hls-color-red);
	border: 1px solid var(--hls-color-red);
	border-radius: 4px;
	cursor: pointer;
	transition: background-color 160ms ease, border-color 160ms ease;
}

.hls_form__submit:hover {
	background: var(--hls-color-red-dark);
	border-color: var(--hls-color-red-dark);
}

.hls_form__submit:focus-visible {
	outline: 3px solid rgba(217, 33, 40, 0.2);
	outline-offset: 2px;
}

/* Status line */

.hls_status {
	flex: 0 0 auto;
	margin: 12px 0 0;
	padding: 0;
	color: var(--hls-color-body);
	font-size: 13px;
	line-height: 20px;
}

.hls_status:empty {
	display: none;
}

.hls_modal--loading .hls_status::before {
	content: '';
	display: inline-block;
	width: 12px;
	height: 12px;
	margin-right: 8px;
	vertical-align: -1px;
	border: 2px solid var(--hls-color-border);
	border-top-color: var(--hls-color-red);
	border-radius: 50%;
	animation: hls-spin 700ms linear infinite;
}

/* Results */

/* Previous results while a new search is pending. */
.hls_modal--loading .hls_results,
.hls_modal--loading .hls_all {
	opacity: 0.5;
	pointer-events: none;
}

.hls_results {
	flex: 1 1 auto;
	min-height: 0;
	margin: 12px -12px 0;
	padding: 0;
	overflow-y: auto;
	list-style: none;
	scrollbar-width: thin;
	scrollbar-color: var(--hls-color-border) transparent;
}

.hls_results[hidden] {
	display: none;
}

.hls_result {
	margin: 0;
	padding: 0;
	border-bottom: 1px solid var(--hls-color-border);
}

.hls_result:last-child {
	border-bottom: 0;
}

.hls_result__link {
	display: flex;
	align-items: center;
	gap: 16px;
	padding: 12px;
	color: var(--hls-color-dark);
	text-decoration: none;
	border-radius: 4px;
	transition: background-color 160ms ease, color 160ms ease;
}

.hls_result__link:hover,
.hls_result__link:focus-visible {
	background: var(--hls-color-hover);
}

.hls_result__link:hover .hls_result__title,
.hls_result__link:focus-visible .hls_result__title {
	color: var(--hls-color-red);
}

.hls_result__link:focus-visible {
	outline: 2px solid var(--hls-color-red);
	outline-offset: -2px;
}

.hls_result__media {
	flex: 0 0 64px;
	width: 64px;
	height: 64px;
	overflow: hidden;
	background: var(--hls-color-hover);
	border-radius: 4px;
}

.hls_result__image {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.hls_result__body {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	gap: 4px;
	min-width: 0;
}

.hls_result__type {
	color: var(--hls-color-red);
	font-size: 11px;
	font-weight: 700;
	line-height: 16px;
	letter-spacing: 1px;
	text-transform: uppercase;
}

.hls_result__title {
	display: -webkit-box;
	overflow: hidden;
	font-size: 15px;
	font-weight: 600;
	line-height: 22px;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	transition: color 160ms ease;
}

/* View all */

.hls_all {
	display: flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	min-height: 56px;
	margin: 16px 0 0;
	padding: 18px 32px;
	color: var(--hls-color-dark);
	font-size: 14px;
	font-weight: 700;
	line-height: 20px;
	letter-spacing: 0.7px;
	text-align: center;
	text-decoration: none;
	text-transform: uppercase;
	background: transparent;
	border: 1px solid var(--hls-color-dark);
	border-radius: 4px;
	transition: color 160ms ease, background-color 160ms ease, border-color 160ms ease;
}

.hls_all[hidden] {
	display: none;
}

.hls_all:hover {
	color: var(--hls-color-white);
	background: var(--hls-color-dark);
}

.hls_all:focus-visible {
	outline: 3px solid rgba(18, 34, 57, 0.2);
	outline-offset: 2px;
}

/* Mobile: full-screen sheet, like the quote popup. */

@media (max-width: 750px) {
	.hls_modal {
		padding: 0;
	}

	.hls_modal__dialog {
		width: 100%;
		height: 100dvh;
		max-height: 100dvh;
		padding: 24px 20px;
		border-radius: 0;
	}

	.hls_modal__close {
		top: 28px;
		right: 18px;
	}

	.hls_modal__title {
		margin-bottom: 16px;
		font-size: 28px;
		line-height: 32px;
	}

	.hls_form__input {
		height: 48px;
		font-size: 16px; /* 16px stops iOS from zooming into the field. */
	}

	.hls_form__submit {
		min-width: 0;
		min-height: 48px;
		padding: 14px 20px;
	}

	.hls_result__media {
		flex-basis: 56px;
		width: 56px;
		height: 56px;
	}

	.hls_all {
		min-height: 48px;
		padding: 14px 20px;
	}
}

/* Short viewports (phones in landscape): full-screen sheet with compact spacing. */

@media (max-height: 500px) {
	.hls_modal {
		padding: 0;
	}

	.hls_modal__dialog {
		width: 100%;
		height: 100dvh;
		max-height: 100dvh;
		padding: 16px 20px;
		border-radius: 0;
	}

	.hls_modal__close {
		top: 18px;
		right: 18px;
	}

	.hls_modal__title {
		margin-bottom: 8px;
		font-size: 24px;
		line-height: 28px;
	}

	.hls_form__input,
	.hls_form__submit {
		height: 48px;
		min-height: 48px;
	}

	.hls_form__submit {
		padding-top: 0;
		padding-bottom: 0;
	}

	.hls_all {
		min-height: 44px;
		margin-top: 8px;
		padding: 12px 20px;
	}
}

@keyframes hls-backdrop-enter {
	from {
		opacity: 0;
	}

	to {
		opacity: 1;
	}
}

@keyframes hls-dialog-enter {
	from {
		opacity: 0;
		transform: translateY(12px) scale(0.985);
	}

	to {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
}

@keyframes hls-spin {
	to {
		transform: rotate(360deg);
	}
}

@media (prefers-reduced-motion: reduce) {
	.hls_modal__backdrop,
	.hls_modal__dialog {
		animation: none;
	}

	.hls_modal__close,
	.hls_form__input,
	.hls_form__submit,
	.hls_result__link,
	.hls_result__title,
	.hls_all {
		transition: none;
	}
}
