/*
 * VSA Course Catalog: version 1 ("as close as possible").
 * Layout and components follow the archived vpsa.veritaspress.com catalog;
 * colors follow the Veritas brand guidelines (May 2024). Everything is scoped
 * under .vsa-catalog so nothing leaks into the rest of the site. Type is
 * inherited from the site.
 */
:root {
	--vsa-blue: #005789;      /* Veritas Blue */
	--vsa-blue-60: #6687af;   /* Veritas Blue 60% */
	--vsa-blue-20: #c0cbde;   /* Veritas Blue 20% */
	--vsa-yellow: #fdbb30;    /* Veritas Yellow */
	--vsa-yellow-10: #ffeccf; /* Veritas Yellow 10% */
	--vsa-gray: #808285;      /* Medium Gray */
	--vsa-light: #e6e7e8;     /* Light Gray */
	--vsa-line: #d1d3d4;
	--vsa-ink: #222;
}

.vsa-catalog {

	/* Padding, not margin: block themes reset the top margin of a page's first
	   block and the bottom margin of its last, which swallowed the spacing. */
	padding-top: 48px;
	padding-bottom: 72px;
	/* Never wider than the theme's wide width, even outside a content area */
	max-width: var(--wp--style--global--wide-size, 1200px);
	margin-left: auto;
	margin-right: auto;
	font-size: 15px;
	line-height: 1.5;
	color: var(--vsa-ink);
}
.vsa-catalog *, .vsa-catalog *::before, .vsa-catalog *::after { box-sizing: border-box; }

/* Title bar: echoes the old catalog's "Courses" bar, and holds the page's H1 */
.vsa-catalog__bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px 24px;
	flex-wrap: wrap;
	padding-bottom: 14px;
	margin-bottom: 24px;
	border-bottom: 1px solid var(--vsa-line);
}
.vsa-catalog__h1 {
	margin: 0;
	font-size: clamp(28px, 3vw, 38px);
	font-weight: 400;
	line-height: 1.2;
	color: var(--vsa-blue);
}

.vsa-catalog__intro {
	max-width: 75ch;
	margin: -8px 0 24px;
	font-size: 16px;
}
.vsa-catalog__intro p { margin: 0 0 10px; }
.vsa-catalog__intro p:last-child { margin-bottom: 0; }

.vsa-catalog__layout {
	display: grid;
	grid-template-columns: 250px minmax(0, 1fr);
	grid-template-areas: "side main";
	gap: 24px;
	align-items: start;
}
.vsa-catalog__main { grid-area: main; min-width: 0; }
.vsa-catalog__side { grid-area: side; }
.vsa-catalog a { color: var(--vsa-blue); }
.vsa-catalog :focus-visible { outline: 2px solid var(--vsa-blue); outline-offset: 2px; }

