/**
 * Dolopedia — Panel de resultados en vivo del buscador del encabezado.
 *
 * Se apoya en el marcado nativo de Divi (.et-search-form dentro de
 * .et_search_outer) sin alterar su posicionamiento ni su animación.
 */

/* Divi recorta el contenedor para animar la apertura; mientras el panel de
   resultados está desplegado hay que dejarlo salir. */
.et_search_outer.dolo-ls-outer-open {
	overflow: visible;
}

/* ---------- Campo de búsqueda ----------
   Divi lo pinta en gris oscuro (#333) y sin borde, ilegible sobre el navy
   del encabezado. Se recuadra en blanco y se centra verticalmente para que
   acompañe a la cabecera también cuando encoge al hacer scroll. */

#main-header .et-search-field {
	position: absolute;
	top: 50%;
	left: 0;
	transform: translateY(-50%);

	/* Ancho explícito: en un <input>, width:auto toma el ancho intrínseco del
	   control (~20 caracteres) en lugar de estirarse entre left y right, y el
	   campo se quedaba corto por la derecha. */
	width: 100%;
	height: 44px;
	padding: 0 52px 0 16px !important;

	/* Divi le da un margen lateral del 5%, que dejaba el borde derecho del
	   campo por dentro del contenedor. El aspa de cerrar se ancla a ese
	   contenedor (right:0), así que quedaba fuera del recuadro. Sin margen,
	   ambos bordes coinciden y el aspa cae dentro del padding reservado. */
	margin: 0 !important;

	color: #fff !important;
	font-size: 15px !important;
	line-height: 42px !important;

	background: rgba(255, 255, 255, 0.08) !important;
	border: 1px solid rgba(255, 255, 255, 0.65) !important;
	border-radius: 6px !important;

	transition: border-color 0.15s ease, background-color 0.15s ease;
}

#main-header .et-search-field:focus {
	background: rgba(255, 255, 255, 0.14) !important;
	border-color: #fff !important;
	outline: none;
}

#main-header .et-search-field::placeholder {
	color: rgba(255, 255, 255, 0.7) !important;
	opacity: 1;
}

#main-header .et-search-field::-webkit-input-placeholder {
	color: rgba(255, 255, 255, 0.7) !important;
}

#main-header .et-search-field::-moz-placeholder {
	color: rgba(255, 255, 255, 0.7) !important;
	opacity: 1;
}

#main-header .et-search-field:-ms-input-placeholder {
	color: rgba(255, 255, 255, 0.7) !important;
}

/* El aspa de cerrar de Divi también viene en gris, y pegada al borde. */
#main-header .et_close_search_field {
	right: 10px;
}

#main-header .et_close_search_field:after {
	color: #fff !important;
}

.dolo-ls-panel {
	position: absolute;
	top: 100%;
	right: 0;
	left: 0;
	z-index: 10000;

	/* Ancho propio, alineado con el extremo derecho del campo de búsqueda. */
	max-width: 440px;
	margin-left: auto;

	max-height: min(70vh, 560px);
	overflow-y: auto;
	overscroll-behavior: contain;

	background: #fff;
	border: 1px solid #e3e7eb;
	border-radius: 10px;
	box-shadow: 0 18px 44px rgba(4, 35, 63, 0.16);

	font-family: inherit;
	text-align: left;

	animation: dolo-ls-in 0.16s ease-out;
}

.dolo-ls-panel[hidden] {
	display: none;
}

@keyframes dolo-ls-in {
	from {
		opacity: 0;
		transform: translateY(-6px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@media (prefers-reduced-motion: reduce) {
	.dolo-ls-panel {
		animation: none;
	}
}

/* ---------- Lista de resultados ---------- */

.dolo-ls-list {
	list-style: none;
	margin: 0;
	padding: 6px;
}

.dolo-ls-item {
	margin: 0;
	padding: 0;
}

.dolo-ls-item a {
	display: block;
	padding: 11px 14px;
	border-radius: 7px;
	text-decoration: none;
	color: #04233f;
	line-height: 1.4;
	transition: background-color 0.12s ease;
}

.dolo-ls-item a:hover,
.dolo-ls-item a:focus,
.dolo-ls-item a.is-active {
	background: #f2f7f8;
	outline: none;
}

.dolo-ls-badge {
	display: inline-block;
	margin-bottom: 5px;
	padding: 2px 8px;
	border-radius: 20px;

	background: #e6f6f6;
	color: #0d8a88;

	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.dolo-ls-title {
	display: block;
	font-size: 15px;
	font-weight: 700;
	color: #04233f;
}

.dolo-ls-item a:hover .dolo-ls-title,
.dolo-ls-item a.is-active .dolo-ls-title {
	color: #0d8a88;
}

.dolo-ls-excerpt {
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	overflow: hidden;

	margin-top: 3px;
	font-size: 13px;
	font-weight: 400;
	color: #5a6b7b;
}

.dolo-ls-panel mark {
	background: rgba(238, 130, 115, 0.24);
	color: inherit;
	padding: 0 1px;
	border-radius: 2px;
	font-weight: 700;
}

/* ---------- Pie: ver todos ---------- */

.dolo-ls-all {
	/* Siempre visible aunque la lista tenga scroll. */
	position: sticky;
	bottom: 0;

	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;

	padding: 11px 16px;
	border-top: 1px solid #eef1f4;
	border-radius: 0 0 10px 10px;

	background: #fafbfc;
	color: #04233f;

	font-size: 13px;
	font-weight: 700;
	text-decoration: none;
}

.dolo-ls-all:hover,
.dolo-ls-all:focus,
.dolo-ls-all.is-active {
	background: #04233f;
	color: #fff;
	outline: none;
}

.dolo-ls-count {
	font-weight: 400;
	font-size: 12px;
	opacity: 0.75;
}

/* ---------- Estados ---------- */

.dolo-ls-state {
	display: flex;
	flex-direction: column;
	gap: 4px;

	padding: 18px 16px;
	font-size: 13px;
	color: #5a6b7b;
}

.dolo-ls-state strong {
	color: #04233f;
	font-size: 14px;
	font-weight: 700;
}

.dolo-ls-loading {
	flex-direction: row;
	align-items: center;
	gap: 9px;
}

.dolo-ls-spinner {
	display: inline-block;
	width: 14px;
	height: 14px;
	flex: 0 0 14px;

	border: 2px solid #dfe6ea;
	border-top-color: #11b1af;
	border-radius: 50%;

	animation: dolo-ls-spin 0.6s linear infinite;
}

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

@media (prefers-reduced-motion: reduce) {
	.dolo-ls-spinner {
		animation-duration: 2s;
	}
}

/* ---------- Móvil ---------- */

@media all and (max-width: 980px) {
	.dolo-ls-panel {
		max-width: none;
		max-height: min(60vh, 420px);
	}

	.dolo-ls-title {
		font-size: 14px;
	}

	.dolo-ls-excerpt {
		font-size: 12px;
	}
}

/* Aviso de errata corregida («Mostrando resultados de …») */
.dolo-ls-correccion { padding: 10px 16px; font-size: 13px; color: #5c6b75; background: #f6f8fa; border-bottom: 1px solid #e6eaee; }
.dolo-ls-correccion strong { color: #00263A; }
