/*
 * Interior pages: paper, pencil marks, and the diner palette.
 * Deliberately excludes the front page; saved page content needs no replacement.
 */
body.page:not(.home) {
	--awn-page-paper: #edeedc;
	--awn-page-ink: #221f20;
	--awn-page-teal: #249d99;
	--awn-page-deep: #17625f;
	--awn-page-mint: #b2d2c6;
	--awn-page-lamp: #ffc390;
	background: var(--awn-page-paper);
	color: var(--awn-page-ink);
}

body.page:not(.home) .wp-site-blocks {
	background: var(--awn-page-paper);
	color: var(--awn-page-ink);
}

body.page:not(.home) .awn-reading-content,
body.page:not(.home) .awn-wide-content {
	position: relative;
	width: min(calc(100% - 3rem), 43rem);
	margin-left: auto !important;
	margin-right: auto !important;
	padding-block: clamp(3.75rem, 8vw, 7rem);
}

body.page:not(.home) .awn-reading-content::before,
body.page:not(.home) .awn-wide-content::before {
	position: absolute;
	top: 0;
	left: 0;
	width: min(9rem, 30vw);
	border-top: 4px solid var(--awn-page-teal);
	content: "";
}

body.page:not(.home) .awn-reading-content > .awn-kicker,
body.page:not(.home) .awn-reading-content > .awn-process-kicker,
body.page:not(.home) .awn-wide-content > .awn-kicker {
	margin: 0 0 1.1rem;
	color: var(--awn-page-deep);
	font-family: "Space Mono", monospace;
	font-size: 0.68rem;
	letter-spacing: 0.12em;
	line-height: 1.5;
	text-transform: uppercase;
}

body.page:not(.home) .awn-reading-content > h1,
body.page:not(.home) .awn-reading-content > .wp-block-post-title,
body.page:not(.home) .awn-wide-content > h1 {
	max-width: 17ch;
	margin: 0 0 1.15rem;
	font-family: "Space Mono", monospace;
	font-size: clamp(2.2rem, 6vw, 4.15rem);
	font-weight: 400;
	letter-spacing: -0.085em;
	line-height: 1.07;
	text-wrap: balance;
}

body.page:not(.home) .awn-reading-content > h2,
body.page:not(.home) .awn-wide-content > h2 {
	margin: 2.8rem 0 0.75rem;
	padding-top: 0.8rem;
	border-top: 1px solid color-mix(in srgb, var(--awn-page-ink) 32%, transparent);
	font-family: "Space Mono", monospace;
	font-size: clamp(1.05rem, 2.5vw, 1.35rem);
	font-weight: 400;
	letter-spacing: -0.045em;
	line-height: 1.4;
}

body.page:not(.home) .awn-reading-content > p:not(.awn-kicker),
body.page:not(.home) .awn-wide-content > p {
	max-width: 38em;
	margin-block: 0 1.25em;
}

body.page:not(.home) .awn-reading-content a,
body.page:not(.home) .awn-wide-content a {
	color: var(--awn-page-deep);
	text-decoration-thickness: 1px;
	text-underline-offset: 0.2em;
}

body.page:not(.home) .awn-reading-content a:hover,
body.page:not(.home) .awn-wide-content a:hover {
	background: var(--awn-page-deep);
	color: var(--awn-page-paper);
}

body.page:not(.home) .awn-reading-content .awn-book-field--description {
	position: relative;
	margin: 1.9rem 0 2.15rem;
	padding: 1.2rem 1.4rem 1.25rem;
	border-left: 3px solid var(--awn-page-teal);
	background: color-mix(in srgb, var(--awn-page-mint) 48%, var(--awn-page-paper));
	font-size: 1.13em;
	line-height: 1.55;
}

body.page:not(.home) .awn-reading-content .awn-book-field--description p {
	margin: 0;
}

/* The sales panel keeps live, server-rendered edition-card blocks intact. */
body.page-get-the-book .awn-reading-content > .awn-edition-card,
body.page-editions .awn-reading-content > .awn-edition-card {
	position: relative;
	display: block;
	margin: 2.5rem 0 2rem;
	padding: clamp(1.25rem, 4vw, 2.3rem);
	border: 1px solid color-mix(in srgb, var(--awn-page-ink) 56%, transparent);
	background: color-mix(in srgb, var(--awn-page-mint) 46%, var(--awn-page-paper));
	box-shadow: 8px 8px 0 var(--awn-page-teal);
}

