@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400;0,700;1,400&family=Merriweather:wght@400;700&display=swap');

body {
    font-family: 'Lora', serif;
    line-height: 1.7;
    color: #333;
    background-color: #f9f9f9;
    margin: 0;
    padding: 20px;
}

.container {
    max-width: 800px;
    margin: 20px auto;
    padding: 30px 40px;
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

h1, h2 {
    font-family: 'Merriweather', serif;
    color: #B50400;
    font-weight: 700;
    text-align: center;
    margin-top: 1em;
    margin-bottom: 0.2em;
}

h1 {
    font-size: 2.2em;
    line-height: 1.2;
}

.subtitle {
    text-align: center;
    font-style: italic;
    color: #555;
    margin-bottom: 2em;
    font-size: 0.9em;
}

.chapter-index {
    margin: 2em auto;
    padding: 1.5em;
    background-color: #f8f8f8;
    border: 1px dashed #ddd;
    border-radius: 5px;
    width: 90%;
    font-size: 0.9em;
}

.chapter-index ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
    text-align: left;
    columns: 2;
    -webkit-columns: 2;
    -moz-columns: 2;
}

.chapter-index li {
    margin-bottom: 0.5em;
}

h3 {
    font-family: 'Merriweather', serif;
    color: #333;
    font-weight: 700;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
    margin-top: 2.5em;
    margin-bottom: 1.5em;
}

h3 .chapter-title {
    color: #B50400;
    display: block;
    font-size: 1.5em;
}

h3 small {
    font-size: 0.7em;
    color: #666;
    display: block;
    font-weight: 400;
    font-style: italic;
    margin-top: 0.5em;
}

p {
    margin-bottom: 1.2em;
    text-align: justify;
}

blockquote {
    margin: 1.5em 0;
    padding: 1em 1.5em;
    border-left: 4px solid #B50400;
    background-color: #fdfaf6;
    font-style: italic;
    color: #444;
}

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

a {
    color: #0056b3;
    text-decoration: none;
    font-weight: bold;
}

a:hover {
    text-decoration: underline;
}

b, strong { font-weight: 700; }
i, em { font-style: italic; }
u {
    text-decoration: underline;
    text-decoration-color: #555;
    text-decoration-thickness: 1px;
}

.nav-link {
    display: block;
    margin-top: 2em;
    margin-bottom: 2em;
    font-size: 0.9em;
    text-align: right;
}

/* === Optimizations for MOBILE (max-width: 600px) === */
@media (max-width: 600px) {
    .container {
        padding: 10px 3vw;
        border: none;
        border-radius: 0;
        box-shadow: none;
    }
    .chapter-index {
        padding: 1em;
        border: none;
        border-radius: 0;
    }
    .chapter-index ul {
        columns: 1;
        -webkit-columns: 1;
        -moz-columns: 1;
    }
    h1 {
        font-size: 1.5em;
    }
}

.links-list {
    list-style-type: none;
    padding: 0;
    margin: 2em auto;
    max-width: 400px;
}

.links-list li {
    margin-bottom: 1em;
    text-align: center;
}

.links-list a {
    display: inline-block;
    font-size: 1.5em;           /* Makes the link text large */
    padding: 0.5em 1.5em;
    color: #B50400;
    border-radius: 6px;
    background: #f5eaea;
    text-decoration: none;
    font-family: 'Merriweather', serif;
    transition: background 0.2s, color 0.2s;
}

.links-list a:hover {
    background: #B50400;
    color: #fff;
}
.links-list a.disabled-link,
.links-list a[aria-disabled="true"] {
    color: #999 !important;
    background: #eee !important;
    cursor: not-allowed !important;
    pointer-events: none;
}

/* === Optimizations for PRINT === */
@media print {
    html, body {
        font-size: 11pt !important;  /* Modern print-friendly size */
        line-height: 1.4 !important; /* Slightly tighter than on-screen */
        font-family: 'Lora', serif !important;
        color: #000 !important;
        background: #fff !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    .container {
        box-shadow: none !important;
        border: none !important;
        border-radius: 0 !important;
        background: #fff !important;
        padding: 0 !important;
        margin: 0 auto !important;
        max-width: none !important;
    }
    .chapter-index {
        background: none !important;
        border: none !important;
        border-radius: 0 !important;
        padding: 0 !important;
    }
    h1, h2, h3, h4, h5, h6 {
        color: #000 !important;
        page-break-after: avoid;
        page-break-inside: avoid;
    }
    h1   { font-size: 1.5em !important;}
    h2   { font-size: 1.2em !important;}
    h3   { font-size: 1em !important;}
    /* can adjust further if headings still too big for your taste */
    h3 {
        border-bottom: none !important;
        padding-bottom: 0 !important;
    }
    blockquote {
        border-left: 3px solid #888 !important;
        background: none !important;
        color: #222 !important;
    }
    a {
        color: #000 !important;
        text-decoration: underline !important;
    }
    .links-list,
    .nav-link {
        display: none !important; /* Hide navigation elements in print */
    }
    /* Optional: reduce paragraph spacing a bit */
    p {
        margin-bottom: 0.7em !important;
    }
}