/* ECOSAM — Portafolio en filas
   Todo va bajo .epr para no chocar con el tema Qi ni con Elementor.
   Los colores son variables: se pueden sobrescribir desde el Personalizador,
   desde Elementor o desde el CSS del tema hijo. */

.epr {
	--epr-green-deep: #1f4b3a;
	--epr-green: #2c6b4f;
	--epr-accent: #283380;
	--epr-accent-soft: #dce2f2;
	--epr-ink: #26251f;
	--epr-ink-soft: #5b5a50;
	--epr-line: #e1dacb;
	--epr-sand: #f6f2e9;
	--epr-sand-dark: #ede6d6;
	--epr-surface: #ffffff;
	--epr-radius: 14px;
	--epr-gap: 14px;
	--epr-photo-size: 102px;
	--epr-photo-ratio: 10 / 7;

	font-family: inherit;
	color: var(--epr-ink);
	line-height: 1.5;
}

.epr *,
.epr *::before,
.epr *::after {
	box-sizing: border-box;
}

/* ---------------------------------------------------------------- Filtros */

.epr-toolbar {
	padding-bottom: 24px;
	margin-bottom: 28px;
	border-bottom: 1px solid var(--epr-line);
}

.epr-filter-row {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	gap: 24px;
	margin-bottom: 14px;
}

.epr-filter-row:last-child {
	margin-bottom: 0;
}

.epr-subrow {
	display: none;
}

.epr-subrow.is-visible {
	display: flex;
}

