/* ===== Reset & Base Styles ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Scholarly Color Palette */
    --primary-color: #2c3e50;
    --secondary-color: #8b4513;
    --accent-color: #d4af37;
    --text-color: #2d2d2d;
    --text-light: #666;
    --bg-color: #fafaf8;
    --bg-white: #ffffff;
    --border-color: #ddd;
    --hover-color: #f5f5f0;
    
    /* Typography */
    --font-serif: 'Crimson Text', 'Georgia', 'Times New Roman', serif;
    --font-sans: 'Lato', 'Helvetica Neue', Arial, sans-serif;
    --line-height: 1.8;
    --reading-width: 720px;
}

body {
    font-family: var(--font-serif);
    font-size: 18px;
    line-height: var(--line-height);
    color: var(--text-color);
    background-color: var(--bg-color);
}

/* ===== Typography ===== */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-sans);
    font-weight: 600;
    line-height: 1.3;
    margin-top: 1.5em;
    margin-bottom: 0.5em;
    color: var(--primary-color);
}

h1 { font-size: 2.5em; margin-top: 0; }
h2 { font-size: 2em; }
h3 { font-size: 1.5em; }
h4 { font-size: 1.25em; }

p {
    margin-bottom: 1.2em;
}

a {
    color: var(--secondary-color);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.2s;
}

a:hover {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

/* ===== Layout ===== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* ===== Header ===== */
.site-header {
    background-color: var(--bg-white);
    border-bottom: 2px solid var(--primary-color);
    padding: 1.5rem 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.site-branding {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.site-logo {
    width: 60px;
    height: 60px;
    object-fit: contain;
}

.site-title-group {
    display: flex;
    flex-direction: column;
}

.site-title {
    font-size: 1.8em;
    margin: 0;
    font-weight: 600;
    line-height: 1.1;
}

.site-title a {
    color: var(--primary-color);
    border: none;
}

.site-title a:hover {
    color: var(--secondary-color);
}

.site-tagline {
    font-size: 0.85em;
    color: var(--text-light);
    font-style: italic;
    margin: 0;
    font-family: var(--font-serif);
}

.main-nav ul {
    list-style: none;
    display: flex;
    gap: 2rem;
}

.main-nav a {
    font-family: var(--font-sans);
    font-size: 1rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: none;
    padding: 0.5rem 0;
}

.main-nav a:hover,
.main-nav a.active {
    color: var(--secondary-color);
}

/* Hamburger toggle — hidden on desktop */
.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 110;
}

.nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--primary-color, #000);
    border-radius: 2px;
    transition: all 0.25s ease;
}

.nav-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}
.nav-toggle.active span:nth-child(2) {
    opacity: 0;
}
.nav-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

