/*
 * Max Studio print stylesheet (1.0.18, pass 11).
 *
 * Loaded only for paper: functions.php enqueues it with media="print" after style.css, so the screen keeps Dusk 2.0
 * (dark-only) untouched and browsers fetch this file at low priority, off the critical path.
 *
 * What it does: dark ink on a white page; no header menu, LinkedIn buttons, follow band, footer, "Back to top",
 * skip link, reading-progress hairline, copy-link button, comment form, older/newer links or lightbox chrome; no
 * animation, transition or view transition; external links print their address after the link text (same-site
 * links do not); headings, cards, figures and captions are not split across pages.
 */

@page {
	margin: 16mm 16mm 18mm;
}

/* ---- Ink on paper --------------------------------------------------------------------------------------------- */

:root,
html {
	color-scheme: light;
}

html,
body,
.wp-site-blocks {
	background: #fff !important;
	color: #111 !important;
}

*,
*::before,
*::after {
	background-color: transparent !important;
	background-image: none !important;
	color: #111 !important;
	box-shadow: none !important;
	text-shadow: none !important;
	filter: none !important;
	/* Motion off: page cross-fade, headline sweep, nudges, spinners, glows. */
	animation: none !important;
	transition: none !important;
}

::view-transition-group(*),
::view-transition-old(*),
::view-transition-new(*) {
	animation: none !important;
}

/* Gold-to-light headline is clipped gradient text on screen; on paper it is plain ink. */
.ms-display,
h1,
h2,
h3 {
	-webkit-background-clip: border-box !important;
	background-clip: border-box !important;
	-webkit-text-fill-color: currentColor !important;
}

body {
	font-size: 11pt;
	line-height: 1.5;
	orphans: 3;
	widows: 3;
}

/* Everything that waits off-screen on screen must render on paper. */
* {
	content-visibility: visible !important;
}

/* ---- Chrome that is no use on paper ---------------------------------------------------------------------------- */

.skip-link,
.screen-reader-text,
.ms-nav,
.wp-block-navigation,
.wp-block-navigation__responsive-container,
.wp-block-navigation__responsive-container-open,
.ms-header .wp-block-buttons,
.ms-footer,
.ms-footer-links,
.ms-to-top,
.ms-copy,
.ms-post-nav,
.ms-arrow,
.wp-block-buttons,
.wp-block-post-comments-form,
.comment-respond,
.comment-reply-link,
#cancel-comment-reply-link,
.wp-block-template-part > .ms-section-tight.ms-bordered,
main ~ .ms-section-tight.ms-bordered,
.ms-article > p.has-small-font-size:first-child,
.ms-topics,
.wp-block-query-pagination,
.wp-lightbox-container button,
.wp-lightbox-overlay,
.jp-carousel-wrap,
.jp-carousel-overlay,
.sharedaddy,
.sd-sharing-enabled,
.jetpack-likes-widget-wrapper,
.wpcnt,
#wpadminbar,
form,
iframe,
video,
audio {
	display: none !important;
}

/* Reading-progress hairline (body::before on articles). */
body.ms-reading::before,
body::before,
body::after {
	display: none !important;
	content: none !important;
}

/* Header: keep the site title only, as a plain line at the top of the first page. */
.ms-header,
header.wp-block-template-part,
#top {
	position: static !important;
	border: 0 !important;
	padding: 0 !important;
	margin: 0 0 6mm !important;
}

.ms-header > .alignwide {
	padding: 0 0 3mm !important;
	border-bottom: 0.5pt solid #999 !important;
}

.wp-block-site-title,
.wp-block-site-title a {
	font-size: 12pt !important;
	font-weight: 700;
	text-decoration: none !important;
}

/* ---- Layout: one column, full page width ---------------------------------------------------------------------- */

.wp-site-blocks,
main,
.ms-article,
.alignwide,
.alignfull,
.has-global-padding {
	max-width: none !important;
	margin-left: 0 !important;
	margin-right: 0 !important;
	padding-left: 0 !important;
	padding-right: 0 !important;
}