body.page-get-the-book .awn-edition-card .awn-edition-details,
body.page-editions .awn-edition-card .awn-edition-details {
	width: 100%;
}

body.page-get-the-book .awn-edition-card .awn-edition-label,
body.page-editions .awn-edition-card .awn-edition-label {
	display: inline-block;
	margin: 0 0 1.15rem;
	padding: 0.35rem 0.55rem;
	background: var(--awn-page-deep);
	color: var(--awn-page-paper);
	font-size: 0.65rem;
	font-weight: 400;
	letter-spacing: 0.08em;
	line-height: 1.5;
	text-transform: uppercase;
}

body.page-get-the-book .awn-edition-card .awn-edition-title,
body.page-editions .awn-edition-card .awn-edition-title {
	margin: 0 0 0.25rem;
	font-family: "Space Mono", monospace;
	font-size: clamp(1.3rem, 4vw, 1.9rem);
	letter-spacing: -0.065em;
	line-height: 1.25;
}

body.page-get-the-book .awn-edition-card .awn-edition-author,
body.page-editions .awn-edition-card .awn-edition-author {
	margin-block: 0.35rem 1.35rem;
	font-style: italic;
}

body.page-get-the-book .awn-edition-card :where(.awn-edition-isbn, .awn-edition-date),
body.page-editions .awn-edition-card :where(.awn-edition-isbn, .awn-edition-date) {
	font-family: "Space Mono", monospace;
	font-size: 0.68rem;
	line-height: 1.6;
}

body.page-get-the-book .awn-edition-card .awn-buy-links,
body.page-editions .awn-edition-card .awn-buy-links {
	margin-block: 1.45rem 0.5rem;
}

body.page-get-the-book .awn-reading-content > p:last-child,
body.page-editions .awn-reading-content > p:last-child {
	margin-top: 2rem;
	padding: 0.85rem 1rem;
	border-left: 2px solid var(--awn-page-lamp);
	background: color-mix(in srgb, var(--awn-page-lamp) 32%, var(--awn-page-paper));
	font-size: 0.94em;
}

/* A quiet author page, with no assumed biography or portrait. */
body.page-author .awn-reading-content > .awn-book-field--author {
	max-width: 14ch;
	margin: 0 0 1.6rem;
	font-family: "Space Mono", monospace;
	font-size: clamp(2.4rem, 7vw, 4.8rem);
	letter-spacing: -0.09em;
	line-height: 1.06;
}

body.page-author .awn-reading-content > .awn-book-field--bio {
	min-height: 1.3em;
	margin: 0 0 2.1rem;
}

body.page-author .awn-reading-content > p:last-child {
	margin-top: 2.3rem;
	padding-top: 1rem;
	border-top: 1px solid color-mix(in srgb, var(--awn-page-ink) 32%, transparent);
	font-size: 0.9em;
}

/* Keep long-form pages book-like without changing paragraph text or order. */
body.page-read-first-pages .awn-reading-content {
	width: min(calc(100% - 3rem), 39rem);
	padding-block: clamp(3.25rem, 7vw, 5.2rem);
}

body.page-read-first-pages .awn-reading-content > p:first-of-type:not(.awn-kicker) {
	margin-bottom: 1.7rem;
	color: var(--awn-page-deep);
	font-size: 1.08em;
	font-style: italic;
}

body.page-read-first-pages .awn-reading-content > .awn-rule {
	margin: 2rem 0 2.5rem;
	border: 0;
	border-top: 1px solid color-mix(in srgb, var(--awn-page-ink) 35%, transparent);
	opacity: 1;
}

body.page-read-first-pages .awn-reading-content > p.awn-placeholder {
	padding: 1rem 1.15rem;
	border-left: 3px solid var(--awn-page-lamp);
	background: color-mix(in srgb, var(--awn-page-lamp) 28%, var(--awn-page-paper));
	font-size: 0.9em;
}

body.page-read-first-pages .awn-reading-content > p:last-child:not(.awn-placeholder) {
	margin-top: 2.7rem;
	padding-top: 1rem;
	border-top: 1px solid color-mix(in srgb, var(--awn-page-ink) 35%, transparent);
	font-family: "Space Mono", monospace;
	font-size: 0.72rem;
}

/* The process page has its own authored copy and image; give the scrap room. */
body.page-the-process .awn-process-page {
	width: min(calc(100% - 3rem), 46rem);
	padding-block: clamp(3.75rem, 8vw, 6.75rem);
}

