/* Events Calendar frontend styles. Themable via CSS custom properties. */

.ec-calendar,
.ec-list,
.ec-single {
	--ec-accent: #2271b1;
	--ec-border: #dcdcde;
	--ec-muted: #646970;
	--ec-text: #1d2327;
	--ec-surface: #fff;
	--ec-spacing: 0.75rem;
	--ec-radius: 8px;
	--ec-shadow: 0 1px 2px rgba(29, 35, 39, 0.05), 0 6px 20px rgba(29, 35, 39, 0.06);
}

/* Dark-on-white only on the plugin's own surfaces; .ec-single wraps theme
   content, so it must not force a text color on the whole article. */
.ec-calendar,
.ec-list__item,
.ec-list__empty,
.ec-single__meta {
	color: var(--ec-text);
}

.ec-calendar a:focus-visible,
.ec-list a:focus-visible,
.ec-single__meta a:focus-visible {
	outline: 2px solid var(--ec-accent);
	outline-offset: 2px;
}

/* Calendar */

.ec-calendar {
	background: var(--ec-surface);
	border: 1px solid var(--ec-border);
	border-radius: var(--ec-radius);
	padding: var(--ec-spacing);
	box-shadow: var(--ec-shadow);
}

.ec-calendar__nav {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: var(--ec-spacing);
}

.ec-calendar__month {
	font-weight: 600;
	font-size: 1.125em;
}

.ec-calendar__nav a {
	text-decoration: none;
	color: var(--ec-accent);
	padding: 0.25rem 0.625rem;
	border: 1px solid var(--ec-border);
	border-radius: 999px;
	line-height: 1.4;
}

.ec-calendar__nav a:hover {
	background: color-mix(in srgb, var(--ec-accent) 10%, var(--ec-surface));
	border-color: var(--ec-accent);
}

.ec-calendar__grid {
	width: 100%;
	border-collapse: collapse;
	table-layout: fixed;
}

.ec-calendar__grid th {
	padding: calc(var(--ec-spacing) / 2);
	text-align: center;
	font-size: 0.75em;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--ec-muted);
	border-bottom: 2px solid var(--ec-border);
}

.ec-calendar__day {
	vertical-align: top;
	min-height: 5rem;
	height: 5rem;
	padding: calc(var(--ec-spacing) / 2);
	border: 1px solid var(--ec-border);
	background: var(--ec-surface);
}

.ec-calendar__day--empty {
	background: color-mix(in srgb, var(--ec-border) 20%, var(--ec-surface));
	border-color: var(--ec-border);
}

.ec-calendar__day--today .ec-calendar__day-number {
	background: var(--ec-accent);
	color: #fff;
	border-radius: 50%;
	display: inline-block;
	width: 1.6em;
	height: 1.6em;
	line-height: 1.6em;
	text-align: center;
}

.ec-calendar__day-number {
	font-size: 0.875em;
	color: var(--ec-muted);
}

.ec-calendar__events {
	list-style: none;
	margin: 0.25rem 0 0;
	padding: 0;
}

.ec-calendar__event a {
	display: block;
	font-size: 0.8125em;
	line-height: 1.3;
	margin-bottom: 0.25rem;
	padding: 0.125rem 0.25rem;
	color: var(--ec-text);
	background: color-mix(in srgb, var(--ec-accent) 12%, transparent);
	border-left: 2px solid var(--ec-accent);
	border-radius: 2px;
	text-decoration: none;
	overflow-wrap: anywhere;
}

.ec-calendar__event a:hover {
	background: color-mix(in srgb, var(--ec-accent) 22%, transparent);
}

/* List */

.ec-list__items {
	list-style: none;
	margin: 0;
	padding: 0;
}

