/* Wizard's First Rule - Book Website Styles */

/* Color Scheme Variables */
:root {
    --bg-primary: #f9f7f4;      /* Parchment */
    --bg-secondary: #ffffff;
    --text-primary: #2c2416;     /* Dark brown */
    --text-secondary: #5a4a3a;
    --accent: #8b4513;           /* Saddle brown */
    --link: #1a5490;
    --link-hover: #0d3a6b;
    --border-color: #d4c5b0;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 18px;
    line-height: 1.7;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Palatino Linotype', 'Book Antiqua', Palatino, serif;
    color: var(--accent);
    margin-top: 1.5em;
    margin-bottom: 0.5em;
    line-height: 1.3;
}

h1 {
    font-size: 2.5em;
    border-bottom: 3px solid var(--accent);
    padding-bottom: 0.3em;
    margin-top: 0;
}

h2 {
    font-size: 2em;
}

h3 {
    font-size: 1.5em;
}

p {
    margin-bottom: 1.2em;
}

/* Links */
a {
    color: var(--link);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.2s ease;
}

a:hover {
    color: var(--link-hover);
    border-bottom-color: var(--link-hover);
}

a:visited {
    color: #5a3a8b;
}

/* Header and Navigation */
header {
    margin-bottom: 2em;
}

.breadcrumb {
    font-size: 0.9em;
    color: var(--text-secondary);
    margin-bottom: 1em;
    padding: 0.5em 0;
}

.breadcrumb a {
    color: var(--text-secondary);
}

.breadcrumb a:hover {
    color: var(--link-hover);
}

.breadcrumb span {
    color: var(--text-primary);
    font-weight: bold;
}

/* Main Content */
main {
    background-color: var(--bg-secondary);
    padding: 2em;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 2em;
}

/* Chapter Content */
.chapter-content {
    margin-bottom: 2em;
}

.events-text {
    text-align: justify;
}

/* Named Characters Section */
.named-characters {
    background-color: var(--bg-primary);
    padding: 1.5em;
    border-radius: 5px;
    border-left: 4px solid var(--accent);
    margin-top: 2em;
}

.named-characters h3 {
    margin-top: 0;
    color: var(--accent);
}

.named-characters ul {
    list-style-type: none;
    padding-left: 0;
}

.named-characters li {
    margin-bottom: 0.8em;
    padding-left: 1.5em;
    position: relative;
}

.named-characters li:before {
    content: "•";
    color: var(--accent);
    font-weight: bold;
    position: absolute;
    left: 0;
}

/* Act Groups (Index Page) */
.act-group {
    margin-bottom: 2.5em;
}

.act-group h2 {
    color: var(--accent);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.3em;
}

.chapter-list {
    list-style-type: none;
    padding-left: 0;
}

.chapter-list li {
    margin-bottom: 0.5em;
    padding-left: 1.5em;
    position: relative;
}

.chapter-list li:before {
    content: "▸";
    color: var(--accent);
    position: absolute;
    left: 0;
}

/* Character List */
.character-entry {
    margin-bottom: 2.5em;
    padding-bottom: 1.5em;
    border-bottom: 1px solid var(--border-color);
}

.character-entry:last-child {
    border-bottom: none;
}

.character-entry h2 {
    margin-top: 0;
    color: var(--accent);
}

.character-entry p {
    color: var(--text-primary);
}

/* Quick Jump Navigation (Characters Page) */
.quick-jump {
    background-color: var(--bg-primary);
    padding: 1em;
    border-radius: 5px;
    margin-bottom: 2em;
    text-align: center;
}

.quick-jump a {
    display: inline-block;
    padding: 0.3em 0.6em;
    margin: 0.2em;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 3px;
    font-weight: bold;
}

.quick-jump a:hover {
    background-color: var(--accent);
    color: white;
    border-color: var(--accent);
}

/* Footer Navigation */
footer {
    margin-top: 2em;
    padding-top: 1.5em;
    border-top: 2px solid var(--border-color);
}

.chapter-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1em;
}

.chapter-nav a {
    padding: 0.8em 1.5em;
    background-color: var(--accent);
    color: white;
    border-radius: 5px;
    font-weight: bold;
    border-bottom: none;
    transition: background-color 0.2s ease;
}

.chapter-nav a:hover {
    background-color: #6d3710;
    color: white;
}

.chapter-nav .back-to-index {
    background-color: var(--text-secondary);
}

.chapter-nav .back-to-index:hover {
    background-color: var(--text-primary);
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        font-size: 16px;
        padding: 10px;
    }

    main {
        padding: 1.5em;
    }

    h1 {
        font-size: 2em;
    }

    h2 {
        font-size: 1.6em;
    }

    .chapter-nav {
        flex-direction: column;
    }

    .chapter-nav a {
        width: 100%;
        text-align: center;
    }
}

/* Print Styles */
@media print {
    body {
        background-color: white;
        color: black;
        max-width: 100%;
    }

    main {
        box-shadow: none;
        background-color: white;
    }

    .breadcrumb,
    footer,
    .quick-jump {
        display: none;
    }

    a {
        color: black;
        text-decoration: underline;
    }
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.mt-2 {
    margin-top: 2em;
}

.mb-2 {
    margin-bottom: 2em;
}

/* Back to Top Link */
.back-to-top {
    display: inline-block;
    margin-top: 1em;
    font-size: 0.9em;
    color: var(--text-secondary);
}

.back-to-top:hover {
    color: var(--link-hover);
}
