/**
 * Upcoming Calendar Events — front-end styles.
 * Professional card layout. Override with theme CSS using .uce-* classes.
 */

/* ---- Wrapper & states ---- */
.uce-events-wrapper {
	position: relative;
	font-family: inherit;
}

.uce-loading {
	display: flex;
	align-items: center;
	gap: 0.6em;
	color: #6b7280;
	font-size: 0.9em;
	padding: 1.5em 0;
}

.uce-loading::before {
	content: '';
	display: inline-block;
	width: 1em;
	height: 1em;
	border: 2px solid #d1d5db;
	border-top-color: #6366f1;
	border-radius: 50%;
	animation: uce-spin 0.7s linear infinite;
	flex-shrink: 0;
}

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

.uce-error {
	display: flex;
	align-items: center;
	gap: 0.5em;
	color: #dc2626;
	background: #fef2f2;
	border: 1px solid #fecaca;
	border-radius: 8px;
	padding: 0.875em 1em;
	font-size: 0.875em;
}

.uce-no-events {
	color: #6b7280;
	text-align: center;
	padding: 3em 1em;
	font-style: italic;
}

/* ---- Day group ---- */
.uce-event-groups {
	display: flex;
	flex-direction: column;
	gap: 2em;
}

.uce-day-group__header {
	display: flex;
	align-items: center;
	gap: 0.6em;
	margin-bottom: 0.875em;
}

.uce-day-group__dot {
	display: inline-block;
	width: 8px;
	height: 8px;
	background: #6366f1;
	border-radius: 50%;
	flex-shrink: 0;
}

.uce-day-group__label {
	font-size: 0.75em;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: #6366f1;
}

/* ---- Card grid ---- */
.uce-card-grid {
	display: flex;
	flex-direction: column;
	gap: 0.875em;
}

/* ---- Card ---- */
.uce-card {
	display: flex;
	align-items: flex-start;
	gap: 1em;
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 12px;
	padding: 1.125em 1.25em;
	transition: box-shadow 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.uce-card:hover {
	border-color: #c7d2fe;
	box-shadow: 0 4px 16px rgba(99, 102, 241, 0.1);
	transform: translateY(-1px);
}

/* Date badge */
.uce-card__date-badge {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	width: 3em;
	height: 3em;
	background: #eef2ff;
	border-radius: 10px;
	text-align: center;
	line-height: 1;
}

.uce-card__month {
	font-size: 0.6em;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: #6366f1;
}

.uce-card__day {
	font-size: 1.2em;
	font-weight: 800;
	color: #1e1b4b;
	margin-top: 0.1em;
}

/* Card content */
.uce-card__content {
	flex: 1 1 auto;
	min-width: 0;
}

.uce-card__title {
	margin: 0 0 0.4em;
	font-size: 0.975em;
	font-weight: 600;
	color: #111827;
	line-height: 1.3;
}

.uce-card__title a {
	color: inherit;
	text-decoration: none;
}

.uce-card__title a:hover {
	color: #6366f1;
}

/* Meta row */
.uce-card__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75em;
	margin-bottom: 0.5em;
}

.uce-card__meta-item {
	display: inline-flex;
	align-items: center;
	gap: 0.3em;
	font-size: 0.8em;
	color: #6b7280;
}

.uce-icon {
	width: 12px;
	height: 12px;
	flex-shrink: 0;
	color: #9ca3af;
}

/* Description */
.uce-card__description {
	font-size: 0.85em;
	color: #4b5563;
	line-height: 1.55;
	margin-top: 0.5em;
	border-top: 1px solid #f3f4f6;
	padding-top: 0.5em;
}

.uce-card__description p { margin: 0 0 0.4em; }
.uce-card__description p:last-child { margin: 0; }

/* CTA link */
.uce-card__cta {
	display: inline-flex;
	align-items: center;
	gap: 0.3em;
	font-size: 0.78em;
	font-weight: 600;
	color: #6366f1;
	text-decoration: none;
	margin-top: 0.6em;
	transition: gap 0.15s;
}

.uce-card__cta:hover {
	gap: 0.5em;
	text-decoration: underline;
}

.uce-card__cta .uce-icon {
	width: 13px;
	height: 13px;
	color: currentColor;
}

/* ---- Load more button ---- */
.uce-load-more-wrap {
	text-align: center;
	margin-top: 1.75em;
}

.uce-load-more {
	display: inline-flex;
	align-items: center;
	gap: 0.4em;
	padding: 0.625em 1.5em;
	background: #fff;
	color: #6366f1;
	border: 1.5px solid #6366f1;
	border-radius: 8px;
	font-size: 0.875em;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.15s, color 0.15s, opacity 0.15s;
}

.uce-load-more:hover:not(:disabled) {
	background: #6366f1;
	color: #fff;
}

.uce-load-more:disabled {
	opacity: 0.55;
	cursor: default;
}

.uce-load-more .uce-load-more__spinner {
	display: none;
	width: 0.85em;
	height: 0.85em;
	border: 2px solid currentColor;
	border-top-color: transparent;
	border-radius: 50%;
	animation: uce-spin 0.7s linear infinite;
}

.uce-load-more.is-loading .uce-load-more__spinner {
	display: inline-block;
}

/* ---- Block editor preview ---- */
.uce-block-loading {
	display: flex;
	align-items: center;
	gap: 0.5em;
	padding: 1em;
	color: #6b7280;
}

.uce-block-error {
	padding: 1em;
	color: #dc2626;
}

.uce-block-empty {
	padding: 1em;
	color: #9ca3af;
	font-style: italic;
}

/* ---- Responsive ---- */
@media ( max-width: 480px ) {
	.uce-card {
		flex-direction: column;
		gap: 0.75em;
	}

	.uce-card__date-badge {
		flex-direction: row;
		width: auto;
		height: auto;
		padding: 0.3em 0.6em;
		gap: 0.4em;
	}

	.uce-card__month { font-size: 0.7em; }
	.uce-card__day   { font-size: 0.9em; margin-top: 0; }
}
