/* Blog Events Calendar: colours come from the theme (currentColor), so it fits light and dark themes. */
.evcal {
	--evcal-line: color-mix(in srgb, currentColor 18%, transparent);
	--evcal-soft: color-mix(in srgb, currentColor 6%, transparent);
	--evcal-strong: color-mix(in srgb, currentColor 12%, transparent);
	scroll-margin-top: 4rem;
}

.evcal-views,
.evcal-scopes,
.evcal-nav,
.evcal-pages {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem;
}

.evcal-views {
	margin-bottom: 1rem;
	border-bottom: 1px solid var(--evcal-line);
}

.evcal-tab {
	padding: 0.4rem 0.9rem;
	text-decoration: none;
	border-bottom: 3px solid transparent;
	margin-bottom: -1px;
}

.evcal-tab.is-current {
	border-bottom-color: currentColor;
	font-weight: 600;
}

.evcal-bar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 0.5rem 1rem;
	margin-bottom: 0.75rem;
}

.evcal .evcal-title {
	margin: 0;
	font-size: 1.5rem;
}

.evcal-nav a,
.evcal-nav span,
.evcal-scope,
.evcal-pages a {
	padding: 0.25rem 0.75rem;
	border: 1px solid var(--evcal-line);
	border-radius: 4px;
	text-decoration: none;
	line-height: 1.5;
}

.evcal-nav .is-disabled {
	opacity: 0.35;
}

.evcal-scope.is-current {
	background: var(--evcal-strong);
	font-weight: 600;
}

.evcal-badge {
	display: inline-block;
	padding: 0 0.4em;
	border: 1px solid currentColor;
	border-radius: 3px;
	font-size: 0.7em;
	font-weight: 400;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	vertical-align: middle;
	opacity: 0.7;
}

.evcal-empty {
	padding: 1rem 0;
	opacity: 0.75;
}

/* Calendar */
.evcal-grid {
	width: 100%;
	table-layout: fixed;
	border-collapse: collapse;
}

.evcal-grid th {
	padding: 0.4rem;
	font-size: 0.8rem;
	font-weight: 600;
	text-align: left;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.evcal-grid th abbr {
	text-decoration: none;
}

.evcal-day {
	height: 6.5rem;
	padding: 0.3rem;
	border: 1px solid var(--evcal-line);
	vertical-align: top;
	font-size: 0.8rem;
	line-height: 1.3;
}

.evcal-day.is-other-month {
	background: var(--evcal-soft);
}

.evcal-day.is-other-month .evcal-daynum,
.evcal-day.is-other-month .evcal-events {
	opacity: 0.55;
}

.evcal-day.is-today {
	box-shadow: inset 0 0 0 2px currentColor;
}

.evcal-daynum {
	display: block;
	font-weight: 600;
}

.evcal-daylabel {
	display: none;
}

.evcal .evcal-events {
	margin: 0.2rem 0 0;
	padding: 0;
	list-style: none;
}

.evcal-event {
	margin: 0 0 0.25rem;
	padding: 0.15rem 0.3rem;
	border-left: 3px solid currentColor;
	background: var(--evcal-soft);
	overflow-wrap: anywhere;
}

.evcal-event a {
	text-decoration: none;
}

.evcal-event a:hover,
.evcal-event a:focus {
	text-decoration: underline;
}

.evcal-event.is-continued {
	border-left-style: dotted;
}

.evcal-event.is-unpublished,
.evcal-item.is-unpublished {
	border-left-style: dashed;
}

.evcal-time {
	font-weight: 600;
	white-space: nowrap;
}

/* List */
.evcal .evcal-month {
	margin: 1.5rem 0 0.5rem;
	padding-bottom: 0.25rem;
	border-bottom: 1px solid var(--evcal-line);
	font-size: 1.15rem;
}

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

.evcal-item {
	display: flex;
	gap: 1rem;
	padding: 0.75rem 0;
	border-bottom: 1px solid var(--evcal-soft);
}

.evcal-item.is-unpublished {
	padding-left: 0.5rem;
	border-left: 3px dashed var(--evcal-line);
}

.evcal-date {
	display: flex;
	flex: 0 0 3.5rem;
	flex-direction: column;
	align-items: center;
	align-self: flex-start;
	padding: 0.3rem 0;
	border: 1px solid var(--evcal-line);
	border-radius: 4px;
	line-height: 1.15;
	text-align: center;
}

.evcal-dow,
.evcal-mon {
	font-size: 0.7rem;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

.evcal-dom {
	font-size: 1.4rem;
	font-weight: 700;
}

.evcal-body {
	min-width: 0;
}

.evcal .evcal-item-title {
	margin: 0 0 0.2rem;
	font-size: 1.1rem;
}

.evcal-body p {
	margin: 0 0 0.2rem;
	font-size: 0.9rem;
}

.evcal-when {
	font-weight: 600;
}

.evcal-pages {
	justify-content: space-between;
	margin-top: 1rem;
}

/* Single event */
.evcal-details {
	margin: 0 0 1.5rem;
	padding: 1rem 1.25rem;
	border: 1px solid color-mix(in srgb, currentColor 18%, transparent);
	border-left-width: 4px;
	border-radius: 4px;
}

.evcal-details p {
	margin: 0 0 0.6rem;
}

.evcal-details p:last-child {
	margin-bottom: 0;
}

.evcal-details strong {
	display: block;
	font-size: 0.75rem;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	opacity: 0.7;
}

.evcal-button {
	display: inline-block;
	text-decoration: none;
}

/* Narrow screens: the grid becomes a list of the days that have events. */
@media (max-width: 640px) {
	.evcal-grid,
	.evcal-grid tbody,
	.evcal-grid tr,
	.evcal-day {
		display: block;
		width: auto;
		height: auto;
	}

	.evcal-grid thead,
	.evcal-day:not(.has-events),
	.evcal-day.is-other-month,
	.evcal-daynum {
		display: none;
	}

	.evcal-day {
		margin-bottom: 0.5rem;
		padding: 0.5rem;
		font-size: 0.95rem;
	}

	.evcal-daylabel {
		display: block;
		font-weight: 600;
	}
}
