/* Typography System - Typewriter Aesthetic */

body {
    font-family: var(--font-mono);
    font-size: var(--font-size-md);
    line-height: var(--line-height-relaxed);
    color: var(--color-text-primary);
    background-color: var(--color-background);
}

/* Reading-optimized body text - Traditional book formatting */
.chapter-body {
    font-family: var(--font-serif);
    font-size: var(--font-size-reader);
    line-height: 1.4;
    color: var(--color-text-primary);
    text-align: justify;
}

.chapter-body p {
    margin-bottom: 0;
    text-indent: 0.5in;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* No indent for first paragraph of chapter */
.chapter-body .page-container > p:first-child {
    text-indent: 0;
}

/* No indent for dateline paragraphs, block quotes, or paragraphs following section breaks */
.chapter-body p.has-dateline,
.chapter-body p.no-indent,
.chapter-body p.block-quote,
.chapter-body .scene-break + p,
.chapter-body .block-quote + p {
    text-indent: 0;
}

/* Signature block - right aligned with spacing */
.chapter-body .signature {
    text-align: right;
    text-indent: 0;
    margin-top: var(--space-xl);
    font-style: italic;
}

/* Chapter titles - Typewriter style with uppercase and letter-spacing */
.chapter-title {
    font-family: var(--font-mono);
    font-size: 1.875rem;
    line-height: var(--line-height-tight);
    font-weight: bold;
    color: var(--color-text-primary);
    margin-bottom: var(--space-md);
    text-transform: uppercase;
    letter-spacing: var(--letter-spacing-wide);
    text-align: center;
}

.chapter-subtitle {
    font-family: var(--font-mono);
    font-size: var(--font-size-sm);
    line-height: var(--line-height-normal);
    color: var(--color-text-secondary);
    font-style: italic;
    margin-bottom: var(--space-sm);
    letter-spacing: var(--letter-spacing-tight);
}

.chapter-meta {
    font-family: var(--font-mono);
    font-size: var(--font-size-sm);
    color: var(--color-text-tertiary);
    margin-bottom: 0;
}

/* Header typography */
.header-title {
    font-family: var(--font-mono);
    font-size: 1.25rem;
    font-weight: bold;
    
    color: var(--color-text-primary);
    text-transform: uppercase;
    letter-spacing: var(--letter-spacing-normal);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    cursor: pointer;
}

.header-title:hover {
    opacity: 0.8;
}

/* Progress text */
.progress-text {
    font-family: var(--font-mono);
    font-size: var(--font-size-xs);
    color: var(--color-text-secondary);
    font-weight: normal;
}

/* Navigation buttons */
.nav-btn {
    font-family: var(--font-mono);
    font-size: var(--font-size-sm);
    font-weight: bold;
    color: var(--color-text-primary);
    text-transform: uppercase;
    letter-spacing: var(--letter-spacing-tight);
}

/* Table of Contents */
.toc-header h2 {
    font-family: var(--font-mono);
    font-size: var(--font-size-sm);
    font-weight: bold;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: var(--letter-spacing-normal);
}

.toc-chapter-title {
    font-family: var(--font-mono);
    font-size: var(--font-size-xs);
    line-height: var(--line-height-normal);
    color: var(--color-text-primary);
}

.toc-chapter-subtitle {
    font-family: var(--font-mono);
    font-size: var(--font-size-xs);
    line-height: var(--line-height-normal);
    color: var(--color-text-secondary);
    font-style: italic;
}

.overall-progress {
    font-family: var(--font-mono);
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    text-align: center;
}

/* Small caps - for headlines/tickers within text */
.small-caps {
    font-size: 0.85em;
    letter-spacing: 0.02em;
}

/* Headline blocks - centered bold text with spacing */
.headline-block {
    display: block;
    text-align: center;
    font-family: Arial, Helvetica, sans-serif;
    font-weight: bold;
    margin: 1.5em 0;
    text-indent: 0 !important;
}

/* Mobile - smaller header to prevent wrapping */
@media (max-width: 599px) {
    .header-title {
        font-size: var(--font-size-lg);
        letter-spacing: 1px;
    }
}

/* Tablet and up */
@media (min-width: 600px) {
    .chapter-title {
        font-size: var(--font-size-2xl);
    }
}
