/* booklist.menloschool.org (2026-11-27, index.twig and unavailable.twig): after the kit and KnightHub's theme
   (theme.css, the bar and the tokens). The list is KnightHub's (the hub's Booklist editor, Go Menlo Admin): a small
   blue label row, then a line a course, a hairline between, the columns lined up across rows (subgrid), the course
   navy, a checked course on Menlo aqua. Under 40rem a row folds to two lines. Your Booklist is a drawer, each course
   a section; summer assignments on a light gold tint with the sun, as on the hub. */

.bk [hidden],
.bk-drawer [hidden] {
	display: none !important;
}

wa-page::part(main-content) {
	padding: 0;
}

/* The school year, a badge beside Booklist (Dan, 2026-11-27): white on a light veil of the bar's blue. The kit draws a
   badge on the element itself. */
.bk-bar__year {
	flex: none;
	padding: 0.25em 0.75em;
	border: var(--wa-border-width-s) solid color-mix(in srgb, white 40%, transparent);
	background: color-mix(in srgb, white 14%, transparent);
	color: white;
	font-size: var(--wa-font-size-s);
	font-weight: var(--wa-font-weight-semibold);
	letter-spacing: 0.01em;
}

/* Your Booklist at the bar's end (Dan, 2026-11-27: "what could go in the top right corner?"), dressed as the division
   was there that morning: a white outline on the bar's blue, white words, a veil of white under the pointer. The count
   is gold with navy figures, shown once a course is checked. On a phone the words go, so the bar stays one row. */
.bk-bar {
	flex-wrap: wrap;
	row-gap: var(--wa-space-xs);
}
.bk-bar__open {
	display: inline-flex;
	align-items: center;
	gap: var(--wa-space-xs);
	flex: none;
	margin-inline-start: auto;
	min-block-size: 2.25rem;
	padding: 0 var(--wa-space-m);
	border: var(--wa-border-width-s) solid color-mix(in srgb, white 45%, transparent);
	border-radius: var(--wa-border-radius-m);
	background: transparent;
	color: white;
	font: inherit;
	font-size: var(--wa-font-size-m);
	font-weight: var(--wa-font-weight-semibold);
	cursor: pointer;
}
@media (hover: hover) {
	.bk-bar__open:hover {
		background: color-mix(in srgb, white 14%, transparent);
	}
}
/* The kit puts 0.75em after a leading icon that has an element after it. */
.bk-bar__open > wa-icon {
	margin-inline-end: 0;
}
.bk-bar__open:focus-visible {
	outline: 2px solid white;
	outline-offset: 2px;
}
.bk-bar__count {
	min-inline-size: 1.5em;
	padding: 0.1em 0.45em;
	border-radius: var(--wa-border-radius-pill);
	background: var(--menlo-gold);
	color: var(--menlo-navy);
	font-size: var(--wa-font-size-s);
	font-weight: var(--wa-font-weight-bold);
	line-height: 1.3;
	text-align: center;
}
.bk-bar__count[hidden] {
	display: none;
}
@media (width < 40rem) {
	.bk-bar {
		column-gap: var(--wa-space-s);
	}
	.bk-bar__open {
		padding-inline: var(--wa-space-s);
	}
	.bk-bar__open-words {
		display: none;
	}
}

/* The search as the Knightbook's (hub-55-site.css; Dan, 2026-11-27: "Can the booklist match?"): the medium size, 16px at
   every width, so Safari never zooms into it (at 14px it did); the words typed semibold navy, the hint regular; the
   glass Menlo blue; a gray-blue edge that turns blue under the pointer. */
.bk__find::part(base) {
	border-color: var(--menlo-gray-blue);
	background: var(--wa-color-surface-default);
}
.bk__find:hover::part(base) {
	border-color: var(--menlo-blue);
}
.bk__find::part(input) {
	color: var(--menlo-navy);
	font-weight: var(--wa-font-weight-semibold);
}
.bk__find::part(input)::placeholder {
	font-weight: var(--wa-font-weight-normal);
}
.bk__find > wa-icon[slot='start'] {
	color: var(--menlo-blue);
}

