/* MEC Próximos Eventos — estilo Cofatuc (verdes, círculos, Bricolage Grotesque + DM Sans) */

.mecpe {
	/* Paletas verdes, las mismas del hero slider. Se cambian desde Elementor › Estilo › Colores */
	--mecpe-s1-bg: #1E4D3B; --mecpe-s1-shape: #2A6150; --mecpe-s1-fg: #F3F7F4;
	--mecpe-s2-bg: #D3E3D7; --mecpe-s2-shape: #BCD3C2; --mecpe-s2-fg: #173A2E;
	--mecpe-s3-bg: #2D5C53; --mecpe-s3-shape: #3A6E64; --mecpe-s3-fg: #F3F7F4;
	--mecpe-s4-bg: #93B69E; --mecpe-s4-shape: #A8C6B1; --mecpe-s4-fg: #12322A;

	--mecpe-section-bg: #EEF4EF;
	--mecpe-section-deco: #DDE9E0;
	--mecpe-heading: #173A2E;
	--mecpe-radius: 28px;
	--mecpe-max: 1320px;
	--mecpe-pad-y: clamp(56px, 7vw, 104px);
	--mecpe-pad-x: clamp(20px, 5vw, 80px);
	--mecpe-gap: clamp(16px, 2vw, 28px);
	--mecpe-cols: 3;

	--mecpe-font-display: 'Bricolage Grotesque', 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
	--mecpe-font-body: 'DM Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

	position: relative;
	isolation: isolate;
	overflow: hidden;
	box-sizing: border-box;
	width: 100%;
	padding: var(--mecpe-pad-y) var(--mecpe-pad-x);
	background: var(--mecpe-section-bg);
	color: var(--mecpe-heading);
	font-family: var(--mecpe-font-body);
}

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

/* Ancho completo de la ventana aunque el contenedor sea más angosto */
.mecpe--full {
	width: 100vw;
	max-width: 100vw;
	left: 50%;
	margin-left: -50vw;
	margin-right: 0;
}

html:has(.mecpe--full),
body:has(.mecpe--full) { overflow-x: clip; }

/* Paletas */
.mecpe [data-scheme="1"] { --bg: var(--mecpe-s1-bg); --shape: var(--mecpe-s1-shape); --fg: var(--mecpe-s1-fg); }
.mecpe [data-scheme="2"] { --bg: var(--mecpe-s2-bg); --shape: var(--mecpe-s2-shape); --fg: var(--mecpe-s2-fg); }
.mecpe [data-scheme="3"] { --bg: var(--mecpe-s3-bg); --shape: var(--mecpe-s3-shape); --fg: var(--mecpe-s3-fg); }
.mecpe [data-scheme="4"] { --bg: var(--mecpe-s4-bg); --shape: var(--mecpe-s4-shape); --fg: var(--mecpe-s4-fg); }

/* Círculos decorativos de la sección */
.mecpe__deco {
	position: absolute;
	z-index: -1;
	border-radius: 50%;
	background: var(--mecpe-section-deco);
	pointer-events: none;
}
.mecpe__deco--a { width: clamp(280px, 34vw, 520px); aspect-ratio: 1; top: -18%; right: -8%; }
.mecpe__deco--b { width: clamp(160px, 18vw, 280px); aspect-ratio: 1; bottom: -12%; left: -5%; border: 2px solid var(--mecpe-section-deco); background: transparent; }

.mecpe__inner {
	position: relative;
	max-width: var(--mecpe-max);
	margin: 0 auto;
}

.mecpe-ico { flex: none; display: block; }

/* ---------- Encabezado ---------- */

.mecpe__head {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 20px 32px;
	margin-bottom: clamp(28px, 3.5vw, 48px);
}

.mecpe__heading { display: flex; flex-direction: column; gap: 14px; }

.mecpe__eyebrow {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	align-self: flex-start;
	padding: 7px 14px 7px 12px;
	border-radius: 999px;
	background: var(--mecpe-s1-bg);
	color: var(--mecpe-s1-fg);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: .1em;
	text-transform: uppercase;
	line-height: 1;
}
.mecpe__eyebrow .mecpe-ico { width: 15px; height: 15px; }

.mecpe .mecpe__title {
	margin: 0;
	font-family: var(--mecpe-font-display);
	font-size: clamp(32px, 4vw, 56px);
	font-weight: 700;
	line-height: 1.02;
	letter-spacing: -0.03em;
	color: var(--mecpe-heading);
}

.mecpe .mecpe__all {
	display: inline-flex;
	align-items: center;
	gap: 12px;
	font-weight: 700;
	font-size: 15px;
	color: var(--mecpe-heading);
	text-decoration: none;
}

.mecpe__all-ico {
	width: 48px;
	height: 48px;
	border-radius: 50%;
	border: 1.5px solid currentColor;
	display: grid;
	place-items: center;
	transition: background-color .25s ease, color .25s ease;
}

.mecpe .mecpe__all:hover .mecpe__all-ico {
	background: var(--mecpe-heading);
	color: var(--mecpe-section-bg);
}

/* ---------- Grilla y tarjetas ---------- */

