/* Base styles */
html {
    background-color: #f5f5f0;
    -webkit-font-smoothing: antialiased;
}

body {
    margin: 0;
    padding: 0;
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Layout container */
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 1.5rem 4rem;
    background-color: #fffef8;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
    min-height: 100vh;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    color: #2c2c2c;
    font-weight: 600;
    line-height: 1.3;
    margin: 0 0 0.5em;
}

h1 {
    font-size: 2.25rem;
    text-align: center;
    margin-bottom: 0.25rem;
}

h2 {
    font-size: 1.5rem;
    margin-top: 2rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e0dcc8;
}

h3 {
    font-size: 1.15rem;
}

p {
    margin: 0 0 1rem;
}

/* Header */
.site-header {
    text-align: center;
    padding-bottom: 1.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #e8e4d8;
}

.tagline {
    font-size: 1.1rem;
    color: #666;
    font-style: italic;
}

.scripture-refs {
    text-align: center;
    margin-top: 0.5rem;
    color: #555;
    font-size: 0.95rem;
}

/* Sections */
section {
    margin-bottom: 2.5rem;
}

/* Introduction */
.intro {
    font-size: 1.1rem;
    color: #444;
    max-width: 700px;
    margin: 0 auto;
    text-align: center;
    line-height: 1.7;
}

/* Cards for studies */
.studies-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.study-card {
    background: #fafaf5;
    border: 1px solid #e8e4d8;
    border-radius: 8px;
    padding: 1.25rem;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.study-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.study-card h3 {
    margin-bottom: 0.5rem;
}

.study-card h3 a {
    color: #2c5a2c;
    text-decoration: none;
}

.study-card h3 a:hover {
    text-decoration: underline;
}

.study-card p {
    font-size: 0.9rem;
    color: #555;
    margin-bottom: 0;
}

.study-links {
    font-size: 0.85rem;
    margin-top: 0.5rem;
    display: block;
}

.study-links a {
    color: #2c5a2c;
    text-decoration: none;
}

.study-links a:hover {
    text-decoration: underline;
}

.study-date {
    font-size: 0.8rem;
    color: #888;
    margin-top: 0.5rem;
    display: block;
}

/* Calendar table */
.calendar-section h2 {
    text-align: center;
    border-bottom: none;
    margin-bottom: 1rem;
}

.calendar-note {
    font-size: 0.9rem;
    color: #666;
    text-align: center;
    margin-bottom: 1.5rem;
    font-style: italic;
}

.table-wrapper {
    overflow-x: auto;
    margin: 0 -1rem;
    padding: 0 1rem;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    min-width: 600px;
}

th, td {
    padding: 0.75rem 0.5rem;
    text-align: left;
    border-bottom: 1px solid #e8e4d8;
}

th {
    background: #f0ede5;
    font-weight: 600;
    color: #2c2c2c;
}

tr:hover {
    background: #fafaf5;
}

.calendar-footnote {
    font-size: 0.85rem;
    color: #666;
    margin-top: 1rem;
    padding: 0.75rem;
    background: #f5f5f0;
    border-radius: 4px;
}

/* Footer */
.site-footer {
    text-align: center;
    padding-top: 2rem;
    margin-top: 2rem;
    border-top: 1px solid #e8e4d8;
    font-size: 0.9rem;
    color: #666;
}

.contact-info {
    margin-bottom: 0.5rem;
}

.contact-info img {
    position: relative;
    top: 4px;
}

/* Links */
a {
    color: #2c5a2c;
}

a:hover {
    color: #1a3a1a;
}

/* Mobile responsive */
@media (max-width: 600px) {
    .container {
        padding: 1.25rem 1rem 3rem;
    }

    h1 {
        font-size: 1.75rem;
    }

    .studies-grid {
        grid-template-columns: 1fr;
    }

    table {
        font-size: 0.8rem;
    }

    th, td {
        padding: 0.5rem 0.4rem;
    }
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    overflow-y: auto;
}

.modal-content {
    background-color: #fffef8;
    margin: 5% auto;
    padding: 0;
    border-radius: 8px;
    max-width: 800px;
    width: 90%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 2rem;
    font-weight: bold;
    color: #666;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    line-height: 1;
}

.modal-close:hover {
    color: #333;
}

.modal-body {
    padding: 2rem;
    overflow-y: auto;
    flex: 1;
}

.modal-body h1 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

.modal-body h2 {
    font-size: 1.25rem;
    margin-top: 1.5rem;
    border-bottom: 1px solid #e0dcc8;
    padding-bottom: 0.25rem;
}

.modal-body h3 {
    font-size: 1.1rem;
    margin-top: 1rem;
}

.modal-body p {
    margin-bottom: 0.75rem;
    line-height: 1.7;
}

.modal-body ul, .modal-body ol {
    margin-bottom: 0.75rem;
    padding-left: 1.5rem;
}

.modal-body li {
    margin-bottom: 0.25rem;
    line-height: 1.6;
}

.modal-body a {
    color: #2c5a2c;
}

.modal-body strong {
    font-weight: 600;
}

.modal-body em {
    font-style: italic;
}

.modal-body blockquote {
    border-left: 3px solid #e0dcc8;
    padding-left: 1rem;
    margin: 1rem 0;
    color: #555;
    font-style: italic;
}

.modal-body code {
    background: #f5f5f0;
    padding: 0.15rem 0.3rem;
    border-radius: 3px;
    font-family: monospace;
    font-size: 0.9em;
}

.modal-body pre {
    background: #f5f5f0;
    padding: 1rem;
    border-radius: 4px;
    overflow-x: auto;
}

.modal-body hr {
    border: none;
    border-top: 1px solid #e0dcc8;
    margin: 1.5rem 0;
}

.modal-footer {
    padding: 1rem 2rem;
    border-top: 1px solid #e0dcc8;
    background: #f5f5f0;
    border-radius: 0 0 8px 8px;
}

.btn-download {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: #2c5a2c;
    color: white !important;
    text-decoration: none;
    border-radius: 4px;
}

.btn-download:hover {
    background: #1a3a1a;
}

.loading {
    text-align: center;
    color: #666;
    font-style: italic;
}

.error {
    color: #a00;
}