/* Shared by the template picker, editor, workshop, and reader. */
.book-template { --ink:#292821; --tone:#927342; min-height:864px; display:flex; flex-direction:column; color:var(--ink); font:18px/1.75 Georgia,serif; text-align:center; }
.book-template .bt-kicker { font:11px/1.6 system-ui,sans-serif; letter-spacing:3px; text-transform:uppercase; color:var(--tone); margin:0 0 35px; }
.book-template .bt-title { font:normal 52px/1.12 Georgia,serif; letter-spacing:-1px; color:var(--ink); margin:0 0 26px; overflow-wrap:anywhere; }
.book-template .bt-rule { color:var(--tone); font-size:12px; letter-spacing:12px; margin:16px 0 30px; text-align:inherit; }
.book-template .bt-rule::before,.book-template .bt-rule::after { content:''; display:inline-block; height:1px; width:55px; background:currentColor; vertical-align:middle; margin:0 16px; opacity:.5; }
.book-template .bt-subtitle { font:italic 22px/1.6 Georgia,serif; color:#696359; margin:0 0 28px; }
.book-template .bt-author { font:14px/1.8 system-ui,sans-serif; letter-spacing:3px; text-transform:uppercase; margin:24px 0; }
.book-template .bt-footer { font:12px/1.8 system-ui,sans-serif; letter-spacing:1px; color:#77736a; margin:25px 0 0; }
.book-template .bt-spacer { flex:1; min-height:28px; margin:0; }
.book-template .bt-body { text-align:left; margin:0; }
.book-template .bt-body p { font:18px/1.8 Georgia,serif; margin:0 0 22px; color:inherit; }
.book-template .bt-subheading { color:var(--ink); font:normal 25px/1.4 Georgia,serif; margin:28px 0 14px; text-align:left; }
.book-template .bt-toc-row { display:flex; justify-content:space-between; gap:20px; text-align:left; border-bottom:1px dotted #bcb3a2; padding:14px 0; margin:0; }
.book-template .bt-toc-row span:last-child { color:var(--tone); }
.book-template .bt-index { display:grid; grid-template-columns:1fr 1fr; gap:0 50px; text-align:left; }
.book-template .bt-index p { font-size:16px; }
.book-template .bt-dedication { max-width:440px; margin:0 auto; font:italic 27px/1.8 Georgia,serif; }
.book-template[data-kind=copyright] { text-align:left; }
.book-template[data-kind=copyright] .bt-title { font-size:30px; }
.book-template[data-kind=copyright] .bt-body p { font-size:14px; line-height:1.9; margin-bottom:20px; }
.book-template[data-kind=copyright] .bt-author { font-size:13px; letter-spacing:0; text-transform:none; }
.book-template[data-kind=half-title] .bt-title { font-size:38px; }
.book-template[data-design=editorial] { --ink:#182432; --tone:#b24e2d; text-align:left; border-left:3px solid var(--ink); padding-left:30px; }
.book-template[data-design=editorial] .bt-title { font:bold 60px/1.05 system-ui,sans-serif; letter-spacing:-3px; }
.book-template[data-design=editorial] .bt-kicker { font-weight:700; letter-spacing:2px; }
.book-template[data-design=editorial] .bt-rule { font-size:0; width:75px; height:5px; background:var(--tone); margin:12px 0 32px; }
.book-template[data-design=editorial] .bt-rule::before,.book-template[data-design=editorial] .bt-rule::after { display:none; }
.book-template[data-design=editorial] .bt-subtitle { font:20px/1.7 system-ui,sans-serif; }
.book-template[data-design=editorial] .bt-dedication { margin-left:0; }
.book-template[data-design=poetic] { --ink:#33463b; --tone:#748773; padding:25px; border:1px solid #bdc8b9; }
.book-template[data-design=poetic] .bt-title { font-style:italic; font-size:50px; }
.book-template[data-design=poetic] .bt-kicker { letter-spacing:4px; }
.book-template[data-design=poetic] .bt-rule::before,.book-template[data-design=poetic] .bt-rule::after { width:35px; }
.book-template[data-design=quiet] { --ink:#353535; --tone:#888; }
.book-template[data-design=quiet] .bt-title { font:300 39px/1.3 system-ui,sans-serif; letter-spacing:1px; }
.book-template[data-design=quiet] .bt-kicker { font-size:10px; letter-spacing:5px; }
.book-template[data-design=quiet] .bt-rule { font-size:0; margin:15px auto 35px; width:24px; height:1px; background:#aaa; }
.book-template[data-design=quiet] .bt-rule::before,.book-template[data-design=quiet] .bt-rule::after { display:none; }
.book-template[data-design=quiet] .bt-author { letter-spacing:1px; text-transform:none; }
.book-template[data-design=quiet] .bt-footer { font-size:10px; }

.writing > .book-template { margin:0; }
.story-text > .book-template { max-width:656px; margin:0 auto; }
.book-template .bt-dedication p { font:inherit; line-height:inherit; color:inherit; margin:0; }
.book-template .bt-toc-row { font:18px/1.75 Georgia,serif; }

.book-template[data-kind=content-page] { text-align:left; }
.book-template[data-kind=content-page] .bt-kicker { text-align:center; border-bottom:1px solid #d8d1c5; padding-bottom:18px; margin-bottom:40px; }
.book-template[data-kind=content-page] .bt-body p { text-indent:1.5em; }
.book-template[data-kind=content-page] .bt-body p:first-child { text-indent:0; }
.book-template[data-kind=content-page][data-design=editorial] { border-left:0; padding-left:0; }
.book-template[data-kind=content-page][data-design=editorial] .bt-kicker { text-align:left; }
.book-template[data-kind=content-page][data-design=editorial] .bt-body p { font-family:system-ui,sans-serif; text-indent:0; }
.book-template[data-kind=content-page][data-design=poetic] .bt-body p:first-child::first-letter { font-size:54px; float:left; line-height:1; padding:7px 8px 0 0; color:var(--tone); }
.book-template[data-kind=content-page][data-design=quiet] .bt-kicker { border:0; }
.book-template[data-kind=content-page][data-design=quiet] .bt-body p { text-indent:0; line-height:2; margin-bottom:28px; }

.writing li[data-continuation="true"], .story-text li[data-continuation="true"] { list-style-type:none; }

/* Text must wrap identically in the editor, workshop and reader. */
.book-template, .story-text { overflow-wrap:anywhere; }
/* A body template is writing, so Enter must not create expanding layout spacers. */
.book-template[data-kind=content-page] .bt-spacer { flex:none; min-height:0; }

/* Saved body sheets use the same usable width and typography as Flow's measurement. */
.site-workshop main > section, .site-reader main > section { box-sizing:border-box; width:816px; min-height:1056px; padding:96px 80px; margin-left:auto; margin-right:auto; }
.story-text { font:18px/1.7 Georgia,serif; color:#222; display:flow-root; }
.story-text p, .story-text div, .story-text blockquote, .story-text ul, .story-text ol { margin:0 0 18px; }
.story-text h1 { font-size:36px; line-height:1.2; }
.story-text h2 { font-size:28px; line-height:1.3; }
.story-text h3 { font-size:22px; line-height:1.4; }
.story-text > :first-child { margin-top:0; }
.story-text > :last-child { margin-bottom:0; }
.story-text > .book-template { margin:0; }

.story-text p { font:inherit; color:inherit; }

/* Reader continuations preserve saved page identities and account bookmarks. */
.site-reader main > section.reader-paginated {padding:0;min-height:0;background:transparent;box-shadow:none;}
.reader-sheet {box-sizing:border-box;width:816px;min-height:1056px;padding:96px 80px;position:relative;background:var(--page-bg,#fdfdfb);box-shadow:0 3px 5px #39301e08,0 14px 40px #39301e12;}
.reader-sheet + .reader-sheet {margin-top:4rem;}
.reader-measure {position:fixed;left:-10000px;top:0;width:656px;visibility:hidden;contain:layout style paint;pointer-events:none;}
.reader-measure .book-template,.reader-sheet .book-template {min-height:0;}

/* Embedded book artwork uses local protected resources and bounded print dimensions. */
.story-text img {display:block;max-width:100%;width:auto;height:auto;max-height:800px;object-fit:contain;margin:1em auto;break-inside:avoid;}

.writing img {display:block;max-width:100%;width:auto;height:auto;max-height:800px;object-fit:contain;margin:1em auto;break-inside:avoid;}

/* A cover or illustrated title leaf already contains its own typography. */
.story-text.illustrated-leaf {height:864px;display:flex;flex-direction:column;align-items:center;justify-content:center;}
.story-text.illustrated-leaf p {margin:0;line-height:0;}
.story-text.illustrated-leaf img {margin:0;max-width:100%;max-height:864px;object-fit:contain;}
@media(max-width:1200px){.site-reader .story-text.illustrated-leaf{height:auto;min-height:0}.site-reader .story-text.illustrated-leaf img{max-height:calc(100svh - 140px)}}
