/* =========================================================================
   ABR - Calendário de Eventos
   Layout inspirado na CNT, identidade visual da ABR (Aeroportos do Brasil).
   As variáveis abaixo são os PADRÕES — a página de Configurações sobrescreve
   tudo via CSS inline (cores, fonte e tamanhos de fonte).
   ========================================================================= */

.abr-ce-wrap {
	/* Cores */
	--abr-primary: #123821;
	--abr-header-text: #ffffff;
	--abr-accent: #06A1FF;
	--abr-cta-text: #ffffff;
	--abr-text: #2c2c2c;
	--abr-muted: #79817c;
	--abr-box-bg: #ffffff;
	--abr-row: #f7f6f0;
	--abr-border: #e4e6e9;
	--abr-day-bg: #eceef0;
	--abr-title: #123821;
	--abr-title-bar: #123821;
	--abr-weekday: #2c2c2c;

	/* Fonte (inherit = herda do tema do site; configurável nas opções) */
	--abr-font: inherit;

	/* Tamanhos de fonte */
	--abr-fs-title: 32px;
	--abr-fs-month: 20px;
	--abr-fs-year: 24px;
	--abr-fs-weekday: 14px;
	--abr-fs-day: 14px;
	--abr-fs-event-title: 15px;
	--abr-fs-event-date: 13px;
	--abr-fs-body: 15px;
	--abr-fs-legend: 14px;
	--abr-fs-cta: 14px;

	font-family: var(--abr-font);
	color: var(--abr-text);
	max-width: 1180px;
	margin: 0 auto;
	box-sizing: border-box;
	/* white-space é herdado — reseta para evitar nowrap vindo do tema. */
	white-space: normal;
}
.abr-ce-wrap *,
.abr-ce-wrap *::before,
.abr-ce-wrap *::after {
	box-sizing: border-box;
}

/* ---- Título ---- */
.abr-ce-title {
	font-size: var(--abr-fs-title);
	font-weight: 700;
	color: var(--abr-title);
	margin: 0 0 28px;
	line-height: 1.15;
}
.abr-ce-title-bar {
	display: block;
	width: 70px;
	height: 6px;
	background: var(--abr-title-bar);
	margin-top: 12px;
	border-radius: 2px;
}

/* ---- Grid de duas colunas ---- */
.abr-ce-inner {
	position: relative;
	transition: opacity .2s ease;
}
.abr-ce-inner.is-loading {
	opacity: .5;
	pointer-events: none;
}
.abr-ce-grid {
	display: grid;
	grid-template-columns: 380px 1fr;
	gap: 28px;
	align-items: start;
}

/* =========================================================================
   COLUNA ESQUERDA — CALENDÁRIO
   ========================================================================= */
.abr-ce-left {
	background: var(--abr-box-bg);
	border: 1px solid var(--abr-border);
	border-radius: 14px;
	padding: 18px;
	box-shadow: 0 6px 18px rgba(18, 56, 33, .06);
}

.abr-ce-cal-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	background: var(--abr-primary);
	border-radius: 10px;
	padding: 14px 16px;
	margin-bottom: 16px;
}
.abr-ce-headcenter {
	display: flex;
	align-items: center;
	gap: 10px;
	min-width: 0;
}
/* Controles do cabeçalho — blindados contra estilos de button/select do tema
   (seletores com .abr-ce-wrap aumentam a especificidade + !important). */
.abr-ce-wrap .abr-ce-cal-head .abr-ce-month {
	appearance: none !important;
	-webkit-appearance: none !important;
	-moz-appearance: none !important;
	width: auto !important;
	max-width: 100% !important;
	min-height: 0 !important;
	height: auto !important;
	background-color: rgba(255, 255, 255, .15) !important;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") !important;
	background-repeat: no-repeat !important;
	background-position: right 10px center !important;
	border: 1px solid rgba(255, 255, 255, .4) !important;
	border-radius: 8px !important;
	color: var(--abr-header-text) !important;
	font-family: inherit !important;
	font-size: var(--abr-fs-month) !important;
	font-weight: 700 !important;
	line-height: 1.2 !important;
	letter-spacing: normal !important;
	text-transform: none !important;
	padding: 6px 30px 6px 12px !important;
	margin: 0 !important;
	box-shadow: none !important;
	cursor: pointer;
}
.abr-ce-wrap .abr-ce-cal-head .abr-ce-month option {
	color: #111;
}
.abr-ce-wrap .abr-ce-cal-head .abr-ce-year {
	flex: 0 0 auto;
	color: var(--abr-header-text) !important;
	font-size: var(--abr-fs-year) !important;
	font-weight: 700 !important;
	line-height: 1.2 !important;
	white-space: nowrap;
}
.abr-ce-wrap .abr-ce-cal-head .abr-ce-nav {
	flex: 0 0 auto !important;
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	width: 34px !important;
	height: 34px !important;
	min-width: 34px !important;
	max-width: 34px !important;
	padding: 0 !important;
	margin: 0 !important;
	background: rgba(255, 255, 255, .15) !important;
	border: none !important;
	border-radius: 8px !important;
	color: var(--abr-header-text) !important;
	font-size: 22px !important;
	font-weight: 400 !important;
	line-height: 1 !important;
	text-transform: none !important;
	box-shadow: none !important;
	cursor: pointer;
	transition: background .15s ease;
}
.abr-ce-wrap .abr-ce-cal-head .abr-ce-nav:hover {
	background: rgba(255, 255, 255, .3) !important;
}

