/**
 * WoP - Eventos e Notícias
 *
 * Namespace "eno" (Eventos e Notícias) para nao colidir com nenhum outro
 * widget do WEM.
 */

.eno {
	--eno-font: Soho, Arial, sans-serif;
}

/* ------------------------------------------------------------------ *
 * Barra: tablador Eventos/Noticias + categorias + botao "Ver todos"
 * ------------------------------------------------------------------ */

.eno__bar {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 16px 24px;
	border-bottom: 1px solid #e2e2e2;
	margin-bottom: 32px;
}

.eno__bar__filters {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	gap: 12px 32px;
}

.eno__bar__sections {
	display: flex;
	gap: 0 28px;
}

.eno__section {
	margin: 0;
	padding: 0 0 6px;
	border-bottom: 2px solid transparent;
	font-family: var(--eno-font);
	font-size: 20px;
	font-weight: 700;
	cursor: pointer;
	color: #4a4a4a;
	transition: color 0.15s ease, border-color 0.15s ease;
}

.eno__section:hover {
	color: #1a1a1a;
}

.eno__section.is-active {
	color: #ba2229;
	border-bottom-color: #ba2229;
}

.eno__categories {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	padding-left: 24px;
	border-left: 1px solid var(--eno-categorias-divisor-cor, #e2e2e2);
}

.eno__categories[hidden] {
	display: none;
}

.eno__category {
	margin: 0;
	padding: 6px 14px;
	border-radius: 20px;
	font-family: var(--eno-font);
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.03em;
	text-transform: uppercase;
	cursor: pointer;
	color: #6a6a6a;
	background: #f2f2f2;
	transition: color 0.15s ease, background-color 0.15s ease;
}

.eno__category:hover {
	color: #1a1a1a;
}

.eno__category.is-active {
	color: #fff;
	background: #ba2229;
}

/* O botao/link "Ver todos" e agora gerado por
   WEM_Botao_Settings::render_field() (classes wem-botao wem-botao--{variante}
   + a classe extra "eno__cta") - o aspeto (cor, padding, icone) vem todo de
   la; aqui so garantimos que o texto nao quebra linha dentro da barra. */
.eno__cta {
	white-space: nowrap;
}

.eno__cta-wrap[hidden] {
	display: none;
}

/* ------------------------------------------------------------------ *
 * Titulo(s) da seccao de resultados
 *
 * Ate 3 cartoes lado a lado (ver .eno__results__list abaixo, grid de 3
 * colunas) - quando ha uma mistura de proximos+passados, o segundo
 * titulo ("Ultimos Eventos") fica posicionado exatamente por cima do
 * grupo de cartoes passados, usando a MESMA grelha (replicado da
 * homepage oficial: o segundo titulo comeca na coluna onde comeca o
 * primeiro cartao "passado" - 1a coluna = --second, 2a coluna = --third).
 * ------------------------------------------------------------------ */

.eno__results__title-box {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	column-gap: 24px;
	margin-bottom: 24px;
}

.eno__results__title {
	grid-column: 1 / span 1;
	margin: 0;
	font-family: var(--eno-font);
	font-size: 18px;
	font-weight: 700;
}

.eno__results__title--second {
	grid-column: 2 / span 1;
}

.eno__results__title--third {
	grid-column: 3 / span 1;
}

.eno__results__title[hidden] {
	display: none;
}

/* ------------------------------------------------------------------ *
 * Lista de resultados (sempre ate 3 cartoes) + divisor entre
 * proximos/passados + spinner de carregamento
 * ------------------------------------------------------------------ */

.eno__results {
	position: relative;
}

.eno__results__list {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	column-gap: 24px;
	row-gap: 32px;
}

.eno__card-wrap {
	position: relative;
	min-width: 0;
}

/* Linha vertical subtil a separar visualmente o grupo "proximos" do
   grupo "passados", tal como na homepage oficial - so aparece no
   PRIMEIRO cartao passado (ver render_cards() em
   includes/class-wem-eno-support.php), nao entre cada par de cartoes. */
.eno__card-wrap--first-past::before {
	content: "";
	position: absolute;
	top: 0;
	left: -12px;
	width: 1px;
	height: 100%;
	background-color: #e2e2e2;
}

.eno__loading {
	display: none;
	position: absolute;
	inset: 0;
	z-index: 6;
	align-items: center;
	justify-content: center;
	background: rgba(255, 255, 255, 0.6);
}

.eno__results.is-loading .eno__loading {
	display: flex;
}

.eno__results.is-loading .eno__results__list {
	opacity: 0.35;
	pointer-events: none;
	transition: opacity 0.15s ease;
}

.eno__spinner {
	width: 34px;
	height: 34px;
	border-radius: 50%;
	border: 3px solid var(--eno-spinner-fundo, rgba(26, 26, 26, 0.15));
	border-top-color: var(--eno-spinner-cor, #ba2229);
	animation: eno-spin 0.7s linear infinite;
}

@keyframes eno-spin {
	to {
		transform: rotate(360deg);
	}
}

@media (prefers-reduced-motion: reduce) {
	.eno__spinner {
		animation-duration: 1.6s;
	}
}

.eno__empty {
	text-align: center;
	padding: 60px 20px;
}

.eno__empty[hidden] {
	display: none;
}

.eno__empty-title {
	margin: 0 0 8px;
	font-family: var(--eno-font);
	font-size: 20px;
	font-weight: 700;
}

.eno__empty-desc {
	margin: 0;
	color: #6a6a6a;
}

/* ------------------------------------------------------------------ *
 * Cartao embutido (usado quando nenhum Loop Item e escolhido)
 * ------------------------------------------------------------------ */

.eno-card {
	display: flex;
	flex-direction: column;
	text-decoration: none;
	color: inherit;
	height: 100%;
}

.eno-card__img {
	display: block;
	width: 100%;
	padding-top: 62%;
	margin-bottom: 16px;
	background-size: cover;
	background-position: center;
	background-color: #1a1a1a;
}

.eno-card__body {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.eno-card__meta {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
}

.eno-card__tag {
	padding: 3px 10px;
	border-radius: 3px;
	font-family: var(--eno-font);
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	color: #fff;
	background: #ba2229;
}

.eno-card__date,
.eno-card__local {
	font-family: var(--eno-font);
	font-size: 12px;
	color: #6a6a6a;
}

.eno-card__divider {
	width: 1px;
	height: 12px;
	background-color: #d5d5d5;
}

.eno-card__title {
	font-family: var(--eno-font);
	font-size: 18px;
	font-weight: 700;
	line-height: 1.3;
	color: #1a1a1a;
}

.eno-card__desc {
	font-size: 13px;
	line-height: 1.5;
	color: #4a4a4a;
}

.eno-card__link {
	margin-top: 4px;
	font-family: var(--eno-font);
	font-size: 13px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	color: #1a1a1a;
	transition: color 0.15s ease;
}

/* ------------------------------------------------------------------ *
 * Responsivo
 * ------------------------------------------------------------------ */

@media (max-width: 991px) {
	.eno__results__title-box,
	.eno__results__list {
		grid-template-columns: repeat(2, 1fr);
	}

	.eno__results__title--third {
		grid-column: 2 / span 1;
	}
}

@media (max-width: 599px) {
	.eno__results__title-box,
	.eno__results__list {
		grid-template-columns: 1fr;
		row-gap: 8px;
	}

	.eno__results__title--second,
	.eno__results__title--third {
		grid-column: 1 / span 1;
	}

	.eno__card-wrap--first-past::before {
		display: none;
	}

	.eno__bar {
		align-items: flex-start;
	}

	.eno__categories {
		padding-left: 0;
		border-left: none;
	}
}
