/* gdl.buzz Super Widgets — Acordeón */

.gdlb-acc {
	--gdlb-acc-speed: 250ms;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.gdlb-acc__item {
	border: 1px solid #e3e8ee;
	border-radius: 12px;
	overflow: hidden;
	background: #fff;
}

/* El encabezado (h2/h3…) no debe traer márgenes ni tipografía del tema */
.gdlb-acc .gdlb-acc__heading {
	margin: 0;
	padding: 0;
	font: inherit;
	line-height: inherit;
}

/* Botón: reseteo fuerte para que el tema (ej. Hello Elementor) no lo pinte */
.gdlb-acc .gdlb-acc__header {
	all: unset;
	box-sizing: border-box;
	display: flex;
	align-items: center;
	width: 100%;
	gap: 12px;
	padding: 16px 20px;
	cursor: pointer;
	color: inherit;
	background-color: transparent;
	text-align: start;
	transition: background-color var(--gdlb-acc-speed) ease, color var(--gdlb-acc-speed) ease;
}

.gdlb-acc .gdlb-acc__header:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: -4px;
}

.gdlb-acc__icon,
.gdlb-acc__toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	line-height: 1;
}

.gdlb-acc__icon {
	font-size: 1.1em;
}

.gdlb-acc__icon svg,
.gdlb-acc__toggle svg {
	width: 1em;
	height: 1em;
}

/* Bloque central: título + (contador y etiqueta) */
.gdlb-acc__main {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	align-items: center;
	gap: 12px;
}

.gdlb-acc__title {
	flex: 0 1 auto;
	min-width: 0;
	font-weight: 600;
}

/* Contador pegado al título; la etiqueta se va a la derecha */
.gdlb-acc__meta {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	align-items: center;
	gap: 10px;
}
.gdlb-acc__meta > .gdlb-acc__badge {
	margin-inline-start: auto;
}

/* Apilado: título en la 1ª línea; contador y etiqueta en la 2ª */
.gdlb-acc--stack .gdlb-acc__main {
	flex-direction: column;
	align-items: flex-start;
	gap: 6px;
}
.gdlb-acc--stack .gdlb-acc__title {
	max-width: 100%;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.gdlb-acc--stack .gdlb-acc__meta {
	flex-wrap: wrap;
	width: 100%;
	gap: 8px;
}
.gdlb-acc--stack .gdlb-acc__meta > .gdlb-acc__badge {
	margin-inline-start: 0;
}
.gdlb-acc--stack .gdlb-acc__count {
	margin-inline-start: 0;
}

@media (max-width: 1024px) {
	.gdlb-acc--stack-tablet .gdlb-acc__main {
		flex-direction: column;
		align-items: flex-start;
		gap: 6px;
	}
	.gdlb-acc--stack-tablet .gdlb-acc__title {
		max-width: 100%;
		white-space: nowrap;
		overflow: hidden;
		text-overflow: ellipsis;
	}
	.gdlb-acc--stack-tablet .gdlb-acc__meta {
		flex-wrap: wrap;
		width: 100%;
		gap: 8px;
	}
	.gdlb-acc--stack-tablet .gdlb-acc__meta > .gdlb-acc__badge,
	.gdlb-acc--stack-tablet .gdlb-acc__count {
		margin-inline-start: 0;
	}
}

@media (max-width: 767px) {
	.gdlb-acc--stack-mobile .gdlb-acc__main {
		flex-direction: column;
		align-items: flex-start;
		gap: 6px;
	}
	.gdlb-acc--stack-mobile .gdlb-acc__title {
		max-width: 100%;
		white-space: nowrap;
		overflow: hidden;
		text-overflow: ellipsis;
	}
	.gdlb-acc--stack-mobile .gdlb-acc__meta {
		flex-wrap: wrap;
		width: 100%;
		gap: 8px;
	}
	.gdlb-acc--stack-mobile .gdlb-acc__meta > .gdlb-acc__badge,
	.gdlb-acc--stack-mobile .gdlb-acc__count {
		margin-inline-start: 0;
	}
}

/* Contador "12 eventos esta semana" */
.gdlb-acc__count {
	flex: 0 1 auto;
	min-width: 0;
	white-space: nowrap;
	font-size: 0.9em;
	line-height: 1.2;
}
.gdlb-acc__count-num {
	font-weight: 700;
	font-variant-numeric: tabular-nums;
}
.gdlb-acc__count-txt {
	opacity: 0.75;
}

.gdlb-acc__badge {
	flex: 0 0 auto;
	font-size: 0.85em;
	line-height: 1.2;
	padding: 3px 10px;
	border-radius: 999px;
	background: rgba(0, 0, 0, 0.06);
}

/* Indicador a la izquierda */
.gdlb-acc--toggle-left .gdlb-acc__toggle {
	order: -1;
}

/* Cambio de ícono del indicador */
.gdlb-acc__toggle-open {
	display: none;
}
.gdlb-acc__item.is-open > .gdlb-acc__heading .gdlb-acc__toggle-closed {
	display: none;
}
.gdlb-acc__item.is-open > .gdlb-acc__heading .gdlb-acc__toggle-open {
	display: inline-flex;
}

/* Panel: el contenido siempre está en el HTML (bueno para SEO);
   solo se oculta visualmente con una animación de altura. */
.gdlb-acc__panel {
	display: grid;
	grid-template-rows: 0fr;
	visibility: hidden;
	transition: grid-template-rows var(--gdlb-acc-speed) ease, visibility 0s linear var(--gdlb-acc-speed);
}

.gdlb-acc__item.is-open > .gdlb-acc__panel {
	grid-template-rows: 1fr;
	visibility: visible;
	transition: grid-template-rows var(--gdlb-acc-speed) ease, visibility 0s linear 0s;
}

.gdlb-acc__panel-inner {
	min-height: 0;
	overflow: hidden;
}

.gdlb-acc__content {
	padding: 4px 20px 20px;
}

.gdlb-acc__content > :first-child {
	margin-top: 0;
}
.gdlb-acc__content > :last-child {
	margin-bottom: 0;
}

/* Botón "Cargar más" */
.gdlb-acc__more-wrap--btn {
	margin-top: 20px;
	text-align: center;
}
.gdlb-acc .gdlb-acc__more-btn {
	all: unset;
	box-sizing: border-box;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	padding: 0 28px;
	border: 2px solid currentColor;
	border-radius: 999px;
	font-weight: 600;
	cursor: pointer;
	transition: background-color .2s ease, color .2s ease, opacity .2s ease;
}
.gdlb-acc .gdlb-acc__more-btn:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 3px;
}

/* Paginación numerada */
.gdlb-acc__pag {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 6px;
	margin-top: 20px;
}
.gdlb-acc__pag a,
.gdlb-acc__pag span {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 40px;
	min-height: 40px;
	padding: 0 12px;
	border: 1px solid rgba(0, 0, 0, 0.15);
	border-radius: 8px;
	text-decoration: none;
	line-height: 1;
}
.gdlb-acc__pag .is-current {
	font-weight: 700;
	border-color: currentColor;
}
.gdlb-acc__pag .gdlb-acc__pag-dots {
	border-color: transparent;
	min-width: auto;
	padding: 0 4px;
}

/* Enlace "Ver todos" */
.gdlb-acc__more-wrap {
	margin-top: 16px;
	text-align: center;
}
.gdlb-acc__more {
	display: inline-block;
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
	.gdlb-acc .gdlb-acc__header,
	.gdlb-acc__panel,
	.gdlb-acc__item.is-open > .gdlb-acc__panel {
		transition: none;
	}
}
