/**
 * EE Voice Search widget.
 *
 * @package LandTechExtras
 * @since   3.31.0
 */

.ltxe-vs {
	--ltxe-vs-mic: 44px;
	--ltxe-vs-mic-color: #111827;
	--ltxe-vs-mic-bg: #f3f4f6;
	--ltxe-vs-wave: #3b82f6;
	position: relative;
	width: 100%;
}

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

.ltxe-vs__field {
	position: relative;
	display: flex;
	align-items: center;
	gap: 8px;
}

.ltxe-vs__input {
	box-sizing: border-box;
	flex: 1 1 auto;
	width: 100%;
	min-height: 44px;
	padding: 10px 14px;
	font-size: 16px;
	line-height: 1.4;
	color: inherit;
	background-color: #fff;
	border: 1px solid #d1d5db;
	border-radius: 6px;
}

.ltxe-vs__input:focus {
	outline: none;
	border-color: #3b82f6;
	box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

.ltxe-vs--mic-only:not(.ltxe-vs--no-speech) .ltxe-vs__input {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
}

.ltxe-vs__btn {
	flex: 0 0 var(--ltxe-vs-mic);
	width: var(--ltxe-vs-mic);
	height: var(--ltxe-vs-mic);
	padding: 0;
	border: 0;
	border-radius: 999px;
	background: var(--ltxe-vs-mic-bg);
	color: var(--ltxe-vs-mic-color);
	cursor: pointer;
}

.ltxe-vs__btn:focus {
	outline: 2px solid #3b82f6;
	outline-offset: 2px;
}

.ltxe-vs--no-speech .ltxe-vs__btn,
.ltxe-vs--no-speech .ltxe-vs__wave {
	display: none;
}

.ltxe-vs__mic {
	display: block;
	width: 18px;
	height: 18px;
	margin: 0 auto;
	border: 2px solid currentColor;
	border-radius: 8px 8px 10px 10px;
	position: relative;
}

.ltxe-vs__mic::after {
	content: "";
	position: absolute;
	left: 50%;
	bottom: -7px;
	width: 10px;
	height: 6px;
	margin-left: -5px;
	border: 2px solid currentColor;
	border-top: 0;
	border-radius: 0 0 6px 6px;
}

.ltxe-vs__wave {
	display: none;
	align-items: flex-end;
	gap: 3px;
	height: 18px;
}

.ltxe-vs--listening .ltxe-vs__wave {
	display: inline-flex;
}

.ltxe-vs__wave span {
	display: block;
	width: 3px;
	height: 14px;
	background: var(--ltxe-vs-wave);
	border-radius: 2px;
	transform-origin: center bottom;
	animation: ltxe-vs-wave 0.45s ease-in-out infinite alternate;
}

.ltxe-vs__wave span:nth-child(2) {
	animation-delay: 0.1s;
}

.ltxe-vs__wave span:nth-child(3) {
	animation-delay: 0.2s;
}

@keyframes ltxe-vs-wave {
	from {
		transform: scaleY(0.4);
	}
	to {
		transform: scaleY(1.3);
	}
}

.ltxe-vs--searching .ltxe-vs__input {
	opacity: 0.8;
}

.ltxe-vs__results {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin: 10px 0 0;
	padding: 0;
	list-style: none;
}

.ltxe-vs__result,
.ltxe-vs__empty {
	margin: 0;
	padding: 0;
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 8px;
}

.ltxe-vs__empty {
	padding: 12px 14px;
	color: #6b7280;
}

.ltxe-vs__result-link {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	padding: 12px 14px;
	text-decoration: none;
	color: inherit;
}

.ltxe-vs__result-thumb {
	width: 56px;
	height: 56px;
	object-fit: cover;
	border-radius: 4px;
	flex: 0 0 56px;
}

.ltxe-vs__result-body {
	display: flex;
	flex-direction: column;
	gap: 4px;
	min-width: 0;
}

.ltxe-vs__result-title {
	font-weight: 600;
}

.ltxe-vs__result-excerpt {
	font-size: 0.9em;
	color: #6b7280;
}

.ltxe-vs__status {
	margin-top: 8px;
	min-height: 1.2em;
	font-size: 0.875em;
	color: #6b7280;
}
