/* FR-842 (CON-35, slice 1b): printing the flyer preview page /r/:slug/flyer - ONE sheet, the page of the paper, nothing else.
   The whole file is inside @media print and under body.lf-fp-print (set by helpers/flyerPreviewRender.js), so no other page and no screen
   is touched. `!important` is needed against the page layer (public/css/proto/laf.css): its selectors sit under
   `.fp-page:not(#fp-p1):not(#fp-p2)` (two ids), and its own @media print keeps the prototype's `position:fixed` for the sheet, which makes the sheet
   repeat on every printed page. The size of the paper is public/scripts/proto-flyer.js (@page from the allow-list, <style id="lf-fp-page">);
   the @page below is the default for a browser without the script (Letter, no margins). */
@media print {
	@page { size: letter; margin: 0; }

	html, body.lf-fp-print {
		margin: 0 !important;
		padding: 0 !important;
		height: auto !important;
		min-height: 0 !important;
		background: #fff !important;
	}

	/* everything that is not the chain to the sheet: body-top, the chat and other things beside #wrapper; the header, the footer and the
	   dialogs inside it; and, in each link of the chain, every sibling of the next link */
	body.lf-fp-print > *:not(#wrapper),
	body.lf-fp-print #wrapper > *:not(.fp-page),
	body.lf-fp-print .fp-page > *:not(main),
	body.lf-fp-print .fp-page > main > *:not(.lf-fp),
	body.lf-fp-print .lf-fp > *:not(.lf-fp__cols),
	body.lf-fp-print .lf-fp__cols > *:not(.lf-fp__pv),
	body.lf-fp-print .lf-fp__pv > *:not(.lf-fp__stage),
	body.lf-fp-print .lf-fp__stage > *:not([data-lf-fp-sheet]) {
		display: none !important;
	}

	/* the chain itself: no layout, no frame, no space */
	body.lf-fp-print #wrapper,
	body.lf-fp-print .fp-page,
	body.lf-fp-print .fp-page > main,
	body.lf-fp-print .lf-fp,
	body.lf-fp-print .lf-fp__cols,
	body.lf-fp-print .lf-fp__pv,
	body.lf-fp-print .lf-fp__stage,
	body.lf-fp-print [data-lf-fp-sheet] {
		display: block !important;
		position: static !important;
		float: none !important;
		width: 100% !important;
		max-width: none !important;
		min-width: 0 !important;
		min-height: 0 !important;
		margin: 0 !important;
		padding: 0 !important;
		border: 0 !important;
		border-radius: 0 !important;
		background: none !important;
		box-shadow: none !important;
		transform: none !important;
		grid-template-columns: none !important;
	}

	/* the sheet is the page: as wide as the paper, as tall as the paper, kept on one page */
	body.lf-fp-print [data-lf-fp-sheet] {
		height: 100vh !important;
		overflow: hidden !important;
		break-inside: avoid !important;
		page-break-inside: avoid !important;
		/* a block exactly as tall as the page overflows it by a rounding fraction in Chrome and prints a second, empty page (checked: 2 pages
		   with margin 0, 1 page with this) */
		margin-bottom: -1px !important;
	}
	body.lf-fp-print .lf-fly {
		position: static !important;
		width: 100% !important;
		height: 100vh !important;
		max-height: 100vh !important;
		margin: 0 !important;
		aspect-ratio: auto !important;
		box-shadow: none !important;
		break-inside: avoid !important;
		page-break-inside: avoid !important;
	}

	/* Bootstrap's print reset of the old theme (bundle.min.css: `*{background:transparent!important;color:#000!important}`) is stronger than every
	   screen rule of the sheet, so the sheet states its own colors again, with the same tokens as on the screen (public/css/proto/laf.css
	   .lf-fly*): the colored band and its white title, the tint under the photo, the reward, the label colors */
	body.lf-fp-print .lf-fly { background-color: #fff !important; color: var(--ink) !important; }
	body.lf-fp-print .lf-fly__top { background-color: var(--f) !important; }
	body.lf-fp-print .lf-fly__top,
	body.lf-fp-print .lf-fly__top * { color: var(--f-ink) !important; }
	body.lf-fp-print .lf-fly__ph { background-color: var(--f-soft) !important; background-repeat: no-repeat !important; background-position: center !important; background-size: auto 56% !important; }
	body.lf-fp-print .lf-fly__reward { background-color: var(--warn-bg) !important; color: var(--warn) !important; }
	body.lf-fp-print .lf-fly__qr { background-color: #fff !important; }
	body.lf-fp-print .lf-fly__name,
	body.lf-fp-print .lf-fly__facts,
	body.lf-fp-print .lf-fly__tel,
	body.lf-fp-print .lf-fly__tabs span,
	body.lf-fp-print .lf-fly__tabs b { color: var(--ink) !important; }
	body.lf-fp-print .lf-fly__marks,
	body.lf-fp-print .lf-fly__where,
	body.lf-fp-print .lf-fly__note,
	body.lf-fp-print .lf-fly__alt { color: var(--head) !important; }
	body.lf-fp-print .lf-fly.no-phone .lf-fly__alt { color: var(--ink) !important; }
	body.lf-fp-print .lf-fly__where b,
	body.lf-fp-print .lf-fly__cl { color: var(--f-tx) !important; }
	body.lf-fp-print .lf-fly__url,
	body.lf-fp-print .lf-fly__foot,
	body.lf-fp-print .lf-fly__foot * { color: var(--muted) !important; }
	/* the silhouettes of a sheet without a photo are the same pictures as .ph-* of kit.css (utests/flyerPreviewAssets_test.js keeps them equal) */
	body.lf-fp-print .lf-fly__ph.ph-dog { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cg fill='%23e8d5bd'%3E%3Cpath d='M22 17C14 15 7 23 8 34c1 9 7 12 11 7 3-6 4-15 6-21zM42 17c8-2 15 6 14 17-1 9-7 12-11 7-3-6-4-15-6-21z'/%3E%3Cellipse cx='32' cy='33' rx='14.5' ry='16'/%3E%3C/g%3E%3Cg fill='%23cdb497'%3E%3Ccircle cx='26.5' cy='30' r='2.3'/%3E%3Ccircle cx='37.5' cy='30' r='2.3'/%3E%3Cpath d='M28.4 37.4h7.2L32 41.4z'/%3E%3C/g%3E%3C/svg%3E") !important; }
	body.lf-fp-print .lf-fly__ph.ph-cat { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cg fill='%23e8d5bd'%3E%3Cpath d='M16 34l-1-24 13 10zM48 34l1-24-13 10z'/%3E%3Cellipse cx='32' cy='36' rx='18' ry='15.5'/%3E%3C/g%3E%3Cg fill='%23cdb497'%3E%3Cellipse cx='25.5' cy='34' rx='2.3' ry='2.9'/%3E%3Cellipse cx='38.5' cy='34' rx='2.3' ry='2.9'/%3E%3Cpath d='M29.8 40h4.4L32 42.6z'/%3E%3C/g%3E%3C/svg%3E") !important; }
	body.lf-fp-print .lf-fly__ph.ph-rabbit { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cg fill='%23e8d5bd'%3E%3Cellipse cx='25' cy='18' rx='5.2' ry='14' transform='rotate(-10 25 18)'/%3E%3Cellipse cx='39' cy='18' rx='5.2' ry='14' transform='rotate(10 39 18)'/%3E%3Cellipse cx='32' cy='41' rx='15' ry='13.5'/%3E%3C/g%3E%3Cg fill='%23cdb497'%3E%3Ccircle cx='26.5' cy='39' r='2.1'/%3E%3Ccircle cx='37.5' cy='39' r='2.1'/%3E%3C/g%3E%3C/svg%3E") !important; }
	body.lf-fp-print .lf-fly__ph.ph-bird { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cg fill='%23e8d5bd'%3E%3Ccircle cx='32' cy='21' r='12'/%3E%3Cellipse cx='32' cy='39' rx='14' ry='17'/%3E%3C/g%3E%3Cg fill='%23cdb497'%3E%3Ccircle cx='27.5' cy='19.5' r='2.1'/%3E%3Ccircle cx='36.5' cy='19.5' r='2.1'/%3E%3Cpath d='M29.4 24h5.2L32 28.4z'/%3E%3C/g%3E%3C/svg%3E") !important; }
	body.lf-fp-print .lf-fly__ph.ph-other { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cg fill='%23e8d5bd'%3E%3Cpath d='M32 31c-7 0-13 8-13 14 0 4 3 6 6 6 3 0 4.5-1.6 7-1.6s4 1.6 7 1.6c3 0 6-2 6-6 0-6-6-14-13-14z'/%3E%3Cellipse cx='15.5' cy='27' rx='4.6' ry='5.8' transform='rotate(-18 15.5 27)'/%3E%3Cellipse cx='24.5' cy='16' rx='4.6' ry='6'/%3E%3Cellipse cx='39.5' cy='16' rx='4.6' ry='6'/%3E%3Cellipse cx='48.5' cy='27' rx='4.6' ry='5.8' transform='rotate(18 48.5 27)'/%3E%3C/g%3E%3C/svg%3E") !important; }

	/* without it Chrome drops the background and the white title on the colored band (--f-ink:#fff) */
	body.lf-fp-print .lf-fly,
	body.lf-fp-print .lf-fly * {
		-webkit-print-color-adjust: exact !important;
		print-color-adjust: exact !important;
	}
}