.bk {
	container-type: inline-size;
	box-sizing: border-box;
	inline-size: 100%;
	max-inline-size: 72rem;
	margin-inline: auto;
	padding: var(--wa-space-xl) var(--wa-space-m) calc(var(--wa-space-4xl) + var(--wa-space-xl));
}
.bk__summer-note {
	margin: 0;
}
/* The search and the division on one row, the search taking what the division leaves; under 40rem the division has
   the row under it, its three buttons sharing it. */
.bk__tools {
	display: flex;
	align-items: center;
	gap: var(--wa-space-m);
}
.bk__find {
	flex: 1 1 auto;
	min-inline-size: 0;
}
.bk__division {
	flex: none;
}
@media (width < 40rem) {
	.bk__tools {
		flex-direction: column;
		align-items: stretch;
		gap: var(--wa-space-s);
	}
	.bk__division::part(form-control-input) {
		display: flex;
	}
	/* Each as wide as its words on one line, the rest shared (equal thirds broke Upper School over two lines). */
	/* Each word centered on its button as the row stretches them (Dan, 2026-11-27: "The text in the segmented control
	   needs to be centered"). */
	.bk__division wa-radio {
		flex: 1 1 auto;
		justify-content: center;
		white-space: nowrap;
		padding-inline: var(--wa-space-s);
	}
}
.bk__none,
.bk__login {
	margin: 0;
}

/* The list. */
.bk__list {
	display: grid;
	grid-template-columns: max-content minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr) max-content;
	column-gap: var(--wa-space-l);
	margin: 0;
	padding: 0;
	list-style: none;
}
.bk__head,
.bk__row {
	display: grid;
	grid-column: 1 / -1;
	grid-template-columns: subgrid;
	align-items: center;
	margin: 0;
	border-block-end: var(--wa-border-width-s) solid var(--wa-color-surface-border);
}
.bk__head {
	position: sticky;
	top: var(--header-height, 0px);
	z-index: 2;
	padding-block: var(--wa-space-xs) var(--wa-space-2xs);
	background: var(--wa-color-surface-default, #fff);
	font-size: var(--wa-font-size-2xs);
	font-weight: var(--wa-font-weight-semibold);
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--wa-color-brand-40);
}
.bk__row {
	padding-block: var(--wa-space-xs);
	cursor: pointer;
}
@media (hover: hover) {
	.bk__row:hover {
		background: color-mix(in srgb, var(--menlo-aqua) 45%, transparent);
	}
}
.bk__row.is-on {
	background: var(--menlo-aqua);
}
.bk__check {
	padding-inline-start: var(--wa-space-xs);
}
.bk__name {
	font-weight: var(--wa-font-weight-semibold);
	color: var(--menlo-navy);
}
.bk__code,
.bk__dept {
	font-size: var(--wa-font-size-s);
	color: var(--wa-color-text-quiet);
}
.bk__code {
	white-space: nowrap;
}
.bk__teacher {
	color: var(--menlo-navy);
}
/* A course's items, a badge at the row's end (Dan, 2026-11-27); none, a quiet dash. */
.bk__items,
.bk__items-head {
	justify-self: end;
	padding-inline-end: var(--wa-space-xs);
	text-align: end;
}
.bk__count {
	font-variant-numeric: tabular-nums;
}
.bk__count-none {
	color: var(--wa-color-text-quiet);
}
.bk__login a {
	display: inline-flex;
	align-items: center;
	gap: var(--wa-space-2xs);
}
@container (width < 40rem) {
	.bk__list {
		display: block;
	}
	.bk__head {
		display: none;
	}
	/* The check, then the course and its items; under them the teacher, then the department. */
	.bk__row {
		grid-template-columns: max-content minmax(0, 1fr) max-content;
		gap: var(--wa-space-3xs) var(--wa-space-s);
	}
	.bk__check {
		grid-row: 1 / span 3;
		align-self: start;
		padding-block-start: 0.15em;
	}
	.bk__course {
		grid-column: 2;
		grid-row: 1;
	}
	.bk__items {
		grid-column: 3;
		grid-row: 1;
		align-self: start;
	}
	.bk__teacher {
		grid-column: 2 / 4;
		grid-row: 2;
		font-size: var(--wa-font-size-s);
	}
	.bk__dept {
		grid-column: 2 / 4;
		grid-row: 3;
	}
}

