/* The Remnant Thread - Print Stylesheet (CSS Paged Media) */
/* Used by WeasyPrint for PDF generation */

/* ==========================================================================
   EMBEDDED FONTS (Required for Lulu/print-on-demand PDF upload)
   ========================================================================== */

@font-face {
    font-family: 'EB Garamond';
    src: url('../fonts/EBGaramond-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'EB Garamond';
    src: url('../fonts/EBGaramond-Bold.ttf') format('truetype');
    font-weight: bold;
    font-style: normal;
}

@font-face {
    font-family: 'EB Garamond';
    src: url('../fonts/EBGaramond-Italic.ttf') format('truetype');
    font-weight: normal;
    font-style: italic;
}

/* ==========================================================================
   PAGE SETUP
   ========================================================================== */

@page {
    size: 6in 9in;  /* Trade paperback size */

    /* Running footer with page numbers */
    @bottom-center {
        content: counter(page);
        font-family: 'EB Garamond', Georgia, serif;
        font-size: 9pt;
        color: #666;
        margin-top: 0.25in;
    }

    /* Footnote area at bottom of page */
    @footnote {
        border-top: 0.5pt solid #ccc;
        padding-top: 0.5em;
        margin-top: 0.5em;
    }
}

/* Asymmetric margins for binding (larger gutter for 700+ page book) */
@page :left {
    margin: 0.75in 0.875in 1in 0.75in;  /* top, gutter(right), bottom, outside(left) */

    /* Running header: Book title on verso (left) pages */
    @top-center {
        content: "THE REMNANT THREAD";
        font-family: 'EB Garamond', Georgia, serif;
        font-size: 8pt;
        font-variant: small-caps;
        letter-spacing: 0.1em;
        color: #666;
    }
}

@page :right {
    margin: 0.75in 0.75in 1in 0.875in;  /* top, outside(right), bottom, gutter(left) */

    /* Running header: Chapter title on recto (right) pages */
    @top-center {
        content: string(chapter-title);
        font-family: 'EB Garamond', Georgia, serif;
        font-size: 8pt;
        font-style: italic;
        color: #666;
    }
}

/* First page of chapters - no header or footer (cleaner opening) */
@page chapter-start {
    @top-center { content: none; }
    @bottom-center { content: none; }
}

/* Blank pages */
@page :blank {
    @bottom-center { content: none; }
}

/* ==========================================================================
   TABLE OF CONTENTS
   ========================================================================== */

/* TOC page - no footer */
@page toc {
    @bottom-center { content: none; }
}

.toc-section {
    page: toc;
    page-break-after: always;
}

.toc-title {
    font-family: 'EB Garamond', Georgia, serif;
    font-size: 16pt;
    font-weight: normal;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin: 0 0 1.5em 0;
    padding-top: 0.5in;
}

.toc-part {
    font-weight: bold;
    font-size: 10pt;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin: 1.25em 0 0.4em 0;
    color: #333;
}

.toc-part a {
    display: block;
    text-decoration: none;
    color: inherit;
}

.toc-part a::after {
    content: leader('.') ' ' target-counter(attr(href), page);
    float: right;
    padding-left: 0.5em;
    font-weight: normal;
    color: #666;
}

.toc-entry {
    display: block;
    margin: 0.35em 0 0.35em 1.5em;
    font-size: 10pt;
    line-height: 1.4;
}

.toc-entry a {
    display: block;
    text-decoration: none;
    color: inherit;
}

.toc-entry a::after {
    content: leader('.') ' ' target-counter(attr(href), page);
    float: right;
    padding-left: 0.5em;
    color: #666;
}

.toc-back-matter {
    margin-top: 1.5em;
    padding-top: 0.75em;
    border-top: 0.5pt solid #ccc;
}

/* ==========================================================================
   BASE TYPOGRAPHY
   ========================================================================== */

:root {
    --bg: #fff;
    --fg: #1a1a1a;
    --accent: #8b4513;
    --muted: #555;
    --border: #ccc;
    --quote-bg: #faf8f5;
}

body {
    font-family: 'EB Garamond', Georgia, serif;
    font-size: 10.5pt;
    line-height: 1.55;
    color: var(--fg, #1a1a1a);
    background: var(--bg, #fff);
    max-width: none;
    margin: 0;
    padding: 0;
}

/* ==========================================================================
   HIDE WEB-ONLY ELEMENTS
   ========================================================================== */

.site-header,
.site-nav,
.chapter-nav,
.progress-bar,
footer,
.no-print,
.bookmark-btn,
.theme-toggle,
nav,
.nav-prev,
.nav-next,
.study-callout,
.tract-link,
.entry-banner {
    display: none !important;
}

/* ==========================================================================
   ARTICLE CONTENT
   ========================================================================== */

article {
    max-width: none;
    margin: 0;
    padding: 0;
}

/* ==========================================================================
   HEADINGS
   ========================================================================== */

/* Chapter titles */
h1 {
    font-family: 'EB Garamond', Georgia, serif;
    font-size: 18pt;
    font-weight: normal;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin: 0 0 1.5em 0;
    padding-top: 1.5in;
    page-break-before: always;
    page: chapter-start;
    color: var(--fg);
    /* Capture chapter title for running headers */
    string-set: chapter-title content();
}

/* First chapter shouldn't break before */
article:first-of-type h1,
.no-break-before h1 {
    page-break-before: avoid;
    padding-top: 0;
}

h2 {
    font-family: 'EB Garamond', Georgia, serif;
    font-size: 12pt;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin: 1.75em 0 0.75em 0;
    color: var(--fg);
    page-break-after: avoid;
    border-bottom: none;
}

h3 {
    font-family: 'EB Garamond', Georgia, serif;
    font-size: 11pt;
    font-weight: bold;
    font-style: italic;
    margin: 1.5em 0 0.5em 0;
    color: var(--fg);
    page-break-after: avoid;
}

h4 {
    font-family: 'EB Garamond', Georgia, serif;
    font-size: 10.5pt;
    font-weight: bold;
    margin: 1.25em 0 0.5em 0;
    page-break-after: avoid;
}

/* ==========================================================================
   PARAGRAPHS
   ========================================================================== */

p {
    margin: 0 0 0.65em 0;
    text-align: justify;
    text-indent: 0;
    hyphens: auto;
    orphans: 3;
    widows: 3;
}

/* First paragraph after heading - no indent */
h1 + p, h2 + p, h3 + p, h4 + p,
blockquote + p,
.no-indent {
    text-indent: 0;
}

/* ==========================================================================
   SCRIPTURE BLOCKQUOTES
   ========================================================================== */

blockquote {
    margin: 1.25em 0.5in;
    padding: 0.5em 0.75em;
    background: var(--quote-bg);
    border-left: 2pt solid var(--accent);
    font-style: italic;
    font-size: 10pt;
    page-break-inside: avoid;
}

blockquote p {
    margin: 0 0 0.4em 0;
    text-align: left;
    text-indent: 0;
}

blockquote p:last-child {
    margin-bottom: 0;
}

/* Attribution in blockquotes */
blockquote p:last-child:not(:only-child) {
    font-style: normal;
    font-size: 9pt;
    color: var(--muted);
    text-align: right;
    margin-top: 0.4em;
}

/* ==========================================================================
   LINKS
   ========================================================================== */

a {
    color: inherit;
    text-decoration: none;
    background: transparent;  /* Override WeasyPrint default link highlighting */
}

/* ==========================================================================
   LISTS
   ========================================================================== */

ul, ol {
    margin: 0.75em 0;
    padding-left: 1.25em;
}

li {
    margin-bottom: 0.3em;
    text-align: justify;
}

li p {
    margin-bottom: 0.3em;
}

/* Nested lists */
ul ul, ol ol, ul ol, ol ul {
    margin: 0.25em 0;
}

/* ==========================================================================
   TABLES
   ========================================================================== */

table {
    width: 100%;
    max-width: 100%;
    border-collapse: collapse;
    margin: 1em 0;
    font-size: 9pt;
    page-break-inside: avoid;
    table-layout: fixed;
    box-sizing: border-box;
}

th, td {
    border: 0.5pt solid var(--border);
    padding: 0.4em 0.5em;
    text-align: left;
    vertical-align: top;
    word-wrap: break-word;
    overflow-wrap: break-word;
    box-sizing: border-box;
}

th {
    background: var(--quote-bg);
    font-weight: bold;
    font-size: 8.5pt;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* ==========================================================================
   SIDENOTES / MARGINNOTES → PAGE FOOTNOTES
   ========================================================================== */

/* Hide the checkbox toggle (web-only interactive element) */
.margin-toggle {
    display: none !important;
}

/* Convert sidenotes to proper page footnotes */
.sidenote,
.marginnote {
    float: footnote;
    font-size: 8pt;
    line-height: 1.35;
    color: var(--muted);
    text-align: left;
}

/* Hide the inline sup number inside sidenotes (WeasyPrint auto-numbers) */
.sidenote sup:first-child,
.marginnote sup:first-child {
    display: none;
}

/* Footnote call (the superscript number in text) */
.sidenote-number::after {
    content: counter(footnote);
    font-size: 7pt;
    vertical-align: super;
    line-height: 0;
    color: var(--accent);
}

/* Footnote marker (the number in the footnote area) */
.sidenote::footnote-call {
    content: counter(footnote);
    font-size: 7pt;
    vertical-align: super;
}

.sidenote::footnote-marker {
    content: counter(footnote) ". ";
    font-size: 8pt;
    font-weight: normal;
}

/* ==========================================================================
   FOOTNOTES
   ========================================================================== */

sup {
    font-size: 7pt;
    line-height: 0;
    vertical-align: super;
}

.footnote {
    font-size: 8.5pt;
    color: var(--muted);
    margin-top: 0.25em;
}

/* ==========================================================================
   HORIZONTAL RULES
   ========================================================================== */

hr {
    border: none;
    border-top: 0.5pt solid var(--border);
    margin: 1.5em auto;
    width: 30%;
    page-break-after: avoid;
}

/* ==========================================================================
   CODE / PREFORMATTED
   ========================================================================== */

pre, code {
    font-family: 'Courier New', Courier, monospace;
    font-size: 8.5pt;
    background: var(--quote-bg);
}

pre {
    padding: 0.5em 0.75em;
    white-space: pre-wrap;
    page-break-inside: avoid;
    margin: 0.75em 0;
}

code {
    padding: 0.1em 0.2em;
}

/* ==========================================================================
   EMPHASIS
   ========================================================================== */

strong {
    font-weight: bold;
}

em {
    font-style: italic;
}

/* ==========================================================================
   SPECIAL SECTIONS
   ========================================================================== */

/* Part dividers */
.part-header {
    page-break-before: always;
    text-align: center;
    padding-top: 2.5in;
}

.part-header h1 {
    font-size: 20pt;
    padding-top: 0;
    page-break-before: avoid;
    margin-bottom: 0.25em;
}

.part-header p {
    font-style: italic;
    color: var(--muted);
    text-align: center;
}

/* Chapter separator - force page break */
.chapter-separator {
    page-break-after: always;
    height: 0;
    visibility: hidden;
}

/* ==========================================================================
   IMAGES & FIGURES
   ========================================================================== */

img {
    max-width: 100%;
    page-break-inside: avoid;
}

figure {
    page-break-inside: avoid;
    margin: 1em 0;
    text-align: center;
}

figcaption {
    font-size: 8.5pt;
    font-style: italic;
    color: var(--muted);
    text-align: center;
    margin-top: 0.5em;
}

/* ==========================================================================
   UTILITY CLASSES
   ========================================================================== */

.page-break {
    page-break-after: always;
}

.no-break {
    page-break-inside: avoid;
}

.centered {
    text-align: center;
}

.small-caps {
    font-variant: small-caps;
    letter-spacing: 0.05em;
}

/* ==========================================================================
   QUESTIONS SECTIONS
   ========================================================================== */

h3:has(+ ul),
h3:has(+ ol) {
    margin-bottom: 0.5em;
}

/* Style question lists */
article ul li,
article ol li {
    page-break-inside: avoid;
}

/* ==========================================================================
   TUFTE ELEMENTS ADAPTATION
   ========================================================================== */

/* Newthought - small caps opening */
.newthought {
    font-variant: small-caps;
    font-size: 1.1em;
    letter-spacing: 0.03em;
}

/* ==========================================================================
   DROP CAPS - REMOVED
   Selector `article > p:first-of-type` failed because combined-print.html
   has no <article> wrapper - build-pdf.sh extracts content and dumps
   directly into <body>. Removed 2025-12-05.
   ========================================================================== */

/* ==========================================================================
   SCENE BREAKS - Ornamental Dividers
   ========================================================================== */

/* Scene break within chapters - olive branch ornament
   Romans 11:17-24 grafting theology: remnant identity through the olive tree.
   Image: Midjourney-generated botanical engraving, transparent background. */
.scene-break {
    text-align: center;
    margin: 1.5em 0;
    page-break-inside: avoid;
    page-break-after: avoid;
    height: 0.5in;
    background: url('../images/ornaments/scene-break.png') center center no-repeat;
    background-size: 2.5in auto;
}

.scene-break::before {
    content: none;
}

/* Alternative: asterisk style */
.scene-break-asterisk::before {
    content: "*  *  *";
    letter-spacing: 0.5em;
}

/* Alternative: fleuron (traditional book ornament) */
.scene-break-fleuron::before {
    content: "❧";
    font-size: 14pt;
    letter-spacing: 0;
}

/* Epigraph styling */
.epigraph {
    margin: 2em 1in;
    font-style: italic;
}

.epigraph footer {
    display: block !important;
    font-style: normal;
    font-size: 9pt;
    text-align: right;
    margin-top: 0.5em;
}

/* ==========================================================================
   DIAGRAMS & GRAPHICS - PRINT OPTIMIZED
   ========================================================================== */

/* Base diagram container */
.diagram {
    page-break-inside: avoid;
    max-width: 100%;
    margin: 1.5em 0;
    padding: 0;
}

.diagram-title {
    font-weight: bold;
    font-size: 11pt;
    text-align: center;
    margin-bottom: 0.5em;
    color: var(--fg);
}

.diagram-subtitle {
    font-size: 9pt;
    font-style: italic;
    text-align: center;
    color: var(--muted);
    margin-bottom: 1em;
}

/* Force single-column grids for 6x9 page */
.diagram-grid-2col,
.diagram-grid-2col-tight,
.phase-columns {
    display: block !important;
}

.diagram-grid-2col > *,
.diagram-grid-2col-tight > *,
.phase-columns > * {
    margin-bottom: 0.75em;
}

/* Timeline diagrams - simplified for print */
.timeline {
    position: relative;
    max-width: 100%;
    margin: 1em 0;
}

/* Hide the vertical line (doesn't print well) */
.timeline::before {
    display: none !important;
}

/* Normalize timeline items to stack vertically */
.timeline-item,
.timeline-item:nth-child(odd),
.timeline-item:nth-child(even) {
    padding-left: 0 !important;
    padding-right: 0 !important;
    text-align: left !important;
    margin-bottom: 1em;
    page-break-inside: avoid;
}

/* Hide timeline marker dots */
.timeline-marker {
    display: none !important;
}

.timeline-date {
    font-weight: bold;
    font-size: 10pt;
    color: var(--fg);
    margin-bottom: 0.25em;
}

.timeline-content {
    background: #f5f5f5;
    padding: 0.75em;
    border: 0.5pt solid var(--border);
    margin-top: 0.25em;
}

.timeline-content h4 {
    font-size: 10pt;
    margin: 0 0 0.25em 0;
}

.timeline-content p {
    font-size: 9pt;
    margin: 0;
}

/* Equation boxes */
.equation-box {
    page-break-inside: avoid;
    border: 0.5pt solid var(--border);
    background: #f9f9f9;
    padding: 0.75em;
    margin: 1em auto;
    max-width: 80%;
    text-align: center;
}

.equation-box .line {
    font-size: 10pt;
    margin: 0.25em 0;
}

.equation-box .operator {
    font-size: 12pt;
    font-weight: bold;
    color: var(--accent);
}

.equation-box .result {
    font-size: 11pt;
    font-weight: bold;
    margin-top: 0.5em;
}

/* Phase boxes (Chapter 16) */
.phase-box {
    page-break-inside: avoid;
    border: 0.5pt solid var(--border);
    background: #fff;
    padding: 0.75em;
    margin: 1em 0;
}

.phase-box.current {
    border: 1pt solid #000;
    background: #f9f9f9;
}

.phase-box.highlight {
    border: 1pt solid #000;
    background: #f5f5f5;
}

.phase-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5em;
    padding-bottom: 0.25em;
    border-bottom: 0.5pt solid var(--border);
}

.phase-number {
    font-weight: bold;
    font-size: 9pt;
}

.phase-status {
    font-size: 8pt;
    font-style: italic;
    color: var(--muted);
}

.phase-title {
    font-size: 10pt;
    font-weight: bold;
    margin: 0.5em 0;
}

.phase-column h5 {
    font-size: 9pt;
    font-weight: bold;
    margin: 0.5em 0 0.25em;
}

.phase-column ul {
    list-style: disc;
    padding-left: 1.25em;
    margin: 0;
}

.phase-column li {
    font-size: 9pt;
    margin-bottom: 0.15em;
}

.phase-column li::before {
    content: none;
}

/* Architecture diagrams (Chapter 10) */
.arch-diagram {
    page-break-inside: avoid;
    background: #f9f9f9;
    border: 0.5pt solid var(--border);
    padding: 0.75em;
    margin: 0.75em 0;
}

.arch-label {
    font-weight: bold;
    font-size: 9pt;
    color: var(--fg);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 0.5em;
    padding-bottom: 0.25em;
    border-bottom: 0.5pt solid var(--border);
}

.arch-box {
    background: #fff;
    border: 0.5pt solid var(--border);
    padding: 0.5em;
    margin: 0.5em 0;
    text-align: center;
}

.arch-box.sacred {
    background: #f5f5f5;
    border: 1pt solid #000;
}

.arch-box strong {
    font-size: 9pt;
    display: block;
    margin-bottom: 0.25em;
}

.arch-box p {
    font-size: 8pt;
    margin: 0;
    text-align: center;
}

/* Phase start/arrows */
.phase-start {
    text-align: center;
    padding: 0.75em;
    background: #f5f5f5;
    border: 0.5pt solid var(--border);
    margin: 0.75em 0;
}

.phase-arrow {
    text-align: center;
    font-size: 14pt;
    color: var(--muted);
    margin: 0.25em 0;
}

/* Comparison tables */
.comparison-table {
    page-break-inside: avoid;
    background: #fff;
    border: 0.5pt solid var(--border);
    width: 100%;
    max-width: 100%;
    margin: 1em 0;
    box-sizing: border-box;
}

.comparison-table th {
    background: #e0e0e0;
    color: #000;
    font-size: 8pt;
    text-transform: uppercase;
}

.comparison-table td {
    font-size: 9pt;
    padding: 0.4em 0.5em;
}

.comparison-table .claim,
.comparison-table .reality {
    font-size: 9pt;
}

/* Full-width comparison tables (Appendix A) */
.comparison-table.full-width {
    width: 100%;
    max-width: 100%;
    table-layout: fixed;
    box-sizing: border-box;
}

.comparison-table.full-width th:first-child,
.comparison-table.full-width td:first-child {
    width: 18%;
    font-weight: 600;
}

.comparison-table.full-width th:nth-child(2),
.comparison-table.full-width td:nth-child(2),
.comparison-table.full-width th:nth-child(3),
.comparison-table.full-width td:nth-child(3) {
    width: 41%;
}

.comparison-table.full-width td {
    vertical-align: top;
    line-height: 1.4;
}

/* Arrow connectors */
.arrow-down,
.connector-arrow {
    text-align: center;
    font-size: 12pt;
    color: var(--muted);
    margin: 0.5em 0;
}

/* Summary boxes */
.summary-box,
.highlight-box {
    page-break-inside: avoid;
    background: #f5f5f5;
    border: 0.5pt solid var(--border);
    padding: 0.75em;
    margin: 1em 0;
}

/* Comparison table wrapper */
.comparison-table-wrapper {
    width: 100%;
    max-width: 100%;
    margin: 1em 0;
    box-sizing: border-box;
}

/* Summary box columns (Appendix A) */
.summary-columns {
    display: flex;
    gap: 1.5em;
}

.summary-column {
    flex: 1;
}

.summary-column h4 {
    margin: 0 0 0.5em 0;
    font-size: 10pt;
    border-bottom: 0.5pt solid var(--border);
    padding-bottom: 0.25em;
}

.summary-column ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.summary-column li {
    padding: 0.15em 0;
    font-size: 9pt;
}

/* Hide any remaining web-specific diagram elements */
.diagram-interactive,
.diagram-tooltip,
.diagram-hover {
    display: none !important;
}

/* ==========================================================================
   BIBLIOGRAPHY
   ========================================================================== */

.bibliography p {
    text-indent: -2em;
    padding-left: 2em;
    margin-bottom: 0.5em;
    text-align: left; /* Override justify for bibliographies */
}

.bibliography p.intro,
.bibliography .print-note p {
    text-indent: 0;
    padding-left: 0;
    margin-bottom: 1em;
}

/* ==========================================================================
   INDEX
   ========================================================================== */

.index-section {
    margin-bottom: 1.5em;
}

.index-section h2 {
    font-size: 12pt;
    font-weight: bold;
    border-bottom: 0.5pt solid var(--border);
    padding-bottom: 0.25em;
    margin-bottom: 0.5em;
    page-break-after: avoid;
}

.index-entry {
    margin-bottom: 0.15em;
    text-indent: 0;
    text-align: left;
    font-size: 9.5pt;
    line-height: 1.4;
}

.index-subentry {
    margin-left: 1.5em;
    margin-bottom: 0.1em;
    text-indent: 0;
    text-align: left;
    font-size: 9pt;
    line-height: 1.4;
}

.index-refs {
    color: var(--muted);
}

/* Hide the alphabetical jump nav in print */
.index-nav {
    display: none !important;
}

.index-intro {
    font-style: italic;
    margin-bottom: 1em;
    font-size: 9.5pt;
}

/* ==========================================================================
   GLOSSARY
   ========================================================================== */

dl.glossary {
    margin: 0;
}

dl.glossary dt {
    font-weight: bold;
    font-size: 10pt;
    margin-top: 0.75em;
    margin-bottom: 0.15em;
    page-break-after: avoid;
}

dl.glossary dd {
    margin-left: 0;
    margin-bottom: 0.5em;
    text-align: justify;
    font-size: 9.5pt;
    line-height: 1.45;
}

/* Keep term and definition together */
dl.glossary dt,
dl.glossary dd {
    page-break-inside: avoid;
}

/* ==========================================================================
   PRINT-FIRST LINKS (Show URLs for PDF/EPUB)
   ========================================================================== */

/* Study links - show full URL after link text
   NOTE: build-pdf.sh converts studies/ links to absolute URLs before WeasyPrint runs,
   so this rule rarely matches. The theremnantthread.com exception below catches them. */
a[href^="studies/"]::after {
    content: " (https://theremnantthread.com/" attr(href) ")";
    font-size: 7.5pt;
    font-style: italic;
    color: var(--muted);
}

/* External links - show URL after link text */
a[href^="http"]::after,
a[href^="https://"]::after {
    content: " (" attr(href) ")";
    font-size: 7.5pt;
    font-style: italic;
    color: var(--muted);
    word-break: break-all;
}

/* Don't show URL for Bible links (too many, reader has context) */
a[href^="bible.html"]::after {
    content: none;
}

/* Don't show URL for internal chapter/appendix links */
a[href^="chapter-"]::after,
a[href^="appendix-"]::after,
a[href^="epilogue"]::after,
a[href^="index.html"]::after,
a[href^="share.html"]::after {
    content: none;
}

/* Bible links converted to absolute URLs by build-pdf.sh - no URL display needed */
a[href*="theremnantthread.com/bible.html"]::after {
    content: none;
}

/* theremnantthread.com links - internal site, no URL display needed in print
   This catches: converted study links, copyright page links, appendix links */
a[href*="theremnantthread.com"]::after {
    content: none;
}

/* Sidenote/marginnote links - text already shows full URL, don't duplicate
   Universal exception (not just http) since some sidenotes have relative links */
.sidenote a::after,
.marginnote a::after {
    content: none;
}

/* ==========================================================================
   GLOSSARY TERM INLINE STYLING (Print)
   ========================================================================== */

/* Glossary terms in running text - italicize to show they're defined */
/* Note: "(see Glossary)" removed because inline definitions already explain terms */
/* e.g., "Decalogue (the Ten Commandments)" - no need for redundant "(see Glossary)" */
.glossary-term {
    font-style: italic;
}

/* ==========================================================================
   SPECIAL CLOSING PAGES (333.html, Epilogue)
   ========================================================================== */

/* 333.html: Verse blocks with borderless blockquotes */
.verse-block {
    margin: 1.5em 0;
    padding: 0 0.5in;
    page-break-inside: avoid;
    text-align: center;
}

.verse-block blockquote {
    border: none;
    margin: 0;
    padding: 0;
    font-style: italic;
    font-size: 10pt;
    line-height: 1.6;
    background: transparent;
    text-align: center;
}

.verse-block .ref {
    display: block;
    margin-top: 0.5em;
    font-style: normal;
    font-size: 8.5pt;
    color: var(--muted);
}

.verse-block .ref a {
    color: var(--muted);
    text-decoration: none;
}

/* 333.html: Decorative dividers between verses */
.divider {
    margin: 1.5em auto;
    width: 40px;
    height: 0.5pt;
    background: var(--border);
    page-break-after: avoid;
}

/* 333.html: Final seal/meditation section */
.seal {
    margin-top: 2em;
    padding-top: 1em;
    border-top: 0.5pt solid var(--border);
    color: var(--muted);
    font-size: 9pt;
    text-align: center;
}

.seal p {
    margin: 0.4em 0;
    line-height: 1.6;
    text-align: center;  /* Override global p { text-align: justify } */
}

/* Epilogue: Verse collection box */
.verses {
    margin: 1.5em auto;
    max-width: 80%;
    text-align: center;
    background: var(--quote-bg);
    padding: 1em;
    border: 0.5pt solid var(--border);
    page-break-inside: avoid;
}

.verses p {
    margin: 0.75em 0;
    font-size: 9.5pt;
    font-style: italic;
    line-height: 1.5;
}

.verses .ref {
    display: block;
    text-align: right;
    margin-top: 0.3em;
    font-style: normal;
    color: var(--muted);
    font-size: 8pt;
}

/* Epilogue: Final word section */
.final-word {
    margin-top: 1.5em;
    color: var(--muted);
    font-size: 9pt;
    line-height: 1.8;
    text-align: center;
}

/* Epilogue: Blessing text */
.blessing {
    font-style: italic;
    color: var(--accent);
    font-size: 10pt;
    margin: 1.25em 0;
    text-align: center;
}

/* ==========================================================================
   333.html: COMPACT SINGLE-PAGE MEDITATION
   All content must fit on one page with no running headers
   ========================================================================== */

@page closing-meditation {
    @top-center { content: none; }
    @bottom-center { content: none; }
}

/* Closing meditation wrapper - single page layout */
/* Note: chapter-separator before this already has page-break-after: always */
.closing-meditation {
    page: closing-meditation;
    page-break-before: auto;  /* Don't add ANOTHER page break - separator handles it */
    page-break-inside: avoid;
    text-align: center;
}

/* 333 heading - override global h1's page and page-break rules */
.closing-meditation h1 {
    page: closing-meditation !important;  /* Override global h1's page: chapter-start */
    padding-top: 0.4in !important;  /* Reduced from global 1.5in */
    margin: 0 !important;
    margin-bottom: 1.2em !important;  /* More space before first verse */
    font-size: 16pt;
    letter-spacing: 0.25em;
    page-break-before: avoid !important;  /* Override global h1 rule */
    page-break-after: avoid;
}

/* Verse blocks with breathing room */
.closing-meditation .verse-block {
    margin: 1em 0;  /* More space between verses */
    padding: 0 0.4in;
}

.closing-meditation .verse-block blockquote {
    font-size: 10pt;
    line-height: 1.5;
}

.closing-meditation .verse-block .ref {
    margin-top: 0.35em;
    font-size: 8pt;
}

/* Dividers with more space */
.closing-meditation .divider {
    margin: 0.6em auto;
    height: 0.5pt;
}

/* Seal section - final meditation with generous space above */
.closing-meditation .seal {
    margin-top: 2em;   /* Equal spacing above divider */
    padding-top: 2em;  /* Equal spacing below divider */
    font-size: 9pt;
    page-break-before: avoid;
}

.closing-meditation .seal p {
    margin: 0.5em 0;
    line-height: 1.6;
}
