/*
 * Live search bar -- Insights (template-parts/insights/search.php) and
 * Case Studies / Case Studies (template-parts/case-studies/grid.php).
 * Modeled on the klouddata.com/blog search bar. Behaviour:
 * assets/js/src/live-search.js. Enqueued only on those two pages -- see
 * inc/enqueue/styles.php.
 */

.live-search {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px;
	background-color: #fff;
	border: 1px solid var(--color-border-light);
	border-radius: 14px;
	box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

.live-search__select {
	flex: 0 0 auto;
}

.live-search__select select {
	min-width: 180px;
	height: 46px;
	padding: 0 40px 0 16px;
	border: 1px solid var(--color-border-light);
	border-radius: 10px;
	background: #f8fafc url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5 6 8l3.5-3.5' fill='none' stroke='%23475569' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 14px center;
	font-family: inherit;
	font-size: 14px;
	font-weight: 600;
	color: var(--color-heading);
	cursor: pointer;
	appearance: none;
	-webkit-appearance: none;
}

.live-search__select select:focus,
.live-search__input:focus-within {
	outline: none;
	border-color: #004195;
	box-shadow: 0 0 0 3px rgba(0, 65, 149, 0.12);
}

.live-search__input {
	display: flex;
	flex: 1 1 auto;
	align-items: center;
	gap: 10px;
	min-width: 0;
	height: 46px;
	padding: 0 16px;
	border: 1px solid var(--color-border-light);
	border-radius: 10px;
	color: #64748b;
	cursor: text;
}

.live-search__input svg {
	flex-shrink: 0;
	width: 18px;
	height: 18px;
}

.live-search__input input {
	flex: 1 1 auto;
	min-width: 0;
	height: 100%;
	padding: 0;
	border: 0;
	outline: 0;
	background: transparent;
	font-family: inherit;
	font-size: 15px;
	color: var(--color-heading);
}

.live-search__input input::placeholder {
	color: #94a3b8;
}

.live-search__btn {
	flex: 0 0 auto;
	height: 46px;
	padding: 0 28px;
	border: 0;
	border-radius: 10px;
	background: linear-gradient(103.84deg, #004195 0%, #01aef0 100%);
	font-family: inherit;
	font-size: 15px;
	font-weight: 700;
	color: #fff;
	cursor: pointer;
	transition: opacity 0.15s ease;
}

.live-search__btn:hover,
.live-search__btn:focus-visible {
	opacity: 0.92;
}

.live-search__count {
	margin: 0 0 24px;
	font-size: 15px;
	color: var(--color-body-text);
}

.live-search__count strong {
	color: var(--color-heading);
}

.live-search__clear {
	margin-left: 12px;
	font-weight: 600;
	color: #004195;
}

[data-live-region][aria-busy="true"] {
	opacity: 0.5;
	transition: opacity 0.2s ease;
}

@media (max-width: 768px) {
	.live-search {
		flex-wrap: wrap;
	}

	.live-search__select,
	.live-search__input,
	.live-search__btn {
		flex: 1 1 100%;
	}

	.live-search__select select {
		width: 100%;
	}
}
