/**
 * Feed de Páginas para Elementor — estilos del frontend.
 *
 * Los colores, tamaños y espaciados se controlan desde la pestaña «Estilo» del
 * widget: aquí solo va la estructura y los valores por defecto.
 */

.fp-feed__grid {
	display: grid;
	grid-template-columns: repeat(var(--fp-columns, 3), minmax(0, 1fr));
	gap: var(--fp-gap, 24px);
}

/* --- Tarjeta --------------------------------------------------------- */

.fp-card {
	position: relative;
	display: flex;
	flex-direction: column;
	height: 100%;
	overflow: hidden;
	background-color: #fff;
	transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease, border-color 0.3s ease;
}

/* La proporción la marca el contenedor: así todas las tarjetas miden igual
   independientemente del tamaño original de cada imagen destacada. */
.fp-card__media {
	position: relative;
	overflow: hidden;
	flex: 0 0 auto;
	aspect-ratio: var(--fp-image-ratio, 16 / 9);
}

/**
 * Dos clases a propósito. Elementor aplica `.elementor img { height: auto }`
 * (especificidad 0,1,1) y con una sola clase ganaría esa regla, dejando cada
 * imagen a su altura natural.
 */
.fp-card__media .fp-card__image {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: var(--fp-image-fit, cover);
	object-position: var(--fp-image-position, center center);
	transition: transform var(--fp-image-transition, 1500ms) ease;
}

.fp-card:hover .fp-card__image,
.fp-card:focus-within .fp-card__image {
	transform: scale(var(--fp-image-zoom, 1.1));
}

.fp-card__overlay {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-color: transparent;
	transition: background-color var(--fp-image-transition, 1500ms) ease;
	pointer-events: none;
}

/* Sin position ni z-index a propósito: así el pseudoelemento de .fp-card__stretch
   se posiciona respecto a .fp-card y puede cubrir también la imagen. */
.fp-card__content {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	justify-content: center;
	padding: 24px;
	text-align: center;
}

.fp-card__localidad,
.fp-card__title,
.fp-card__excerpt {
	margin: 0;
	max-width: 100%;
}

/**
 * `font: inherit` para que el título herede del encabezado y no de la tipografía
 * global de enlaces («.elementor-kit-N a { font-size … }»), que si no se impone
 * al texto porque es una declaración directa sobre el <a>.
 *
 * A propósito con una sola clase: así el control de tipografía del widget, que
 * genera un selector más específico, siempre puede ganarle.
 */
.fp-card__title a {
	color: inherit;
	font: inherit;
	text-decoration: none;
}

.fp-card__excerpt {
	overflow-wrap: break-word;
}

/* --- Botón ----------------------------------------------------------- */

/* Bloque a ancho completo: así el botón (inline-block) sigue el text-align de la
   tarjeta. El z-index (sin position, funciona por ser hijo de un flex) lo deja
   por encima del área pulsable, para que un botón que sea enlace real se pueda
   pulsar. */
.fp-card__button-wrapper {
	z-index: 3;
	display: block;
	width: 100%;
}

.fp-card__button {
	display: inline-block;
	padding: 12px 28px;
	border: 1px solid transparent;
	border-radius: 100px;
	background-color: #1b3fae;
	color: #fff;
	line-height: 1.2;
	text-align: center;
	text-decoration: none;
	transition: color 0.3s ease, background-color 0.3s ease, border-color 0.3s ease;
}

a.fp-card__button:hover,
a.fp-card__button:focus {
	text-decoration: none;
}

/* --- Área pulsable de toda la tarjeta -------------------------------- */

/**
 * El enlace del título (o el del botón) se «estira» con un pseudoelemento para
 * cubrir la tarjeta entera. Así se puede pulsar en cualquier sitio sin añadir un
 * segundo enlace vacío: la tarjeta tiene un único enlace, con texto de verdad.
 */
.fp-card__stretch::after {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	z-index: 2;
	width: 100%;
	height: 100%;
}

/* Solo cuando no hay ni título ni botón: enlace que cubre la tarjeta, con
   aria-label, porque no hay ningún texto que se pueda enlazar. */
.fp-card__link {
	position: absolute;
	top: 0;
	left: 0;
	z-index: 2;
	width: 100%;
	height: 100%;
	border-radius: inherit;
}

/* Con el enlace en el título, el botón es un span decorativo: tiene que dejar
   pasar el clic hasta el área pulsable, que queda por debajo en el apilado. */
.fp-card__button-wrapper--decorative {
	pointer-events: none;
}

.fp-card--linked .fp-card__button {
	cursor: pointer;
}

/* --- Filtro ---------------------------------------------------------- */

.fp-feed__filter {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	justify-content: center;
	margin-bottom: 32px;
}

.fp-feed__filter-button {
	padding: 8px 18px;
	border: 1px solid currentColor;
	border-radius: 100px;
	background-color: transparent;
	color: inherit;
	cursor: pointer;
	font: inherit;
	line-height: 1.2;
	transition: color 0.3s ease, background-color 0.3s ease, border-color 0.3s ease;
}

.fp-card.is-hidden {
	display: none;
}

/* --- Paginación ------------------------------------------------------- */

.fp-feed__pagination {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: center;
	justify-content: center;
	margin-top: 40px;
}

.fp-feed__pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 2.5em;
	padding: 8px 14px;
	border: 1px solid currentColor;
	border-radius: 100px;
	color: inherit;
	/* Igual que en el título: que no manden los estilos globales de enlace. */
	font: inherit;
	line-height: 1.2;
	text-align: center;
	text-decoration: none;
	transition: color 0.3s ease, background-color 0.3s ease, border-color 0.3s ease;
}

.fp-feed__pagination a.page-numbers:hover,
.fp-feed__pagination a.page-numbers:focus {
	text-decoration: none;
}

/* Los puntos suspensivos no son un botón: sin recuadro. */
.fp-feed__pagination .page-numbers.dots {
	border-color: transparent;
	background-color: transparent;
}

/* --- Estados sin resultados ------------------------------------------ */

.fp-feed__empty {
	text-align: center;
}

.fp-feed__notice {
	padding: 20px;
	border: 1px dashed currentColor;
	border-radius: 6px;
	opacity: 0.7;
	text-align: center;
}

/* --- Accesibilidad --------------------------------------------------- */

.fp-card .screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	border: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
	.fp-card,
	.fp-card__image,
	.fp-card__overlay {
		transition: none !important;
	}

	.fp-card:hover .fp-card__image,
	.fp-card:focus-within .fp-card__image {
		transform: none;
	}
}
