/**
 * Front-end styles for the MOTM Busy Times block.
 *
 * Adds a small coloured dot beneath each Flatpickr day cell that has traffic
 * data, using the same four-level colour scale as the bar chart.
 * The ::after pseudo-element approach avoids conflicting with Flatpickr's
 * own background colours for selected, today, and hovered states.
 */

.flatpickr-day.motm-day-not-busy,
.flatpickr-day.motm-day-light,
.flatpickr-day.motm-day-moderate,
.flatpickr-day.motm-day-peak {
	position: relative;
	/* Flatpickr already sets this; declared here for safety. */
}

.flatpickr-day.motm-day-not-busy::after,
.flatpickr-day.motm-day-light::after,
.flatpickr-day.motm-day-moderate::after,
.flatpickr-day.motm-day-peak::after {
	content: '';
	display: block;
	width: 15px;
	height: 5px;
	border-radius: 0;
	position: absolute;
	bottom: 4px;
	left: 50%;
	transform: translateX(-50%);
}

.flatpickr-day.motm-day-not-busy::after {
	background-color: rgba(39, 174, 96, 0.9);
}

.flatpickr-day.motm-day-light::after {
	background-color: rgba(255, 234, 0, 0.9);
}

.flatpickr-day.motm-day-moderate::after {
	background-color: rgba(255, 172, 28, 0.9);
}

.flatpickr-day.motm-day-peak::after {
	background-color: rgba(192, 57, 43, 0.9);
}

.flatpickr-day.nextMonthDay.motm-day-not-busy::after {
	background-color: rgba(39, 174, 95, 0.4);
}

.flatpickr-day.nextMonthDay.motm-day-light::after {
	background-color: rgba(255, 234, 0, 0.4);
}

.flatpickr-day.nextMonthDay.motm-day-moderate::after {
	background-color: rgba(255, 172, 28, 0.4);
}

.flatpickr-day.nextMonthDay.motm-day-peak::after {
	background-color: rgba(192, 57, 43, 0.4);
}

.motm-busy-times-top {
	display: flex;
	flex-direction: row;
	gap: 4rem;
	justify-content: flex-start;
	align-items: flex-end;
}

.motm-busy-times-top .flatpickr-calendar {
	flex-shrink: 0;
}

.motm-busy-times-chart-wrapper {
	flex: 1;
	width: 100%;
	min-width: 500px;
}

/* Colour legend */
.motm-busy-times-legend {
	list-style: none;
	margin: 0.75rem 0 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 0.25rem 1.25rem;
	font-size: 1.4rem;
	margin-bottom: 3rem;
}

.motm-busy-times-legend li {
	display: flex;
	align-items: center;
	gap: 0.4rem;
}

.motm-legend-swatch {
	display: inline-block;
	width: 14px;
	height: 14px;
	border-radius: 2px;
	flex-shrink: 0;
}

.motm-legend-not-busy {
	background-color: rgba(39, 174, 96, 0.75);
}

.motm-legend-light {
	background-color: rgba(255, 234, 0, 0.75);
}

.motm-legend-moderate {
	background-color: rgba(255, 172, 28, 0.75);
}

.motm-legend-peak {
	background-color: rgba(192, 57, 43, 0.75);
}

@media (max-width: 640px) {
	.motm-busy-times-top {
		display: block;
	}

	.motm-busy-times-chart-wrapper {
		width: 100%;
		min-width: 100%;
	}
}
