/*
 * Swim: estilos de presentación sobre el markup de Events Manager.
 * Mobile-first.
 * Selectores con prefijo `body .swim-feed .em.pixelbones` para ganar
 * especificidad sobre el CSS de Events Manager usando !important solo donde EM ya lo usa.
 */

/* Hero: banda clara y compacta; el azul queda para cabecera, pie y acentos. */
.swim-hero .swim-eyebrow {
	margin: 0;
	color: var(--wp--preset--color--deep);
	text-transform: uppercase;
	letter-spacing: 0.12em;
	font-size: 0.75rem;
	font-weight: 700;
}

/* En el layout centrado, lo que tiene ancho máximo se alinea a la izquierda con el resto */
.swim-hero .swim-hero__title,
.swim-hero .swim-search {
	margin-left: 0 !important;
	margin-right: auto !important;
}

.swim-hero .swim-hero__title {
	max-width: 22ch;
	margin-top: 0.5rem;
	color: var(--wp--preset--color--abyss);
	text-wrap: balance;
}

.swim-hero .swim-search {
	max-width: 640px;
}

.swim-hero .swim-search .wp-block-search__inside-wrapper {
	background: var(--wp--preset--color--base);
	border: 1px solid var(--wp--preset--color--line);
	border-radius: var(--wp--custom--radius--pill);
	padding: 4px;
	box-shadow: var(--wp--custom--shadow--card);
}

.swim-hero .swim-search .wp-block-search__inside-wrapper:focus-within {
	border-color: var(--wp--preset--color--wave);
}

.swim-hero .swim-search .wp-block-search__input {
	border: 0;
	background: transparent;
	padding-left: 1rem;
	min-height: 44px;
	color: var(--wp--preset--color--ink);
}

.swim-hero .swim-search .wp-block-search__button {
	margin: 0;
	border-radius: var(--wp--custom--radius--pill);
	background: var(--wp--preset--color--buoy);
	color: var(--wp--preset--color--base);
	font-weight: 700;
	padding: 0.55rem 1.25rem;
}

.swim-chips {
	gap: 0.5rem;
}

.swim-chips p {
	margin: 0;
}

.swim-chip {
	display: inline-flex;
	align-items: center;
	min-height: 36px;
	padding: 0 0.9rem;
	border-radius: var(--wp--custom--radius--pill);
	border: 1px solid var(--wp--preset--color--line);
	background: var(--wp--preset--color--base);
	color: var(--wp--preset--color--deep) !important;
	font-size: 0.8125rem;
	font-weight: 600;
	text-decoration: none;
}

.swim-chip:hover,
.swim-chip:focus-visible {
	border-color: var(--wp--preset--color--deep);
	background: var(--wp--preset--color--deep);
	color: var(--wp--preset--color--base) !important;
}

/* Título de sección */
.swim-feed .swim-feed__title {
	margin-bottom: var(--wp--preset--spacing--30);
}

/* Buscador de Events Manager: una barra liviana, con el acento de la marca */
.swim-feed .em.em-events-search {
	border-radius: var(--wp--custom--radius--card);
	border-color: var(--wp--preset--color--line) !important;
	box-shadow: none;
	margin-bottom: var(--wp--preset--spacing--40);
}

body .swim-feed .em.em-events-search button.em-search-submit {
	border-radius: var(--wp--custom--radius--pill) !important;
	background: var(--wp--preset--color--deep) !important;
	border-color: var(--wp--preset--color--deep) !important;
	color: var(--wp--preset--color--base) !important;
	text-transform: none !important;
	letter-spacing: 0 !important;
	font-weight: 700 !important;
}

/* Lista de eventos: tarjetas compactas, con aire entre ellas */
body .swim-feed .em.pixelbones.em-list {
	display: grid;
	gap: 1rem;
	grid-template-columns: 1fr;
}