body.page-the-process .awn-reading-content {
	width: 100%;
	max-width: none;
	margin: 0 !important;
	padding: 0;
}

body.page-the-process .awn-process-page::before {
	display: block;
	width: min(9rem, 30vw);
	margin-bottom: 2.1rem;
	border-top: 4px solid var(--awn-page-teal);
	content: "";
}

body.page-the-process .awn-process-page > .awn-process-kicker {
	margin-bottom: 1rem;
	color: var(--awn-page-deep);
	font-size: 0.68rem;
	letter-spacing: 0.12em;
}

body.page-the-process .awn-process-page > .awn-process-title {
	max-width: 15ch;
	margin-bottom: 1.7rem;
	font-size: clamp(2.35rem, 6vw, 4rem);
	letter-spacing: -0.085em;
	line-height: 1.08;
}

body.page-the-process .awn-process-page > p:not(.awn-process-kicker):not(.awn-process-byline) {
	max-width: 39em;
	margin-bottom: 1.2em;
}

body.page-the-process .awn-process-page > .awn-process-byline {
	margin-block: 2rem 1.1rem;
	color: var(--awn-page-deep);
	font-family: "Space Mono", monospace;
	font-size: 0.72rem;
	letter-spacing: 0.04em;
}

body.page-the-process .awn-process-page > .awn-process-screenshot {
	width: min(100%, 38rem);
	margin: 0 0 0 auto;
	padding: 0.8rem;
	border: 1px solid color-mix(in srgb, var(--awn-page-ink) 40%, transparent);
	background: color-mix(in srgb, var(--awn-page-mint) 42%, var(--awn-page-paper));
	box-shadow: 8px 8px 0 var(--awn-page-teal);
}

body.page-the-process .awn-process-page .awn-process-screenshot img {
	display: block;
	width: 100%;
	height: auto;
}

body.page-the-process .awn-process-page .awn-process-screenshot .wp-element-caption {
	margin: 0;
	padding: 0.7rem 0.2rem 0.1rem;
	font-size: 0.77rem;
	font-style: italic;
}

/* The bookseller pattern is already a bespoke diner composition. These small
   additions bring its paper edges and book details into the same system. */
body.page-bookstores-and-libraries .awn-booksellers-root .booksellers-intro {
	background: var(--awn-page-paper);
}

body.page-bookstores-and-libraries .awn-booksellers-root .booksellers-edition,
body.page-bookstores-and-libraries .awn-booksellers-root .booksellers-reference {
	scroll-margin-top: 1rem;
}

body.page-bookstores-and-libraries .awn-booksellers-root .edition-part,
body.page-bookstores-and-libraries .awn-booksellers-root .reference-row {
	overflow-wrap: anywhere;
}

body.page:not(.home) :where(a, button, input, select, textarea):focus-visible {
	outline: 3px solid var(--awn-page-deep);
	outline-offset: 4px;
}

body.page:not(.home) .awn-site-footer :where(a, button):focus-visible,
body.page-bookstores-and-libraries .awn-booksellers-root .diner-footer a:focus-visible {
	outline-color: var(--awn-page-lamp);
}

