/* The Librarian's Index - Main Stylesheet */

/* Color Variables */
:root {
    --primary-color: #4c2c1c; /* Rich mahogany brown */
    --secondary-color: #124c2c; /* Deep emerald green */
    --accent-color: #c49b60; /* Burnished gold */
    --dark-accent: #1e293b; /* Midnight blue */
    --light-color: #f9f5ee; /* Parchment */
    --shadow-color: rgba(0, 0, 0, 0.1);
    --highlight-color: rgba(196, 155, 96, 0.2); /* Gold highlight */
    --text-color: #2c2018; /* Dark brown text */
    --quote-color: #1e293b; /* Dark blue for quotes */
}

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Source Sans Pro', sans-serif;
    background-color: var(--light-color);
    color: var(--text-color);
    line-height: 1.6;
    font-size: 16px;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

a {
    text-decoration: none;
    color: var(--secondary-color);
    transition: all 0.3s ease;
}

a:hover {
    color: var(--accent-color);
}

img {
    max-width: 100%;
    height: auto;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 0;
}

/* First Letter Styling for Literary Feel */
.first-letter::first-letter {
    font-family: 'Playfair Display', serif;
    font-size: 3.5em;
    line-height: 0.8;
    float: left;
    padding-right: 0.1em;
    color: var(--secondary-color);
}

/* Button Styles */
.cta-button, .secondary-button, .submit-button {
    display: inline-block;
    padding: 0.8rem 1.8rem;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.cta-button {
    background-color: var(--secondary-color);
    color: var(--light-color);
    box-shadow: 0 4px 6px var(--shadow-color);
}

.cta-button:hover {
    background-color: var(--primary-color);
    color: var(--light-color);
    transform: translateY(-2px);
    box-shadow: 0 6px 8px var(--shadow-color);
}

.secondary-button {
    background-color: transparent;
    color: var(--secondary-color);
    border: 2px solid var(--secondary-color);
}

.secondary-button:hover {
    background-color: var(--secondary-color);
    color: var(--light-color);
}

.submit-button {
    background-color: var(--accent-color);
    color: var(--primary-color);
    font-weight: bold;
    width: 100%;
}

.submit-button:hover {
    background-color: var(--primary-color);
    color: var(--light-color);
}

/* Header */
header {
    background-color: var(--primary-color);
    color: var(--light-color);
    padding: 1.5rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.header-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

header h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: var(--light-color);
}

header h2 {
    font-size: 1rem;
    font-weight: 400;
    margin-bottom: 1rem;
    color: var(--accent-color);
}

nav ul {
    display: flex;
    list-style: none;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

nav a {
    color: var(--light-color);
    font-weight: 600;
    padding: 0.5rem;
    position: relative;
}

nav a:hover {
    color: var(--accent-color);
}

nav a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: var(--accent-color);
    transition: width 0.3s ease;
}

nav a:hover::after {
    width: 100%;
}

/* Hero Section */
.hero {
    position: relative;
    min-height: 80vh;
    display: flex;
    align-items: center;
    background: linear-gradient(to bottom, var(--dark-accent), var(--primary-color));
    padding: 2rem 0;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><text y="50" x="50" font-size="80" text-anchor="middle" fill="rgba(255,255,255,0.03)">📚</text></svg>');
    background-size: 200px;
    opacity: 0.1;
    z-index: 1;
}

.hero-content {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.book-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.book-cover {
    flex: 1;
    position: relative;
    max-width: 350px;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease;
    border-radius: 4px;
    overflow: hidden;
}

.book-cover:hover {
    transform: translateY(-10px) rotate(2deg);
}

.book-cover img {
    width: 100%;
    height: auto;
    display: block;
}

.book-info {
    flex: 1;
    color: var(--light-color);
    text-align: center;
    max-width: 600px;
}

.book-info h2 {
    font-size: 1.8rem;
    color: var(--accent-color);
    margin-bottom: 1rem;
    font-style: italic;
}

.book-info .tagline {
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

/* About Section */
.about-section {
    background-color: var(--light-color);
    padding: 4rem 0;
}

.about-content {
    max-width: 800px;
    margin: 0 auto;
}

.about-content p {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

.book-quote {
    background-color: var(--highlight-color);
    padding: 2rem;
    border-left: 4px solid var(--accent-color);
    margin: 2rem 0;
    font-style: italic;
}

.book-quote p {
    font-family: 'Playfair Display', serif;
    font-size: 1.3rem;
    color: var(--quote-color);
    line-height: 1.6;
    margin-bottom: 0;
}

/* Characters Section */
.characters-section {
    background-color: var(--primary-color);
    padding: 4rem 0;
    color: var(--light-color);
}

.characters-section h2,
.characters-section h3 {
    color: var(--accent-color);
    text-align: center;
}

.characters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.character-card {
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.character-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
}

.character-image {
    height: 200px;
    background-size: cover;
    background-position: center;
    border-bottom: 3px solid var(--accent-color);
}

.character-image.mira {
    background-image: linear-gradient(rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.1)), url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><text y="50" x="50" font-size="80" text-anchor="middle" fill="rgba(255,255,255,0.6)">👩‍🦰</text></svg>');
    background-color: var(--secondary-color);
}

.character-image.paige {
    background-image: linear-gradient(rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.1)), url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><text y="50" x="50" font-size="80" text-anchor="middle" fill="rgba(255,255,255,0.6)">👨</text></svg>');
    background-color: var(--dark-accent);
}

.character-image.bookworm {
    background-image: linear-gradient(rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.1)), url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><text y="50" x="50" font-size="80" text-anchor="middle" fill="rgba(255,255,255,0.6)">🐉</text></svg>');
    background-color: #8b3a19;
}

.character-image.wellsbrook {
    background-image: linear-gradient(rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.1)), url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><text y="50" x="50" font-size="80" text-anchor="middle" fill="rgba(255,255,255,0.6)">👵</text></svg>');
    background-color: #6b4226;
}