.bk-drawer {
	--size: min(34rem, 100vw);
}
/* Copy Link and Print in the header beside Your Booklist, text actions at Remove's size (2026-11-27). Centered on the
   header's row with the title and the close button (Dan, the same evening: "doesn't look lined up with the x or the
   header text": the actions slot centers nothing, so they sat 3px high), each icon as near its words as Remove's (the
   kit puts 0.75em after an icon that leads a button with more after it, which made the gap 15px). */
.bk-plain.bk-head-act {
	align-self: center;
	font-size: var(--wa-font-size-s);
	white-space: nowrap;
	margin-inline-end: var(--wa-space-s);
}
.bk-head-act > wa-icon {
	margin-inline-end: 0;
}
/* On a narrow phone (a 375px iPhone) the title kept to one line beside Copy Link, Print and the close button: the
   actions closer together, the title a size down. */
@media (width < 25rem) {
	.bk-plain.bk-head-act {
		margin-inline-end: var(--wa-space-2xs);
	}
	.bk-drawer::part(title) {
		font-size: 1.125rem;
	}
}
.bk-drawer__keplers {
	margin-block-end: var(--wa-space-l);
}
.bk-course {
	display: flex;
	flex-direction: column;
	gap: var(--wa-space-m);
}
.bk-course + .bk-course {
	padding-block-start: var(--wa-space-xl);
	border-block-start: var(--wa-border-width-s) solid var(--wa-color-surface-border);
}
/* The course's name and Remove: the name wraps beside Remove, which stays at the top right (Dan, 2026-11-27: on a long
   name wa-split had pushed Remove to a row of its own). */
.bk-course__head {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	align-items: first baseline;   /* Remove on the name's first line (Dan, 2026-11-27) */
	column-gap: var(--wa-space-m);
}
.bk-course__name {
	margin: 0;
	font-family: var(--menlo-serif);
	font-size: var(--wa-font-size-l);
	font-weight: var(--wa-font-weight-semibold);
	line-height: 1.2;
	color: var(--menlo-navy);
}
.bk-course__meta {
	margin: var(--wa-space-3xs) 0 0;
	font-size: var(--wa-font-size-s);
	color: var(--wa-color-text-quiet);
}
/* .bk-plain's font: inherit would make it the name's size. */
.bk-plain.bk-remove {
	font-size: var(--wa-font-size-s);
	white-space: nowrap;
}
.bk-sec {
	display: flex;
	flex-direction: column;
	gap: var(--wa-space-xs);
}
.bk-sec__title {
	display: flex;
	align-items: center;
	gap: 0.3em;
	margin: 0;
	font-size: var(--wa-font-size-2xs);
	font-weight: var(--wa-font-weight-semibold);
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--wa-color-brand-40);
}
.bk-sec--summer {
	padding: var(--wa-space-s) var(--wa-space-m);
	border-radius: var(--wa-border-radius-m);
	background: color-mix(in srgb, var(--menlo-gold) 14%, white);
}
.bk-sec--summer .bk-sec__title {
	color: var(--menlo-navy);
}
.bk-sec--summer .bk-sec__title wa-icon {
	color: #c98a1f;
}
.bk-items {
	display: flex;
	flex-direction: column;
	gap: var(--wa-space-m);
	margin: 0;
	padding: 0;
	list-style: none;
}
.bk-item {
	display: flex;
	gap: var(--wa-space-s);
	margin: 0;
}
.bk-item__mark {
	flex: none;
	display: grid;
	place-items: center;
	inline-size: 2.5rem;
	block-size: 3.75rem;
	border-radius: var(--wa-border-radius-s);
	background: var(--wa-color-surface-lowered);
	color: var(--menlo-blue);
	font-size: var(--wa-font-size-l);
	overflow: hidden;
}
.bk-item__mark--small {
	block-size: 2.5rem;
}
.bk-item__mark img {
	display: block;
	inline-size: 100%;
	block-size: 100%;
	object-fit: cover;
}
.bk-item__body {
	min-inline-size: 0;
}
.bk-item__body > p {
	margin: 0;
}
.bk-item__title {
	font-weight: var(--wa-font-weight-semibold);
	color: var(--menlo-navy);
	overflow-wrap: anywhere;
}
.bk-item__sub {
	font-weight: var(--wa-font-weight-normal);
	color: var(--wa-color-text-quiet);
}
.bk-item__line {
	font-size: var(--wa-font-size-s);
	color: var(--wa-color-text-quiet);
}
.bk-item__acts {
	margin-block-start: var(--wa-space-2xs);
	font-size: var(--wa-font-size-s);
}
.bk-item__notes {
	margin-block-start: var(--wa-space-2xs) !important;
	font-size: var(--wa-font-size-s);
	white-space: pre-line;
	overflow-wrap: anywhere;
}
/* A link to elsewhere: the icon after the words, outside the underline. */
.bk-ext > wa-icon {
	margin-inline-start: 0.3em;
}
.bk-plain {
	padding: 0;
	border: 0;
	background: none;
	font: inherit;
	color: var(--wa-color-text-link);
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	gap: 0.3em;
}
@media (hover: hover) {
	.bk-plain:hover {
		text-decoration: underline solid var(--menlo-gold);
		text-underline-offset: 3px;
	}
}
.bk-plain:focus-visible {
	outline: var(--wa-focus-ring);
	outline-offset: var(--wa-focus-ring-offset);
	border-radius: var(--wa-border-radius-s);
}
.bk-store {
	display: inline-flex;
	align-items: center;
	gap: var(--wa-space-xs);
}
.bk-store svg {
	inline-size: 1rem;
	block-size: 1rem;
}
.bk-drawer__empty,
.bk-drawer__wait {
	margin: 0;
	color: var(--wa-color-text-quiet);
}
.bk-drawer__wait {
	display: grid;
	place-items: center;
	min-block-size: 6rem;
	font-size: var(--wa-font-size-xl);
}