.abr-ce-weekdays,
.abr-ce-days {
	display: grid;
	grid-template-columns: repeat(7, 1fr);
	gap: 6px;
}
.abr-ce-weekdays {
	margin-bottom: 8px;
}
.abr-ce-weekdays span {
	text-align: center;
	font-weight: 700;
	font-size: var(--abr-fs-weekday);
	color: var(--abr-weekday);
	padding: 4px 0;
}

.abr-ce-day {
	aspect-ratio: 1 / 1;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	font-size: var(--abr-fs-day);
	font-weight: 500;
	background: var(--abr-day-bg);
	color: var(--abr-text);
}
.abr-ce-day-blank {
	background: transparent;
}
.abr-ce-day-event {
	cursor: pointer;
	color: #fff;
	font-weight: 700;
	transition: transform .12s ease, box-shadow .12s ease;
}
.abr-ce-day-event:hover {
	transform: scale(1.08);
	box-shadow: 0 2px 8px rgba(0, 0, 0, .2);
}

/* ---- Legenda ---- */
.abr-ce-legend {
	margin-top: 18px;
	padding-top: 16px;
	border-top: 1px solid var(--abr-border);
	display: flex;
	flex-direction: column;
	gap: 10px;
}
.abr-ce-legend-item {
	display: flex;
	align-items: center;
	gap: 10px;
	font-size: var(--abr-fs-legend);
	color: var(--abr-text);
}
.abr-ce-dot {
	width: 16px;
	height: 16px;
	border-radius: 50%;
	flex: 0 0 auto;
	background: var(--abr-muted);
}

/* =========================================================================
   COLUNA DIREITA — LISTA (ACCORDION)
   ========================================================================= */
.abr-ce-right {
	display: flex;
	flex-direction: column;
	gap: 10px;
	min-width: 0;
}
.abr-ce-empty {
	color: var(--abr-muted);
	font-size: 16px;
	padding: 20px;
	background: var(--abr-row);
	border-radius: 10px;
	text-align: center;
}

.abr-ce-event {
	background: var(--abr-row);
	border: 1px solid var(--abr-border);
	border-radius: 10px;
	overflow: hidden;
	transition: box-shadow .15s ease;
}
.abr-ce-event.is-highlight {
	box-shadow: 0 0 0 2px var(--abr-accent);
}
.abr-ce-event-head {
	width: 100%;
	display: flex;
	align-items: center;
	gap: 16px;
	/* !important para neutralizar estilos de <button> herdados do tema (ex.: cor de marca). */
	background: transparent !important;
	border: none !important;
	box-shadow: none !important;
	padding: 12px 16px;
	margin: 0;
	cursor: pointer;
	text-align: left;
	font-family: inherit;
	color: inherit;
}
.abr-ce-event-head:hover,
.abr-ce-event-head:focus,
.abr-ce-event-head:active {
	background: transparent !important;
	color: inherit;
	box-shadow: none !important;
	outline: none;
}
.abr-ce-event-date {
	flex: 0 0 auto;
	min-width: 96px;
	text-align: center;
	font-weight: 700;
	font-size: var(--abr-fs-event-date);
	color: #fff;
	padding: 6px 8px;
	border-radius: 5px;
	background: var(--abr-muted);
}
.abr-ce-event-title {
	flex: 1 1 auto;
	min-width: 0;
	text-align: center;
	font-size: var(--abr-fs-event-title);
	font-weight: 700;
	color: var(--abr-text);
	white-space: normal !important;
	overflow-wrap: anywhere;
	word-break: break-word;
}
.abr-ce-event-toggle {
	flex: 0 0 auto;
	color: var(--abr-muted);
	font-size: 14px;
	transition: transform .2s ease;
}
.abr-ce-event.is-open .abr-ce-event-toggle {
	transform: rotate(180deg);
}