@media (max-width: 768px) {
    .nav-toggle {
        display: flex;
    }

    .header-content {
        flex-wrap: nowrap;
        gap: 0.75rem;
    }

    .main-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-white, #fff);
        border-bottom: 2px solid var(--primary-color, #000);
        box-shadow: 0 8px 24px rgba(0,0,0,0.1);
        z-index: 100;
    }

    .main-nav.nav-open {
        display: block;
    }

    .main-nav ul {
        flex-direction: column;
        gap: 0;
        padding: 0.5rem 0;
    }

    .main-nav li {
        border-bottom: 1px solid var(--border-color, #e5e5e5);
    }

    .main-nav li:last-child {
        border-bottom: none;
    }

    .main-nav a {
        display: block;
        padding: 0.85rem 1.5rem;
        font-size: 0.95rem;
    }

    .main-nav a:hover {
        background: var(--bg-color, #f9f9f9);
    }

    .site-header {
        position: relative;
    }

    .site-logo {
        width: 40px;
        height: 40px;
    }

    .header-search {
        flex: 1;
        min-width: 0;
    }
}

/* ===== Main Content ===== */
.site-main {
    min-height: calc(100vh - 300px);
    padding: 3rem 0;
}

/* ===== Home Page ===== */
.hero {
    text-align: center;
    padding: 3rem 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 3rem;
}

.hero h2 {
    font-size: 3em;
    margin-bottom: 0.5rem;
}

.lead {
    font-size: 1.3em;
    color: var(--text-light);
    max-width: 800px;
    margin: 0 auto;
}

/* What's New Section */
.whats-new {
    background: var(--hover-color);
    padding: 2rem;
    border-radius: 8px;
    margin-bottom: 3rem;
    border-left: 4px solid var(--accent-color);
}

.whats-new h3 {
    margin-top: 0;
    color: var(--primary-color);
    font-size: 1.5em;
}

.new-items ul {
    list-style: none;
    margin: 0;
}

.new-items li {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.new-items li:last-child {
    border-bottom: none;
}

.new-items a {
    font-size: 1.1em;
    font-weight: 500;
}

.new-items .date {
    color: var(--text-light);
    font-size: 0.9em;
    font-family: var(--font-sans);
}

/* Category Grid */
.content-categories {
    margin-bottom: 3rem;
}

.content-categories h3 {
    text-align: center;
    font-size: 2em;
    margin-bottom: 2rem;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.category-box {
    background: var(--bg-white);
    padding: 2rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    text-align: center;
    transition: all 0.3s;
}

.category-box:hover {
    border-color: var(--secondary-color);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.category-icon {
    font-size: 3em;
    margin-bottom: 1rem;
}

.category-box h4 {
    color: var(--primary-color);
    margin: 0.5rem 0;
    font-size: 1.3em;
}

.category-box p {
    color: var(--text-light);
    font-size: 0.95em;
    margin-bottom: 1.5rem;
}

/* Level System */
.about-levels {
    background: var(--bg-white);
    padding: 2rem;
    border-radius: 8px;
    margin-bottom: 3rem;
    border: 1px solid var(--border-color);
}

.about-levels h3 {
    text-align: center;
    margin-top: 0;
    font-size: 1.8em;
}

.levels-explanation {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.level-info {
    text-align: center;
}

.level-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 0.9em;
    margin-bottom: 0.5rem;
}

.level-1 {
    background: #e8f5e9;
    color: #2e7d32;
    border: 2px solid #2e7d32;
}

.level-2 {
    background: #fff3e0;
    color: #e65100;
    border: 2px solid #e65100;
}

.level-3 {
    background: #e3f2fd;
    color: #1565c0;
    border: 2px solid #1565c0;
}

.lang-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    background: var(--hover-color);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 0.85em;
}

.levels-note {
    text-align: center;
    color: var(--text-light);
    font-size: 0.95em;
    margin-top: 1.5rem;
}

/* Citation Info */
.citation-info {
    background: var(--hover-color);
    padding: 2rem;
    border-radius: 8px;
    text-align: center;
    border-left: 4px solid var(--accent-color);
}

.citation-info h3 {
    margin-top: 0;
    color: var(--primary-color);
}

.citation-info p {
    margin: 0;
    font-size: 1.05em;
}

.section-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 3rem 0;
}

.section-card {
    background: var(--bg-white);
    padding: 2rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    text-align: center;
}

.section-card h3 {
    color: var(--primary-color);
    margin-top: 0;
}

/* Browse More Section */
.browse-more {
    text-align: center;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.browse-more h3 {
    color: var(--primary-color);
    font-size: 1.5em;
    margin-bottom: 1.5rem;
}

.browse-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.browse-links a {
    font-family: var(--font-sans);
    font-size: 1.1em;
    color: var(--secondary-color);
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    transition: all 0.2s;
}

.browse-links a:hover {
    background: var(--hover-color);
    border-color: var(--secondary-color);
}

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background-color: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 4px;
    font-family: var(--font-sans);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 1rem;
    transition: background-color 0.2s;
}

.btn:hover {
    background-color: var(--primary-color);
    border-bottom: none;
}

.content-list {
    list-style: none;
}

.content-list li {
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
}

.content-list a {
    font-size: 1.2em;
    font-weight: 500;
}

.meta {
    display: block;
    color: var(--text-light);
    font-size: 0.9em;
    font-family: var(--font-sans);
    margin-top: 0.25rem;
}

/* ===== Essay Styles ===== */
.essay-header {
    text-align: center;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 2rem;
    margin-bottom: 3rem;
}

.essay-author {
    font-size: 1.2em;
    color: var(--text-light);
    font-style: italic;
}

.essay-badges {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin: 1rem 0;
    flex-wrap: wrap;
}

.substantial-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: var(--accent-color);
    color: var(--primary-color);
    border-radius: 20px;
    font-family: var(--font-sans);
    font-weight: 700;
    font-size: 1.2em;
}

.essay-meta {
    margin-top: 1rem;
}

.categories a {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background-color: var(--hover-color);
    border: 1px solid var(--border-color);
    border-radius: 3px;
    font-family: var(--font-sans);
    font-size: 0.85em;
    margin: 0.25rem;
}

.essay-content {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 3rem;
    max-width: 1100px;
    margin: 0 auto;
}

.toc {
    position: sticky;
    top: 2rem;
    align-self: start;
    background: var(--bg-white);
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.9em;
}

.toc h3 {
    font-size: 1em;
    margin-top: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.toc ul {
    list-style: none;
}

.toc li {
    margin: 0.5rem 0;
}

.toc a {
    color: var(--text-light);
    border: none;
    font-family: var(--font-sans);
}

.toc a:hover {
    color: var(--secondary-color);
}

.content-body {
    max-width: var(--reading-width);
}

/* Scripture References in Text */
.content-body strong {
    color: var(--primary-color);
    font-weight: 600;
}

/* Blockquotes */
blockquote {
    border-left: 4px solid var(--accent-color);
    padding-left: 2rem;
    margin: 2rem 0;
    font-style: italic;
    color: var(--text-light);
}

/* Scripture References Sidebar */
.scripture-refs {
    background: var(--hover-color);
    padding: 1.5rem;
    border-radius: 4px;
    margin: 2rem 0;
}

.scripture-refs h3 {
    margin-top: 0;
    font-size: 1.2em;
}

.scripture-refs ul {
    columns: 2;
    column-gap: 1.5rem;
}

.scripture-refs li {
    margin-bottom: 0.5rem;
    font-family: var(--font-sans);
    font-size: 0.9em;
}

/* Citation Box */
.essay-footer {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 2px solid var(--border-color);
}

.citation {
    background: var(--hover-color);
    padding: 1.5rem;
    border-radius: 4px;
    border-left: 4px solid var(--accent-color);
}

.citation h4 {
    margin-top: 0;
    font-size: 1em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.citation-text {
    font-family: var(--font-sans);
    font-size: 0.95em;
    line-height: 1.6;
    margin: 0 0 0.5rem 0;
}

.citation-note {
    font-size: 0.85em;
    color: var(--text-light);
    font-style: italic;
    margin: 0;
}

/* ===== Essays List Page ===== */
.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.filters {
    background: var(--bg-white);
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    margin-bottom: 2rem;
}

.filter-group h3 {
    font-size: 1em;
    margin-top: 0;
}

.filter-group ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.essays-grid {
    display: grid;
    gap: 2rem;
}

.essay-card {
    background: var(--bg-white);
    padding: 2rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    transition: box-shadow 0.2s;
}

.essay-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.essay-card h2 {
    font-size: 1.8em;
    margin-top: 0;
}

.card-meta {
    margin: 1rem 0;
}

.category-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background-color: var(--hover-color);
    border: 1px solid var(--border-color);
    border-radius: 3px;
    font-family: var(--font-sans);
    font-size: 0.85em;
    margin-right: 0.5rem;
}

.excerpt {
    color: var(--text-light);
    font-size: 0.95em;
}

.read-more {
    font-family: var(--font-sans);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.9em;
}

/* ===== Bible Chapter Styles ===== */
.bible-chapter {
    max-width: var(--reading-width);
    margin: 0 auto;
}

.chapter-header {
    margin-bottom: 2rem;
}

.book-nav {
    font-family: var(--font-sans);
    margin-bottom: 1rem;
}

.book-nav a {
    color: var(--text-light);
}

.book-title {
    color: var(--primary-color);
    font-weight: 600;
    margin-left: 1rem;
}

.chapter-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--hover-color);
    border-radius: 4px;
    margin: 2rem 0;
    font-family: var(--font-sans);
}

.chapter-nav.bottom {
    margin-top: 3rem;
}

.nav-prev, .nav-next {
    font-weight: 600;
    padding: 0.5rem 1rem;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 3px;
}

.chapter-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.chapter-selector select {
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 3px;
    font-family: var(--font-serif);
    font-size: 1rem;
}

/* Verse Styling — hover/click handled in reading-ui.html */
.chapter-content .verse {
    display: inline;
}

.verse-num {
    font-family: var(--font-sans);
    font-size: 0.75em;
    vertical-align: super;
    font-weight: 600;
    color: var(--secondary-color);
    margin-right: 0.25rem;
}

/* Section Headings in Bible */
.section-heading {
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 1.1em;
    color: var(--primary-color);
    margin-top: 2rem;
    margin-bottom: 1rem;
}

/* Poetry/Quote Styling */
.poetry {
    margin: 1.5rem 0 1.5rem 2rem;
    font-style: italic;
    color: var(--text-light);
}

.chapter-footer {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.translation-note {
    font-family: var(--font-sans);
    font-size: 0.9em;
    color: var(--text-light);
}

/* ===== Translations & Books Grid ===== */
.translations-grid,
.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
    margin: 3rem 0;
}

.translation-card,
.book-card {
    background: var(--bg-white);
    padding: 2rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    min-height: auto; /* Allow natural height */
}

.translation-card:hover,
.book-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
    border-color: var(--secondary-color);
}