/* Use the homepage's paper-and-ink cues with the native shared template parts. */
body.awn-interior .awn-site-header {
	padding: 0 clamp(1rem, 5vw, 4rem);
	border-bottom: 1px solid color-mix(in srgb, #221f20 20%, transparent);
	background: #edeedc;
	color: #221f20;
}

body.awn-interior .awn-header-inner {
	width: min(100%, 1280px);
	min-height: 5.3rem;
	margin-inline: auto;
	gap: 1rem;
}

body.awn-interior .awn-site-header .awn-brand {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	color: #221f20;
	font-size: 0.83rem;
	letter-spacing: -0.045em;
}

body.awn-interior .awn-site-header .awn-brand::before {
	flex: 0 0 26px;
	width: 26px;
	height: 26px;
	background:
		linear-gradient(90deg, transparent 20%, #ffc390 20% 35%, transparent 35% 47%, #ffc390 47% 62%, transparent 62% 74%, #ffc390 74% 89%, transparent 89%),
		#17625f;
	content: "";
}

body.awn-interior .awn-site-header .wp-block-navigation-item__content {
	color: #221f20;
	font-size: 0.68rem;
	letter-spacing: 0;
}

body.awn-interior .awn-site-header .wp-block-navigation-item__content:hover,
body.awn-interior .awn-site-header .current-menu-item > .wp-block-navigation-item__content {
	border-bottom-color: #17625f;
	background: transparent;
	color: #17625f;
}

body.awn-interior .awn-site-header .wp-block-navigation__responsive-container.is-menu-open {
	background: #17625f;
	color: #edeedc;
}

body.awn-interior .awn-site-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content {
	color: #edeedc;
}

body.awn-interior .awn-site-footer {
	border-top: 1px solid color-mix(in srgb, #edeedc 25%, transparent);
	background: #221f20;
	color: #edeedc;
}

body.awn-interior .awn-footer-checker {
	height: 22px;
}

/* page.html wraps saved patterns in an .awn-reading-content main. Avoid a
   second measure, top rule, and padding when a pattern supplies its own. */
body.page:not(.home) .awn-reading-content .awn-reading-content {
	width: auto;
	max-width: none;
	margin: 0 !important;
	padding: 0;
}

body.page:not(.home) .awn-reading-content .awn-reading-content::before,
body.page-the-process .awn-reading-content::before {
	display: none;
}

@media (max-width: 781px) {
	body.page:not(.home) .awn-reading-content,
	body.page:not(.home) .awn-wide-content,
	body.page-the-process .awn-process-page {
		width: min(calc(100% - 2.25rem), 43rem);
		padding-block: 3.35rem;
	}

	body.page-get-the-book .awn-reading-content > .awn-edition-card,
	body.page-editions .awn-reading-content > .awn-edition-card {
		box-shadow: 5px 5px 0 var(--awn-page-teal);
	}

	body.page-the-process .awn-process-page > .awn-process-screenshot {
		width: min(100% - 0.5rem, 36rem);
		margin-right: 0.25rem;
		box-shadow: 5px 5px 0 var(--awn-page-teal);
	}
}

@media (max-width: 420px) {
	body.page:not(.home) .awn-reading-content,
	body.page:not(.home) .awn-wide-content,
	body.page-the-process .awn-process-page {
		width: calc(100% - 2rem);
	}

	body.page-get-the-book .awn-reading-content > .awn-edition-card,
	body.page-editions .awn-reading-content > .awn-edition-card {
		padding: 1rem;
	}

	body.page:not(.home) .awn-reading-content > h1,
	body.page:not(.home) .awn-wide-content > h1 {
		font-size: clamp(2rem, 11vw, 2.8rem);
	}
}

@media (prefers-color-scheme: dark) {
	body.page:not(.home) {
		--awn-page-paper: #221f20;
		--awn-page-ink: #edeedc;
		--awn-page-deep: #b2d2c6;
		--awn-page-mint: #17625f;
		--awn-page-teal: #249d99;
		--awn-page-lamp: #ffc390;
	}

	body.page:not(.home) .wp-site-blocks {
		background: var(--awn-page-paper);
		color: var(--awn-page-ink);
	}

	body.page:not(.home) .awn-reading-content a,
	body.page:not(.home) .awn-wide-content a,
	body.page:not(.home) .awn-reading-content > .awn-kicker,
	body.page:not(.home) .awn-reading-content > .awn-process-kicker {
		color: var(--awn-page-deep);
	}

	body.page:not(.home) .awn-reading-content .awn-book-field--description,
	body.page-get-the-book .awn-reading-content > p:last-child,
	body.page-editions .awn-reading-content > p:last-child,
	body.page-read-first-pages .awn-reading-content > p.awn-placeholder {
		background: color-mix(in srgb, var(--awn-page-mint) 42%, var(--awn-page-paper));
	}

	body.page-get-the-book .awn-reading-content > .awn-edition-card,
	body.page-editions .awn-reading-content > .awn-edition-card {
		background: color-mix(in srgb, var(--awn-page-mint) 45%, var(--awn-page-paper));
		color: var(--awn-page-ink);
	}

	body.page-get-the-book .awn-edition-card .awn-edition-label,
	body.page-editions .awn-edition-card .awn-edition-label {
		background: var(--awn-page-teal);
		color: #221f20;
	}

	body.page:not(.home) :where(a, button, input, select, textarea):focus-visible {
		outline-color: var(--awn-page-lamp);
	}
}

@media (prefers-reduced-motion: reduce) {
	body.page:not(.home) *,
	body.page:not(.home) *::before,
	body.page:not(.home) *::after {
		scroll-behavior: auto !important;
		transition-duration: 0.01ms !important;
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
	}
}