.abr-ce-event-body {
	/* Recolhido por padrão — !important para o tema não forçar a abertura. */
	max-height: 0 !important;
	overflow: hidden !important;
	padding: 0 16px;
	transition: max-height .25s ease, padding .25s ease;
	font-size: var(--abr-fs-body);
	line-height: 1.6;
	/* Descrição em cor secundária para se distinguir do título. */
	color: var(--abr-muted);
}
.abr-ce-event.is-open .abr-ce-event-body {
	max-height: 2000px !important;
	overflow: visible !important;
	/* Linha divisória separando o título (cabeçalho) da descrição. */
	border-top: 1px solid var(--abr-border);
	padding: 14px 16px 16px;
}
.abr-ce-event-body p:first-child {
	margin-top: 0;
}

/* ---- CTAs (botões lado a lado, espaçamento uniforme) ---- */
.abr-ce-ctas {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	margin-top: 14px;
}
.abr-ce-cta {
	flex: 0 1 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: var(--abr-accent);
	color: var(--abr-cta-text) !important;
	text-decoration: none !important;
	font-size: var(--abr-fs-cta);
	font-weight: 700;
	line-height: 1.2;
	padding: 10px 20px;
	border-radius: 6px;
	transition: filter .15s ease, transform .12s ease;
}
.abr-ce-cta:hover {
	filter: brightness(.92);
	transform: translateY(-1px);
	color: var(--abr-cta-text) !important;
}

/* =========================================================================
   RESPONSIVO / MOBILE
   ========================================================================= */

/* Tablet: empilha as colunas */
@media (max-width: 900px) {
	.abr-ce-grid {
		grid-template-columns: 1fr;
		gap: 22px;
	}
	.abr-ce-left {
		max-width: 460px;
		margin: 0 auto;
		width: 100%;
	}
	.abr-ce-right {
		width: 100%;
	}
	.abr-ce-event-head {
		flex-wrap: wrap;
		gap: 8px 12px;
	}
	.abr-ce-event-date {
		order: 1;
	}
	.abr-ce-event-toggle {
		order: 2;
		margin-left: auto; /* empurra a seta para a direita na 1ª linha */
	}
	.abr-ce-event-title {
		order: 3;
		flex: 1 1 100%;
		text-align: left;
	}
}

/* Celular */
@media (max-width: 540px) {
	.abr-ce-title {
		font-size: clamp(22px, 7vw, var(--abr-fs-title));
		margin-bottom: 20px;
	}
	.abr-ce-left {
		padding: 14px;
		border-radius: 12px;
	}
	/* Cabeçalho do calendário: tudo numa linha só, com fontes reduzidas. */
	.abr-ce-cal-head {
		padding: 10px;
		gap: 6px;
		flex-wrap: nowrap;
	}
	.abr-ce-headcenter {
		flex: 1 1 auto;
		min-width: 0;
		justify-content: center;
		gap: 6px;
		margin: 0;
	}
	.abr-ce-wrap .abr-ce-cal-head .abr-ce-month {
		font-size: 14px !important;
		padding: 5px 24px 5px 8px !important;
		min-width: 0 !important;
	}
	.abr-ce-wrap .abr-ce-cal-head .abr-ce-year {
		font-size: 16px !important;
	}
	.abr-ce-wrap .abr-ce-cal-head .abr-ce-nav {
		width: 28px !important;
		height: 28px !important;
		min-width: 28px !important;
		max-width: 28px !important;
		font-size: 18px !important;
	}
	.abr-ce-weekdays,
	.abr-ce-days {
		gap: 4px;
	}
	.abr-ce-day {
		font-size: 13px;
	}
	.abr-ce-event-date {
		min-width: 84px;
	}
	/* CTAs ocupam a largura toda, um sobre o outro, no celular */
	.abr-ce-ctas {
		gap: 10px;
	}
	.abr-ce-cta {
		flex: 1 1 100%;
	}
}

/* Telas bem estreitas: dias menores ainda legíveis */
@media (max-width: 360px) {
	.abr-ce-day {
		font-size: 12px;
	}
	.abr-ce-weekdays span {
		font-size: 12px;
	}
}