.mecpe__grid {
	display: grid;
	grid-template-columns: repeat(var(--mecpe-cols), minmax(0, 1fr));
	gap: var(--mecpe-gap);
}

.mecpe__card {
	position: relative;
	isolation: isolate;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	gap: 28px;
	min-height: 380px;
	padding: clamp(24px, 2.4vw, 34px);
	border-radius: var(--mecpe-radius);
	background: var(--bg);
	color: var(--fg);
	transition: transform .35s cubic-bezier(.2, .7, .2, 1), box-shadow .35s ease;
}

.mecpe__card:hover {
	transform: translateY(-6px);
	box-shadow: 0 22px 44px -24px rgba(18, 50, 42, .55);
}

.mecpe__shape {
	position: absolute;
	z-index: -1;
	width: 260px;
	aspect-ratio: 1;
	border-radius: 50%;
	background: var(--shape);
	top: -110px;
	right: -90px;
	transition: transform .6s cubic-bezier(.2, .7, .2, 1);
}

.mecpe__card:hover .mecpe__shape { transform: scale(1.12); }

.mecpe__top {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 16px;
}

/* Fecha en círculo */
.mecpe__date {
	width: 96px;
	height: 96px;
	flex: none;
	border-radius: 50%;
	border: 1.5px solid currentColor;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 4px;
	line-height: 1;
}

.mecpe__day {
	font-family: var(--mecpe-font-display);
	font-size: 40px;
	font-weight: 700;
	letter-spacing: -0.04em;
	font-variant-numeric: tabular-nums;
}

.mecpe__month {
	font-size: 12px;
	font-weight: 700;
	letter-spacing: .14em;
	text-transform: uppercase;
}

/* Foto en círculo */
.mecpe__photo {
	width: 112px;
	height: 112px;
	flex: none;
	border-radius: 50%;
	overflow: hidden;
	color: var(--fg);
	box-shadow: 0 0 0 6px var(--bg), 0 0 0 7.5px var(--fg);
	margin: 7px 7px 0 0;
}

.mecpe__photo img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform .6s ease;
}

.mecpe__card:hover .mecpe__photo img { transform: scale(1.06); }

/* Cuerpo */
.mecpe__body {
	display: flex;
	flex-direction: column;
	gap: 14px;
	flex: 1;
}

.mecpe__labels {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 12px;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: .1em;
	text-transform: uppercase;
}

.mecpe__weekday { opacity: .78; }

.mecpe__cat {
	padding: 5px 11px;
	border-radius: 999px;
	border: 1.5px solid currentColor;
	line-height: 1;
}

.mecpe .mecpe__name {
	margin: 0;
	font-family: var(--mecpe-font-display);
	font-size: clamp(22px, 1.9vw, 27px);
	font-weight: 700;
	line-height: 1.12;
	letter-spacing: -0.02em;
	color: inherit;
}

.mecpe .mecpe__name a {
	color: inherit;
	text-decoration: none;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* El enlace del título cubre toda la tarjeta */
.mecpe .mecpe__name a::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
}

.mecpe__meta {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 8px;
	font-size: 15px;
	line-height: 1.35;
}

.mecpe__meta li {
	margin: 0;
	padding: 0;
	display: flex;
	align-items: flex-start;
	gap: 10px;
}

.mecpe__meta .mecpe-ico { margin-top: 1px; opacity: .85; }

/* Botón en píldora */
.mecpe .mecpe__btn {
	position: relative;
	z-index: 2;
	margin-top: auto;
	align-self: flex-start;
	display: inline-flex;
	align-items: center;
	gap: 10px;
	min-height: 46px;
	padding: 11px 22px;
	border-radius: 999px;
	background: var(--fg);
	color: var(--bg);
	font-weight: 700;
	font-size: 15px;
	text-decoration: none;
	transition: gap .25s ease, opacity .25s ease;
}

.mecpe .mecpe__btn:hover { gap: 16px; }

.mecpe .mecpe__btn:focus-visible,
.mecpe .mecpe__all:focus-visible,
.mecpe .mecpe__name a:focus-visible {
	outline: 3px solid var(--mecpe-s4-bg);
	outline-offset: 3px;
}

/* Sin eventos */
.mecpe__empty {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 28px 32px;
	border-radius: var(--mecpe-radius);
	background: var(--bg);
	color: var(--fg);
	font-weight: 500;
}
.mecpe__empty p { margin: 0; }

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

@media (max-width: 1024px) {
	.mecpe__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.mecpe--cols-1 .mecpe__grid { grid-template-columns: 1fr; }
	.mecpe--cols-3 .mecpe__card:last-child { grid-column: 1 / -1; min-height: 0; }
}

@media (max-width: 767px) {
	.mecpe__grid { grid-template-columns: 1fr; }
	.mecpe__head { align-items: flex-start; }
	.mecpe__card { min-height: 0; gap: 22px; }
	.mecpe__date { width: 84px; height: 84px; }
	.mecpe__day { font-size: 34px; }
	.mecpe__photo { width: 92px; height: 92px; }
}

@media (prefers-reduced-motion: reduce) {
	.mecpe *, .mecpe *::before { transition: none !important; }
	.mecpe__card:hover { transform: none; }
}
