/* Convocatorias shortcode — uses theme color variables */

.clgds-convocatorias {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
	gap: 1.5rem;
	width: 100%;
}

/* Card */
.clgds-convocatoria-card {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	background-color: var(--wp--preset--color--secondary-light, #fff);
	border-radius: 22px;
	padding: 1.5rem;
	border: 1px solid var(--wp--preset--color--border-color, #EAE1F0);
}

/* Featured image (formacion archive) */
.clgds-convocatoria-card__imagen {
	display: block;
	width: 100%;
	aspect-ratio: 16 / 10;
	overflow: hidden;
	border-radius: 22px;
	margin-bottom: 0.25rem;
}

.clgds-convocatoria-card__imagen img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

/* Footer without price (formacion archive) */
.clgds-convocatoria-card__footer--formacion {
	justify-content: flex-end;
}

/* Book cover image (publicacion archive) */
.clgds-publicacion-card__imagen {
	aspect-ratio: 2 / 3;
}

/* Date badge */
.clgds-convocatoria-card__fecha {
	display: inline-flex;
	align-self: flex-start;
	background-color: var(--wp--preset--color--secondary, #FEF7F7);
	color: var(--wp--preset--color--primary, #596a35);
	font-family: var(--wp--preset--font-family--chillax, sans-serif);
	font-size: 14px;
	font-weight: 500;
	border-radius: 8px;
	padding: 4px 10px;
	margin-bottom: 0.25rem;
	align-items: baseline;
}

/* Date badge numbers */
.clgds-convocatoria-card__fecha {
	font-family: var(--wp--preset--font-family--body, sans-serif);
	font-weight: 500;
	font-size: 26px;
	color: var(--wp--preset--color--primary, #596a35);
}

/* Date badge month span */
.clgds-convocatoria-card__mes {
	font-family: var(--wp--preset--font-family--body, sans-serif);
	font-weight: 400;
	font-size: 12px;
	color: var(--wp--preset--color--primary, #596a35);
	margin-left: 4px;
}

/* Category label */
.clgds-convocatoria-card__categoria {
	font-family: var(--wp--preset--font-family--body, sans-serif);
	font-size: 11px;
	font-weight:  500;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--wp--preset--color--primary, #596a35);
	margin: 0;
}

/* Title */
.clgds-convocatoria-card__titulo {
	font-family: var(--wp--preset--font-family--body, sans-serif);
	font-size: 18px;
	font-weight: 600;
	line-height: 1.3;
	color: var(--wp--preset--color--tertiary, #141414);
	margin: 0;
}

.clgds-convocatoria-card__titulo a {
	color: inherit;
	text-decoration: none;
}

.clgds-convocatoria-card__titulo a:hover {
	color: var(--wp--preset--color--primary, #596a35);
}

/* Meta (duration + location) */
.clgds-convocatoria-card__meta {
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
	margin-top: 0.5rem;
	border-top: 1px solid var(--wp--preset--color--border-light, #e9e5f2);
	padding-top: 1rem;
}

.clgds-convocatoria-card__meta-item {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	font-family: var(--wp--preset--font-family--body, sans-serif);
	font-size: 14px;
	font-weight: 400;
	color: var(--wp--preset--color--accent, #4A3E66);
}

.clgds-convocatoria-card__meta-item svg {
	flex-shrink: 0;
	width: 18px;
	height: 18px;
}

/* Footer: price + CTA */
.clgds-convocatoria-card__footer {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	margin-top: auto;
	padding-top: 1rem;
	border-top: 1px solid var(--wp--preset--color--border-light, #e9e5f2);
}

.clgds-convocatoria-card__precio {
	display: flex;
	flex-direction: column;
}

.clgds-convocatoria-card__precio-label {
	font-family: var(--wp--preset--font-family--body, sans-serif);
	font-size: 12px;
	font-weight: 400;
	color: var(--wp--preset--color--accent-light, #8B80A3);
}

.clgds-convocatoria-card__precio-valor {
	font-family: var(--wp--preset--font-family--body, sans-serif);
	font-size: 20px;
	font-weight: 500;
	color: var(--wp--preset--color--tertiary, #141414);
}

.clgds-convocatoria-card__cta {
	font-family: var(--wp--preset--font-family--body, sans-serif);
	font-size: 14px;
	font-weight: 500;
	color: var(--wp--preset--color--primary, #596a35);
	text-decoration: none;
	white-space: nowrap;
}

.clgds-convocatoria-card__cta:hover {
	text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
	.clgds-convocatorias {
		grid-template-columns: 1fr;
	}
}

/* Pagination */
.clgds-convocatorias__paginacion {
	display: flex;
	justify-content: center;
	gap: 0.5rem;
	margin-top: 2rem;
	flex-wrap: wrap;
}

.clgds-convocatorias__paginacion .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	min-width: 36px;
	height: 36px;
	padding: 0 0.5rem;
	border-radius: 8px;
	font-family: var(--wp--preset--font-family--body, sans-serif);
	font-size: 14px;
	font-weight: 500;
	color: var(--wp--preset--color--tertiary, #141414);
	text-decoration: none;
	border: 1px solid var(--wp--preset--color--border-light, #e9e5f2);
	transition: background-color 0.2s ease, color 0.2s ease;
}

.clgds-convocatorias__paginacion .page-numbers:hover {
	background-color: var(--wp--preset--color--primary-light, #ede9e4);
}

.clgds-convocatorias__paginacion .page-numbers.current {
	background-color: var(--wp--preset--color--primary, #596a35);
	color: var(--wp--preset--color--secondary-light, #fff);
	border-color: var(--wp--preset--color--primary, #596a35);
}

/* Slider mode */
.clgds-convocatorias--slider {
	display: flex;
	flex-direction: column;
	gap: 1.5rem;
}

.clgds-convocatorias__viewport {
	overflow: hidden;
	width: 100%;
}

.clgds-convocatorias__track {
	display: flex;
	gap: 1.5rem;
	overflow-x: auto;
	scroll-snap-type: x proximity;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
	padding-bottom: 4px;
	cursor: grab;
}

.clgds-convocatorias__track:active {
	cursor: grabbing;
}

.clgds-convocatorias__track::-webkit-scrollbar {
	display: none;
}

.clgds-convocatorias--slider .clgds-convocatoria-card {
	flex: 0 0 280px;
	scroll-snap-align: start;
}

/* Dots */
.clgds-convocatorias__dots {
	display: flex;
	justify-content: center;
	gap: 0.5rem;
}

.clgds-convocatorias__dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	border: none;
	padding: 0;
	cursor: pointer;
	background-color: var(--wp--preset--color--border-light, #e9e5f2);
	transition: background-color 0.2s ease;
}

.clgds-convocatorias__dot.is-active {
	background-color: var(--wp--preset--color--primary, #596a35);
}

@media (max-width: 768px) {
	.clgds-convocatorias__viewport,
	.clgds-convocatorias__track {
		width: 100%;
	}

	.clgds-convocatorias__track {
		gap: 0;
	}

	.clgds-convocatorias--slider .clgds-convocatoria-card {
		box-sizing: border-box;
		flex: 0 0 100%;
		min-width: 100%;
		scroll-snap-align: start;
	}
}
