/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Georgia, 'Times New Roman', serif;
    line-height: 1.6;
    color: #333;
    background: #fafafa;
}

/* Header */
header {
    background: #2c3e50;
    color: white;
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

nav {
    max-width: 1200px;
    margin: 0 auto;
}

.site-title {
    color: white;
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: bold;
}

.site-title:hover {
    text-decoration: underline;
}

.site-subtitle {
    color: #bdc3c7;
    margin-left: 1rem;
}

/* Main content */
main {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 2rem;
}

h1 {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: #2c3e50;
}

h2 {
    font-size: 1.5rem;
    margin: 2rem 0 1rem;
    color: #34495e;
    border-bottom: 2px solid #3498db;
    padding-bottom: 0.5rem;
}

h3 {
    font-size: 1.2rem;
    margin: 1.5rem 0 0.5rem;
    color: #2c3e50;
}

/* Home page stats */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin: 2rem 0;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-align: center;
}

.stat-card .number {
    font-size: 2.5rem;
    font-weight: bold;
    color: #3498db;
}

.stat-card .label {
    color: #7f8c8d;
    margin-top: 0.5rem;
}

/* Journal series */
.journal-series {
    background: white;
    padding: 1.5rem;
    margin: 1rem 0;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.journal-series h3 {
    margin-top: 0;
}

.journal-series .years {
    color: #7f8c8d;
    font-size: 0.9rem;
}

/* Volume list */
.volume-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 0.5rem;
    margin-top: 1rem;
}

.volume-link {
    display: block;
    background: #ecf0f1;
    padding: 0.5rem;
    text-align: center;
    text-decoration: none;
    color: #2c3e50;
    border-radius: 4px;
    transition: background 0.2s;
}

.volume-link:hover {
    background: #3498db;
    color: white;
}

/* Article list */
.article-list {
    list-style: none;
}

.article-item {
    background: white;
    padding: 1rem 1.5rem;
    margin: 0.5rem 0;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.article-item:hover {
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.article-title {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.article-title a {
    color: #2c3e50;
    text-decoration: none;
}

.article-title a:hover {
    color: #3498db;
    text-decoration: underline;
}

.article-meta {
    font-size: 0.9rem;
    color: #7f8c8d;
}

.article-meta .authors {
    color: #555;
}

.article-meta .pages {
    margin-left: 1rem;
}

/* Article page */
.article-header {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.article-header h1 {
    margin-bottom: 1rem;
}

.article-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 4px;
}

.detail-item {
    display: flex;
    flex-direction: column;
}

.detail-label {
    font-size: 0.8rem;
    color: #7f8c8d;
    text-transform: uppercase;
}

.detail-value {
    font-size: 1rem;
    color: #2c3e50;
}

/* Download buttons */
.download-links {
    margin: 1.5rem 0;
}

.download-btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    margin-right: 0.5rem;
    background: #3498db;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.download-btn:hover {
    background: #2980b9;
}

.download-btn.secondary {
    background: #95a5a6;
}

.download-btn.secondary:hover {
    background: #7f8c8d;
}

/* OCR text */
.ocr-text {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    white-space: pre-wrap;
    font-family: Georgia, serif;
    font-size: 1rem;
    line-height: 1.8;
    max-height: 80vh;
    overflow-y: auto;
}

/* Breadcrumb */
.breadcrumb {
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.breadcrumb a {
    color: #3498db;
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb span {
    color: #7f8c8d;
    margin: 0 0.5rem;
}

/* Footer */
footer {
    background: #2c3e50;
    color: #bdc3c7;
    padding: 2rem;
    margin-top: 4rem;
    text-align: center;
}

footer a {
    color: #3498db;
}

/* Navigation */
nav {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-link {
    color: #bdc3c7;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background 0.2s, color 0.2s;
}

.nav-link:hover {
    background: rgba(255,255,255,0.1);
    color: white;
}

.search-link {
    margin-left: auto;
    background: rgba(52, 152, 219, 0.3);
}

.search-link:hover {
    background: #3498db;
}

/* Search page */
#search {
    margin: 2rem 0;
}

.search-tips {
    background: white;
    padding: 1.5rem 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-top: 2rem;
}

.search-tips ul {
    margin-left: 1.5rem;
    margin-top: 1rem;
}

.search-tips li {
    margin: 0.5rem 0;
    color: #555;
}

/* Pagefind UI overrides */
.pagefind-ui {
    --pagefind-ui-scale: 1;
    --pagefind-ui-primary: #3498db;
    --pagefind-ui-text: #2c3e50;
    --pagefind-ui-background: #ffffff;
    --pagefind-ui-border: #ecf0f1;
    --pagefind-ui-tag: #ecf0f1;
    --pagefind-ui-border-width: 2px;
    --pagefind-ui-border-radius: 8px;
    --pagefind-ui-font: Georgia, 'Times New Roman', serif;
}

.pagefind-ui__search-input {
    font-size: 1.1rem !important;
    padding: 1rem !important;
}

.pagefind-ui__result {
    padding: 1rem !important;
    border-radius: 8px !important;
    margin: 0.5rem 0 !important;
    background: white !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1) !important;
}

.pagefind-ui__result:hover {
    box-shadow: 0 2px 6px rgba(0,0,0,0.15) !important;
}

.pagefind-ui__result-link {
    color: #2c3e50 !important;
    font-size: 1.1rem !important;
}

.pagefind-ui__result-link:hover {
    color: #3498db !important;
}

.pagefind-ui__result-excerpt {
    color: #555 !important;
    font-size: 0.95rem !important;
}

/* Responsive */
@media (max-width: 768px) {
    main {
        padding: 0 1rem;
    }

    .volume-grid {
        grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    }

    nav {
        flex-wrap: wrap;
    }

    .search-link {
        margin-left: 0;
        margin-top: 0.5rem;
    }
}
