/*
 * ALL AT SEA Awards — the bar kit's print pieces (MP-109 §3.5).
 *
 * Three formats, one stylesheet:
 *   .aas-print--tent    A5 landscape sheet, two faces with a fold line. The
 *                       top face is rotated 180° so that, folded, both sides
 *                       of the table read it the right way up.
 *   .aas-print--poster  A4 portrait, one face.
 *   .aas-print--strip   80 mm wide, till-receipt width, continuous length.
 *
 * Everything sizes in millimetres, because that is what comes out of the
 * printer. The QR is drawn by qrcodejs at a fixed pixel resolution (crisp)
 * and then SIZED HERE in mm per piece (--qr) so it can never outgrow its face
 * — v0.9.0 let the 320 px canvas render at ~85 mm inside a 74 mm face, which
 * is what "the tent doesn't format" looked like.
 *
 * The on-screen view is a preview of the printed piece, not a web page: same
 * geometry on a light ground, one toolbar and one hint that .no-print removes
 * on the way to paper. The theme's stylesheets are pruned from this page
 * (AAS_Bar_Page::enqueue_print_assets), so nothing here needs to out-rank them.
 */

:root {
	--print-navy: #163A57;
	--print-foam: #F1F4F4;
	--print-sunset: #C24A2C;
	--print-seaglass: #2F7E80;
	--print-muted: #5B7183;
	--print-rule: #D3DEE0;
	--qr: 40mm;
}

* { box-sizing: border-box; }

body.aas-print {
	margin: 0;
	padding: 0;
	background: #E7ECEC;
	color: var(--print-navy);
	font-family: Georgia, "Times New Roman", serif;
	line-height: 1.25;
	-webkit-print-color-adjust: exact;
	print-color-adjust: exact;
}

/* -------------------------------------------------------------- Toolbar */

.aas-print__bar {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	align-items: center;
	justify-content: space-between;
	background: var(--print-navy);
	color: var(--print-foam);
	font-family: Arial, "Helvetica Neue", sans-serif;
	font-size: 14px;
	padding: 12px 20px;
}

.aas-print__bar-actions { display: flex; gap: 8px; }

.aas-print__btn {
	appearance: none;
	cursor: pointer;
	display: inline-block;
	font-family: Arial, "Helvetica Neue", sans-serif;
	font-size: 13px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.09em;
	text-decoration: none;
	color: #fff;
	background: var(--print-sunset);
	border: 0;
	border-radius: 2px;
	padding: 10px 16px;
}

.aas-print__btn--ghost { background: transparent; border: 1px solid rgba(241, 244, 244, 0.5); }

.aas-print__hint {
	max-width: 210mm;
	margin: 16px auto 0;
	padding: 0 8px;
	font-family: Arial, "Helvetica Neue", sans-serif;
	font-size: 14px;
	line-height: 1.5;
	color: var(--print-muted);
	text-align: center;
}

/* ---------------------------------------------------------------- Piece */

.aas-print__piece {
	background: #fff;
	margin: 16px auto 32px;
	box-shadow: 0 2px 16px rgba(22, 58, 87, 0.15);
	overflow: hidden;
}

.aas-print__inner {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
	padding: 12mm;
	overflow: hidden;
}

.aas-print__copy { min-width: 0; }

.aas-print__kicker {
	font-family: Arial, "Helvetica Neue", sans-serif;
	font-size: 8.5pt;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.16em;
	color: var(--print-seaglass);
	margin: 0 0 3mm;
}

.aas-print__headline {
	font-size: 30pt;
	line-height: 1.05;
	font-weight: 600;
	color: var(--print-navy);
	margin: 0 0 3mm;
}

.aas-print__sub {
	font-size: 13pt;
	line-height: 1.3;
	color: var(--print-navy);
	margin: 0 0 3mm;
}

.aas-print__venue {
	font-size: 15pt;
	line-height: 1.25;
	font-weight: 700;
	color: var(--print-navy);
	margin: 0 0 4mm;
}

.aas-print__venue span { font-weight: 400; color: var(--print-muted); }

.aas-print__qr {
	display: inline-block;
	flex: 0 0 auto;
	line-height: 0;
	padding: 3mm;
	background: #fff;
	border: 1px solid var(--print-rule);
}

.aas-print__qr img,
.aas-print__qr canvas {
	display: block;
	width: var(--qr);
	height: var(--qr);
	max-width: none;
}

/* qrcodejs draws a canvas AND an img of the same code; show one. */
.aas-print__qr canvas { display: none; }

