/* =========================================================================
 * Libros Evaristo · Base · v1.2.6
 *
 * Solo lo que Elementor no permite hacer de forma nativa. Colores y
 * tipografías: Elementor › Ajustes del sitio (Colores y Fuentes globales).
 * ====================================================================== */

/* ---------- 1. Foco visible en todo el sitio (accesibilidad) ---------- */
:where(a, button, input, select, textarea, summary):focus-visible {
	outline: 2px solid var(--e-global-color-primary, #7A2331);
	outline-offset: 3px;
}

/* ---------- 2. Cabecera: se encoge al hacer scroll ----------
 * En Elementor (Theme Builder › Cabecera):
 *   Contenedor exterior · clase «le-cabecera» · Efectos de movimiento ›
 *   Fijo: Arriba · Desplazamiento de efectos: 100.
 *   Dentro: imagen del monograma con clase «le-cabecera__monograma» y
 *   texto de oficios con clase «le-cabecera__oficios».
 * Elementor añade .elementor-sticky--effects al pasar el desplazamiento.
 */
.le-cabecera,
.le-cabecera .le-cabecera__monograma img,
.le-cabecera .le-cabecera__nombre .elementor-heading-title {
	transition: all .25s ease;
}
.le-cabecera > .e-con {
	transition: min-height .25s ease;
}
.le-cabecera.elementor-sticky--effects {
	box-shadow: 0 2px 18px rgba(31, 27, 22, .10);
}
.le-cabecera.elementor-sticky--effects > .e-con {
	--min-height: 72px;
}
.le-cabecera.elementor-sticky--effects .le-cabecera__monograma img {
	width: 40px;
	height: 40px;
}
.le-cabecera.elementor-sticky--effects .le-cabecera__nombre .elementor-heading-title {
	font-size: 23px;
}
.le-cabecera.elementor-sticky--effects .le-cabecera__oficios {
	display: none;
}

/* ---------- 3. Biblioteca · v1.2.4 ---------- */

/* Portada dinámica: color de la temática (variable desde functions.php). */
.le-portada {
	aspect-ratio: 2 / 3;
	background-color: var(--le-color-tema, #7A2331);
	transition: transform .25s ease, box-shadow .25s ease;
}
.e-loop-item:hover .le-portada,
.e-loop-item:focus-within .le-portada {
	transform: translateY(-4px);
	box-shadow: 0 14px 30px rgba(31, 27, 22, .18);
}

/* Tarjeta: sin subrayado y subtítulo vacío oculto (ACF opcional). */
.le-tarjeta,
.le-tarjeta:hover { text-decoration: none; }
.le-tarjeta:hover .le-tarjeta__titulo .elementor-heading-title { color: var(--e-global-color-primary, #7A2331); }
.le-oculta-vacio:has(.elementor-heading-title:empty) { display: none; }

/* Punto de color de la temática delante del texto. */
.le-punto .elementor-heading-title::before {
	content: "";
	display: inline-block;
	width: 8px;
	height: 8px;
	margin-right: 6px;
	border-radius: 50%;
	background: var(--le-color-tema, #7A2331);
	vertical-align: 1px;
}

.le-punto--grande .elementor-heading-title::before { width: 10px; height: 10px; margin-right: 8px; }

/* Ficha: los datos sin rellenar (año, editorial, páginas) no se muestran. */
.le-datos .le-dato:not(:has(.le-dato__valor)) { display: none; }

/* Filtros por temática (widget Menú, menú «Filtros · Libros»): pastillas. */
.le-filtros .elementor-nav-menu--main .elementor-nav-menu { gap: 6px; flex-wrap: nowrap; }
.le-filtros .elementor-nav-menu--main .elementor-item {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 42px;
	padding: 0 16px !important;
	border: 1px solid #D9CFBE;
	border-radius: 999px;
	background: #FBF8F2;
	color: #1F1B16;
	white-space: nowrap;
	transition: border-color .2s ease, background-color .2s ease, color .2s ease;
}
.le-filtros .elementor-nav-menu--main .elementor-item:hover { border-color: #1F1B16; color: #1F1B16; }
.le-filtros .elementor-nav-menu--main [class*="le-tema-"] > .elementor-item::before {
	content: "";
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background: var(--le-color-tema);
	/* Elementor oculta los ::before del menú sin hover (regla muy específica). */
	position: static !important;
	opacity: 1 !important;
	transform: none !important;
	flex: none;
}
.le-filtros .elementor-nav-menu--main .elementor-item.elementor-item-active,
.le-filtros .elementor-nav-menu--main .current-menu-item > .elementor-item {
	border-color: #1F1B16;
	background: #1F1B16;
	color: #F6F1E7;
}
.le-filtros .elementor-nav-menu--main .elementor-item-active::before { background: #F6F1E7 !important; }

/* Buscador de la biblioteca (widget Buscar). */
.le-buscar-libros .e-search-input {
	min-height: 44px;
	border: 1px solid #D9CFBE;
	border-radius: 0;
	background: #FBF8F2;
	font-size: 15px;
}
.le-buscar-libros .e-search-input:focus { border-color: #7A2331; }

/* Selector [le_ordenar] */
.le-ordenar {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0;
	font-family: var(--e-global-typography-text-font-family, "Inter"), sans-serif;
	font-size: 14px;
	color: var(--e-global-color-accent, #6B6259);
}
.le-ordenar label { margin: 0; white-space: nowrap; }
.le-ordenar select {
	min-height: 44px;
	padding: 0 36px 0 14px;
	border: 1px solid #D9CFBE;
	border-radius: 0;
	background: #FBF8F2 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%237A2331' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 14px center;
	-webkit-appearance: none;
	appearance: none;
	color: #1F1B16;
	font: inherit;
	cursor: pointer;
}
.le-ordenar select:hover { border-color: #7A2331; }

/* Móvil: pastillas con desplazamiento lateral y tarjeta compacta. */
@media (max-width: 767px) {
	.le-filtros { width: 100%; }
	.le-filtros .elementor-nav-menu--main { overflow-x: auto; scrollbar-width: none; padding-right: 20px; }
	.le-filtros .elementor-nav-menu--main::-webkit-scrollbar { display: none; }
	.le-filtros .elementor-nav-menu--main .elementor-item { min-height: 40px; padding: 0 14px !important; }
	.le-barra-filtros .le-ordenar { padding-right: 20px; }
}

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
