section.schedule-metadata {
	margin-left: 3.5em;
	margin-bottom: 2em;
}

.schedule {
	display: grid;
	grid-template-columns: repeat(7, 1fr);
	grid-template-rows: auto repeat(calc(24 * 60 ), 0.5px);
	width: calc(100% - 7em);
	margin-inline: auto;
	margin-bottom: 2em;
	max-height: fit-content;
	background-color: var(--primary-light);
	border-top-left-radius: 1em;
	border-top-right-radius: 1em;
}

/* Hides the gap between the header and the sticky “table head”, where otherwise the “table's” contents would be visible. */
.schedule::before {
	position: sticky;
	top: 60px;
	grid-row: 1;
	grid-column: 1/8;
	background-color: white;
	border-bottom: 0.5em solid white;
	height: 10px;
	width: 100%;
	transform: translateY(calc(-100% + 0.5em));
	content: '';
	z-index: 3;
}

.schedule .heading {
	grid-row: 1;
	margin: auto; /* centre horizontally */
	position: sticky;
	top: 60px;
	display: flex;
	flex-direction: column;
	row-gap: 0.2em;
	width: 100%;
	height: fit-content;
	padding-block: 0.5em;
	justify-content: center;
	align-items: center;
	background-color: var(--primary);
	color: var(--primary-light);
	text-decoration: none;
	z-index: 3;
}

.schedule .heading-MONDAY {
	border-top-left-radius: 0.65em;
}

/* Hides the timestamps when scrolling vertically. */
.heading.heading-MONDAY::before {
	display: block;
	width: 3em;
	height: calc(100% + 1em + 10px); /* Account for top: -10px */
	content: "";
	background: linear-gradient(0deg,rgba(255,255,255,0) 0%,#fff 75%);
	transform: translateX(-100%);
	position: absolute;
	left: 0;
	top: -10px; /* Cover gap between header and schedule's first row. */
}

.schedule .heading-SUNDAY {
	border-top-right-radius: 0.65em;
}

.schedule .heading:hover {
	background-color: #2d487b;
	color: white;
}

.schedule .heading time {
	font-size: 0.8em;
}

.hour-of-day {
	position: relative;
	transform: translate(-3.5em, -0.5em);
	font-size: 0.8em;
	color: var(--primary);
	font-weight: bold;
	text-align: right;
	width: fit-content;
}

.schedule .hour-of-day-divider:not(.no-right-border) {
	border-right: 0.5px solid #aabde1;
}

.hour-of-day-divider:not(.no-bottom-border) {
	border-bottom: 0.5px solid #aabde1;
}

.schedule .timespan {
	z-index: 1;
}

.schedule .timespan.FREE,
.schedule .timespan.PARTIALLY_OCCUPIED:has(a) {
	display: flex;
	justify-content: center;
	align-items: center;
}

.schedule .timespan.OCCUPIED,
.schedule .timespan.PARTIALLY_OCCUPIED:not(:has(a)) { /* Partially-occupied items in the past have no book-room link. */
	--primary-stripe: #6782b5;
	--secondary-stripe: #bccef0;
	background: repeating-linear-gradient(
			45deg,
			var(--primary-stripe),
			var(--primary-stripe) 10px,
			var(--secondary-stripe) 10px,
			var(--secondary-stripe) 20px
	);
}

.timespan.FREE a,
.timespan.PARTIALLY_OCCUPIED a {
	width: calc(100% - 20px);
	height: calc(100% - 20px);
	border: 2px dashed transparent;
	display: flex;
	justify-content: center;
	align-items: center;
	font-weight: bold;
	text-underline-offset: 0.25em;
	text-decoration-style: dotted;
	border-radius: 0.5em;
	opacity: 0;
}

.timespan.PARTIALLY_OCCUPIED:has(a) {
	background-color: #bccef0;
}

.timespan.FREE a.small,
.timespan.PARTIALLY_OCCUPIED a.small {
	width: calc(100% - 10px);
	height: calc(100% - 10px);
	font-weight: lighter;
	font-size: 0.75em;
}

.timespan.FREE a.smaller,
.timespan.PARTIALLY_OCCUPIED a.smaller {
	width: calc(100% - 6px);
	height: calc(100% - 6px);
	font-weight: lighter;
	font-size: 0.7em;
}

.timespan.FREE a.smallest,
.timespan.PARTIALLY_OCCUPIED a.smallest {
	width: calc(100% - 2px);
	height: calc(100% - 2px);
	font-size: 0.7em;
}

.timespan.FREE a.hidden,
.timespan.PARTIALLY_OCCUPIED a.hidden {
	width: calc(100% - 2px);
	height: calc(100% - 2px);
}

.timespan.FREE a.hidden i,
.timespan.PARTIALLY_OCCUPIED a.hidden i {
	display: none;
}

.timespan.FREE a:hover,
.timespan.PARTIALLY_OCCUPIED a:hover {
	border-color: var(--link-colour);
	opacity: 1;
}

.timespan.FREE a:hover {
	background-color: #e1eafb;
}

.timespan.FREE a i,
.timespan.PARTIALLY_OCCUPIED a i {
	font-style: normal;
}

.schedule .current-time {
	border-top: 4px solid #bb0303;
	transform: translateY(2px);
	border-radius: 100px;
	z-index: 2;
}

/* filled circle */
.schedule .current-time::before {
	background-color: #bb0303;
	display: block;
	content: "";
	height: 10px;
	width: 10px;
	border-radius: 100%;
	transform: translate(-50%, calc(-50% - 2px)); /* half of itself plus half of the border width */
	z-index: 2;
}