/**
 * Month-grid calendar styles for [oe_calendar].
 */

.oe-calendar {
	--oe-cal-border: #e3e8ef;
	--oe-cal-ink: #0b1f3a;
	--oe-cal-muted: #5a6a82;
	--oe-cal-accent: #e8352a;
	--oe-cal-today: #fff5f4;
	font-family: inherit;
	color: var(--oe-cal-ink);
}

.oe-calendar__toolbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	margin-bottom: 1rem;
}

.oe-calendar__title {
	margin: 0;
	font-size: 1.4rem;
	font-weight: 700;
	text-align: center;
	flex: 1 1 auto;
}

.oe-calendar__nav {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.5rem;
	height: 2.5rem;
	border: 1px solid var(--oe-cal-border);
	border-radius: 8px;
	font-size: 1.5rem;
	line-height: 1;
	text-decoration: none;
	color: var(--oe-cal-ink);
	background: #fff;
}

.oe-calendar__nav:hover,
.oe-calendar__nav:focus {
	border-color: var(--oe-cal-accent);
	color: var(--oe-cal-accent);
}

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

.oe-calendar__weekday {
	padding: 0.5rem;
	font-size: 0.75rem;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--oe-cal-muted);
	text-align: left;
	border-bottom: 2px solid var(--oe-cal-border);
}

.oe-calendar__cell {
	vertical-align: top;
	height: 6.5rem;
	padding: 0.35rem;
	border: 1px solid var(--oe-cal-border);
}

.oe-calendar__cell--empty {
	background: #fafbfc;
}

.oe-calendar__cell--today {
	background: var(--oe-cal-today);
	box-shadow: inset 0 0 0 2px var(--oe-cal-accent);
}

.oe-calendar__daynum {
	display: block;
	font-size: 0.8rem;
	font-weight: 600;
	color: var(--oe-cal-muted);
	margin-bottom: 0.25rem;
}

.oe-calendar__cell--today .oe-calendar__daynum {
	color: var(--oe-cal-accent);
}

.oe-calendar__events {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 0.2rem;
}

.oe-calendar__event-link {
	display: block;
	padding: 0.2rem 0.35rem;
	border-radius: 6px;
	background: var(--oe-cal-ink);
	color: #fff;
	text-decoration: none;
	font-size: 0.72rem;
	line-height: 1.25;
	overflow: hidden;
}

.oe-calendar__event-link:hover,
.oe-calendar__event-link:focus {
	background: var(--oe-cal-accent);
	color: #fff;
}

.oe-calendar__event-time {
	display: block;
	font-weight: 700;
	opacity: 0.85;
}

.oe-calendar__event-title {
	display: block;
	white-space: nowrap;
	text-overflow: ellipsis;
	overflow: hidden;
}

.oe-calendar__subscribe {
	margin-top: 1rem;
	font-size: 0.9rem;
}

/* Responsive: stack into a day list on narrow screens. */
@media (max-width: 640px) {
	.oe-calendar__grid,
	.oe-calendar__grid thead,
	.oe-calendar__grid tbody,
	.oe-calendar__grid tr {
		display: block;
	}

	.oe-calendar__grid thead {
		display: none;
	}

	.oe-calendar__cell {
		display: block;
		width: 100%;
		height: auto;
		min-height: 2.5rem;
	}

	.oe-calendar__cell--empty {
		display: none;
	}

	.oe-calendar__daynum {
		font-size: 0.95rem;
	}
}