main,
.ms-article,
.ms-section,
.ms-section-tight,
.ms-hero,
.ms-band,
.ms-creds {
	padding-top: 0 !important;
	padding-bottom: 0 !important;
	border: 0 !important;
}

.ms-section,
.ms-section-tight,
.ms-band,
.ms-creds {
	margin-top: 8mm !important;
}

h1,
.wp-block-post-title {
	font-size: 22pt !important;
	line-height: 1.15 !important;
	margin: 0 0 4mm !important;
}

h2 {
	font-size: 15pt !important;
	line-height: 1.2 !important;
	margin: 6mm 0 2mm !important;
}

h3 {
	font-size: 12pt !important;
	line-height: 1.25 !important;
	margin: 4mm 0 1.5mm !important;
}

.ms-eyebrow,
.ms-meta,
.ms-byline,
.wp-block-post-date,
.ms-muted,
figcaption,
.wp-element-caption {
	color: #444 !important;
}

/* Cards and grids print as a plain list with a hairline between items. */
.ms-grid,
.ms-press,
.ms-press-cards,
.wp-block-post-template,
.wp-block-columns,
.ms-hero-cols {
	display: block !important;
}

.wp-block-column {
	width: auto !important;
	flex-basis: auto !important;
}

.wp-block-post-template > li,
.ms-card,
.ms-ep,
.ms-topic,
.ms-chip {
	border: 0 !important;
	border-radius: 0 !important;
	padding: 0 !important;
}

.wp-block-post-template > li,
.ms-ep {
	padding: 2mm 0 !important;
	border-bottom: 0.5pt solid #ccc !important;
}

/* Pictures: keep them, but no taller than half a page; list thumbnails stay small. */
img,
svg {
	max-width: 100% !important;
	height: auto !important;
}

img {
	max-height: 110mm !important;
	object-fit: contain !important;
	border-radius: 0 !important;
}

.wp-block-post-template img,
.ms-ep-thumb img {
	max-height: 40mm !important;
	width: auto !important;
}

.ms-portrait img {
	max-height: 70mm !important;
	width: auto !important;
}

/* ---- Links --------------------------------------------------------------------------------------------------- */

a {
	text-decoration: underline !important;
	text-decoration-thickness: 0.5pt !important;
	text-underline-offset: 1.5pt;
}

h1 a,
h2 a,
h3 a,
.wp-block-site-title a {
	text-decoration: none !important;
}

/* External links show where they go. Same-site links (relative, or absolute to maxshifman.com) do not, nor do
   in-page anchors, mail or phone links, or links that wrap only a picture. */
a[href^="http"]:not([href*="://maxshifman.com"]):not([href*="://www.maxshifman.com"])::after {
	content: " (" attr(href) ")";
	font-size: 0.85em;
	font-weight: 400;
	color: #444 !important;
	word-break: break-all;
	overflow-wrap: anywhere;
	text-decoration: none !important;
}

figure > a::after,
.wp-block-post-featured-image a::after,
a:has(> img:only-child)::after {
	content: none !important;
}

/* ---- Page breaks --------------------------------------------------------------------------------------------- */

h1,
h2,
h3,
h4,
h5,
h6 {
	break-after: avoid-page;
	page-break-after: avoid;
	break-inside: avoid;
	page-break-inside: avoid;
}

figure,
figcaption,
.wp-block-image,
.wp-block-post-featured-image,
.wp-block-post-template > li,
.ms-card,
.ms-ep,
.ms-cred,
.ms-creds .wp-block-column,
blockquote,
.wp-block-quote,
.wp-block-pullquote,
pre,
table,
tr,
li {
	break-inside: avoid;
	page-break-inside: avoid;
}

/* A caption stays with its picture. */
figure img,
.wp-block-image img {
	break-after: avoid;
	page-break-after: avoid;
}

p {
	orphans: 3;
	widows: 3;
}

/* Comments that already exist still print; the reply form does not. */
.ms-comments {
	border-top: 0.5pt solid #ccc !important;
	margin-top: 8mm !important;
	padding-top: 4mm !important;
}
