/**
 * print.css — the one sheet the customer actually prints.
 *
 * Plan §3 (this file: "Small: hide chrome, expand `<details>`, show hrefs,
 * print the order summary legibly"), §5.13a ("`print.css` makes this screen
 * print legibly — it is the screen customers actually print"),
 * THEME-RULES.md §6.3, §11 item 37.
 *
 * ---------------------------------------------------------------------------
 * HAND-WRITTEN, NOT BUILT, AND OUTSIDE THE BYTE BUDGET
 * ---------------------------------------------------------------------------
 * `bin/build-css.mjs` does not touch this file and `bin/check-budgets.sh` does
 * not measure it. THEME-RULES.md §6.3 gives the reason and draws the line
 * carefully: `print.css` stays exempt "because it is genuinely small, genuinely
 * non-blocking, and printed at most once per visitor", and — the half that
 * matters — "neither exemption is a loophole: nothing that belongs in
 * `theme.css` may be parked anywhere to make a number fit." Nothing screen-
 * facing goes in here.
 *
 * It is enqueued with `media="print"`, so it is fetched at low priority and
 * never blocks a render.
 *
 * ---------------------------------------------------------------------------
 * WHAT A PRINTED PAGE IS FOR
 * ---------------------------------------------------------------------------
 * One reader, on paper, with no hover, no scroll, no JavaScript and no way to
 * open anything. So:
 *
 *   · CHROME GOES. A navigation bar on paper is a list of places the reader
 *     cannot go. The header, the footer, the filter bar, the CTA bands, the
 *     enquiry surface, the pagination and the total bar are all removed.
 *   · `<details>` OPENS. A collapsed disclosure prints as its summary alone,
 *     which on an order summary means the line items are simply missing.
 *     `[open]` is forced on every one.
 *   · LINK TARGETS APPEAR. A blue word is not a URL on paper. Every anchor in
 *     prose prints its href after it — with three deliberate exceptions below.
 *   · INK IS EXPENSIVE. Dark bands print as paper with ink text rather than as
 *     a solid black rectangle, and no image on the transaction screens prints
 *     at all.
 *
 * ---------------------------------------------------------------------------
 * THE ONE RULE THAT IS A SECURITY DECISION RATHER THAN A TYPOGRAPHIC ONE
 * ---------------------------------------------------------------------------
 * **`template-order.php` prints NO href, anywhere.** §5.13a: that URL carries
 * `?o={uuid}&t={token}`, the plugin sends `Referrer-Policy: no-referrer`, and
 * the template renders zero outbound links precisely so nothing can leak the
 * token. A print stylesheet that helpfully appended every `href` to its link
 * text would print the order token onto a sheet of paper — which is a leak the
 * headers cannot do anything about. So the href-expansion rule is scoped to
 * `.gwb-prose` and is switched off entirely on `.gwb-transaction`.
 *
 * The other two exceptions are ordinary: an anchor whose text already IS its
 * href (the telephone number) would print it twice, and a fragment link points
 * at somewhere on the same sheet.
 */

@media print {

	/* -----------------------------------------------------------------
	 * 1. Ground and ink.
	 * -------------------------------------------------------------- */

	html,
	body {
		background: #ffffff;
		color: #000000;
	}

	/*
	 * Dark bands, on paper. The selectors are listed rather than blanket
	 * `[class*="dark"]`, so that a component added later is not silently
	 * assumed to be handled. `print-color-adjust: economy` is the default
	 * and is not restated; what is restated is the ground.
	 */
	.gwb-cta,
	.gwb-card--featured,
	.gwb-review--dark,
	.gwb-sechead--ink {
		background: #ffffff;
		color: #000000;
	}

	.gwb-cta__title,
	.gwb-card--featured .gwb-card__title,
	.gwb-review--dark .gwb-review__quote,
	.gwb-sechead--ink .gwb-sechead__title {
		color: #000000;
	}

	/* -----------------------------------------------------------------
	 * 2. Chrome that has no meaning on paper.
	 * -------------------------------------------------------------- */

	.gwb-utility,
	.gwb-header,
	.gwb-nav,
	.gwb-nav-mobile,
	.gwb-nav-toggle,
	.gwb-footer,
	.gwb-filterbar,
	.gwb-pagination,
	.gwb-cta,
	.gwb-enquiry,
	.gwb-total,
	.gwb-skip-link,
	.gwb-hero__scrim,
	.gwb-breadcrumbs {
		display: none;
	}

	/* The step indicator is progress through a process that is over by the
	 * time anybody prints. The order summary beneath it is the document. */
	.gwb-steps {
		display: none;
	}

	/* -----------------------------------------------------------------
	 * 3. Disclosures print open.
	 * -------------------------------------------------------------- */

	details {
		display: block;
	}

	details > summary {
		list-style: none;
	}

	details > *:not(summary) {
		display: revert;
	}

	.gwb-card__summary::after,
	.gwb-moreinfo__summary::after {
		content: "";
	}

	/* -----------------------------------------------------------------
	 * 4. Link targets, except where a target is a secret.
	 * -------------------------------------------------------------- */

	.gwb-prose a[href]::after {
		content: " (" attr(href) ")";
		font-size: .9em;
		word-break: break-all;
	}

	.gwb-prose a[href^="#"]::after,
	.gwb-prose a[href^="tel:"]::after,
	.gwb-prose a[href^="mailto:"]::after,
	.gwb-transaction .gwb-prose a[href]::after {
		content: "";
	}

	/* -----------------------------------------------------------------
	 * 5. The transaction screens — §5.13a, item 37.
	 * -------------------------------------------------------------- */

	/* No image on any of the four screens prints. There is only one to begin
	 * with (the minimal header's logo) and it is chrome. */
	.gwb-transaction img,
	.gwb-transaction .gwb-slot {
		display: none;
	}

	.gwb-transaction .gwb-txn {
		max-width: none;
		padding-block: 0;
	}

	/* The summary panel loses its border and its ground: on paper the rules
	 * between the lines carry the structure and a boxed panel wastes a margin. */
	.gwb-txn__panel {
		padding: 0;
		border: 0;
		background: none;
	}

	.gwb-sumline {
		border-top: 1px solid #999999;
		break-inside: avoid;
	}

	.gwb-sumline--deposit {
		padding: 8px 0;
		border-top: 1px solid #000000;
		background: none;
	}

	/* The two figures nobody may lose to a page break. */
	.gwb-sumline--total,
	.gwb-sumline--deposit {
		break-inside: avoid;
		break-before: avoid;
	}

	/* The status line is about a poll that is not running on paper. Its text
	 * still reads correctly, which is why it prints rather than being hidden:
	 * "call us on …" is the sentence a customer with a printout wants. */
	[data-gwuk-role="payment-status-poll"] {
		border: 1px solid #999999;
		background: none;
	}

	/* -----------------------------------------------------------------
	 * 6. Page breaks in ordinary content.
	 * -------------------------------------------------------------- */

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

	figure,
	blockquote,
	table,
	.gwb-card,
	.gwb-row {
		break-inside: avoid;
	}
}
