/**
 * Estilos base de Event Manager.
 *
 * Diseñados para heredar del tema: no fijan familia tipográfica ni color de
 * texto, y todo lo ajustable está en variables. Para personalizar, redefine
 * las variables en tu tema o en Elementor:
 *
 *   .em-lista { --em-columna: 320px; --em-radio: 16px; --em-acento: #2b57d8; }
 */

.em-lista,
.em-formulario {
	--em-columna: 300px;
	--em-hueco: 32px;
	--em-radio: 12px;
	--em-borde: rgba( 0, 0, 0, 0.1 );
	--em-suave: rgba( 0, 0, 0, 0.55 );
	--em-acento: currentColor;
	--em-tarjeta: #fff;
}

/* ---------- Listado de eventos ---------- */

.em-lista {
	display: grid;
	grid-template-columns: repeat( auto-fill, minmax( var( --em-columna ), 1fr ) );
	gap: var( --em-hueco );
	list-style: none;
	margin: 0;
	padding: 0;
}

.em-evento {
	position: relative;
	display: flex;
	flex-direction: column;
	background: var( --em-tarjeta );
	border-radius: var( --em-radio );
	overflow: hidden;
	box-shadow: 0 2px 8px rgba( 16, 24, 40, 0.06 );
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.em-evento:hover {
	transform: translateY( -4px );
	box-shadow: 0 16px 32px rgba( 16, 24, 40, 0.12 );
}

/* ---- Imagen y botón de compartir ---- */

.em-evento__media {
	position: relative;
	aspect-ratio: 16 / 10;
	background: var( --em-borde );
}

.em-evento__foto {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.em-evento__compartir {
	position: absolute;
	top: 12px;
	right: 12px;
	/* Por encima del enlace que cubre la tarjeta, o no se podría pulsar. */
	z-index: 2;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba( 255, 255, 255, 0.92 );
	color: #1d2939;
	cursor: pointer;
	box-shadow: 0 2px 6px rgba( 16, 24, 40, 0.16 );
	transition: background 0.2s ease, transform 0.2s ease;
}

.em-evento__compartir:hover {
	background: #fff;
	transform: scale( 1.08 );
}

.em-evento__compartir[data-em-copiado="1"]::after {
	content: attr( data-em-mensaje );
	position: absolute;
	top: 50%;
	right: calc( 100% + 8px );
	transform: translateY( -50% );
	padding: 4px 10px;
	border-radius: 6px;
	background: #1d2939;
	color: #fff;
	font-size: 12px;
	white-space: nowrap;
}

/* ---- Cuerpo de la tarjeta ---- */

.em-evento__cuerpo {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 20px;
	flex: 1 1 auto;
}

.em-evento__badge {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	min-width: 44px;
	line-height: 1.1;
	color: var( --em-acento );
}

/* La hora hace de contrapeso a la fecha, con el texto centrado en medio. */
.em-evento__badge--hora {
	padding-left: 14px;
	border-left: 1px solid var( --em-borde );
}

.em-evento__horario {
	font-size: 1.15em;
	font-weight: 700;
	white-space: nowrap;
}

.em-evento__mes {
	font-size: 0.7em;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
}

.em-evento__dia {
	font-size: 1.6em;
	font-weight: 700;
}

.em-evento__texto {
	min-width: 0;
	flex: 1 1 auto;
	text-align: center;
}

.em-evento__titulo {
	margin: 0 0 6px;
	font-size: 1.1em;
	line-height: 1.3;
}

.em-evento__titulo a {
	color: inherit;
	text-decoration: none;
}

/* La tarjeta entera es clicable, sin anidar enlaces ni romper el lector de pantalla. */
.em-evento__titulo a::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
}

.em-evento:hover .em-evento__titulo a {
	text-decoration: underline;
}

.em-evento__lugar {
	margin: 0;
	font-size: 0.9em;
	color: var( --em-suave );
}

@media ( max-width: 380px ) {
	/* En pantallas muy estrechas, tres columnas dejan el título en una
	   palabra por línea: se apila y se centra todo. */
	.em-evento__cuerpo {
		flex-direction: column;
		gap: 10px;
	}

	.em-evento__badge--hora {
		padding-left: 0;
		border-left: 0;
	}
}

.em-evento__resumen {
	margin: 8px 0 0;
	font-size: 0.9em;
	line-height: 1.5;
	color: var( --em-suave );
	/* Dos líneas como máximo: si no, las tarjetas quedan desiguales. */
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.em-lista--vacia {
	color: var( --em-suave );
	font-style: italic;
}

/* ---------- Formulario de inscripción ---------- */

.em-form__campo {
	display: flex;
	flex-direction: column;
	gap: 6px;
	margin-bottom: 18px;
}

.em-form__campo label {
	font-size: 0.9em;
	font-weight: 600;
}

.em-form__campo--check {
	flex-direction: row;
	align-items: flex-start;
	gap: 10px;
}

.em-form__campo--check label {
	font-weight: 400;
	font-size: 0.9em;
	line-height: 1.5;
}

.em-form input[type="text"],
.em-form input[type="email"],
.em-form input[type="tel"],
.em-form input[type="number"],
.em-form textarea {
	width: 100%;
	padding: 12px 14px;
	border: 1px solid var( --em-borde );
	border-radius: calc( var( --em-radio ) / 2 );
	font: inherit;
	color: inherit;
	background: transparent;
}

.em-form input:focus,
.em-form textarea:focus {
	outline: 2px solid var( --em-acento );
	outline-offset: 1px;
}

.em-campo--error {
	border-color: #c92a2a !important;
}

.em-obligatorio {
	color: #c92a2a;
}

/* El honeypot se oculta con CSS y no con type=hidden: los bots lo rellenan igual. */
.em-hp {
	position: absolute !important;
	left: -9999px !important;
	height: 1px;
	overflow: hidden;
}

.em-form__boton {
	padding: 14px 32px;
	border: 0;
	border-radius: 999px;
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}

.em-form__boton[disabled] {
	opacity: 0.6;
	cursor: default;
}

.em-form__respuesta:empty {
	display: none;
}

.em-form__respuesta--error {
	color: #c92a2a;
	font-size: 0.9em;
}

/* ---------- Bloques legales del formulario ---------- */

.em-form__legal {
	margin: 24px 0;
	padding: 20px;
	border: 1px solid var( --em-borde );
	border-radius: calc( var( --em-radio ) / 2 );
}

.em-legal {
	margin-bottom: 12px;
}

/* Plegados por defecto: desplegados convierten el formulario en un muro
   de texto y la gente abandona antes de llegar al botón. */
.em-legal__titulo {
	cursor: pointer;
	font-size: 0.9em;
	font-weight: 600;
	list-style: none;
}

.em-legal__titulo::marker,
.em-legal__titulo::-webkit-details-marker {
	display: none;
}

.em-legal__titulo::before {
	content: "▸ ";
	display: inline-block;
	transition: transform 0.2s ease;
}

.em-legal[open] .em-legal__titulo::before {
	content: "▾ ";
}

.em-legal__texto {
	margin-top: 10px;
	max-height: 220px;
	overflow-y: auto;
	padding-right: 8px;
	font-size: 0.8em;
	line-height: 1.6;
	color: var( --em-suave );
}

.em-legal__texto p {
	margin: 0 0 0.8em;
}

.em-opcional {
	color: var( --em-suave );
	font-size: 0.85em;
}

/* ---------- Avisos ---------- */

.em-aviso {
	padding: 14px 18px;
	border-radius: calc( var( --em-radio ) / 2 );
	border-left: 4px solid;
	line-height: 1.5;
}

.em-aviso--ok {
	background: #eef8f0;
	border-color: #2e7d32;
	color: #1b4d20;
}

.em-aviso--error {
	background: #fdeded;
	border-color: #c92a2a;
	color: #8a1f1f;
}

.em-aviso--completo,
.em-aviso--cerrada {
	background: #fdf3e7;
	border-color: #b26a00;
	color: #7a4900;
}

/* ---------- Plantilla de respaldo del evento ---------- */

/*
 * Esta plantilla solo se usa cuando no hay una plantilla Single de Elementor
 * ni del tema, así que no puede dar por hecho ningún contenedor: se pone su
 * propio ancho máximo y sus propios márgenes.
 */
.em-single {
	--em-columna: 300px;
	--em-radio: 12px;
	--em-borde: rgba( 0, 0, 0, 0.1 );
	--em-suave: rgba( 0, 0, 0, 0.6 );
	--em-acento: currentColor;

	box-sizing: border-box;
	width: 100%;
	max-width: 900px;
	margin: 0 auto;
	padding: 72px 24px 96px;
}

.em-single > * + * {
	margin-top: 40px;
}

.em-single__cabecera {
	text-align: center;
}

.em-single__titulo {
	margin: 0;
	line-height: 1.15;
}

.em-single__entradilla {
	margin: 16px auto 0;
	max-width: 620px;
	font-size: 1.15em;
	line-height: 1.6;
	color: var( --em-suave );
}

.em-single__imagen {
	margin-left: 0;
	margin-right: 0;
}

.em-single__imagen img {
	width: 100%;
	height: auto;
	display: block;
	border-radius: var( --em-radio );
}

.em-single__datos {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
	list-style: none;
	padding: 0;
}

.em-single__dato {
	flex: 1 1 200px;
	display: flex;
	flex-direction: column;
	gap: 4px;
	padding: 16px 20px;
	border: 1px solid var( --em-borde );
	border-radius: var( --em-radio );
}

.em-single__etiqueta {
	font-size: 0.75em;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var( --em-acento );
}

.em-single__valor {
	font-size: 1.05em;
	line-height: 1.4;
}

.em-single__contenido {
	line-height: 1.7;
}

.em-single__contenido > * + * {
	margin-top: 1.2em;
}

.em-single__contenido img {
	max-width: 100%;
	height: auto;
	border-radius: var( --em-radio );
}

.em-single__inscripcion {
	padding-top: 40px;
	border-top: 1px solid var( --em-borde );
}

.em-single__inscripcion-titulo {
	margin: 0 0 24px;
}

@media ( max-width: 640px ) {
	.em-single {
		padding: 40px 20px 64px;
	}

	.em-single > * + * {
		margin-top: 28px;
	}
}