.translation-card h2,
.book-card h3 {
    margin-top: 0;
    margin-bottom: 1rem;
}

.translation-card h2 a,
.book-card h3 a {
    color: var(--primary-color);
    border-bottom: none;
}

.translation-meta,
.book-meta {
    display: flex;
    gap: 1.5rem;
    margin: 1rem 0;
    font-family: var(--font-sans);
    font-size: 0.9em;
    color: var(--text-light);
}

.translator,
.book-count,
.book-chapters {
    font-weight: 600;
}

.translation-desc {
    color: var(--text-light);
    margin: 1rem 0 auto;
    flex-grow: 1;
}

/* Translation Action Buttons */
.translation-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.translation-actions .btn-primary,
.translation-actions .btn-secondary {
    flex: 1;
    text-align: center;
}

/* Buttons */
.btn-primary,
.btn-secondary,
.btn-start {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 4px;
    font-family: var(--font-sans);
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary {
    background: var(--bg-white);
    color: var(--secondary-color);
    border: 2px solid var(--secondary-color);
}

.btn-primary:hover,
.btn-start:hover {
    background: var(--primary-color);
    color: white;
    border-bottom: none;
}

.btn-secondary:hover {
    background: #444444;
    color: white;
    border-bottom: none;
    border-color: #444444;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.1em;
}

/* ===== Chapters Grid ===== */
.chapters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 1rem;
    margin: 2rem 0;
}

