/* ==========================================================================
   Print
   Loaded with media="print". Strips the site chrome and interactive UI and
   prints content as black on white. The main case is a parent printing a
   class page as a shopping list, or a school page as its list of classes.
   ========================================================================== */

@page {
	margin: 15mm;
}

*,
*::before,
*::after {
	background: #fff !important;
	color: #000 !important;
	box-shadow: none !important;
	text-shadow: none !important;
}

body {
	font-size: 11pt;
	line-height: 1.4;
}

/* Chrome and controls
   ========================================================================== */

.site-header,
.site-footer,
.search-overlay,
.language-filter,
.accordion-icon,
.class-books-toolbar,
.class-book-checkbox,
.class-book-thumb,
.class-pdf-frame,
.shop-sidebar,
.shop-toolbar,
.page-404-search,
.page-404-home,
.woocommerce div.product form.cart,
.woocommerce div.product .woocommerce-tabs ul.tabs,
.woocommerce div.product .related,
.woocommerce div.product .upsells,
.woocommerce .woocommerce-product-gallery__trigger,
.woocommerce .flex-control-thumbs,
.woocommerce .woocommerce-ordering,
.woocommerce nav.woocommerce-pagination,
.woocommerce ul.products li.product .button,
.woocommerce a.added_to_cart,
.woocommerce-account .woocommerce-MyAccount-navigation,
.home-hero-arrow,
.home-hero-controls,
.home-school-search,
.home-school-search-status,
.home-help-button {
	display: none !important;
}

/* Layout: full page width, no card padding or rounded boxes
   ========================================================================== */

main {
	padding: 0 !important;
}

.page-single-inner,
.school-archive-inner,
.school-single-inner,
.class-single-inner,
.shop-page-inner,
.search-page-inner,
.woocommerce-main-inner {
	max-width: none !important;
}

.shop-layout,
.woocommerce div.product,
.woocommerce-account .woocommerce:has(> .woocommerce-MyAccount-navigation) {
	display: block !important;
}

h1,
h2,
h3 {
	break-after: avoid;
}

img,
tr,
.school-card,
.shop-card,
.woocommerce ul.products li.product {
	break-inside: avoid;
}

/* Links in prose print their address */
.entry-content a[href^="http"]::after {
	content: " (" attr(href) ")";
	font-size: 90%;
	word-break: break-all;
}

/* Badges lose their fill, so give them an outline to stay recognizable */
.class-meta-badge,
.woocommerce span.onsale {
	border: 1px solid #000;
}

/* School page: every bracket expanded, as a compact list of classes
   ========================================================================== */

.accordion-panel {
	max-height: none !important;
	overflow: visible !important;
}

.accordion-item {
	margin-bottom: 12pt;
}

.accordion-header {
	padding: 0 0 4pt !important;
	border-bottom: 1px solid #000;
}

.class-list {
	grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
	padding: 6pt 0 !important;
}

.class-item a {
	padding: 3pt 0 !important;
}

/* Class page: book list addresses, then the selected books as a list
   ========================================================================== */

.class-pdfs {
	display: block !important;
}

.class-pdf {
	padding: 0 !important;
	margin-bottom: 8pt;
}

.class-pdf-print-link {
	display: block !important;
	font-size: 10pt;
	word-break: break-all;
}

/* Prints the books the visitor has ticked, so unticking what they already
   own before printing gives them their actual shopping list. */
.class-book-item:has(.class-book-checkbox:not(:checked)) {
	display: none !important;
}

.class-books-list {
	display: block !important;
}

.class-book-item {
	border-bottom: 1px solid #ccc;
	break-inside: avoid;
}

.class-book-item label {
	display: flex !important;
	align-items: baseline;
	gap: 12pt;
	padding: 6pt 0 !important;
}

.class-book-name {
	flex: 1 1 auto;
}
