/* EA Tools - barra di ricerca interna. Dark-mode aware, nessuna dipendenza. */

.ea-ricerca {
	--ear-accent: #0d9488;
	--ear-bg: #ffffff;
	--ear-fg: #1f2937;
	--ear-muted: #6b7280;
	--ear-border: #d1d5db;
	--ear-hover: #f0fdfa;
	position: relative;
	max-width: 560px;
	margin: 0 auto;
	box-sizing: border-box;
	font-size: 1rem;
}

.ea-ricerca * { box-sizing: border-box; }

.ea-ricerca-sr {
	position: absolute;
	width: 1px; height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	white-space: nowrap;
}

.ea-ricerca-box {
	display: flex;
	align-items: center;
	gap: 8px;
	background: var(--ear-bg);
	border: 1px solid var(--ear-border);
	border-radius: 999px;
	padding: 0 14px;
}

.ea-ricerca-box:focus-within {
	border-color: var(--ear-accent);
	box-shadow: 0 0 0 3px rgba( 13, 148, 136, 0.15 );
}

.ea-ricerca-ico { font-size: 1rem; line-height: 1; opacity: 0.7; }

.ea-ricerca-input {
	flex: 1 1 auto;
	border: 0;
	outline: 0;
	background: transparent;
	color: var(--ear-fg);
	font: inherit;
	padding: 0.6rem 0;
	min-width: 0;
}

.ea-ricerca-input::placeholder { color: var(--ear-muted); }

.ea-ricerca-results {
	position: absolute;
	left: 0; right: 0;
	top: calc(100% + 6px);
	z-index: 9999;
	background: var(--ear-bg);
	border: 1px solid var(--ear-border);
	border-radius: 12px;
	box-shadow: 0 12px 30px rgba( 0, 0, 0, 0.14 );
	overflow: hidden;
	max-height: 70vh;
	overflow-y: auto;
}

.ea-ricerca-item {
	display: block;
	padding: 10px 14px;
	text-decoration: none;
	color: var(--ear-fg);
	border-bottom: 1px solid rgba( 0, 0, 0, 0.06 );
}

.ea-ricerca-item:last-child { border-bottom: 0; }

.ea-ricerca-item:hover,
.ea-ricerca-item:focus,
.ea-ricerca-item.is-active {
	background: var(--ear-hover);
	outline: none;
}

.ea-ricerca-item-t {
	display: block;
	font-weight: 600;
	color: var(--ear-accent);
	margin-bottom: 2px;
}

.ea-ricerca-item-s {
	display: block;
	font-size: 0.86rem;
	color: var(--ear-muted);
	line-height: 1.4;
}

.ea-ricerca-badge {
	display: inline-block;
	margin-left: 8px;
	font-size: 0.68rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	color: #ffffff;
	background: var(--ear-accent);
	border-radius: 999px;
	padding: 1px 8px;
	vertical-align: middle;
}

.ea-ricerca-empty {
	padding: 14px;
	color: var(--ear-muted);
	font-size: 0.9rem;
	text-align: center;
}

@media ( prefers-color-scheme: dark ) {
	.ea-ricerca {
		--ear-bg: #111827;
		--ear-fg: #e5e7eb;
		--ear-muted: #9ca3af;
		--ear-border: #374151;
		--ear-hover: #0f2b28;
		--ear-accent: #2dd4bf;
	}
}

body.dark-mode .ea-ricerca,
[data-theme="dark"] .ea-ricerca,
.is-dark-theme .ea-ricerca {
	--ear-bg: #111827;
	--ear-fg: #e5e7eb;
	--ear-muted: #9ca3af;
	--ear-border: #374151;
	--ear-hover: #0f2b28;
	--ear-accent: #2dd4bf;
}