.vsa-sr {
	position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
	overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Buttons */
.vsa-catalog .vsa-btn,
.vsa-ui .vsa-btn {
	display: inline-block;
	min-width: 120px;
	padding: 8px 22px;
	border: 0;
	border-radius: 999px;
	background: var(--vsa-blue);
	color: #fff;
	font-size: 14px;
	font-weight: 700;
	line-height: 20px;
	text-align: center;
	text-decoration: none;
	box-shadow: 0 3px 8px rgba(0, 0, 0, .15);
	transition: background-color .15s ease, box-shadow .15s ease;
}
.vsa-catalog .vsa-btn:hover,
.vsa-ui .vsa-btn:hover { background: #00466e; color: #fff; box-shadow: 0 4px 12px rgba(0, 0, 0, .2); }
/* Accent: Veritas Yellow with dark text (white on yellow fails contrast) */
.vsa-catalog .vsa-btn--accent,
.vsa-ui .vsa-btn--accent { background: var(--vsa-yellow); color: var(--vsa-ink); }
.vsa-catalog .vsa-btn--accent:hover,
.vsa-ui .vsa-btn--accent:hover { background: #f5ad12; color: var(--vsa-ink); }
@media (prefers-reduced-motion: reduce) {
	.vsa-catalog .vsa-btn, .vsa-ui .vsa-btn { transition: none; }
}
.vsa-center { text-align: center; }

/* ---------- Sidebar ---------- */
.vsa-catalog__side {
	background: #fff;
	border: 1px solid var(--vsa-line);
}
.vsa-box {
	padding: 12px;
	border-bottom: 1px solid var(--vsa-light);
}
.vsa-box:last-child { border-bottom: 0; }
.vsa-box h3 {
	margin: 0 0 8px;
	font-size: 18px;
	font-weight: 400;
	line-height: 1.3;
	color: var(--vsa-blue);
}
.vsa-box h4 {
	margin: 14px 0 4px;
	font-size: 14px;
	font-weight: 700;
	color: var(--vsa-ink);
}
.vsa-box p { margin: 0 0 10px; font-size: 14px; }
.vsa-box p:last-child { margin-bottom: 0; }

/* Course Planning: shield watermark under an 85% white veil, as on the old site */
.vsa-box--planning { position: relative; overflow: hidden; }
.vsa-box--planning::before {
	content: "";
	position: absolute;
	inset: 0;
	background: var(--vsa-emblem, none) no-repeat right -70px top -20px / 210px auto;
}
.vsa-box--planning::after {
	content: "";
	position: absolute;
	inset: 0;
	background: rgba(255, 255, 255, .85);
}
.vsa-box--planning > * { position: relative; z-index: 1; }

/* ---------- Filter panel ---------- */
.vsa-filters { margin-bottom: 10px; }
.vsa-filters__head {
	padding: 12px;
	background: var(--vsa-light);
	border: 1px solid var(--vsa-line);
	border-radius: 5px 5px 0 0;
}
.vsa-filters__title {
	margin: 0 0 10px;
	font-size: 24px;
	font-weight: 400;
	line-height: 1.3;
	color: var(--vsa-blue);
}
.vsa-filters__row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.vsa-filters__row + .vsa-filters__row { margin-top: 10px; }
.vsa-filters__label { min-width: 130px; font-size: 14px; }

/* "Browse by subject": a dropdown of real links, so crawlers can follow them */
.vsa-menu { position: relative; }
.vsa-menu summary {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 4px 12px 4px 14px;
	border: 1px solid var(--vsa-line);
	border-radius: 4px;
	background: #fff;
	font-size: 14px;
	line-height: 20px;
	cursor: pointer;
	list-style: none;
}
.vsa-menu summary::-webkit-details-marker { display: none; }
.vsa-menu summary::after {
	content: "";
	border-top: 5px solid currentColor;
	border-right: 4px solid transparent;
	border-left: 4px solid transparent;
}
.vsa-menu[open] summary::after { transform: rotate(180deg); }
.vsa-menu summary:hover { background: var(--vsa-yellow-10); }
.vsa-menu ul {
	position: absolute;
	top: calc(100% + 4px);
	left: 0;
	z-index: 20;
	min-width: 240px;
	max-height: 60vh;
	overflow-y: auto;
	margin: 0;
	padding: 6px 0;
	list-style: none;
	background: #fff;
	border: 1px solid var(--vsa-line);
	border-radius: 4px;
	box-shadow: 0 6px 16px rgba(0, 0, 0, .12);
}
.vsa-menu li a {
	display: block;
	padding: 6px 14px;
	font-size: 14px;
	text-decoration: none;
}
.vsa-menu li a:hover { background: var(--vsa-yellow-10); }
.vsa-menu li a[aria-current="page"] { font-weight: 700; }

/* Grade level: segmented links, the successor to the old dropdown */
.vsa-seg { display: inline-flex; flex-wrap: wrap; }
.vsa-seg a {
	padding: 4px 14px;
	border: 1px solid var(--vsa-line);
	margin-left: -1px;
	background: #fff;
	color: var(--vsa-ink);
	font-size: 14px;
	line-height: 20px;
	text-decoration: none;
}
.vsa-seg a:first-child { margin-left: 0; border-radius: 4px 0 0 4px; }
.vsa-seg a:last-child { border-radius: 0 4px 4px 0; }
.vsa-seg a:hover { background: var(--vsa-yellow-10); }
.vsa-seg a[aria-current="page"] {
	position: relative;
	background: var(--vsa-blue);
	border-color: var(--vsa-blue);
	color: #fff;
}

.vsa-filters__body {
	display: grid;
	grid-template-columns: 250px minmax(0, 1fr);
	gap: 16px 30px;
	padding: 12px;
	background: #fff;
	border: 1px solid var(--vsa-line);
	border-top: 0;
	border-radius: 0 0 5px 5px;
}
.vsa-filters__group { margin: 0; padding: 0; border: 0; min-width: 0; }
.vsa-filters__group legend {
	padding: 0;
	margin-bottom: 8px;
	font-size: 20px;
	color: var(--vsa-blue);
}
.vsa-check {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0;
	padding: 2px 0;
	font-size: 14px;
	cursor: pointer;
}
.vsa-check input { width: 16px; height: 16px; margin: 0; accent-color: var(--vsa-blue); }
.vsa-check--all { margin-top: 10px; font-weight: 700; }
.vsa-check--spaced { margin-top: 12px; }
.vsa-note { margin: 0 0 4px; font-size: 13px; color: var(--vsa-gray); }
.vsa-note a { color: var(--vsa-blue); }

.vsa-catalog .vsa-count { margin: 14px 0 8px; font-size: 13px; color: var(--vsa-gray); }
.vsa-catalog .vsa-prompt {
	margin: 14px 0 0;
	padding: 18px;
	border: 1px dashed var(--vsa-blue-20);
	border-radius: 4px;
	text-align: center;
	font-size: 15px;
	color: var(--vsa-blue);
}
.vsa-prompt[hidden], .vsa-count[hidden], .vsa-empty[hidden] { display: none; }
.vsa-catalog .vsa-empty {
	padding: 16px;
	background: var(--vsa-yellow-10);
	border-radius: 4px;
	font-size: 14px;
}

/* ---------- Course rows ---------- */
.vsa-list { display: grid; gap: 12px; }
.vsa-row {
	background: #fff;
	border-radius: 3px;
	box-shadow: 0 1px 1px 1px #ddd;
	overflow: hidden;
}
.vsa-row[hidden] { display: none; }
.vsa-row__header {
	display: flex;
	align-items: center;
	gap: 12px;
	min-height: 39px;
	padding: 0 10px 0 15px;
	background: var(--vsa-blue);
	color: #fff;
	box-shadow: inset 0 2px 3px rgba(255, 255, 255, .3), inset 0 -2px 3px rgba(0, 0, 0, .3);
	cursor: pointer;
}
.vsa-row__title {
	flex: 1;
	margin: 0;
	padding: 9px 0;
	font-size: 14px;
	font-weight: 700;
	line-height: 1.4;
	color: inherit;
}
.vsa-catalog .vsa-row__title a { color: inherit; text-decoration: none; }
.vsa-catalog .vsa-row__title a:hover { text-decoration: underline; }
.vsa-row__meta { font-size: 12px; white-space: nowrap; }
/* Header text and the toggle are set explicitly, so theme styles for spans,
   paragraphs, and buttons can't dim them. */
.vsa-catalog .vsa-row--regular .vsa-row__header,
.vsa-catalog .vsa-row--club .vsa-row__header,
.vsa-catalog .vsa-row--regular .vsa-row__header *,
.vsa-catalog .vsa-row--club .vsa-row__header * { color: #fff; }
.vsa-catalog .vsa-row--selfpaced .vsa-row__header,
.vsa-catalog .vsa-row--selfpaced .vsa-row__header * { color: var(--vsa-ink); }
.vsa-catalog .vsa-row__header p { margin: 0; }

/* Toggle: a triangle pointing left when closed and down when open, as on the old site */
.vsa-row__toggle {
	position: relative;
	flex: none;
	width: 28px;
	height: 28px;
	padding: 0;
	border: 0;
	border-radius: 3px;
	background: transparent;
	color: inherit;
	cursor: pointer;
}
.vsa-row__toggle::before {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	border-top: 6px solid transparent;
	border-bottom: 6px solid transparent;
	border-right: 8px solid currentColor;
	transform: translate(-50%, -50%);
	transition: transform .15s ease;
}
.vsa-row__toggle[aria-expanded="true"]::before { transform: translate(-50%, -50%) rotate(-90deg); }
@media (prefers-reduced-motion: reduce) {
	.vsa-row__toggle::before { transition: none; }
}
.vsa-row__toggle:hover { background: rgba(255, 255, 255, .15); }
.vsa-row__header .vsa-row__toggle:focus-visible,
.vsa-row__header a:focus-visible { outline: 2px solid var(--vsa-yellow); outline-offset: 2px; }

/* Self-paced rows: Veritas Yellow, with dark text for contrast */
.vsa-row--selfpaced .vsa-row__header { background: var(--vsa-yellow); color: var(--vsa-ink); }
.vsa-row--selfpaced .vsa-row__toggle:hover { background: rgba(0, 0, 0, .08); }
.vsa-row--selfpaced .vsa-row__header .vsa-row__toggle:focus-visible,
.vsa-row--selfpaced .vsa-row__header a:focus-visible { outline-color: var(--vsa-blue); }

.vsa-row__summary {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 210px;
	gap: 20px 28px;
	padding: 14px 15px 16px;
}
/* A collapsed row stays collapsed, whatever layout other styles give the
   panel (the sections plugin lays it out as a grid). */
.vsa-catalog .vsa-row__summary[hidden],
.vsa-catalog .vsa-tabpanel[hidden] { display: none !important; }
.vsa-catalog .vsa-row__excerpt { margin: 0; font-size: 14px; }

/* Tabs, modeled on the old Bootstrap 2 nav-tabs */
.vsa-tabs {
	display: flex;
	gap: 2px;
	margin-bottom: 12px;
	border-bottom: 1px solid var(--vsa-line);
}
.vsa-tabs [role="tab"] {
	margin-bottom: -1px;
	padding: 6px 12px;
	border: 1px solid transparent;
	border-radius: 4px 4px 0 0;
	background: transparent;
	color: var(--vsa-blue);
	font: inherit;
	font-size: 14px;
	cursor: pointer;
}
.vsa-tabs [role="tab"]:hover { background: var(--vsa-yellow-10); }
.vsa-tabs [role="tab"][aria-selected="true"] {
	border-color: var(--vsa-line) var(--vsa-line) #fff;
	background: #fff;
	color: var(--vsa-ink);
}
.vsa-tabpanel[hidden] { display: none; }
.vsa-catalog .vsa-kit { margin: 0 0 6px; font-size: 14px; font-weight: 700; }
.vsa-catalog .vsa-kit-items { margin: 0 0 10px; padding-left: 20px; font-size: 14px; }
.vsa-catalog .vsa-kit-items li { margin: 2px 0; }
.vsa-catalog .vsa-kit-note { margin: 0; font-size: 13px; }

/* Right column: price, facts, and the button */
.vsa-row__side { padding-left: 20px; border-left: 1px solid var(--vsa-light); }
.vsa-catalog .vsa-row__price {
	margin: 0 0 10px;
	font-size: 22px;
	font-weight: 700;
	line-height: 1.2;
	color: var(--vsa-blue);
}
.vsa-row__facts { display: grid; gap: 8px; margin: 0 0 14px; }
.vsa-row__facts:empty { display: none; }
.vsa-row__facts dt { font-size: 12px; color: var(--vsa-gray); }
.vsa-row__facts dd { margin: 0; font-size: 14px; font-weight: 700; }
.vsa-row__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }

/* ---------- Course page blocks ---------- */
.vsa-page-main { padding-top: 48px; padding-bottom: 72px; }
.vsa-ui { color: var(--vsa-ink); }
.vsa-ui a { color: var(--vsa-blue); }
.vsa-ui :focus-visible { outline: 2px solid var(--vsa-blue); outline-offset: 2px; }
.vsa-muted { color: var(--vsa-gray); }

.vsa-crumbs-bar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 6px 20px;
	margin: 0 0 10px;
}
.vsa-crumbs-bar .vsa-crumbs ol { margin: 0; }
.vsa-crumbs ol {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	margin: 0 0 10px;
	padding: 0;
	list-style: none;
	font-size: 13px;
	color: var(--vsa-gray);
}
.vsa-crumbs li + li::before { content: "/"; margin-right: 4px; color: var(--vsa-line); }
.vsa-crumbs a { text-decoration: none; }
.vsa-crumbs a:hover { text-decoration: underline; }

.wp-block-post-title.vsa-title {
	margin: 0 0 24px;
	padding-bottom: 14px;
	border-bottom: 1px solid var(--vsa-line);
	font-size: clamp(28px, 3vw, 38px);
	font-weight: 400;
	line-height: 1.2;
	color: var(--vsa-blue);
}

.vsa-course-body { max-width: 820px; }

.vsa-facts {
	display: flex;
	flex-wrap: wrap;
	gap: 10px 36px;
	margin: 0 0 24px;
	padding: 14px 18px;
	background: #fff;
	border: 2px solid var(--vsa-yellow);
	border-radius: 6px;
}
.vsa-facts dt { font-size: 12px; color: #5c5e61; }
.vsa-facts dd { margin: 0; font-size: 15px; font-weight: 700; }
.vsa-facts .vsa-facts__price { font-size: 18px; color: var(--vsa-blue); }

.vsa-ui .vsa-callout {
	margin: 20px 0 12px;
	padding: 12px 16px;
	background: var(--vsa-yellow-10);
	border-left: 4px solid var(--vsa-yellow);
	font-size: 15px;
}
.vsa-actions__buttons { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 20px 0 8px; }

.vsa-section h2 {
	margin: 36px 0 12px;
	padding-bottom: 6px;
	border-bottom: 1px solid var(--vsa-light);
	font-size: 24px;
	font-weight: 400;
	line-height: 1.3;
	color: var(--vsa-blue);
}
.vsa-section p { margin: 0 0 12px; }
.vsa-section .vsa-list { margin: 0 0 12px; padding-left: 22px; }
.vsa-section .vsa-list li { margin: 3px 0; }
.vsa-section .vsa-kit { font-weight: 700; }

/* Sections, in the gray of the old section rows */
.vsa-sections-empty {
	padding: 14px 15px;
	background: var(--vsa-light);
	border-radius: 2px;
	font-size: 14px;
	color: #555;
}
.vsa-sections { display: grid; gap: 8px; }
.vsa-sections__row {
	display: grid;
	grid-template-columns: 110px 1fr 1fr 130px;
	gap: 12px;
	align-items: center;
	padding: 10px 15px;
	background: var(--vsa-light);
	border-radius: 2px;
	font-size: 14px;
}
.vsa-sections__status { font-weight: 700; }
.vsa-sections__row--full .vsa-sections__status { color: var(--vsa-gray); }

/* Sections inside a catalog row: more compact */
.vsa-row .vsa-sections__row { grid-template-columns: 90px 1fr 1fr 110px; padding: 8px 12px; font-size: 13px; }

/* Promotions */
.vsa-promo-slot { display: grid; gap: 12px; margin: 0 0 20px; }
.vsa-promo { padding: 14px 18px; border-radius: 5px; font-size: 15px; }
.vsa-promo > :first-child { margin-top: 0; }
.vsa-promo > :last-child { margin-bottom: 0; }
.vsa-promo--sale { background: var(--vsa-yellow-10); border-left: 4px solid var(--vsa-yellow); }
.vsa-promo--notice { background: #eef2f8; border-left: 4px solid var(--vsa-blue); }
.vsa-catalog__side .vsa-promo-slot { margin: 12px; }

/* Editor placeholders for the course blocks */
.vsa-block-placeholder {
	padding: 12px 14px;
	border: 1px dashed var(--vsa-blue-20);
	border-radius: 4px;
	background: #fafbfd;
	font-size: 14px;
	color: var(--vsa-ink);
}
.vsa-block-placeholder__desc { margin-top: 2px; font-size: 13px; color: var(--vsa-gray); }

/* ---------- Small screens ---------- */
@media (max-width: 782px) {
	.vsa-catalog { padding-top: 28px; padding-bottom: 48px; }
	.vsa-catalog__layout {
		grid-template-columns: minmax(0, 1fr);
		grid-template-areas: "main" "side";
	}
	.vsa-filters__body { grid-template-columns: minmax(0, 1fr); }
	.vsa-row__header { flex-wrap: wrap; gap: 0 12px; padding-top: 4px; padding-bottom: 4px; }
	.vsa-row__title { flex-basis: calc(100% - 40px); }
	.vsa-row__toggle { order: 2; }
	.vsa-row__meta { order: 3; flex-basis: 100%; padding-bottom: 6px; }
	.vsa-row__summary { grid-template-columns: minmax(0, 1fr); }
	.vsa-row__side { padding: 14px 0 0; border-left: 0; border-top: 1px solid var(--vsa-light); }
	.vsa-page-main { padding-top: 28px; padding-bottom: 48px; }
	.vsa-sections__row { grid-template-columns: 1fr 1fr; }
}
