/* Shared reading roles; the king template below retains the accepted book layout. */
/* Lawrence: follow the supplied EPUB's blue serif headings, italic lead-ins and indents. */
body[data-book="library/source-103"].book-edition h1{font-family:Georgia,"Times New Roman",var(--serif);font-size:30px;line-height:1.4;letter-spacing:.01em;font-weight:500;color:#365f91;text-align:left;overflow-wrap:normal}
body[data-book="library/source-103"] .prose :is(h2,h3){font-family:Georgia,"Times New Roman",var(--serif);color:#365f91;text-align:left;letter-spacing:0}
body[data-book="library/source-103"][data-presentation=book] .prose>p{text-indent:2em;margin-bottom:.85em}
body[data-book="library/source-103"][data-presentation=book] .prose.lang-en>p{text-indent:1.5em}
body[data-book="library/source-103"] .prose>p:first-child:has(>em:only-child){text-indent:0;font-size:.93em;color:var(--ink);margin-bottom:1.5em;line-height:1.8}
body[data-book="library/source-103"] .prose em{font-style:italic}
body[data-book="library/source-103"] .prose blockquote{font-family:inherit;font-size:.95em;border-left:2px solid var(--line);padding-left:1em;margin:1.5em 0}
body[data-book="library/source-103"] .prose blockquote p{font-family:inherit;text-indent:0;text-align:left;margin:0;overflow-wrap:normal}
body[data-book="library/source-103"][data-theme=night] h1,body[data-book="library/source-103"][data-theme=night] .prose :is(h2,h3){color:#94b8e3}
.book-edition[data-presentation=book] h1{font-size:31px;line-height:1.45;letter-spacing:.02em;overflow-wrap:anywhere}
.book-edition .prose{line-height:var(--reading-line)}
.book-edition h1,.book-edition .prose :is(h2,h3,h4,h5,h6){font-family:var(--sans)}
.book-edition[data-presentation=book] .prose>h2{font-size:1.15em;line-height:1.6;letter-spacing:.02em;text-align:left}
.book-edition .prose h3{font-size:1.08em;line-height:1.6}
.book-edition .prose :is(h4,h5,h6){font-size:1em;line-height:1.6}
.book-edition[data-presentation=book] .prose>p{margin-bottom:1em;text-indent:0}
.book-edition .prose>p:first-child:has(>em:only-child){font-size:inherit;color:inherit}
.book-edition[data-presentation=book] .prose blockquote{font-family:inherit;font-size:1em;border-left:2px solid var(--line);padding-left:1em;margin:1.5em 0}
.book-edition[data-presentation=book] .prose blockquote p{text-indent:0;margin-bottom:.6em}
.book-edition .prose .footnote{font-size:.88em;line-height:1.75}
.book-edition .prose blockquote cite{font-size:.85em;white-space:normal}
.book-edition[data-presentation=book] .prose strong{font-family:inherit;font-size:inherit;font-weight:650}
.book-edition .prose :is(table,pre){max-width:100%;overflow-x:auto;display:block}
.book-edition .prose{overflow-wrap:anywhere}
/* Keep Luther's reference abbreviations intact beside their descriptions. */
body[data-book="library/source-97"] .prose table{display:table;width:100%;border-collapse:separate;border-spacing:0 .6em}
body[data-book="library/source-97"] .prose table :is(th,td){vertical-align:top;text-align:left}
body[data-book="library/source-97"] .prose table :is(th,td):first-child{width:1%;white-space:nowrap;overflow-wrap:normal;padding-right:.8em}
/* king: the accepted 十架君王 reading template. */
body[data-reading-template="king"].book-edition h1,body[data-reading-template="king"].book-edition .prose :is(h2,h3){font-family:var(--serif)}
body[data-reading-template="king"][data-presentation=book] h1{font-size:44px;line-height:1.35;letter-spacing:.12em;font-weight:500;overflow-wrap:normal}
body[data-reading-template="king"][data-presentation=book] .prose>p{text-indent:2em;margin-bottom:.8em}
body[data-reading-template="king"][data-presentation=book] .prose>p:first-child:has(>em:only-child){color:var(--muted);font-size:.93em;margin-bottom:1.65em}
body[data-reading-template="king"][data-presentation=book] .prose>h2{font-size:1.12em;font-weight:500;letter-spacing:.12em;text-align:center;margin:2.6em 0 1.2em}
body[data-reading-template="king"][data-presentation=book] .prose blockquote{font-family:"Kaiti SC","STKaiti","KaiTi",var(--reading-font);font-size:1.04em;color:color-mix(in srgb,var(--ink) 83%,var(--paper));margin:1.8em 0 2em;padding:0 .5em;border-left:0}
body[data-reading-template="king"][data-presentation=book] .prose blockquote p{text-indent:2em;margin:0}
body[data-reading-template="king"][data-presentation=book] .prose>blockquote:first-child{margin-top:.8em}
body[data-reading-template="king"].book-edition .prose blockquote cite{font-size:.8em;white-space:normal}
body[data-reading-template="king"][data-presentation=book] .prose strong{font-family:var(--sans);font-size:.96em;font-weight:600}
body[data-reading-template="king"].book-edition .prose .footnote{font:15px/1.85 Georgia,"Times New Roman",var(--serif)}
@media(max-width:359px){body[data-reading-template="king"][data-presentation=book] h1{font-size:38px}body[data-reading-template="king"][data-presentation=book] .prose blockquote{padding:0}}

/* Supplementary note pages stay accessible outside the main reading sequence. */
.toc-appendices{border-top:1px solid var(--line);margin-top:16px}
.toc-appendices>summary{display:flex;align-items:center;gap:12px;min-height:60px;padding:16px 0;font:14px/1.6 var(--sans);color:var(--ink);cursor:pointer;list-style:none}
.toc-appendices>summary::-webkit-details-marker{display:none}
.toc-appendix-count{margin-left:auto;color:var(--muted);font-size:12px}
.toc-appendices>summary::after{content:"";width:7px;height:7px;border-right:1px solid currentColor;border-bottom:1px solid currentColor;transform:rotate(-45deg);margin:0 4px 0 3px}
.toc-appendices[open]>summary::after{transform:rotate(45deg)}
.toc-appendices .num{color:var(--muted)}

/* Inline notes stay available without extending the main reading path. */
.chapter-footnotes{border-top:1px solid var(--line);margin:2.4em 0 1.3em}
.chapter-footnotes>summary{display:flex;align-items:center;gap:12px;min-height:56px;padding:14px 0;font:14px/1.7 var(--sans);color:var(--muted);text-indent:0;cursor:pointer;list-style:none}
.chapter-footnotes>summary::-webkit-details-marker{display:none}
.chapter-footnote-count{margin-left:auto;font-size:12px}
.chapter-footnotes>summary::after{content:"";width:7px;height:7px;border-right:1px solid currentColor;border-bottom:1px solid currentColor;transform:rotate(-45deg);margin:0 4px 0 3px}
.chapter-footnotes[open]>summary::after{transform:rotate(45deg)}
.chapter-footnotes>summary:focus-visible{outline:2px solid var(--green);outline-offset:3px}
.book-edition .prose .chapter-footnotes .footnote{border:0;margin-top:0;padding-top:.6em}
.book-edition .chapter-footnotes .footnote::before{content:none}

/* Only the open chapter exposes its existing section headings. */
.toc-subsections{margin:0 0 12px 32px;border-left:1px solid var(--line);padding:4px 0 4px 13px}
.toc-subsection{display:block;width:100%;min-height:44px;padding:10px 0;text-align:left;font:14px/1.7 var(--sans);color:var(--muted);overflow-wrap:anywhere}
.toc-subsection:hover,.toc-subsection:focus-visible{color:var(--green)}
.toc-subsection.nested{padding-left:12px;font-size:13px}

/* Split long chapter titles without changing their text or the accepted king headings. */
.book-edition[data-presentation=book] h1.has-chapter-number{font-size:clamp(34px,10vw,44px);line-height:1.45;letter-spacing:.06em}
.book-edition[data-presentation=book] .has-chapter-number .chapter-number{display:block;margin-bottom:12px;font:16px/1.6 var(--sans);letter-spacing:.12em;color:var(--muted)}
.book-edition[data-presentation=book] .has-chapter-number .chapter-name{display:block;text-wrap:balance}
.book-edition[data-presentation=book] .has-passage-reference .chapter-number{letter-spacing:.04em;font-variant-numeric:tabular-nums}
.chapter-name .title-word{display:inline-block}
.book-edition[data-presentation=book] .has-chapter-date .chapter-date{display:block;margin-top:14px;font:16px/1.6 var(--sans);letter-spacing:.08em;color:var(--muted)}

/* Preserve paragraph spacing and aligned verse lines in the accepted book template. */
body[data-reading-template="king"][data-presentation=book] .prose blockquote p+p{margin-top:.8em}
body[data-reading-template="king"][data-presentation=book] .prose blockquote p:has(br){text-indent:0;text-align:left;padding-inline-start:1em}

/* Academic reference tables retain usable columns inside their own scroll area. */
body:is([data-book="library/source-116"],[data-book="library/source-117"]) .prose table{font-size:16px;line-height:1.6;margin:1.4em 0;border-collapse:collapse}
body:is([data-book="library/source-116"],[data-book="library/source-117"]) .prose table>tbody{display:table;min-width:560px;width:100%;border-collapse:collapse}
body:is([data-book="library/source-116"],[data-book="library/source-117"]) .prose table :is(th,td){padding:8px;border-bottom:1px solid var(--line);text-align:left;vertical-align:top}

/* Long essay titles in the Wang Mingdao collection leave room for body text on phones. */
body[data-book="library/source-138"][data-presentation=book] h1{font-size:clamp(26px,7vw,34px);line-height:1.5;letter-spacing:.04em}
/* The source's standalone verse lines keep a common left edge. */
body:is([data-book="library/source-137"],[data-book="library/source-138"])[data-presentation=book] .prose>p:has(br){text-indent:0;text-align:left}

/* Lewis collection: signatures and small illustrations retain the EPUB's reading context. */
body[data-book^="library/source-59-"] .prose>p:has(>cite:only-child){text-indent:0;text-align:right;font-size:.9em;margin-top:1.2em}
body[data-book^="library/source-59-"] .prose>p:has(>cite:only-child) cite{font-style:normal;white-space:normal}
body[data-book^="library/source-59-"] .prose img[alt="原书手绘小图"]{display:inline-block;height:2em;width:auto;max-width:100%;margin:0 .15em;vertical-align:middle}
body[data-book^="library/source-59-"] .prose img[alt="原书韵律符号"]{display:inline-block;height:1em;width:auto;max-width:100%;margin:0 .1em;vertical-align:middle}
body[data-book^="library/source-59-"][data-presentation=book] h1{font-size:clamp(28px,8vw,40px);line-height:1.5;letter-spacing:.04em}

/* Narnia: retain the dedication letter signature without changing other books. */
body[data-book^="library/source-101-"] .prose>p:has(>cite:only-child){text-indent:0;text-align:right;font-size:.9em;margin-top:1.2em}
body[data-book^="library/source-101-"] .prose>p:has(>cite:only-child) cite{font-style:normal;white-space:normal}

/* Chinese TNTC passage headings remain compact on a phone. */
body:is([data-book="library/source-282"],[data-book="library/source-283"],[data-book="library/source-284"],[data-book="library/source-285"],[data-book="library/source-286"],[data-book="library/source-287"],[data-book="library/source-288"],[data-book="library/source-289"],[data-book="library/source-290"],[data-book="library/source-291"])[data-presentation=book] h1{font-size:clamp(28px,8vw,36px);letter-spacing:.04em;line-height:1.45}

/* Matthew's source outlines keep their column relationships on a phone. */
body[data-book="library/source-291"] #body-content table{display:table;width:100%;border-collapse:collapse;margin:1.4em 0;font-size:16px;line-height:1.65}
body[data-book="library/source-291"] #body-content table :is(th,td){text-align:left;vertical-align:top;padding:.45em .6em .45em 0;border-bottom:1px solid var(--line)}
body[data-book="library/source-291"] #body-content table :is(th,td):first-child{white-space:nowrap;width:1%;min-width:3em}

/* Simply Jesus: keep chronology dates and their two-character column label intact. */
body[data-book="library/source-164"] #body-content table :is(th,td):first-child{white-space:nowrap;overflow-wrap:normal;min-width:2em;padding-right:.6em}

/* Psalms 1–72: wrap hymn titles while keeping their printed page references aligned. */
body[data-book="library/source-257"] #body-content[data-article="book-257-en-chapters-007"] table :is(th,td):first-child{white-space:normal;width:auto}
body[data-book="library/source-257"] #body-content[data-article="book-257-en-chapters-007"] table :is(th,td):last-child{white-space:nowrap;width:4em;padding-left:.5em}

/* Psalm 137's nine-line chiasm remains legible as a diagram on narrow screens. */
body[data-book="library/source-299"] #body-content[data-article="book-299-en-chapters-069"] p:has(br){font-size:.9em;line-height:1.8;hyphens:none}
@media(max-width:350px){body[data-book="library/source-299"] #body-content[data-article="book-299-en-chapters-069"] p:has(br){font-size:.8em}}

/* Wisdom books: preserve intentional verse lines without word hyphenation. */
body:is([data-book="library/source-300"],[data-book="library/source-301"],[data-book="library/source-302"]) #body-content p:has(br){text-align:left;hyphens:none}
/* Ecclesiastes 7:23-24 is printed as a six-line, centred epitaph. */
body[data-book="library/source-301"] #body-content[data-article="book-301-en-chapters-050"] blockquote p:has(br){text-align:center;font-size:.95em;line-height:1.7}

/* Book 82 keeps its Chinese design while English uses Latin text spacing. */
body[data-book="library/source-82"] .prose [lang=en]{font-family:Georgia,"Times New Roman",serif;letter-spacing:0;line-break:auto}
body[data-book="library/source-82"] .prose>h2[lang=en]{text-align:left;letter-spacing:0;margin:1.8em 0 .8em;line-height:1.5}
body[data-book="library/source-82"] .prose blockquote[lang=en]{font-family:Georgia,"Times New Roman",serif;font-size:.96em;padding:0 .6em}
body[data-book="library/source-82"] .prose blockquote[lang=en] p{font-family:inherit;text-indent:0;text-align:left;letter-spacing:0;padding-inline-start:0}
body[data-book="library/source-82"] .prose>p[lang=en]{text-indent:0}