.chapter-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.5rem 1rem;
    background: var(--bg-white);
    border: 2px solid var(--border-color);
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.2s;
}

.chapter-link:hover {
    background: var(--hover-color);
    border-color: var(--secondary-color);
    transform: translateY(-2px);
}

.chapter-num {
    font-size: 2em;
    font-weight: 700;
    color: var(--secondary-color);
    font-family: var(--font-sans);
}

.chapter-label {
    margin-top: 0.5rem;
    font-size: 0.9em;
    color: var(--text-light);
    font-family: var(--font-sans);
}

.quick-start {
    text-align: center;
    margin: 3rem 0;
}

/* ===== Breadcrumb Navigation ===== */
.breadcrumb {
    font-family: var(--font-sans);
    font-size: 0.9em;
    color: var(--text-light);
    margin-bottom: 2rem;
}

.breadcrumb a {
    color: var(--secondary-color);
}

.breadcrumb a:hover {
    color: var(--primary-color);
}

/* ===== Chapter Reading Page ===== */
.chapter-reading {
    max-width: var(--reading-width);
    margin: 0 auto;
}

.chapter-header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.chapter-meta {
    font-family: var(--font-sans);
    color: var(--text-light);
    font-size: 0.9em;
}

/* Chapter Navigation Bar */
.chapter-nav-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--hover-color);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    margin: 2rem 0;
    font-family: var(--font-sans);
}

.chapter-nav-bar.bottom {
    margin-top: 3rem;
}

.nav-btn {
    padding: 0.75rem 1.5rem;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    text-decoration: none;
    color: var(--primary-color);
    font-weight: 600;
    transition: all 0.2s;
    white-space: nowrap;
}

.nav-btn:hover {
    background: var(--secondary-color);
    color: white;
    border-color: var(--secondary-color);
}

.nav-btn.nav-disabled {
    visibility: hidden;
    min-width: 80px; /* Maintain consistent width */
}

.nav-btn.nav-prev,
.nav-btn.nav-next {
    min-width: 80px;
    text-align: center;
}

.nav-btn.nav-book {
    background: var(--primary-color);
    color: white;
}

.chapter-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    justify-content: center;
}

.chapter-selector label {
    font-weight: 600;
    color: var(--text-color);
}

.chapter-selector select {
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-family: var(--font-serif);
    font-size: 1rem;
    background: white;
}

/* Chapter Content */
.chapter-content {
    line-height: 2;
    font-size: 1.1em;
}

/* verse display handled in reading-ui.html */

.chapter-footer {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.translation-note {
    font-family: var(--font-sans);
    font-size: 0.9em;
    color: var(--text-light);
}

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
    .chapter-nav-bar {
        flex-wrap: wrap;
    }
    
    .chapter-selector {
        order: 3;
        flex-basis: 100%;
        margin-top: 0.5rem;
    }
    
    .chapters-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
    
    .translations-grid,
    .books-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== Translations List ===== */
.translations-list {
    max-width: 1000px;
    margin: 0 auto;
}

.intro-content {
    margin: 2rem 0 3rem;
    max-width: var(--reading-width);
}

.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 3rem 0;
}

.book-card {
    background: var(--bg-white);
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    transition: all 0.2s;
}

.book-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border-color: var(--secondary-color);
}

.book-card h3 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    font-size: 1.4em;
}

.book-card h3 a {
    color: var(--primary-color);
    border-bottom: none;
}

.book-card h3 a:hover {
    color: var(--secondary-color);
}

.book-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.75rem;
    font-family: var(--font-sans);
    font-size: 0.9em;
    color: var(--text-light);
}

.book-testament {
    font-weight: 600;
    color: var(--secondary-color);
}

.book-chapters {
    color: var(--text-light);
}

.book-translation {
    font-size: 0.9em;
    color: var(--text-light);
    font-style: italic;
    margin-bottom: 0;
}

.translation-info {
    margin-top: 4rem;
    padding: 2rem;
    background: var(--hover-color);
    border-left: 4px solid var(--secondary-color);
    border-radius: 4px;
}

.translation-info h2 {
    margin-top: 0;
}

/* ===== Footer ===== */
.site-footer {
    background-color: var(--primary-color);
    color: white;
    padding: 2rem 0;
    margin-top: 4rem;
    text-align: center;
}

