/*
 * The footer calendar, [bca_calendar]. Sits on the dark footer, in a column
 * about 200px wide on a desktop and full width on a phone.
 *
 * Today has a white outline, which can sit on any mark. With dates="yes":
 * a school-closed day (holiday or vacation) is filled saffron, the strongest
 * mark because it changes a family's day; an exam is ringed; an event
 * carries a dot.
 */

.bca-cal {
	max-width: 300px;
	padding: 12px 10px 10px;
	border: 1px solid rgba(232, 220, 207, 0.18);
	border-radius: 12px;
	background-color: rgba(232, 220, 207, 0.04);
	color: #E8DCCF;
}

/* Without the script there is no grid to show, only the list of dates. */
.bca-cal:not(.is-ready) .bca-cal__head,
.bca-cal:not(.is-ready) .bca-cal__grid,
.bca-cal:not(.is-ready) .bca-cal__key {
	display: none;
}

.bca-cal__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	margin-bottom: 8px;
}

.bca-cal__title {
	margin: 0;
	color: #FFFFFF;
	font-family: "Montserrat", sans-serif;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.3;
	text-align: center;
}

.bca-cal .bca-cal__nav {
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	min-height: 0;
	margin: 0;
	padding: 0;
	border: 1px solid rgba(232, 220, 207, 0.22);
	border-radius: 50%;
	background: transparent;
	box-shadow: none;
	color: #E8DCCF;
	font: inherit;
	line-height: 1;
	cursor: pointer;
	transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}

.bca-cal .bca-cal__nav:hover:not(:disabled) {
	border-color: #E08A2E;
	background-color: #E08A2E;
	color: #3A2418;
}

.bca-cal .bca-cal__nav:disabled {
	opacity: 0.3;
	cursor: default;
}

.bca-cal .bca-cal__nav:focus-visible,
.bca-cal .bca-cal__day:focus-visible {
	outline: 2px solid #F2B36B;
	outline-offset: 2px;
}

/* Theme table styles add borders, stripes and padding; none apply here. */
.bca-cal .bca-cal__grid {
	width: 100%;
	margin: 0;
	border: 0;
	border-collapse: collapse;
	table-layout: fixed;
	background: none;
}

.bca-cal .bca-cal__grid th,
.bca-cal .bca-cal__grid td {
	padding: 2px 0;
	border: 0;
	background: none;
	text-align: center;
	vertical-align: middle;
}

.bca-cal .bca-cal__grid th {
	padding-bottom: 6px;
	color: #C9B9A8;
	font-family: "Montserrat", sans-serif;
	font-size: 10.5px;
	font-weight: 600;
	text-transform: uppercase;
}

/* A circle up to 28px, shrinking with the column so seven always fit. */
.bca-cal .bca-cal__day {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	max-width: 28px;
	aspect-ratio: 1;
	height: auto;
	min-height: 0;
	margin: 0 auto;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	box-shadow: none;
	color: #E8DCCF;
	font-family: "Montserrat", sans-serif;
	font-size: 12.5px;
	font-weight: 500;
	font-variant-numeric: tabular-nums;
	line-height: 1;
	text-transform: none;
}

.bca-cal button.bca-cal__day {
	cursor: pointer;
	transition: background-color 0.2s, box-shadow 0.2s;
}

/* The weekly off (Sunday) in light saffron, as a printed calendar shows it. */
.bca-cal .bca-cal__day.is-off {
	color: #F2B36B;
}

.bca-cal .bca-cal__day.is-closed {
	background-color: #E08A2E;
	color: #3A2418;
	font-weight: 700;
}

.bca-cal .bca-cal__day.is-exam {
	box-shadow: inset 0 0 0 1.5px #E08A2E;
	color: #FFFFFF;
}

.bca-cal .bca-cal__day.is-event::after {
	content: "";
	position: absolute;
	bottom: 3px;
	left: 50%;
	width: 4px;
	height: 4px;
	margin-left: -2px;
	border-radius: 50%;
	background-color: #F2B36B;
}

