/* Red Dawn Website - Unified Stylesheet */
/* Theme: Revolutionary red with cream card aesthetic */

/* ========================================
   CSS Reset & Base Styles
   ======================================== */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Source Serif 4', Georgia, serif;
    background: linear-gradient(135deg, #2a0a0a 0%, #1a0505 100%);
    min-height: 100vh;
    color: #f5f0e8;
}

/* ========================================
   Floating Red Star (Brand Element)
   ======================================== */

.floating-star {
    position: fixed;
    bottom: 15px;
    right: 15px;
    width: 60px;
    height: 60px;
    opacity: 0.7;
    pointer-events: none;
    z-index: 100;
}

.floating-star svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 0 20px rgba(139, 0, 0, 0.5));
}

/* ========================================
   Header
   ======================================== */

header {
    background: #8b0000;
    padding: 0.6rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.header-title-row {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    flex-wrap: wrap;
}

header h1 {
    font-family: 'Noto Serif SC', 'Source Serif 4', Georgia, serif;
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 0.05em;
}

header h1 a {
    color: inherit;
    text-decoration: none;
}

header h1 a:hover {
    text-decoration: underline;
}

.header-quote-en {
    font-family: 'Source Serif 4', Georgia, serif;
    font-size: 0.9rem;
    font-style: italic;
    opacity: 0.9;
}

.header-quote-cn {
    font-family: 'Noto Serif SC', serif;
    font-size: 0.7rem;
    opacity: 0.7;
}

header nav a {
    color: #f5f0e8;
    text-decoration: none;
    margin-left: 1.5rem;
    font-size: 0.9rem;
    opacity: 0.9;
}

header nav a:hover {
    opacity: 1;
    text-decoration: underline;
}

/* ========================================
   Main Content Area
   ======================================== */

main {
    max-width: 700px;
    margin: 0 auto;
    padding: 3rem 1.5rem;
}

/* Wider main for volume pages */
main.wide {
    max-width: 900px;
}

/* ========================================
   Card Container (Cream Background)
   ======================================== */

.card {
    background: #f5f0e8;
    color: #1a0505;
    border-radius: 8px;
    padding: 2.5rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

/* ========================================
   Typography
   ======================================== */

.title {
    font-family: 'Noto Serif SC', serif;
    font-size: 2.5rem;
    color: #8b0000;
    margin-bottom: 0.5rem;
}

.page-title {
    font-family: 'Noto Serif SC', serif;
    font-size: 2rem;
    color: #8b0000;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #8b0000;
    padding-bottom: 0.5rem;
}

.subtitle {
    font-size: 1.1rem;
    color: #666;
    font-style: italic;
    margin-bottom: 1.5rem;
}

.description {
    margin-bottom: 2rem;
    line-height: 1.7;
    color: #333;
}

h2 {
    font-size: 1.1rem;
    color: #8b0000;
    margin: 2rem 0 1rem;
    border-bottom: 1px solid #ddd;
    padding-bottom: 0.3rem;
}

h2:first-of-type {
    margin-top: 0;
}

/* ========================================
   Content Styles (About Page)
   ======================================== */

.content {
    line-height: 1.8;
    color: #333;
}

.content p {
    margin-bottom: 1rem;
}

.content ul {
    margin: 1rem 0 1rem 1.5rem;
}

.content li {
    margin-bottom: 0.5rem;
}

.content a {
    color: #8b0000;
    text-decoration: none;
}

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

.highlight-box {
    background: #fff8f0;
    border-left: 4px solid #8b0000;
    padding: 1rem 1.25rem;
    margin: 1.5rem 0;
    font-style: italic;
}

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

.stat-item {
    text-align: center;
    padding: 1rem;
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.stat-number {
    font-size: 1.75rem;
    font-weight: 700;
    color: #8b0000;
}

.stat-label {
    font-size: 0.85rem;
    color: #666;
    margin-top: 0.25rem;
}

/* ========================================
   Volume List (Index Page)
   ======================================== */

.volumes {
    list-style: none;
}

.volumes li {
    margin: 0.6rem 0;
}

.volumes a {
    color: #8b0000;
    text-decoration: none;
}

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

.volumes .unavailable {
    color: #999;
}

.volumes .status {
    font-size: 0.8rem;
    color: #666;
    font-style: italic;
}

/* ========================================
   Chapter List (Volume Pages)
   ======================================== */

.chapters {
    list-style: none;
    column-count: 2;
    column-gap: 2rem;
}

.chapters li {
    margin: 0.4rem 0;
    break-inside: avoid;
}

.chapters a {
    color: #333;
    text-decoration: none;
}

.chapters a:hover {
    color: #8b0000;
    text-decoration: underline;
}

.chapter-num {
    color: #8b0000;
    font-weight: 600;
    margin-right: 0.3rem;
}

/* ========================================
   Chapter Reading Page
   ======================================== */

.chapter-header {
    margin-bottom: 2rem;
    border-bottom: 1px solid #ddd;
    padding-bottom: 1rem;
}

.chapter-title {
    font-family: 'Noto Serif SC', serif;
    font-size: 1.75rem;
    color: #8b0000;
    margin-bottom: 0.5rem;
}

.chapter-subtitle {
    font-size: 0.9rem;
    color: #666;
    font-style: italic;
}

.chapter-content {
    line-height: 1.9;
    font-size: 1.1rem;
}

.chapter-content p {
    margin-bottom: 1.25rem;
    text-indent: 1.5em;
}

.chapter-content p:first-child {
    text-indent: 0;
}

/* Chapter Navigation */
.chapter-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.chapter-nav.nav-top {
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #ddd;
}

.chapter-nav.nav-bottom {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #ddd;
}

.chapter-nav a {
    color: #8b0000;
    text-decoration: none;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border: 1px solid #8b0000;
    border-radius: 4px;
    transition: background 0.2s, color 0.2s;
}

.chapter-nav a:hover {
    background: #8b0000;
    color: #f5f0e8;
}

.chapter-nav .disabled {
    opacity: 0.3;
    pointer-events: none;
}

.chapter-nav .toc {
    border: none;
}

/* ========================================
   404 Page
   ======================================== */

body.page-404 {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
}

body.page-404 h1 {
    font-family: 'Noto Serif SC', serif;
    font-size: 4rem;
    color: #8b0000;
    margin-bottom: 1rem;
}

body.page-404 p {
    color: #a89880;
    margin-bottom: 2rem;
}

body.page-404 a {
    color: #d4a574;
    text-decoration: none;
}

body.page-404 a:hover {
    text-decoration: underline;
}

/* ========================================
   Footer
   ======================================== */

footer {
    text-align: center;
    padding: 2rem;
    color: #888;
    font-size: 0.85rem;
}

footer .chinese {
    font-family: 'Noto Serif SC', serif;
    color: #8b0000;
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

/* ========================================
   Responsive Design
   ======================================== */

@media (max-width: 600px) {
    .floating-star {
        width: 40px;
        height: 40px;
        bottom: 8px;
        right: 8px;
    }

    header {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }

    header nav {
        margin-top: 0.5rem;
    }

    header nav a {
        margin: 0 0.75rem;
    }

    .title {
        font-size: 2rem;
    }

    .page-title {
        font-size: 1.5rem;
    }

    .chapters {
        column-count: 1;
    }

    .chapter-content {
        font-size: 1rem;
    }
}