/* The page before the booklist opens. */
.bk--closed {
	padding-block-start: var(--wa-space-4xl);
	text-align: center;
}
.bk__closed-icon {
	font-size: 3rem;
	color: var(--menlo-blue);
}
.bk__closed-line {
	margin: 0;
	font-family: var(--menlo-serif);
	font-size: var(--wa-font-size-xl);
	font-weight: var(--wa-font-weight-semibold);
	color: var(--menlo-navy);
}

/* Your Booklist on paper (Dan, 2026-11-27: "Is it possible to add a print booklist feature?"): booklist.js copies the
   drawer's courses into a sheet of their own, and while that sheet exists, print shows only it, in black on white,
   without the page, the drawer or their buttons. A link's address prints under its title. Without the sheet (the
   drawer closed) the page prints as it is. */
.bk-print-sheet {
	display: none;
}
@media print {
	@page {
		margin: 0.6in;
	}
	body:has(> .bk-print-sheet) > :not(.bk-print-sheet) {
		display: none !important;
	}
	.bk-print-sheet {
		display: block;
		color: black;
		font-size: 11pt;
	}
	.bk-print-sheet__head {
		margin-block-end: 0.25in;
		padding-block-end: 0.1in;
		border-block-end: 1px solid #999;
	}
	.bk-print-sheet__school {
		margin: 0;
		font-size: 10pt;
		color: #444;
	}
	.bk-print-sheet__title {
		margin: 0;
		font-family: var(--wa-font-family-heading);
		font-size: 20pt;
		color: black;
	}
	.bk-print-sheet :is(.bk-course__name, .bk-course__meta, .bk-sec__title, .bk-item__title, .bk-item__sub, .bk-item__line, .bk-item__notes, a) {
		color: black;
	}
	.bk-print-sheet a {
		text-decoration: none;
	}
	.bk-print-sheet .bk-ext wa-icon {
		display: none;
	}
	.bk-print-sheet [data-print-url]::after {
		content: attr(data-print-url);
		display: block;
		font-size: 9pt;
		font-weight: normal;
		color: #333;
		overflow-wrap: anywhere;
	}
	.bk-print-sheet :is(.bk-course__name, .bk-sec__title) {
		break-after: avoid;
	}
	.bk-print-sheet .bk-item {
		break-inside: avoid;
	}
}