.character-card h3 {
    padding: 1rem 1rem 0.5rem;
    font-size: 1.2rem;
    text-align: center;
}

.character-card p {
    padding: 0 1rem 1rem;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.9);
}

.characters-secondary {
    margin-top: 3rem;
}

.characters-secondary h3 {
    margin-bottom: 2rem;
}

.secondary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
}

.secondary-card {
    background-color: rgba(255, 255, 255, 0.05);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.secondary-card:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-5px);
}

.secondary-card h4 {
    color: var(--accent-color);
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.secondary-card p {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.9);
}

/* Magical World Section */
.magical-world-section {
    background-color: var(--light-color);
    padding: 4rem 0;
    position: relative;
    overflow: hidden;
}

.magical-world-section::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 40%;
    height: 100%;
    background-image: linear-gradient(to right, transparent, var(--highlight-color));
    z-index: 1;
    opacity: 0.7;
}

.world-content {
    position: relative;
    z-index: 2;
}

.world-item {
    margin-bottom: 3rem;
}

.world-item h3 {
    color: var(--secondary-color);
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--accent-color);
    padding-bottom: 0.5rem;
    display: inline-block;
}

.magic-types {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.magic-type {
    background-color: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 5px 15px var(--shadow-color);
    transition: all 0.3s ease;
    border-top: 3px solid var(--secondary-color);
}

.magic-type:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px var(--shadow-color);
}

.magic-type h4 {
    color: var(--dark-accent);
    margin-bottom: 0.5rem;
}

/* Sample Chapter Section */
.sample-section {
    background-color: var(--secondary-color);
    color: var(--light-color);
    padding: 4rem 0;
}

.sample-section h2 {
    color: var(--light-color);
    text-align: center;
    margin-bottom: 2rem;
}

.sample-content {
    background-color: rgba(255, 255, 255, 0.1);
    padding: 2rem;
    border-radius: 8px;
    max-width: 800px;
    margin: 0 auto;
    position: relative;
}

.sample-content::before {
    content: '"';
    position: absolute;
    top: -30px;
    left: 20px;
    font-size: 100px;
    font-family: 'Playfair Display', serif;
    color: rgba(255, 255, 255, 0.1);
}