.bca-cal button.bca-cal__day:not(.is-closed):hover {
	background-color: rgba(232, 220, 207, 0.1);
}

.bca-cal button.bca-cal__day.is-closed:hover {
	background-color: #F2A04A;
}

.bca-cal .bca-cal__day.is-today {
	outline: 1.5px solid #FFFFFF;
	outline-offset: 1px;
	color: #FFFFFF;
	font-weight: 700;
}

.bca-cal .bca-cal__day.is-closed.is-today {
	color: #3A2418;
}

/* The day whose name is showing in the note below the grid. */
.bca-cal .bca-cal__day.is-picked {
	box-shadow: 0 0 0 3px rgba(242, 179, 107, 0.35);
}

.bca-cal .bca-cal__day.is-exam.is-picked {
	box-shadow: inset 0 0 0 1.5px #E08A2E, 0 0 0 3px rgba(242, 179, 107, 0.35);
}

.bca-cal__note {
	margin: 8px 0 0;
	color: #FFFFFF;
	font-size: 13px;
	line-height: 1.5;
	text-align: center;
}

.bca-cal__note:empty {
	display: none;
}

.bca-cal .bca-cal__key,
.bca-cal .bca-cal__next {
	margin: 10px 0 0;
	padding: 10px 0 0;
	border-top: 1px solid rgba(232, 220, 207, 0.12);
	list-style: none;
}

.bca-cal .bca-cal__key {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 4px 14px;
	color: #C9B9A8;
	font-size: 12px;
	line-height: 1.6;
}

.bca-cal .bca-cal__key li,
.bca-cal .bca-cal__next li {
	margin: 0;
	padding: 0;
	list-style: none;
}

.bca-cal .bca-cal__key li::before,
.bca-cal .bca-cal__next li::before {
	content: none;
}

.bca-cal .bca-cal__key li {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.bca-cal__mark {
	display: inline-block;
	flex: 0 0 auto;
	width: 10px;
	height: 10px;
	border-radius: 50%;
}

.bca-cal__mark.is-closed {
	background-color: #E08A2E;
}

.bca-cal__mark.is-exam {
	box-shadow: inset 0 0 0 1.5px #E08A2E;
}

.bca-cal__mark.is-event {
	width: 6px;
	height: 6px;
	margin: 0 2px;
	background-color: #F2B36B;
}

/* The key and the list share one rule above them when both show. */
.bca-cal.is-ready .bca-cal__key + .bca-cal__next {
	margin-top: 8px;
	padding-top: 0;
	border-top: 0;
}

.bca-cal .bca-cal__next li {
	display: flex;
	gap: 8px;
	margin-bottom: 4px;
	font-size: 13px;
	line-height: 1.5;
}

.bca-cal .bca-cal__next li:last-child {
	margin-bottom: 0;
}

.bca-cal__when {
	flex: 0 0 auto;
	color: #F2B36B;
	font-family: "Montserrat", sans-serif;
	font-size: 12px;
	font-weight: 600;
	line-height: 1.65;
	white-space: nowrap;
}

.bca-cal__what {
	color: #E8DCCF;
}

/* A narrow column (five footer columns on a small laptop or tablet): tighter
   box, smaller arrows and type, so the month name stays on one line. */
.bca-cal {
	container-type: inline-size;
}

@container (max-width: 200px) {
	.bca-cal__head {
		gap: 4px;
	}

	.bca-cal__title {
		font-size: 12.5px;
		white-space: nowrap;
	}

	.bca-cal .bca-cal__nav {
		width: 26px;
		height: 26px;
	}

	.bca-cal .bca-cal__day {
		font-size: 11.5px;
	}
}

/* Full width on a phone: bigger days, easier to tap. */
@media (max-width: 767px) {
	.bca-cal {
		max-width: 340px;
	}

	.bca-cal .bca-cal__day {
		max-width: 36px;
		font-size: 14px;
	}

	.bca-cal .bca-cal__grid td {
		padding: 3px 0;
	}
}