.footer-branding {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.footer-logo {
    width: 40px;
    height: 40px;
    filter: brightness(0) invert(1);
}

.site-footer p {
    margin: 0.5rem 0;
}

.footer-note {
    font-size: 0.9em;
    opacity: 0.8;
}

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }
    
    /* header-content and main-nav handled by hamburger CSS above */
    
    .essay-content {
        grid-template-columns: 1fr;
    }
    
    .toc {
        position: static;
        margin-bottom: 2rem;
    }
    
    .chapter-nav {
        flex-direction: column;
        gap: 1rem;
    }
    
    .section-grid {
        grid-template-columns: 1fr;
    }
    
    .scripture-refs ul {
        columns: 1;
    }
}

/* ===== Print Styles ===== */
@media print {
    .site-header,
    .site-footer,
    .toc,
    .chapter-nav,
    .btn {
        display: none;
    }
    
    body {
        background: white;
        font-size: 12pt;
    }
    
    .essay-content {
        grid-template-columns: 1fr;
    }
    
    a {
        color: black;
        text-decoration: underline;
    }
}

/* Translation Resources Section */
.translation-resources {
    margin: 3rem 0;
    padding: 2rem;
    background: var(--hover-color);
    border-left: 4px solid var(--secondary-color);
    border-radius: 4px;
}

.translation-resources h2 {
    margin-top: 0;
    color: var(--secondary-color);
}

.translation-resources p {
    margin: 1rem 0;
}

/* Read Now Section */
.read-now-section {
    text-align: center;
    margin: 3rem 0;
    padding: 2rem;
    background: linear-gradient(135deg, var(--hover-color) 0%, var(--bg-white) 100%);
    border-radius: 8px;
    border: 2px solid var(--border-color);
}

.read-now-section .btn-large {
    font-size: 1.2em;
    padding: 1.2rem 3rem;
    margin-bottom: 1rem;
}

.read-now-note {
    color: var(--text-light);
    font-family: var(--font-sans);
    font-size: 0.95em;
    margin-top: 1rem;
}

.section-heading {
    margin: 3rem 0 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color);
    color: var(--secondary-color);
}

/* Book & Chapter Selector */
.book-chapter-selector {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.book-select,
.chapter-select {
    padding: 0.5rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-white);
    font-family: var(--font-sans);
    font-size: 0.95em;
    cursor: pointer;
    transition: border-color 0.2s;
}

.book-select {
    min-width: 150px;
}

.chapter-select {
    min-width: 120px;
}

.book-select:hover,
.chapter-select:hover,
.book-select:focus,
.chapter-select:focus {
    border-color: var(--secondary-color);
    outline: none;
}

/* Home Search Bar */
.home-search {
    max-width: 800px;
    margin: 3rem auto;
}

.search-form {
    display: flex;
    gap: 1rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    border-radius: 8px;
    overflow: hidden;
}

#home-search-input {
    flex: 1;
    padding: 1.2rem 1.5rem;
    border: 2px solid var(--border-color);
    border-right: none;
    font-size: 1.1em;
    font-family: var(--font-sans);
    border-radius: 8px 0 0 8px;
}

#home-search-input:focus {
    outline: none;
    border-color: var(--secondary-color);
}

.search-submit {
    padding: 1.2rem 2.5rem;
    background: var(--secondary-color);
    color: white;
    border: none;
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 1.1em;
    cursor: pointer;
    transition: background 0.2s;
    border-radius: 0 8px 8px 0;
}

.search-submit:hover {
    background: var(--primary-color);
}

