.octane-event-calendar {
	--oec-accent: var(--wp--preset--color--primary, #1d4ed8);
	--oec-accent-text: var(--wp--preset--color--base, #fff);
	--oec-day-size: 2.25em;
	--oec-radius: 0.5rem;
	--oec-weekend-bg: #f6f7f8;
	--oec-today-bg: rgba(29, 78, 216, 0.08);
	container-type: inline-size;
	--oec-head-bg: var(--wp--preset--color--contrast, #1f2328);
	--oec-head-text: var(--wp--preset--color--base, #fff);
}

.octane-event-calendar__nav {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 0.5em;
}

.octane-event-calendar__nav a {
	padding: 0.25em 0.5em;
	text-decoration: none;
}

.octane-event-calendar__grid {
	width: 100%;
	table-layout: fixed;
	border-collapse: separate;
	border-spacing: 0;
	border-radius: var(--oec-radius);
	text-align: center;
}

.octane-event-calendar__grid th {
	padding: 0.25em 0;
	background: var(--oec-head-bg);
	border-color: rgba(255, 255, 255, 0.15);
	color: var(--oec-head-text);
}

.octane-event-calendar__grid td.is-weekend {
	background: var(--oec-weekend-bg);
}

.octane-event-calendar__grid td.is-today {
	background: var(--oec-today-bg);
}

@supports (background: color-mix(in srgb, red 10%, transparent)) {
	.octane-event-calendar__grid td.is-today {
		background: color-mix(in srgb, var(--oec-accent) 10%, transparent);
	}
}

.octane-event-calendar__grid th:first-child {
	border-top-left-radius: var(--oec-radius);
}

.octane-event-calendar__grid th:last-child {
	border-top-right-radius: var(--oec-radius);
}

.octane-event-calendar__grid tbody tr:last-child td:first-child {
	border-bottom-left-radius: var(--oec-radius);
}

.octane-event-calendar__grid tbody tr:last-child td:last-child {
	border-bottom-right-radius: var(--oec-radius);
}

.octane-event-calendar__grid td {
	position: relative;
	padding: 0;
}

.octane-event-calendar__cell {
	display: flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	aspect-ratio: 3 / 2;
}

.octane-event-calendar__day:not(.has-events) .octane-event-calendar__cell {
	opacity: 0.6;
}

.octane-event-calendar__day.is-today {
	font-weight: 700;
}

.octane-event-calendar__day.is-today .octane-event-calendar__cell {
	position: relative;
	opacity: 1;
}

.octane-event-calendar__today {
	position: absolute;
	bottom: 0.2em;
	left: 0;
	right: 0;
	font-size: 0.625em;
	font-weight: 600;
	letter-spacing: 0.04em;
	line-height: 1;
	text-transform: uppercase;
}

@container (max-width: 26rem) {
	.octane-event-calendar__today {
		display: none;
	}
}

.octane-event-calendar__day.has-events .octane-event-calendar__cell > a {
	display: flex;
	align-items: center;
	justify-content: center;
	height: min(var(--oec-day-size), 90%);
	aspect-ratio: 1;
	border-radius: 50%;
	background: var(--oec-accent);
	color: var(--oec-accent-text);
	text-decoration: none;
}

.octane-event-calendar__day.has-events .octane-event-calendar__cell > a:hover,
.octane-event-calendar__day.has-events .octane-event-calendar__cell > a:focus-visible {
	opacity: 0.85;
}

.octane-event-calendar__day.is-selected .octane-event-calendar__cell > a {
	outline: 2px solid var(--oec-accent);
	outline-offset: 2px;
}

.octane-event-calendar__popover {
	position: absolute;
	bottom: calc(100% - 0.25rem);
	left: 50%;
	z-index: 20;
	box-sizing: border-box;
	width: 14rem;
	max-width: calc(100vw - 1rem);
	padding: 0.65rem 0.75rem;
	border: 1px solid rgba(0, 0, 0, 0.15);
	border-radius: 0.375rem;
	background: #fff;
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
	color: #1a1a1a;
	font-size: 0.875rem;
	line-height: 1.35;
	text-align: left;
	transform: translateX(calc(-50% + var(--oec-shift, 0px)));
}

.octane-event-calendar__popover[hidden] {
	display: none;
}

.octane-event-calendar__popover.is-below {
	top: calc(100% - 0.25rem);
	bottom: auto;
}

.octane-event-calendar__events {
	margin: 0;
	padding: 0;
	list-style: none;
}

.octane-event-calendar__events li + li {
	margin-top: 0.6rem;
	padding-top: 0.6rem;
	border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.octane-event-calendar__event-title {
	display: block;
	font-weight: 600;
}

.octane-event-calendar__event-link {
	display: inline-block;
	margin-top: 0.4rem;
	padding: 0.3em 0.9em;
	border-radius: 999px;
	background: var(--oec-accent);
	color: var(--oec-accent-text);
	font-size: 0.8125rem;
	font-weight: 600;
	text-decoration: none;
}

.octane-event-calendar__event-link:hover,
.octane-event-calendar__event-link:focus-visible {
	opacity: 0.85;
}

.octane-event-calendar__all-link {
	display: block;
	margin-top: 0.6rem;
	font-size: 0.8125rem;
}

.octane-event-calendar__filter {
	margin-top: 0.75em;
	font-size: 0.9em;
}

.octane-event-calendar .screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}