.epr-filter-group {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.epr-filter-label {
	display: block;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.5px;
	text-transform: uppercase;
	color: var(--epr-ink-soft);
}

.epr-filter-label--main {
	font-size: 16px;
	letter-spacing: normal;
	text-transform: none;
	color: var(--epr-ink);
	margin-bottom: 4px;
}

.epr-pills {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.epr-pill {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	margin: 0;
	padding: 7px 14px;
	font-family: inherit;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.2;
	color: var(--epr-ink-soft);
	background: var(--epr-surface);
	border: 1px solid var(--epr-line);
	border-radius: 999px;
	cursor: pointer;
	transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.epr-pill:hover {
	border-color: var(--epr-green);
	color: var(--epr-green-deep);
}

.epr-pill:focus-visible {
	outline: 2px solid var(--epr-accent);
	outline-offset: 2px;
}

.epr-pill.is-active {
	color: #fff;
	background: var(--epr-green-deep);
	border-color: var(--epr-green-deep);
}

/* Categoría con color propio (meta epr_color del término). */
.epr-pill--colored {
	color: var(--epr-accent);
	border-color: var(--epr-accent);
	font-weight: 700;
}

.epr-pill--colored.is-active {
	color: #fff;
	background: var(--epr-accent);
	border-color: var(--epr-accent);
}

.epr-pill--sub {
	font-size: 12px;
	padding: 5px 12px;
}

/* ------------------------------------------------------------------ Filas */

.epr-list {
	display: block;
}

.epr-row {
	position: relative;
	display: flex;
	align-items: center;
	gap: 20px;
	padding: 20px 22px;
	margin-bottom: var(--epr-gap);
	background: var(--epr-surface);
	border: 1px solid var(--epr-line);
	border-left: 4px solid var(--epr-line);
	border-radius: var(--epr-radius);
	color: inherit;
	text-decoration: none;
	transition: transform 0.2s ease, box-shadow 0.2s ease, border-left-color 0.2s ease;
}

.epr-row:last-child {
	margin-bottom: 0;
}

.epr-row:hover,
.epr-row:focus {
	color: inherit;
	text-decoration: none;
	transform: translateY(-3px);
	box-shadow: 0 14px 28px -16px rgba(31, 75, 58, 0.28);
	border-left-color: var(--epr-accent);
}

.epr-row:focus-visible {
	outline: 2px solid var(--epr-accent);
	outline-offset: 3px;
}

.epr-row.is-hidden {
	display: none;
}

/* Entrada escalonada. --epr-i lo pone PHP y lo reordena el JS al filtrar. */
.epr-row {
	opacity: 0;
	animation: epr-rise 0.45s ease forwards;
	animation-delay: calc(var(--epr-i, 0) * 60ms);
}

@keyframes epr-rise {
	from {
		opacity: 0;
		transform: translateY(10px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@media (prefers-reduced-motion: reduce) {
	.epr-row {
		opacity: 1;
		animation: none;
		transition: none;
	}
	.epr-row:hover {
		transform: none;
	}
}

/* ------------------------------------------------------------------ Foto */

.epr-photo {
	position: relative;
	flex: 0 0 auto;
	width: auto;
	height: var(--epr-photo-size);
	aspect-ratio: var(--epr-photo-ratio);
	border-radius: 12px;
	overflow: hidden;
	background: var(--epr-sand-dark);
}

/* Selector largo a proposito: `.elementor img { height: auto }` se carga despues
   que esta hoja y le gana por especificidad, dejando una franja de fondo bajo la
   foto. El posicionamiento absoluto ademas desacopla la altura de esa regla. */
.epr .epr-photo .epr-photo-img {
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
	margin: 0;
	border-radius: inherit;
}

.epr-photo--empty {
	background: repeating-linear-gradient(135deg, var(--epr-sand-dark), var(--epr-sand-dark) 6px, #e4dcc7 6px, #e4dcc7 12px);
}

/* --------------------------------------------------------------- Contenido */

.epr-body {
	flex: 1 1 auto;
	min-width: 0;
}

.epr-name {
	display: block;
	font-size: 15.5px;
	font-weight: 700;
	line-height: 1.3;
	color: var(--epr-ink);
	text-transform: none;
}

.epr-subtitle {
	display: block;
	margin-top: 3px;
	font-size: 12.5px;
	font-weight: 400;
	color: var(--epr-ink-soft);
}

.epr-badges {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: 8px;
}

.epr-badge {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 4px 10px;
	font-size: 10.5px;
	font-weight: 700;
	letter-spacing: 0.4px;
	text-transform: uppercase;
	color: var(--epr-green-deep);
	background: #e7efe9;
	border-radius: 999px;
}

.epr-badge--colored {
	color: #fff;
	background: var(--epr-accent);
}

.epr-chip {
	padding: 3px 9px;
	font-size: 11px;
	font-weight: 600;
	color: var(--epr-ink-soft);
	background: var(--epr-sand-dark);
	border-radius: 6px;
}

.epr-summary {
	display: -webkit-box;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	margin: 8px 0 0;
	font-size: 12.5px;
	line-height: 1.45;
	color: var(--epr-ink-soft);
}

.epr-summary b {
	color: var(--epr-ink);
	font-weight: 700;
}

/* ------------------------------------------------------------------- CTA */

.epr-cta {
	flex: 0 0 auto;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 6px;
	margin-left: auto;
}

.epr-go {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 13.5px;
	font-weight: 700;
	color: var(--epr-accent);
	white-space: nowrap;
}

.epr-row:hover .epr-go span {
	transform: translateX(3px);
}

.epr-go span {
	display: inline-block;
	transition: transform 0.2s ease;
}

/* --------------------------------------------------------- Banner destacado */

.epr-row--banner {
	flex-direction: column;
	align-items: stretch;
	padding: 0;
	overflow: hidden;
}

.epr-row--banner .epr-photo {
	width: 100%;
	height: 300px;
	aspect-ratio: auto;
	border-radius: 0;
}

.epr-row--banner .epr-body {
	padding: 20px 22px 4px;
}

.epr-row--banner .epr-cta {
	flex-direction: row;
	justify-content: flex-end;
	margin-left: 0;
	padding: 0 22px 18px;
}

/* ----------------------------------------------------------------- Vacío */

.epr-empty {
	margin: 8px 0 0;
	padding: 28px 0;
	text-align: center;
	font-size: 14px;
	color: var(--epr-ink-soft);
}

/* ------------------------------------------------------------- Responsive */

@media (max-width: 800px) {
	.epr-row {
		flex-wrap: wrap;
		gap: 16px;
		padding: 16px 18px;
	}

	.epr-photo {
		--epr-photo-size: 84px;
	}

	.epr-body {
		flex: 1 1 60%;
	}

	.epr-cta {
		width: 100%;
		flex-direction: row;
		justify-content: flex-end;
		margin-left: 0;
	}

	.epr-filter-row {
		gap: 16px;
	}
}
