/* Public course catalog: /courses/ hub and /courses/{school} pages */

.catalog {
	max-width: 1000px;
}
.catalog p {
	text-align: left;
}
/* core_styles makes every li inline with padded block links; the catalog wants plain lists */
.catalog li {
	display: block;
}
.catalog li a {
	display: inline;
	padding: 0;
	float: none;
}
.catalog h1 {
	text-align: center;
	margin: 0 0 .75rem;
	font-size: clamp(1.75rem, 6vw, 2.5rem);
}
.catalog h2 {
	font-size: 1.4rem;
	margin: 1.75rem 0 .75rem;
}
.catalog-lead {
	font-size: 1.1rem;
	max-width: 46rem;
	margin: 0 auto 1rem;
}
.catalog a.catalog-inline-link {
	text-decoration: underline;
	font-weight: bold;
}

/* Breadcrumb */
.catalog-breadcrumb ol {
	list-style: none;
	display: flex;
	flex-wrap: wrap;
	padding: 0;
	margin: 0 0 .75rem;
	font-size: .9rem;
	color: rgba(0,0,0,.6);
}
.catalog-breadcrumb li + li::before {
	content: "\203A";
	margin: 0 .4rem;
}
.catalog-breadcrumb a {
	text-decoration: underline;
}

/* Stats row */
.catalog-stats {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: .75rem;
	margin: .5rem 0 1rem;
	padding: 0;
}
.catalog-stats li {
	border: 1.5px solid var(--red-a25);
	border-radius: .5rem;
	padding: .4rem 1rem;
	text-align: center;
	min-width: 8rem;
}
.catalog-stats strong {
	display: block;
	font-size: 1.4rem;
	color: var(--red);
}

/* Notice banner (your school shortcut, school mismatch) */
.catalog-notice {
	background: var(--red-a15);
	border-left: 4px solid var(--red);
	border-radius: .35rem;
	padding: .6rem 1rem;
	margin: .5rem 0 1rem;
}
.catalog-notice p {
	margin: 0;
}

/* Hub: school cards */
.catalog-schools {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
	gap: .75rem;
	padding: 0;
	margin: 0;
}
.catalog-schools li a.catalog-school {
	display: flex;
	flex-direction: column;
	height: 100%;
	padding: .75rem 1rem;
	border: 1.5px solid rgba(0,0,0,.15);
	border-radius: .5rem;
	text-decoration: none;
	transition: border-color .15s, box-shadow .15s;
}
.catalog-schools li a.catalog-school:hover,
.catalog-schools li a.catalog-school:focus {
	border-color: var(--red);
	box-shadow: 0 2px 8px var(--red-a25);
	color: black;
}
.catalog-school-name {
	font-size: 1.2rem;
	font-weight: bold;
}
.catalog-school-long {
	font-size: .9rem;
	color: rgba(0,0,0,.6);
}
/* One size and weight for the whole line so "Including CHEM, MATH..." reads as one phrase;
   the codes stand out by color alone. (Only the regular weight of the font is loaded, so
   any bold here renders as heavy as the card title.) */
.catalog-school-subjects {
	margin-top: .4rem;
	font-size: .85rem;
	color: rgba(0,0,0,.5);
}
.catalog-school-codes {
	color: rgba(0,0,0,.85);
}

/* Subject chips */
.catalog-chips {
	display: flex;
	flex-wrap: wrap;
	gap: .4rem;
	padding: 0;
	margin: 0;
}
.catalog-chips li {
	border: 1.5px solid rgba(0,0,0,.15);
	border-radius: 2rem;
	padding: .15rem .75rem;
	font-size: .9rem;
}