/* About Author Section */
.about-author-section {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
    align-items: flex-start;
}
.author-text {
    flex: 1;
}
.author-image img {
    width: 300px;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
@media (max-width: 768px) {
    .about-author-section {
        flex-direction: column-reverse;
    }
    .author-image img {
        width: 100%;
        max-width: 300px;
    }
}

/* Fix nested list bullets on About page */
.single-content ul {
    list-style-type: disc;
    margin-left: 1.5rem;
}
.single-content ul ul {
    list-style-type: circle;
    margin-left: 1.5rem;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}
.single-content ul li {
    margin-bottom: 0.3rem;
}

/* Fix nested list bullets on About page */
.content ul {
    list-style-type: disc;
    margin-left: 1.5rem;
    padding-left: 1rem;
}
.content ul ul {
    list-style-type: circle;
    margin-left: 1.5rem;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}
.content ul li {
    margin-bottom: 0.5rem;
}

/* Fix nested list bullets on About page */
.content ul {
    list-style-type: disc;
    margin-left: 1.5rem;
    padding-left: 1rem;
}
.content ul ul {
    list-style-type: circle;
    margin-left: 1.5rem;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}
.content ul li {
    margin-bottom: 0.5rem;
}
/* Harmony of the Gospels Styles */

/* Gospel source colors */
.gospel-mt {
    color: #000000; /* Matthew - Black */
}

.gospel-mk {
    color: #215868; /* Mark - Teal */
}

.gospel-lk {
    color: #7030A0; /* Luke - Purple */
}

.gospel-jn {
    color: #C00000; /* John - Dark Red */
}

/* Color legend */
.harmony-legend {
    display: flex;
    gap: 1.5rem;
    padding: 1rem 1.5rem;
    background: #f8f5f0;
    border-radius: 8px;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    justify-content: center;
    font-weight: 600;
    border: 1px solid #e5e0d8;
}

.harmony-legend span {
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    background: white;
}

.harmony-legend .gospel-mt {
    border-left: 4px solid #000000;
}

.harmony-legend .gospel-mk {
    border-left: 4px solid #215868;
}

.harmony-legend .gospel-lk {
    border-left: 4px solid #7030A0;
}

.harmony-legend .gospel-jn {
    border-left: 4px solid #C00000;
}

/* Harmony intro text */
.harmony-intro {
    font-size: 1.1rem;
    line-height: 1.7;
    color: #4a4a4a;
    margin-bottom: 2rem;
    padding: 1rem 0;
    border-bottom: 1px solid #e5e0d8;
}

/* Section dropdown navigation */
.harmony-nav-container {
    position: sticky;
    top: 0;
    background: white;
    padding: 1rem 0;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #e5e0d8;
    z-index: 100;
}

.harmony-dropdown {
    width: 100%;
    max-width: 600px;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: 1px solid #ccc;
    border-radius: 6px;
    background: white;
    cursor: pointer;
}

.harmony-dropdown:focus {
    outline: none;
    border-color: #8b6914;
    box-shadow: 0 0 0 2px rgba(139, 105, 20, 0.2);
}

/* Topic headers */
.topic-header {
    color: #8b6914;
    margin-top: 2.5rem;
    margin-bottom: 0.5rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e0d8;
    font-size: 1.4rem;
}

.topic-header:first-child {
    margin-top: 0;
    border-top: none;
    padding-top: 0;
}

.topic-reference {
    color: #666;
    font-style: italic;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

/* Harmony text paragraphs */
.harmony-text {
    line-height: 1.8;
    margin-bottom: 0.75rem;
    text-align: justify;
    white-space: pre-wrap; /* Preserve tabs for genealogy formatting */
}

/* Section navigation */
.harmony-section-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 0;
    margin-top: 2rem;
    border-top: 1px solid #e5e0d8;
    flex-wrap: wrap;
    gap: 1rem;
}

.harmony-section-nav a {
    padding: 0.75rem 1.5rem;
    background: #8b6914;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    transition: background 0.2s;
}

.harmony-section-nav a:hover {
    background: #6d5310;
}

.harmony-section-nav .all-sections {
    background: #2c3e50;
}

.harmony-section-nav .all-sections:hover {
    background: #1a252f;
}

/* Print styles */
@media print {
    .harmony-nav-container,
    .harmony-section-nav {
        display: none;
    }
    
    .gospel-mt { color: #000000 !important; }
    .gospel-mk { color: #215868 !important; }
    .gospel-lk { color: #7030A0 !important; }
    .gospel-jn { color: #C00000 !important; }
}

/* Mobile responsive */
@media (max-width: 768px) {
    .harmony-legend {
        gap: 0.75rem;
        padding: 0.75rem 1rem;
    }
    
    .harmony-legend span {
        font-size: 0.9rem;
        padding: 0.2rem 0.5rem;
    }
    
    .topic-header {
        font-size: 1.2rem;
    }
    
    .harmony-text {
        font-size: 0.95rem;
        text-align: left;
    }
}

/* Gospel colors - high specificity override */
.harmony-content .gospel-mt,
.harmony-text .gospel-mt,
span.gospel-mt { color: #000000 !important; }

.harmony-content .gospel-mk,
.harmony-text .gospel-mk,
span.gospel-mk { color: #215868 !important; }

.harmony-content .gospel-lk,
.harmony-text .gospel-lk,
span.gospel-lk { color: #7030A0 !important; }

.harmony-content .gospel-jn,
.harmony-text .gospel-jn,
span.gospel-jn { color: #C00000 !important; }
/* Harmony Navigation - Sticky */
.harmony-sticky-nav {
    position: sticky;
    top: 0;
    background: white;
    z-index: 100;
    border-bottom: 1px solid #e0e0e0;
    padding: 0.75rem 0;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.harmony-nav-inner {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.harmony-back {
    color: #666;
    text-decoration: none;
    font-size: 0.9rem;
    white-space: nowrap;
}

.harmony-back:hover {
    color: var(--primary-color, #8b6914);
}

.harmony-dropdown {
    flex: 1;
    min-width: 200px;
    max-width: 500px;
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
    border: 1px solid #ccc;
    border-radius: 6px;
    background: white;
    cursor: pointer;
}

.harmony-dropdown:focus {
    outline: none;
    border-color: var(--primary-color, #8b6914);
}

/* Mini legend for sticky nav */
.harmony-legend-mini {
    display: flex;
    gap: 0.5rem;
    font-size: 0.8rem;
    font-weight: 600;
}

.harmony-legend-mini span {
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    background: #f5f5f5;
}

/* Header without section number */
.harmony-header h1 {
    margin-bottom: 0.25rem;
}

.section-reference {
    color: #666;
    font-style: italic;
    font-size: 0.95rem;
    margin-top: 0;
}

/* Topic styling */
.harmony-topic {
    margin-bottom: 2rem;
    padding-top: 1rem;
}

.harmony-topic:first-child {
    padding-top: 0;
}

.topic-header {
    color: var(--primary-color, #8b6914);
    margin-bottom: 0.25rem;
    font-size: 1.3rem;
}

.topic-reference {
    color: #666;
    font-style: italic;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

/* Bottom navigation */
.harmony-section-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 0;
    margin-top: 3rem;
    border-top: 2px solid #e0e0e0;
    gap: 1rem;
}

.harmony-section-nav a {
    padding: 0.75rem 1.5rem;
    background: var(--primary-color, #8b6914);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 500;
    transition: background 0.2s;
}

.harmony-section-nav a:hover {
    background: #6d5310;
}

.harmony-section-nav .nav-outline {
    background: #2c3e50;
}

.harmony-section-nav .nav-outline:hover {
    background: #1a252f;
}

.harmony-section-nav .nav-placeholder {
    width: 120px;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .harmony-nav-inner {
        flex-direction: column;
        align-items: stretch;
    }
    
    .harmony-dropdown {
        max-width: 100%;
    }
    
    .harmony-legend-mini {
        justify-content: center;
    }
    
    .harmony-section-nav {
        flex-direction: column;
    }
    
    .harmony-section-nav a {
        width: 100%;
        text-align: center;
    }
    
    .harmony-section-nav .nav-placeholder {
        display: none;
    }
}
/* Additional Harmony Outline styles */
.outline-list {
    list-style: none;
    padding-left: 0;
    margin: 0.5rem 0 1.5rem 0;
}

.outline-list li {
    padding: 0.4rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.outline-list li a {
    text-decoration: none;
    color: #2c3e50;
}

.outline-list li a:hover {
    color: var(--primary-color, #8b6914);
}

.outline-list .ref {
    color: #888;
    font-size: 0.85rem;
    font-style: italic;
}
/* Harmony verse numbers superscript styling */
.harmony-text sup {
    font-size: 0.7em;
    color: #666;
    font-weight: normal;
    vertical-align: super;
    line-height: 0;
    margin-right: 1px;
}

/* Preserve tabs for genealogy columns */
.harmony-text {
    white-space: pre-wrap;
    tab-size: 20;
    -moz-tab-size: 20;
}

/* Topic reference with colored abbreviations */
.topic-reference .gospel-mt,
.topic-reference .gospel-mk,
.topic-reference .gospel-lk,
.topic-reference .gospel-jn {
    font-weight: 600;
}
/* Harmony of the Gospels - Stylesheet v4 */

/* ==========================================
   Gospel Source Colors
   ========================================== */

/* Matthew - Black (default text color) */
.gospel-mt {
    color: #000000;
}

/* Mark - Teal */
.gospel-mk {
    color: #215868;
}

/* Luke - Purple */
.gospel-lk {
    color: #7030A0;
}

/* John - Red */
.gospel-jn {
    color: #C00000;
}

/* Color legend styling */
.harmony-legend {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    padding: 0.75rem 1rem;
    background: #f8f9fa;
    border-radius: 4px;
    flex-wrap: wrap;
}

.harmony-legend span {
    font-weight: 600;
}

/* ==========================================
   Verse Number Superscript
   ========================================== */

.verse-num {
    font-size: 0.7em;
    color: #666;
    font-weight: bold;
    vertical-align: super;
    line-height: 0;
    margin-right: 2px;
    font-family: sans-serif;
}

/* Verse numbers inside bold/italic should still be styled */
strong .verse-num,
em .verse-num,
strong em .verse-num {
    font-weight: bold;
}

/* ==========================================
   Genealogy Formatting (Tab Columns)
   ========================================== */

.genealogy-text {
    font-family: inherit;
    font-size: 1em;
    line-height: 1.6;
    white-space: pre-wrap;
    tab-size: 20;
    -moz-tab-size: 20;
    margin: 0.5em 0;
    padding: 0;
    background: transparent;
    border: none;
    overflow-x: auto;
}

/* Genealogy HTML Tables (v4 - proper column alignment) */
.genealogy-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    table-layout: fixed;
}

.genealogy-table td.genealogy-cell {
    padding: 0.3rem 0.5rem;
    vertical-align: top;
    line-height: 1.7;
    text-align: left;
}

.genealogy-table sup {
    font-size: 0.7em;
    color: #666;
    font-weight: normal;
    vertical-align: super;
    line-height: 0;
    margin-right: 1px;
}

/* Ensure gospel colors work inside table cells */
.genealogy-table .gospel-mt { color: #000000 !important; }
.genealogy-table .gospel-mk { color: #215868 !important; }
.genealogy-table .gospel-lk { color: #7030A0 !important; }
.genealogy-table .gospel-jn { color: #C00000 !important; }

@media (max-width: 768px) {
    .genealogy-table {
        font-size: 0.85em;
    }
    .genealogy-table td.genealogy-cell {
        padding: 0.2rem 0.3rem;
    }
}

/* ==========================================
   Topic Structure
   ========================================== */

.harmony-topic {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #e5e5e5;
}

.harmony-topic:last-child {
    border-bottom: none;
}

.topic-header {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: #1a1a1a;
}

.topic-reference {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 1rem;
    font-style: italic;
}

.topic-reference .gospel-mt,
.topic-reference .gospel-mk,
.topic-reference .gospel-lk,
.topic-reference .gospel-jn {
    font-weight: 600;
    font-style: normal;
}

/* ==========================================
   Text Content
   ========================================== */

.harmony-text {
    line-height: 1.7;
    margin: 0.5em 0;
    text-align: justify;
}

/* Direct speech (italic within color spans) */
.harmony-text em {
    font-style: italic;
}

/* Bold content (emphasized text, John's prologue, etc.) */
.harmony-text strong {
    font-weight: 600;
}

/* ==========================================
   Section Navigation
   ========================================== */

.section-nav {
    display: flex;
    justify-content: space-between;
    margin: 2rem 0;
    padding-top: 1rem;
    border-top: 1px solid #e5e5e5;
}

.section-nav a {
    padding: 0.5rem 1rem;
    background: #f0f0f0;
    border-radius: 4px;
    text-decoration: none;
    color: #333;
}

.section-nav a:hover {
    background: #e0e0e0;
}

/* ==========================================
   Topics Index/Grid
   ========================================== */

.harmony-topics-grid {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.topic-link {
    display: block;
    padding: 0.5rem;
    text-decoration: none;
    color: #333;
    border-radius: 4px;
}

.topic-link:hover {
    background: #f5f5f5;
}

.topic-link .ref {
    color: #666;
    font-size: 0.85em;
}

/* ==========================================
   Intro Section
   ========================================== */

.harmony-intro {
    font-size: 1.1rem;
    line-height: 1.6;
    color: #444;
    margin-bottom: 1.5rem;
}

.harmony-start {
    margin: 2rem 0;
    text-align: center;
}

/* btn-primary and btn-large are defined earlier in file - removed duplicate blue definition */

/* ==========================================
   Dropdown Navigation
   ========================================== */

.harmony-dropdown {
    position: relative;
    margin-bottom: 1rem;
}

.harmony-dropdown select {
    width: 100%;
    padding: 0.75rem;
    font-size: 1rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: white;
    cursor: pointer;
}

/* ==========================================
   Responsive Adjustments
   ========================================== */

@media (max-width: 768px) {
    .genealogy-text {
        font-size: 0.9em;
        tab-size: 12;
        -moz-tab-size: 12;
    }
    
    .harmony-legend {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .topic-header {
        font-size: 1.1rem;
    }
}

/* ==========================================
   Print Styles
   ========================================== */

@media print {
    .gospel-mt { color: #000000 !important; }
    .gospel-mk { color: #215868 !important; }
    .gospel-lk { color: #7030A0 !important; }
    .gospel-jn { color: #C00000 !important; }
    
    .section-nav,
    .harmony-dropdown {
        display: none;
    }
    
    .harmony-topic {
        page-break-inside: avoid;
    }
}

/* ==========================================
   Essay Overflow Fix - Prevent Horizontal Scrolling
   ========================================== */

.essay {
    max-width: 100%;
    overflow-x: hidden;
}

.essay-content {
    overflow-x: hidden;
}

.content-body {
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
    overflow-x: hidden;
}

/* Handle long URLs and strings */
.content-body a,
.content-body p,
.content-body li {
    overflow-wrap: break-word;
    word-wrap: break-word;
}

/* Prevent tables from causing overflow */
.content-body table {
    max-width: 100%;
    overflow-x: auto;
    display: block;
}

/* Prevent pre/code blocks from causing overflow */
.content-body pre,
.content-body code {
    max-width: 100%;
    overflow-x: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* ============================================
   PDF DOWNLOAD LINK
   ============================================ */

/* Default style — small inline next to author/meta */
.pdf-download {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-family: var(--font-ui, 'Source Sans Pro', sans-serif);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-text-muted, #888);
    text-decoration: none;
    border: 1px solid var(--color-border, #e5e5e5);
    border-radius: 4px;
    padding: 0.15rem 0.45rem;
    transition: all 0.15s ease;
    letter-spacing: 0.03em;
    vertical-align: middle;
    margin-left: 0.5rem;
}

.pdf-download:hover {
    color: var(--color-accent, #9c7c38);
    border-color: var(--color-accent, #9c7c38);
}

.pdf-download svg {
    flex-shrink: 0;
}

/* Toolbar variant (chapter reader) — matches AA button */
.pdf-btn-minimal {
    padding: 0.45rem 0.65rem;
}

.pdf-btn-minimal:hover {
    border-color: var(--color-accent, #9c7c38);
    background: var(--color-bg-alt, #f9f9f9);
}
