/*!
 * GlobalBenefits Workspace - print styles
 *
 * Loaded with media="print", so it costs nothing on screen.
 *
 * Goal: a visitor can walk into a county office with a printed copy of their workspace.
 * That means ink-cheap, no interactive chrome, and URLs written out in full because a
 * printed link is useless otherwise.
 *
 * Scoped entirely under `.gbw` except for one page-margin rule, so it cannot alter how any
 * other page of the site prints.
 */

@page {
	margin: 14mm;
}

.gbw {
	margin: 0;
	color: #000000;
}

.gbw-frame,
.gbw-fallback,
.gbw-privacy,
.gbw-notyet,
.gbw-warn {
	border: 1px solid #666666;
	border-left-color: #666666;
	background: transparent;
	padding: 8mm;
}

.gbw-title {
	font-size: 16pt;
	color: #000000;
}

.gbw-lead,
.gbw-muted {
	color: #000000;
}

/* Buttons are meaningless on paper. */
.gbw-toolbar,
.gbw-btn,
.gbw-status {
	display: none;
}

/* A printed link must carry its destination. */
.gbw a::after {
	content: ' (' attr(href) ')';
	font-size: 9pt;
	word-break: break-all;
}

/* Keep a field label and its value on the same sheet. */
.gbw-dl dt,
.gbw-dl dd {
	break-inside: avoid;
	page-break-inside: avoid;
}

.gbw-dl {
	border-top: 1px solid #999999;
}

.gbw-dl dd {
	border-bottom: 1px solid #999999;
	font-weight: 700;
}

/* The privacy statement is part of the record and must survive to paper. */
.gbw-privacy {
	break-inside: avoid;
	page-break-inside: avoid;
}

.gbw-privacy-never {
	color: #000000;
	font-weight: 700;
}

/* ---------- Printed plan ---------- */

/* The whole point of printing is to take the plan to an office, so every folded section
   must be open on paper regardless of whether the visitor expanded it on screen. */
.gbw-details > div,
.gbw-details > summary + * {
	display: block;
}

.gbw-details {
	border: 0;
	padding: 0;
}

.gbw-details summary {
	color: #000000;
	font-weight: 700;
	list-style: none;
}

/* A card is a unit of meaning; splitting one across sheets makes it unusable at a counter. */
.gbw-card,
.gbw-today-group {
	break-inside: avoid;
	page-break-inside: avoid;
	border: 1px solid #666666;
	border-top-width: 3px;
	margin-bottom: 6mm;
	padding: 5mm;
}

.gbw-grid {
	display: block;
}

.gbw-card-title,
.gbw-today-prog {
	color: #000000;
}

.gbw-tag {
	border: 1px solid #666666;
	background: transparent;
	color: #000000;
}

/* Selects and date fields print as their chosen value, framed, not as widgets. */
.gbw-select,
.gbw-date {
	border: 0;
	border-bottom: 1px solid #000000;
	padding: 0;
	min-height: 0;
	font-weight: 700;
	color: #000000;
	/* Chrome omits form control values otherwise. */
	-webkit-appearance: none;
	appearance: none;
}

.gbw-check input {
	/* An unticked box must still print as an empty box to tick by hand. */
	-webkit-appearance: checkbox;
	appearance: checkbox;
}

/* The not-a-government-agency statement must be on the printed page too - a printout
   circulating without it is exactly the confusion the rule exists to prevent. */
.gbw-legal {
	break-inside: avoid;
	page-break-inside: avoid;
	border: 1px solid #000000;
	background: transparent;
	color: #000000;
	font-weight: 600;
}

/* ---------- Printed Action Pack ---------- */

.gbw-ap-sec {
	break-inside: avoid;
	page-break-inside: avoid;
	border-bottom: 1px solid #999999;
}

.gbw-ap-num {
	background: transparent;
	border: 1px solid #000000;
	color: #000000;
}

.gbw-ap-title,
.gbw-ap-h {
	color: #000000;
}

/* On paper an outbound button is not pressable, so it prints as its destination.
   The generic `.gbw a::after` rule already appends the href. */
.gbw-btn-tool,
.gbw-toollink .gbw-btn-official {
	display: inline;
	width: auto;
	min-height: 0;
	padding: 0;
	border: 0;
	background: transparent;
	color: #000000;
	font-weight: 700;
	text-align: left;
}

.gbw-toollink-dest {
	display: block;
	color: #000000;
}

/* Section 12 is the sheet someone carries to a counter, so it starts its own page. */
.gbw-ap-summary {
	break-before: page;
	page-break-before: always;
	break-inside: avoid;
	page-break-inside: avoid;
	border: 2px solid #000000;
}

/* ---------- Benefit Discovery ---------- */

/*
 * The printed page is the deliverable here, not a consolation. A visitor who has just found out
 * that five programmes are worth applying for needs to carry that list - with the documents, the
 * steps and the official addresses - to a counter, a caseworker, or a kitchen table.
 *
 * So on paper: the progress bar and the buttons go, every collapsed <details> opens, and each
 * result card is kept whole rather than split across a page break.
 */

.gbw-dsc-progress,
.gbw-dsc-nav,
.gbw-dsc-resultbar,
.gbw-dsc-actions .gbw-btn-secondary {
	display: none;
}

/*
 * Documents and steps are the whole point of printing this, and CSS CANNOT reveal them on its own.
 *
 * A closed <details> withholds its non-summary content through the browser's own slot mechanism, so
 * `display: block` on the inner div achieves nothing - this file previously claimed to open every
 * collapsed section and a generated PDF contained "Documents to get ready" and not one document.
 *
 * The actual work is done in gbw-discover-view.js, which sets the `open` attribute before printing
 * and restores it afterwards. These rules only style the result once it is genuinely open, and are
 * kept as a second line of defence for the case where the script has not run.
 */
.gbw-dsc-card details[open] > div {
	display: block;
}

.gbw-dsc-card summary {
	font-weight: 700;
	color: #000000;
	list-style: none;
}

.gbw-dsc-summary,
.gbw-dsc-card {
	border: 1px solid #666666;
	border-left: 3px solid #000000;
	background: transparent;
	break-inside: avoid;
	page-break-inside: avoid;
}

.gbw-dsc-card-title,
.gbw-dsc-group-h,
.gbw-dsc-est-value {
	color: #000000;
}

/* The tier must survive a monochrome printer, so it prints as a bordered word. */
.gbw-dsc-badge {
	border: 1px solid #000000;
	color: #000000;
}

.gbw-dsc-urgent,
.gbw-dsc-estimate {
	border-left: 3px solid #000000;
	background: transparent;
	color: #000000;
}

/* The official destination prints as its URL - the generic `.gbw a::after` rule appends it. */
.gbw-dsc-actions .gbw-btn-official {
	display: inline;
	width: auto;
	min-height: 0;
	padding: 0;
	border: 0;
	background: transparent;
	color: #000000;
	font-weight: 700;
	text-align: left;
}