.sample-content::after {
    content: '"';
    position: absolute;
    bottom: -80px;
    right: 20px;
    font-size: 100px;
    font-family: 'Playfair Display', serif;
    color: rgba(255, 255, 255, 0.1);
}

.sample-content p {
    margin-bottom: 1rem;
    line-height: 1.8;
}

.read-more {
    text-align: center;
    margin-top: 2rem;
}

/* Contact Section */
.contact-section {
    background-color: var(--light-color);
    padding: 4rem 0;
}

/* Download Section */
.download-section {
    background-color: var(--dark-accent);
    padding: 4rem 0;
    color: var(--light-color);
}

.download-section h2 {
    color: var(--accent-color);
    text-align: center;
    margin-bottom: 2rem;
}

.download-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.download-content p {
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

.download-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}

.download-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.5rem;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    transition: all 0.3s ease;
    color: var(--light-color);
    min-width: 120px;
}

.download-button:hover {
    transform: translateY(-5px);
    background-color: rgba(255, 255, 255, 0.2);
    color: var(--accent-color);
}

.download-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.download-text {
    font-weight: bold;
    letter-spacing: 1px;
}

.html-link:hover {
    box-shadow: 0 5px 15px rgba(255, 255, 255, 0.1);
}

.pdf-link:hover {
    box-shadow: 0 5px 15px rgba(196, 155, 96, 0.2);
}

.epub-link:hover {
    box-shadow: 0 5px 15px rgba(18, 76, 44, 0.3);
}

.contact-section h2 {
    text-align: center;
    margin-bottom: 2rem;
}

.contact-content {
    max-width: 600px;
    margin: 0 auto;
}

.contact-content p {
    margin-bottom: 2rem;
    text-align: center;
}

.contact-form {
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 5px 15px var(--shadow-color);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--primary-color);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-family: 'Source Sans Pro', sans-serif;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px var(--highlight-color);
}

/* Footer */
footer {
    background-color: var(--dark-accent);
    color: var(--light-color);
    padding: 3rem 0;
}

.footer-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 2rem;
}

.footer-info h3 {
    color: var(--accent-color);
    margin-bottom: 1rem;
}

.footer-links ul,
.footer-social ul {
    list-style: none;
}

.footer-links li,
.footer-social li {
    margin-bottom: 0.8rem;
}

.footer-links a,
.footer-social a {
    color: var(--light-color);
    opacity: 0.8;
    transition: all 0.3s ease;
}

.footer-links a:hover,
.footer-social a:hover {
    opacity: 1;
    color: var(--accent-color);
}

.social-icon {
    display: inline-flex;
    align-items: center;
}

.social-icon::before {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    margin-right: 0.5rem;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.social-icon.facebook::before {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><text y="80" x="50" font-size="80" text-anchor="middle" fill="rgba(255,255,255,0.9)">f</text></svg>');
}

.social-icon.twitter::before {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><text y="80" x="50" font-size="80" text-anchor="middle" fill="rgba(255,255,255,0.9)">t</text></svg>');
}

.social-icon.instagram::before {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><text y="80" x="50" font-size="80" text-anchor="middle" fill="rgba(255,255,255,0.9)">i</text></svg>');
}

.social-icon.goodreads::before {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><text y="80" x="50" font-size="80" text-anchor="middle" fill="rgba(255,255,255,0.9)">g</text></svg>');
}

/* Placeholder Cover */
@media (max-width: 768px) {
    .book-preview {
        flex-direction: column;
    }

    .header-content {
        flex-direction: column;
    }

    nav ul {
        margin-top: 1rem;
    }

    .hero {
        padding: 1rem 0;
    }

    .characters-grid,
    .secondary-grid,
    .magic-types {
        grid-template-columns: 1fr;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
    }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.about-content, .characters-grid, .world-content, .sample-content, .contact-content {
    animation: fadeIn 1s ease forwards;
}

/* Create a placeholder cover image in case the real one isn't found */
img[src="placeholder-cover.jpg"] {
    background-color: var(--primary-color);
    aspect-ratio: 2/3;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

img[src="placeholder-cover.jpg"]::after {
    content: "The Librarian's Index";
    position: absolute;
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    color: var(--accent-color);
    text-align: center;
    width: 80%;
}