/* School page: filter bar */
/* Search and subject share one row at every width, so the list starts higher on phones */
.catalog-filters {
	display: flex;
	gap: .5rem;
	margin: 1rem 0 .25rem;
	position: sticky;
	top: var(--catalog-sticky-top, 0px);
	z-index: 5;
	background: white;
	padding: .5rem 0;
}
/* The site header's second row is transparent beside the Location box, so while stuck the bar
   paints a white band up to the navbar to hide the course rows scrolling through that gap.
   Only while stuck: in normal flow the band would cover the content above the bar. */
.catalog-filters::before {
	content: "";
	display: none;
	position: absolute;
	left: 0;
	right: 0;
	bottom: 100%;
	height: var(--catalog-sticky-gap, 0px);
	background: white;
}
.catalog-filters.is-stuck::before {
	display: block;
}
.catalog-filters.is-stuck {
	box-shadow: 0 6px 6px -6px rgba(0,0,0,.25);
}
/* core_styles makes #wrap a scroll container on phones, which stops position: sticky from
   ever engaging. This stylesheet only loads on catalog pages, which have nothing wider than
   the screen, so the override stays scoped to them. */
@media (max-width: 575.98px) {
	#wrap {
		overflow: visible;
	}
}
.catalog-filters input {
	flex: 1 1 auto;
	min-width: 0;
}
.catalog-filters select {
	flex: 0 0 auto;
	width: clamp(7.5rem, 30%, 14rem);
}
.catalog-result-count {
	font-size: .9rem;
	color: rgba(0,0,0,.6);
	margin: 0 0 .5rem;
}

/* School page: popular courses */
.catalog-popular {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
	gap: .25rem 1rem;
	padding: 0;
	margin: 0;
}
.catalog-popular .course-code {
	font-weight: bold;
	margin-right: .35rem;
}

/* School page: course list */
.catalog-subject h2 {
	border-bottom: 1.5px solid var(--red-a25);
	padding-bottom: .25rem;
	scroll-margin-top: 8rem;
}
.catalog-subject-count {
	font-size: .9rem;
	font-weight: normal;
	color: rgba(0,0,0,.55);
	margin-left: .35rem;
}
.catalog-courses {
	padding: 0;
	margin: 0;
}
.catalog-courses > li {
	padding: .6rem 0;
	border-bottom: 1px solid rgba(0,0,0,.08);
}
.catalog-courses > li:last-child {
	border-bottom: none;
}
.course-head {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: .1rem .6rem;
}
.course-head h3 {
	font-size: 1.05rem;
	margin: 0;
	flex: 1 1 16rem;
}
.course-head .course-code {
	font-weight: bold;
	margin-right: .4rem;
	white-space: nowrap;
}
.course-head .course-name {
	font-weight: normal;
}
.catalog li a.course-signup {
	display: inline-block;
	font-size: .85rem;
	font-weight: bold;
	color: var(--red);
	border: 1.5px solid var(--red);
	border-radius: 2rem;
	padding: .05rem .75rem;
	white-space: nowrap;
	text-decoration: none;
}
.catalog li a.course-signup:hover {
	background: var(--red);
	color: white;
}

/* Course description: clamped to 2 lines; the full text stays in the page for search
   engines, and the more/less toggle is added by script only where text overflows */
.course-desc {
	font-size: .92rem;
	color: rgba(0,0,0,.75);
	margin-top: .2rem;
}
.course-desc-text {
	display: -webkit-box;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	overflow-wrap: anywhere;
}
.course-desc.open .course-desc-text {
	display: block;
	-webkit-line-clamp: unset;
	line-clamp: unset;
	overflow: visible;
}
.course-desc-toggle {
	background: none;
	border: none;
	padding: 0;
	font-size: .82rem;
	color: var(--red);
	cursor: pointer;
}
.course-desc-toggle::after { content: "more \203A"; }
.course-desc.open .course-desc-toggle::after { content: "\2039 less"; }
.course-desc-toggle:hover { text-decoration: underline; }

.catalog-empty {
	text-align: center;
	padding: 1.5rem 0;
	color: rgba(0,0,0,.6);
}
.catalog [hidden] {
	display: none !important;
}