body .swim-feed .em.pixelbones.em-list .em-item.em-event {
	position: relative;
	display: grid;
	grid-template-columns: 52px 1fr;
	gap: 0.9rem;
	align-items: start;
	margin: 0;
	padding: 1rem;
	border: 1px solid var(--wp--preset--color--line);
	border-radius: var(--wp--custom--radius--card);
	background: var(--wp--preset--color--base);
	box-shadow: var(--wp--custom--shadow--card);
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

body .swim-feed .em.pixelbones.em-list .em-item.em-event:hover,
body .swim-feed .em.pixelbones.em-list .em-item.em-event:focus-within {
	border-color: #c6d9e6;
	box-shadow: var(--wp--custom--shadow--raised);
}

/* Fecha como insignia pequeña; la foto, si hay, en el mismo cuadro */
body .swim-feed .em.pixelbones.em-list .em-item .em-item-image {
	width: 52px;
	min-width: 0;
	max-width: 52px;
	height: auto;
	margin: 0;
	padding: 0;
	border: 0;
}

body .swim-feed .em.pixelbones.em-list .em-item .em-item-image img {
	width: 52px;
	height: 52px;
	object-fit: cover;
	border-radius: var(--wp--custom--radius--badge);
}

body .swim-feed .em.pixelbones.em-list .em-item .em-item-image-placeholder {
	width: 52px;
	height: 56px;
	padding: 0;
	margin: 0;
	border: 0;
	min-width: 0;
	max-width: none;
	aspect-ratio: auto;
	opacity: 1;
	border-radius: var(--wp--custom--radius--badge);
	background: var(--wp--preset--color--tint);
	box-shadow: inset 0 0 0 1px var(--wp--preset--color--line);
	display: flex;
	align-items: center;
	justify-content: center;
}

body .swim-feed .em.pixelbones.em-list .em-item .em-item-image-placeholder::before,
body .swim-feed .em.pixelbones.em-list .em-item .em-item-image-placeholder::after {
	display: none;
}

body .swim-feed .em.pixelbones.em-list .em-item .em-item-image-placeholder .date {
	position: static;
	display: flex;
	min-width: 0;
	height: auto;
	flex-direction: column;
	align-items: center;
	gap: 2px;
	line-height: 1;
	color: var(--wp--preset--color--abyss);
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	transform: none;
}

body .swim-feed .em.pixelbones.em-list .em-item .em-item-image-placeholder .day {
	font-family: var(--wp--preset--font-family--display);
	font-size: 1.375rem;
	font-weight: 700;
	line-height: 1;
	color: inherit;
	font-variant-numeric: tabular-nums;
}

body .swim-feed .em.pixelbones.em-list .em-item .em-item-image-placeholder .month {
	font-size: 0.6875rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--wp--preset--color--buoy);
}

body .swim-feed .em.pixelbones.em-list .em-item .em-item-info {
	padding: 0;
	border: 0;
	min-width: 0;
}

body .swim-feed .em.pixelbones.em-list .em-item .em-item-info h3.em-item-title {
	margin: 0 0 0.3rem;
	padding: 0;
	border: 0;
	font-family: var(--wp--preset--font-family--display);
	/* Events Manager fuerza font-weight/size con !important en .em.pixelbones h3 */
	font-size: 1.0625rem !important;
	font-weight: 700 !important;
	line-height: 1.3;
	letter-spacing: -0.01em;
}

body .swim-feed .em.pixelbones.em-list .em-item .em-item-info h3.em-item-title a {
	color: var(--wp--preset--color--abyss) !important;
	text-decoration: none;
}

/* Toda la tarjeta lleva a la ficha */
body .swim-feed .em.pixelbones.em-list .em-item .em-item-info h3.em-item-title a::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: inherit;
}

body .swim-feed .em.pixelbones.em-list .em-item .em-item-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 0.15rem 0.85rem;
	margin: 0 0 0.4rem;
	color: var(--wp--preset--color--mist);
	font-size: 0.8125rem;
}

/* La fecha ya está en la insignia */
body .swim-feed .em.pixelbones.em-list .em-item .em-item-image.has-placeholder ~ .em-item-info .em-event-date {
	display: none;
}

body .swim-feed .em.pixelbones.em-list .em-item .em-item-meta-line {
	margin: 0;
	display: inline-flex;
	align-items: center;
	gap: 0.3rem;
}

body .swim-feed .em.pixelbones.em-list .em-item .em-item-meta-line a {
	position: relative;
	z-index: 1;
	color: var(--wp--preset--color--deep) !important;
	font-style: normal;
	text-decoration: none;
	font-weight: 600;
}

body .swim-feed .em.pixelbones.em-list .em-item .em-icon {
	width: 13px;
	height: 13px;
	margin: 0;
	opacity: 0.6;
}

body .swim-feed .em.pixelbones.em-list .em-item .em-item-desc {
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	margin: 0;
	font-size: 0.875rem;
	line-height: 1.5;
	color: var(--wp--preset--color--ink);
}

/* El botón "Más info" sobra: la tarjeta completa es el enlace */
body .swim-feed .em.pixelbones.em-list .em-item .em-item-actions {
	display: none;
}

@media (min-width: 640px) {
	body .swim-feed .em.pixelbones.em-list {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 1.25rem;
	}
}

@media (min-width: 1024px) {
	body .swim-feed .em.pixelbones.em-list {
		grid-template-columns: repeat(3, minmax(0, 1fr));
		gap: 1.5rem 1.25rem;
	}

	body .swim-feed .em.pixelbones.em-list .em-item.em-event {
		padding: 1.125rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	body .swim-feed .em.pixelbones.em-list .em-item.em-event {
		transition: none;
	}
}

/* Llamado a avisos */
.swim-cta h2 {
	margin: 0;
}

.swim-cta p {
	margin: 0;
	max-width: 60ch;
}

.swim-cta .swim-cta__text {
	flex: 1 1 320px;
}

/* Ficha de evento */
.swim-event .swim-back a {
	text-decoration: none;
	font-weight: 600;
}

/* Tarjetas genéricas (búsqueda/archivo) */
.swim-card {
	padding: 1rem;
	border: 1px solid var(--wp--preset--color--line);
	border-radius: var(--wp--custom--radius--card);
	box-shadow: var(--wp--custom--shadow--card);
}

.swim-event .em-location-map-container,
.swim-event .em-location-map {
	border-radius: var(--wp--custom--radius--card);
	overflow: hidden;
}
