/* CSS Reset for consistent styling across browsers */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Basic Styles */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: #f5f5f5; /* Lighter text overall */
    background-color: #333; /* Dark background for better contrast */
    scroll-behavior: smooth;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem;
}

/* Development Notice Bar (restore the red banner) */
.dev-notice {
    background-color: #e74c3c; /* bright red */
    color: #fff;
    text-align: center;
    padding: 0.75rem 1rem;
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1.4;
}
.dev-notice strong {
    text-transform: uppercase;
}

/* Header & Navigation */
.site-header {
    background-color: #222; /* Darker header background */
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.site-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand {
    font-size: 1.25rem;           /* ↓ smaller so it stays one line */
    font-weight: 700;
    color: #f5f5f5; /* Lighter text */
    text-decoration: none;
    white-space: nowrap;          /* keep the name on a single line */
}

.brand-text {
    display: none;
}

@media (min-width: 600px) {
    .brand-text {
        display: inline;
        margin-left: 0.5rem;
    }
}

.nav-toggle {
    display: block;
    background: none;
    border: none;
    color: #f5f5f5;
    font-size: 1.5rem;
    cursor: pointer;
}

#site-nav {
    display: none;
}

#site-nav.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: #444;
    padding: 1rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

#site-nav a {
    color: #f5f5f5;
    text-decoration: none;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    text-align: center;
}

#site-nav a:last-child {
    border-bottom: none;
}

@media (min-width: 600px) {
    .nav-toggle {
        display: none;
    }
    #site-nav {
        display: flex;
        flex-direction: row;
        position: static;
        background: none;
        box-shadow: none;
        gap: 2rem;
    }
    #site-nav a {
        border-bottom: none;
        padding: 0;
    }
}

/* Sections and general content */
.section {
    padding: 4rem 0;
    text-align: center;
}
.section.alt {
    background-color: #444; /* Dark alt background */
}
.section h2 {
    font-size: clamp(2rem, 5vw, 3rem);
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    color: #ffffff; /* White headings */
}
.section p {
    max-width: 800px;
    margin: 0 auto 1.5rem auto;
    font-size: 1.1rem;
    opacity: 0.95;
    color: #f5f5f5; /* Lighter paragraph text */
}

/* Book & Author Grid */
.book-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    align-items: center;
    text-align: center;
}

@media (min-width: 768px) {
    .book-grid {
        grid-template-columns: 1fr 2fr;
        text-align: left;
    }
    .book-grid.reverse {
        grid-template-columns: 2fr 1fr;
    }
}

.book-cover {
    max-width: 300px;
    margin: 0 auto;
    border-radius: 8px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease;
}

.book-cover:hover {
    transform: scale(1.05);
}

.book-details h3 {
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    color: #ffffff; /* White titles */
}

.book-details .tagline {
    font-size: 1rem;
    font-style: italic;
    opacity: 0.8;
    color: #ddd; /* Lighter tagline */
}

.book-details p {
    margin: 1rem 0;
    font-size: 1rem;
    color: #f5f5f5;
}

.author-name {
    font-style: italic;
    opacity: 0.9;
    margin-top: 0.5rem;
    color: #f5f5f5;
}

/* Buy Links */
.buy-links {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.5rem;
}

@media (min-width: 768px) {
    .buy-links {
        justify-content: flex-start;
    }
}

.buy-links a {
    display: inline-block;
    background-color: #e74c3c;
    color: white;
    padding: 0.75rem 1.5rem;
    text-decoration: none;
    border-radius: 9999px;
    font-weight: 600;
    transition: opacity 0.3s ease;
}

.buy-links a:hover {
    opacity: 0.8;
}

/* Footer */
.site-footer {
    padding: 2rem 0;
    background-color: #222;
    color: #ccc;
    font-size: 0.9rem;
    opacity: 0.8;
    text-align: center;
}

/* 404 Page Specific Styles */
.error-page-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    text-align: center;
}
.error-page-container h1 {
    font-size: clamp(2.5rem, 8vw, 4rem);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    color: #ffffff;
}
.error-page-container p {
    font-size: 1.1rem;
    margin-bottom: 2rem;
    opacity: 0.9;
    color: #f5f5f5;
}

/* Newsletter Page Specific Styles */
.newsletter-section {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 12rem);
    padding: 2rem;
    box-sizing: border-box;
}

.newsletter-container {
    max-width: 600px;
    width: 100%;
    background-color: #444;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.newsletter-container h1 {
    font-size: clamp(2rem, 6vw, 3rem);
    margin-bottom: 1rem;
    text-transform: uppercase;
    color: #ffffff;
}

.newsletter-container p {
    font-size: 1rem;
    margin-bottom: 1.5rem;
    opacity: 0.9;
    color: #f5f5f5;
}

.newsletter-container .form-input {
    width: 100%;
    padding: 0.75rem;
    margin-bottom: 1rem;
    border: 1px solid #666;
    border-radius: 8px;
    background-color: #333;
    color: #f5f5f5;
    font-size: 1rem;
}

.newsletter-container .form-input::placeholder {
    color: #bbb;
}

.newsletter-container .submit-btn {
    width: 100%;
    padding: 0.75rem;
    border: none;
    border-radius: 8px;
    background-color: #e74c3c;
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.3s ease, background-color 0.3s ease;
}

.newsletter-container .submit-btn:hover {
    opacity: 0.8;
}

.message-box {
    margin-top: 1rem;
    padding: 0.75rem;
    border-radius: 8px;
    font-size: 1rem;
}
.message-box.success {
    background-color: #27ae60;
    color: white;
}
.message-box.error {
    background-color: #c0392b;
    color: white;
}