/* Server-rendered book pages (/book/, /book/<story>/).
   Plain HTML on cream paper; no JavaScript required. */

:root {
	--ink: #3b2a1e;
	--ink-soft: #4e3828;
	--ink-muted: #6e5340;
	--paper: #f3e4cc;
	--paper-deep: #e7d0b3;
	--rule: rgba(92, 58, 32, 0.35);
}

html { -webkit-text-size-adjust: 100%; }
body.book-page {
	margin: 0;
	min-height: 100vh;
	background:
		radial-gradient(ellipse at 30% 10%, rgba(255,255,255,0.5), transparent 60%),
		radial-gradient(ellipse at 80% 90%, rgba(231,208,179,0.7), transparent 55%),
		var(--paper);
	color: var(--ink);
	font-family: "Source Serif 4", Georgia, serif;
	font-size: 1.08rem;
	line-height: 1.6;
}

a { color: inherit; text-decoration-color: var(--rule); text-underline-offset: 0.15em; }
a:hover { text-decoration-color: var(--ink); }

h1, h2, h3 {
	font-family: "Cormorant Garamond", "Times New Roman", serif;
	font-weight: 500;
	color: var(--ink);
	margin: 0;
}

.book-masthead {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 1rem;
	flex-wrap: wrap;
	padding: 1.2rem clamp(1rem, 4vw, 2.5rem);
	border-bottom: 1px solid var(--rule);
}
.book-home {
	font-family: "Cormorant Garamond", serif;
	font-size: 1.35rem;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	text-decoration: none;
}
.book-masthead nav { display: flex; gap: 1.4rem; font-size: 0.95rem; font-style: italic; }
.book-masthead nav a { text-decoration: none; color: var(--ink-muted); }
.book-masthead nav a:hover { color: var(--ink); }

.book-sheet {
	max-width: 42rem;
	margin: 0 auto;
	padding: clamp(1.5rem, 5vw, 3.5rem) clamp(1rem, 4vw, 2rem) 4rem;
}

/* Hero */
.book-hero { display: grid; grid-template-columns: minmax(0, 14rem) 1fr; gap: 2rem; align-items: start; }
.book-cover { width: 100%; height: auto; box-shadow: 0 14px 30px rgba(59,42,30,0.22); }
.book-kicker {
	margin: 0 0 0.3rem;
	font-size: 0.8rem;
	letter-spacing: 0.22em;
	text-transform: uppercase;
	color: var(--ink-muted);
}
.book-hero h1 { font-size: clamp(2.2rem, 6vw, 3.2rem); letter-spacing: 0.14em; text-transform: uppercase; line-height: 1.1; }
.book-byline { margin: 0.4rem 0 0.8rem; font-style: italic; font-size: 1.15rem; color: var(--ink-soft); }
.book-facts { margin: 0 0 1rem; font-size: 0.95rem; color: var(--ink-muted); }
.book-tagline { font-size: 1.15rem; margin: 0 0 1.2rem; }
.book-cta { display: flex; gap: 0.8rem; flex-wrap: wrap; margin: 0 0 1.4rem; }
.book-btn {
	display: inline-block;
	padding: 0.55rem 1.3rem;
	border: 1px solid var(--ink);
	border-radius: 3px;
	background: var(--ink);
	color: var(--paper);
	text-decoration: none;
	letter-spacing: 0.08em;
	font-size: 0.95rem;
}
.book-btn:hover { background: var(--ink-soft); }
.book-btn-quiet { background: transparent; color: var(--ink); border-color: var(--rule); }
.book-btn-quiet:hover { background: rgba(59,42,30,0.06); border-color: var(--ink); }
.book-epigraph { margin: 0; color: var(--ink-muted); font-size: 1rem; line-height: 1.4; }
.book-epigraph small { font-style: normal; font-size: 0.85rem; }

/* Sections */
.book-section { margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--rule); }
.book-section h2 { font-size: 1.9rem; letter-spacing: 0.06em; margin-bottom: 0.9rem; }
.book-section h3 { font-size: 1.35rem; margin: 1.6rem 0 0.5rem; }
.book-lead { font-size: 1.15rem; }

.book-comps { margin: 1.5rem 0 0; }
.book-comps dt { font-family: "Cormorant Garamond", serif; font-size: 1.3rem; margin-top: 1.2rem; }
.book-comps dd { margin: 0.3rem 0 0; }

.book-themes { padding-left: 1.2rem; margin: 0; }
.book-themes li { margin: 0.3rem 0; }
.book-notes { color: var(--ink-soft); font-size: 1rem; }

.book-stories { list-style: none; counter-reset: story; padding: 0; margin: 0; }
.book-stories li { position: relative; padding-left: 2.6rem; margin: 1.6rem 0; }
.book-stories li::before {
	counter-increment: story;
	content: counter(story, upper-roman);
	position: absolute;
	left: 0; top: 0.2rem;
	font-family: "Cormorant Garamond", serif;
	font-size: 1.1rem;
	color: var(--ink-muted);
	letter-spacing: 0.08em;
}
.book-stories li#postscript::before { content: "—"; }
.book-stories h3 { margin: 0 0 0.3rem; font-size: 1.4rem; }
.book-stories p { margin: 0; }
.book-story-note { margin-top: 0.3rem !important; font-style: italic; font-size: 0.95rem; color: var(--ink-muted); }

.book-editions { list-style: none; padding: 0; margin: 0 0 1rem; }
.book-editions li { display: flex; justify-content: space-between; gap: 1rem; padding: 0.6rem 0; border-bottom: 1px dotted var(--rule); }
.book-editions a { text-decoration: none; font-variant-numeric: tabular-nums; }

/* Story page */
.story-head { text-align: center; margin-bottom: 2.5rem; }
.story-head h1 { font-size: clamp(2.2rem, 6vw, 3rem); letter-spacing: 0.12em; text-transform: uppercase; }
.story-text { font-size: 1.14rem; line-height: 1.7; }
.story-text p { margin: 0 0 0.1rem; text-indent: 1.6em; }
.story-text p:first-child { text-indent: 0; }
.story-text p:first-child::first-letter {
	font-family: "Cormorant Garamond", serif;
	font-size: 3.4em;
	float: left;
	line-height: 0.82;
	padding: 0.08em 0.1em 0 0;
}
.story-foot { margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--rule); text-align: center; }
.story-end { font-size: 0.9rem; color: var(--ink-muted); margin: 0 0 1.2rem; }
.story-foot .book-cta { justify-content: center; }
.story-copyright { font-size: 0.85rem; color: var(--ink-muted); }

.book-foot { max-width: 42rem; margin: 0 auto; padding: 1.5rem 1rem 3rem; font-size: 0.85rem; color: var(--ink-muted); text-align: center; border-top: 1px solid var(--rule); }
.book-foot p { margin: 0.3rem 0; }

@media (max-width: 640px) {
	body.book-page { font-size: 1rem; }
	.book-hero { grid-template-columns: 1fr; }
	.book-cover { max-width: 14rem; margin: 0 auto; display: block; }
	.book-hero-text { text-align: center; }
	.book-cta { justify-content: center; }
	.book-stories li { padding-left: 2.2rem; }
}