.ec-list__item {
	display: flex;
	align-items: flex-start;
	gap: calc(var(--ec-spacing) * 1.5);
	padding: var(--ec-spacing);
	background: var(--ec-surface);
	border: 1px solid var(--ec-border);
	border-radius: var(--ec-radius);
	box-shadow: var(--ec-shadow);
	transition: box-shadow 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.ec-list__item + .ec-list__item {
	margin-top: var(--ec-spacing);
}

.ec-list__item:hover {
	border-color: color-mix(in srgb, var(--ec-accent) 40%, var(--ec-border));
	box-shadow: 0 2px 4px rgba(29, 35, 39, 0.06), 0 10px 28px rgba(29, 35, 39, 0.1);
	transform: translateY(-1px);
}

@media (prefers-reduced-motion: reduce) {
	.ec-list__item {
		transition: none;
	}

	.ec-list__item:hover {
		transform: none;
	}
}

/* Date badge styled as a tear-off calendar sheet: accent month band with
   binder holes on top, day number on the page below. */
.ec-list__date-badge {
	display: flex;
	flex-direction: column-reverse; /* month band above the day number */
	flex: 0 0 3.75rem;
	text-align: center;
	background: var(--ec-surface);
	border: 1px solid var(--ec-border);
	border-radius: 6px;
	overflow: hidden;
	box-shadow: 0 2px 5px rgba(29, 35, 39, 0.12);
}

.ec-list__date-day {
	display: block;
	font-size: 1.5em;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	line-height: 1;
	padding: 0.4rem 0 0.45rem;
}

.ec-list__date-month {
	position: relative;
	display: block;
	font-size: 0.6875em;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.1em;
	background: var(--ec-accent);
	color: #fff;
	padding: 0.25em 0;
}

.ec-list__date-month::before,
.ec-list__date-month::after {
	content: "";
	position: absolute;
	top: 50%;
	width: 0.3em;
	height: 0.3em;
	margin-top: -0.15em;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.55);
}

.ec-list__date-month::before {
	left: 0.5em;
}

.ec-list__date-month::after {
	right: 0.5em;
}

.ec-list__body {
	min-width: 0;
}

.ec-list__title {
	margin: 0 0 0.25rem;
	font-size: 1.125em;
	line-height: 1.35;
}

.ec-list__title a {
	color: inherit;
	text-decoration: none;
}

.ec-list__title a:hover {
	color: var(--ec-accent);
	text-decoration: underline;
}

.ec-list__meta {
	margin: 0 0 0.375rem;
	color: var(--ec-muted);
	font-size: 0.875em;
}

.ec-list__excerpt {
	margin: 0;
	font-size: 0.9375em;
	line-height: 1.55;
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	overflow: hidden;
}

.ec-list__empty {
	padding: calc(var(--ec-spacing) * 2);
	text-align: center;
	color: var(--ec-muted);
	background: var(--ec-surface);
	border: 1px dashed var(--ec-border);
	border-radius: var(--ec-radius);
}

.ec-list__pagination {
	display: flex;
	justify-content: space-between;
	margin-top: var(--ec-spacing);
}

.ec-list__pagination a {
	color: var(--ec-accent);
	text-decoration: none;
	padding: 0.375rem 0.875rem;
	border: 1px solid var(--ec-border);
	border-radius: 999px;
}

.ec-list__pagination a:hover {
	background: color-mix(in srgb, var(--ec-accent) 10%, var(--ec-surface));
	border-color: var(--ec-accent);
}

/* Keep "next" on the right when there is no "previous" link. */
.ec-list__pagination-next {
	margin-left: auto;
}

/* Single event */

.ec-single__image {
	margin: 0 0 1rem;
}

.ec-single__image img {
	max-width: 100%;
	height: auto;
	border-radius: var(--ec-radius);
}

.ec-single__meta {
	margin: 1.25rem 0;
	padding: calc(var(--ec-spacing) * 1.5);
	background: var(--ec-surface);
	border: 1px solid var(--ec-border);
	border-radius: var(--ec-radius);
	box-shadow: var(--ec-shadow);
}

.ec-single__meta h2 {
	font-size: 0.75em;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--ec-muted);
	margin: var(--ec-spacing) 0 0.25rem;
}

.ec-single__meta h2:first-child {
	margin-top: 0;
}

.ec-single__meta p {
	margin: 0;
	line-height: 1.55;
}

.ec-single__meta a {
	color: var(--ec-accent);
	text-decoration: none;
}

.ec-single__meta a:hover {
	text-decoration: underline;
}