.aas-print__url {
	font-family: Arial, "Helvetica Neue", sans-serif;
	font-size: 12pt;
	font-weight: 700;
	color: var(--print-navy);
	margin: 0 0 2mm;
	overflow-wrap: anywhere;
}

.aas-print__foot {
	font-family: Arial, "Helvetica Neue", sans-serif;
	font-size: 7.5pt;
	line-height: 1.4;
	letter-spacing: 0.03em;
	color: var(--print-muted);
	margin: 0;
}

/* ------------------------------------------------------------ Table tent */
/* A5 landscape = 210 × 148 mm; @page margin 8 mm leaves 194 × 132 mm.
 * Two faces of 62 mm plus the fold fit that with room to spare. Each face is
 * copy on the left, QR on the right, so the code stays scannable at table
 * distance and the words stay big enough to read across it. */

.aas-print--tent { --qr: 40mm; }
.aas-print--tent .aas-print__piece { width: 194mm; }

.aas-print--tent .aas-print__inner {
	height: 62mm;
	flex-direction: row;
	justify-content: space-between;
	gap: 8mm;
	text-align: left;
	padding: 7mm 10mm;
}

.aas-print--tent .aas-print__copy { flex: 1 1 auto; }
.aas-print--tent .aas-print__kicker { margin-bottom: 2mm; }
.aas-print--tent .aas-print__headline { font-size: 24pt; margin-bottom: 1.5mm; }
.aas-print--tent .aas-print__sub { font-size: 11.5pt; margin-bottom: 2mm; }
.aas-print--tent .aas-print__venue { font-size: 12.5pt; margin-bottom: 3mm; }
.aas-print--tent .aas-print__url { font-size: 10.5pt; }
.aas-print--tent .aas-print__foot { font-size: 7pt; }

/* The fold. Printed as a hairline so it can be creased accurately. */
.aas-print__fold {
	height: 0;
	border-top: 1px dashed #A9803E;
	margin: 0 6mm;
}

.aas-print__inner--mirror { transform: rotate(180deg); }

/* ---------------------------------------------------------------- Poster */
/* A4 portrait = 210 × 297 mm; @page margin 8 mm leaves 194 × 281 mm.
 * One face, 270 mm tall, so it never spills onto a second sheet. */

.aas-print--poster { --qr: 84mm; }
.aas-print--poster .aas-print__piece { width: 194mm; }
.aas-print--poster .aas-print__inner { height: 270mm; padding: 16mm 14mm; }
.aas-print--poster .aas-print__kicker { font-size: 10pt; margin-bottom: 8mm; }
.aas-print--poster .aas-print__headline { font-size: 36pt; margin-bottom: 6mm; }
.aas-print--poster .aas-print__venue { font-size: 17pt; margin-bottom: 10mm; }
.aas-print--poster .aas-print__qr { margin-bottom: 8mm; }
.aas-print--poster .aas-print__url { font-size: 16pt; margin-bottom: 4mm; }
.aas-print--poster .aas-print__foot { font-size: 9pt; }

/* ------------------------------------------------------------ Till strip */
/* 80 mm receipt paper; @page margin 3 mm leaves 74 mm. */

.aas-print--strip { --qr: 50mm; }
.aas-print--strip .aas-print__piece { width: 74mm; }

.aas-print__strip-inner {
	text-align: center;
	padding: 6mm 4mm;
}

.aas-print__strip-head {
	font-size: 11.5pt;
	line-height: 1.25;
	font-weight: 600;
	color: var(--print-navy);
	margin: 0 0 4mm;
}

.aas-print--strip .aas-print__qr { padding: 2mm; margin: 0 auto; }

.aas-print__strip-url {
	font-family: Arial, "Helvetica Neue", sans-serif;
	font-size: 9.5pt;
	font-weight: 700;
	color: var(--print-navy);
	margin: 4mm 0 2mm;
	overflow-wrap: anywhere;
}

.aas-print__strip-foot {
	font-family: Arial, "Helvetica Neue", sans-serif;
	font-size: 7pt;
	line-height: 1.4;
	color: var(--print-muted);
	margin: 0;
}

/* ----------------------------------------------------------------- Print */

@media print {
	.no-print { display: none !important; }

	body.aas-print { background: #fff; }

	.aas-print__piece { margin: 0; box-shadow: none; }
}

/* The per-piece paper SIZE is emitted inline by the partial (@page cannot be
 * selected by a body class). This is only the shared default margin, for the
 * case where that inline block is stripped by an optimiser. */
@page { margin: 8mm; }
