/* Base styles for static device reading (no pagination) */

/* Basic typography for screen reading */
body {
    font-family: "Georgia", "Times New Roman", serif;
    font-size: 18px;
    line-height: 1.6;
    margin: 0;
    padding: 20px;
    max-width: 800px;
    margin: 0 auto;
    background-color: #ffffff;
    color: #333333;
    hyphens: auto;
    -webkit-hyphens: auto;
    -ms-hyphens: auto;
}

/* Responsive font sizing */
@media (max-width: 768px) {
    body {
        font-size: x-large;
        padding: 10px;
    }
    p {
        font-size: x-large;
    }
    
    /* Keep headings at reasonable sizes on small screens */
    h1 {
        font-size: 1.5em;
    }
    
    h2 {
        font-size: 1.25em;
    }
    
    h3 {
        font-size: 1.1em;
    }
    
    h4, h5, h6 {
        font-size: 1em;
    }
}

/* Common heading styles */
h1, h2, h3, h4, h5, h6 {
    font-weight: bold;
    margin-top: 1.5em;
    margin-bottom: 0.75em;
    color: #222222;
}

/* TOC back-link styling */
.toc-backlink {
    display: inline-block;
    margin-top: 0.5em;
    margin-bottom: 1em;
}

@media (max-width: 768px) {
    .toc-backlink {
        font-size: 0.9em;
    }
}

/* Heading size variations */
h1 {
    font-size: 1.5em;
    margin-top: 1em;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 0.3em;
}

h2 {
    font-size: 1.3em;
}

h3 {
    font-size: 1.15em;
}

h4 {
    font-size: 1.05em;
}

h5, h6 {
    font-size: 1em;
}

p {
    margin-bottom: 1em;
}

blockquote {
    font-style: italic;
    margin: 1em 0;
    padding-left: 1em;
    border-left: 4px solid #ccc;
    color: #555;
}

/* Image styling for responsive sizing */
img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 1.5em auto;
}

/* For smaller images that should stay inline */
p img {
    max-width: 100%;
    display: inline-block;
    vertical-align: middle;
}

/* Title page styling */
.title-page {
    text-align: center;
    padding: 3em 0;
    margin-bottom: 3em;
    border-bottom: 2px solid #e0e0e0;
}

.title-page h1 {
    font-size: 2.5em;
    margin-bottom: 0.5em;
    border: none;
}

/* Section spacing */
.front-matter-content,
.body-content,
.back-matter-content {
    margin-bottom: 2em;
}

/* Arc styling */
.arc-title {
    text-align: center;
    margin: 3em 0 2em 0;
}

.arc-title h1 {
    font-size: 2em;
    color: #444;
}

/* Lists */
ul, ol {
    margin: 1em 0;
    padding-left: 2em;
}

li {
    margin-bottom: 0.5em;
}

/* Tables */
table {
    border-collapse: collapse;
    width: 100%;
    margin: 1.5em 0;
    overflow-x: auto;
    display: block;
}

@media (max-width: 768px) {
    table {
        font-size: 0.9em;
    }
}

th, td {
    border: 1px solid #ddd;
    padding: 8px 12px;
    text-align: left;
}

th {
    background-color: #f4f4f4;
    font-weight: bold;
}

/* Code blocks */
pre {
    background-color: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 1em;
    overflow-x: auto;
    margin: 1em 0;
}

code {
    font-family: "Courier New", monospace;
    font-size: 0.9em;
    background-color: #f5f5f5;
    padding: 2px 4px;
    border-radius: 3px;
}

pre code {
    background-color: transparent;
    padding: 0;
}

/* Links */
a {
    color: #0066cc;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

a:visited {
    color: #551a8b;
}

/* Footnotes for screen display */
.footnote {
    font-size: 0.9em;
    color: #666;
    border-left: 3px solid #e0e0e0;
    padding-left: 1em;
    margin: 1em 0;
}

/* Print styles */
@media print {
    body {
        max-width: none;
        padding: 0;
        font-size: 12pt;
    }
    
    .title-page,
    .arc-title {
        page-break-after: always;
    }
    
    h1, h2, h3, h4, h5, h6 {
        page-break-after: avoid;
    }
    
    pre, blockquote, table {
        page-break-inside: avoid;
    }
}
