/* ==========================================================================
   MARK BELL AUTHOR WEBSITE CSS
   Cozy Mystery Theme with Modern Design
   ========================================================================== */

/* CSS Variables for Consistent Design */
:root {
    /* Color Palette - Vibrant Mystery Theme */
    --primary-color: #8B2635; /* Deep burgundy/wine */
    --secondary-color: #1B4A4A; /* Rich teal */
    --accent-color: #D4793A; /* Warm copper */
    --highlight-color: #B8860B; /* Darker gold */
    --background-color: #FAF7F2; /* Soft ivory */
    --text-color: #2A2A2A; /* Rich charcoal */
    --text-light: #5A5A5A; /* Medium gray */
    --white: #FFFFFF;
    
    /* Typography */
    --font-serif: 'Playfair Display', serif;
    --font-sans: 'Open Sans', sans-serif;
    
    /* Spacing */
    --section-padding: 80px 0;
    --container-max-width: 1200px;
    --container-padding: 0 20px;
    
    /* Transitions */
    --transition: all 0.3s ease;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
}

/* Container */
.container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: var(--container-padding);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-serif);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2.2rem; }
h3 { font-size: 1.8rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.3rem; }
h6 { font-size: 1.1rem; }

p {
    margin-bottom: 1rem;
    font-size: 1rem;
    line-height: 1.7;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--accent-color);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 14px 28px;
    font-family: var(--font-sans);
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition);
    line-height: 1;
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--white);
}

.btn-primary:hover {
    background-color: var(--secondary-color);
    color: var(--white);
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-secondary:hover {
    background-color: var(--primary-color);
    color: var(--white);
}

.btn-outline {
    background-color: transparent;
    color: var(--accent-color);
    border: 2px solid var(--accent-color);
}

.btn-outline:hover {
    background-color: var(--accent-color);
    color: var(--white);
}

.btn-large {
    padding: 18px 36px;
    font-size: 1.1rem;
}

.text-link {
    color: var(--text-light);
    text-decoration: underline;
    font-size: 0.9rem;
}

.text-link:hover {
    color: var(--primary-color);
}

/* Section Titles */
.section-title {
    text-align: center;
    color: var(--secondary-color);
    margin-bottom: 2rem;
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background-color: var(--accent-color);
    margin: 1rem auto;
}

.section-subtitle {
    text-align: center;
    color: var(--text-light);
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: rgba(253, 246, 227, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    padding: 1rem 0;
    transition: var(--transition);
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand h1 {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin: 0;
}

.nav-menu ul {
    display: flex;
    list-style: none;
    align-items: center;
    gap: 2rem;
}

.nav-menu a {
    color: var(--text-color);
    font-weight: 600;
    transition: var(--transition);
}

.nav-menu a:hover {
    color: var(--primary-color);
}

.nav-menu .cta-button {
    background-color: var(--accent-color);
    color: var(--white);
    padding: 10px 20px;
    border-radius: 25px;
}

.nav-menu .cta-button:hover {
    background-color: var(--primary-color);
    color: var(--white);
}

/* Mobile Menu */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 4px;
}

.mobile-menu-toggle span {
    width: 25px;
    height: 3px;
    background-color: var(--primary-color);
    transition: var(--transition);
}

/* Hero Section */
.hero {
    position: relative;
    height: 100vh;
    min-height: 600px;
    display: flex;
    align-items: center;
    /* Fallback gradient if image doesn't load */
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    /* Fallback gradient */
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    /* Image overlay if available */
    background-image: url('images/hero-background.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    /* Stronger overlay to ensure text readability */
    background: rgba(44, 44, 44, 0.7);
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    color: var(--white);
    max-width: 800px;
    margin: 0 auto;
    padding: 100px 2rem 0 2rem;
    /* Add text shadow for better readability */
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.hero-headline {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.hero-subheadline {
    font-size: 1.3rem;
    margin-bottom: 2.5rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    opacity: 0.95;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Books Section */
.books {
    padding: var(--section-padding);
    background-color: var(--white);
}

.book-showcase {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 4rem;
    align-items: center;
    margin-bottom: 4rem;
}

.book-showcase.reverse {
    grid-template-columns: 2fr 1fr;
}

.book-showcase.reverse .book-cover {
    order: 2;
}

.book-showcase.reverse .book-content {
    order: 1;
}

.book-image {
    width: 100%;
    max-width: 400px;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    transition: var(--transition);
}

.book-image:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.3);
}

.book-title {
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
}

.genre-tag {
    display: inline-block;
    background-color: var(--highlight-color);
    color: var(--white);
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.book-blurb {
    font-size: 1.1rem;
    line-height: 1.7;
    margin-bottom: 2rem;
}

/* How It Works Section */
.how-it-works {
    padding: var(--section-padding);
    background-color: var(--background-color);
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.step-card {
    background-color: var(--white);
    padding: 2.5rem 2rem;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    transition: var(--transition);
}

.step-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    background-color: var(--primary-color);
    color: var(--white);
    font-size: 1.5rem;
    font-weight: 700;
    border-radius: 50%;
    margin-bottom: 1.5rem;
}

.step-card h3 {
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

/* About Author Section */
.about-author {
    padding: var(--section-padding);
    background-color: var(--white);
}

.about-content {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 4rem;
    align-items: center;
}

.author-image {
    width: 100%;
    max-width: 400px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.author-info h2 {
    color: var(--secondary-color);
    margin-bottom: 1.5rem;
}

.author-info p {
    font-size: 1.1rem;
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

.social-links {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    background-color: var(--primary-color);
    color: var(--white);
    border-radius: 50%;
    font-size: 1.2rem;
    transition: var(--transition);
}

.social-link:hover {
    background-color: var(--accent-color);
    transform: translateY(-2px);
}

/* Preview Section */
.preview-section {
    padding: var(--section-padding);
    background-color: var(--background-color);
}

.preview-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.preview-card {
    background-color: var(--white);
    padding: 2.5rem;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    transition: var(--transition);
}

.preview-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.preview-card h3 {
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
}

.preview-card p {
    color: var(--text-light);
    margin-bottom: 2rem;
}

/* Newsletter Signup */
.newsletter-signup {
    padding: var(--section-padding);
    background-color: var(--secondary-color);
    color: var(--white);
}

.newsletter-signup .section-title,
.newsletter-signup .section-subtitle {
    color: var(--white);
}

.newsletter-form {
    max-width: 600px;
    margin: 0 auto;
}

.form-group {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.form-input {
    flex: 1;
    min-width: 200px;
    padding: 14px 18px;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    background-color: var(--white);
    color: var(--text-color);
}

.form-input:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(218, 165, 32, 0.3);
}

.privacy-note {
    text-align: center;
    font-size: 0.9rem;
    opacity: 0.8;
    margin-top: 1rem;
}

/* Testimonials */
.testimonials {
    padding: var(--section-padding);
    background-color: var(--white);
}

.testimonials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.testimonial-card {
    background-color: var(--background-color);
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    border-left: 4px solid var(--accent-color);
}

.stars {
    color: var(--accent-color);
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.testimonial-card p {
    font-style: italic;
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
}

.testimonial-card cite {
    color: var(--text-light);
    font-size: 0.9rem;
}

/* Final CTA */
.final-cta {
    padding: var(--section-padding);
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: var(--white);
    text-align: center;
}

.final-cta h2 {
    color: var(--white);
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.cta-subtitle {
    font-size: 1.2rem;
    margin-bottom: 2.5rem;
    opacity: 0.9;
}

.cta-buttons {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

/* Footer */
.footer {
    background-color: var(--text-color);
    color: var(--white);
    padding: 3rem 0 1rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-column h4 {
    color: var(--accent-color);
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.footer-column ul {
    list-style: none;
}

.footer-column li {
    margin-bottom: 0.5rem;
}

.footer-column a {
    color: #cccccc;
    transition: var(--transition);
}

.footer-column a:hover {
    color: var(--accent-color);
}

.social-icons {
    display: flex;
    gap: 1rem;
}

.social-icons a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 35px;
    height: 35px;
    background-color: var(--primary-color);
    border-radius: 50%;
    transition: var(--transition);
}

.social-icons a:hover {
    background-color: var(--accent-color);
}

.footer-newsletter {
    display: flex;
    gap: 0.5rem;
}

.footer-newsletter input {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 4px;
    font-size: 0.9rem;
}

.footer-newsletter button {
    padding: 10px 15px;
    background-color: var(--accent-color);
    color: var(--white);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: var(--transition);
}

.footer-newsletter button:hover {
    background-color: var(--primary-color);
}

/* Popup Styles */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0,0,0,0.7);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    backdrop-filter: blur(3px);
    transition: all 0.3s ease;
}

.popup-overlay.active {
    opacity: 1;
    visibility: visible;
}

.popup-modal {
    background-color: var(--white);
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    position: relative;
    transform: scale(0.8);
    transition: transform 0.3s ease;
}

.popup-overlay.active .popup-modal {
    transform: scale(1);
}

.popup-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 30px;
    height: 30px;
    border: none;
    background-color: transparent;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-light);
    z-index: 10001;
    transition: var(--transition);
}

.popup-close:hover {
    color: var(--primary-color);
}

.popup-content {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    min-height: 400px;
}

.popup-visual {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.popup-visual img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.8;
}

.popup-form-section {
    padding: 2.5rem 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.popup-form-section h3 {
    color: var(--secondary-color);
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.popup-benefits {
    margin-bottom: 1.5rem;
}

.popup-benefits p {
    color: var(--text-light);
    margin-bottom: 1rem;
}

.popup-benefits ul {
    list-style: none;
    padding: 0;
}

.popup-benefits li {
    color: var(--text-color);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.popup-form {
    margin-bottom: 1rem;
}

.popup-form input {
    width: 100%;
    padding: 14px;
    border: 2px solid #eee;
    border-radius: 6px;
    font-size: 1rem;
    margin-bottom: 1rem;
}

.popup-form input:focus {
    outline: none;
    border-color: var(--accent-color);
}

.popup-form .btn {
    width: 100%;
    justify-content: center;
}

.popup-privacy {
    font-size: 0.8rem;
    color: var(--text-light);
    text-align: center;
    margin-bottom: 1rem;
}

.popup-dismiss {
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 0.9rem;
    cursor: pointer;
    text-align: center;
    width: 100%;
    padding: 0.5rem;
    transition: var(--transition);
}

.popup-dismiss:hover {
    color: var(--primary-color);
}

/* Responsive Design */
@media (max-width: 768px) {
    /* Typography adjustments */
    h1 { font-size: 2rem; }
    h2 { font-size: 1.8rem; }
    h3 { font-size: 1.5rem; }
    
    .hero {
        min-height: 70vh;
        height: auto;
    }
    
    .hero-content {
        padding: 80px 1rem 40px 1rem;
    }
    
    .hero-headline {
        font-size: 2.2rem;
        line-height: 1.2;
        margin-bottom: 1rem;
    }
    
    .hero-subheadline {
        font-size: 1rem;
        line-height: 1.4;
        margin-bottom: 2rem;
    }
    
    /* Header mobile */
    .nav-menu {
        display: none;
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
    
    /* Grid adjustments */
    .book-showcase,
    .book-showcase.reverse {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
        padding: 3rem 0;
    }

    .book-showcase.reverse .book-cover {
        order: 1;
    }

    .book-showcase.reverse .book-content {
        order: 2;
    }
    
    .book-image {
        max-width: 280px;
        margin: 0 auto;
    }    .about-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }
    
    .author-image {
        max-width: 250px;
        margin: 0 auto;
    }

    .steps-grid,
    .preview-options,
    .testimonials-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    section {
        padding: 4rem 0;
    }
    
    /* Form adjustments */
    .form-group {
        flex-direction: column;
    }
    
    .form-input {
        min-width: auto;
    }
    
    /* Popup adjustments */
    .popup-content {
        grid-template-columns: 1fr;
    }
    
    .popup-visual {
        min-height: 150px;
    }
    
    .popup-form-section {
        padding: 2rem 1.5rem;
    }
    
    /* Hero buttons */
    .hero-buttons {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
        margin-top: 2rem;
    }

    .hero-buttons .btn {
        width: 100%;
        max-width: 280px;
        padding: 1rem 2rem;
        font-size: 1rem;
        text-align: center;
    }    /* CTA buttons */
    .cta-buttons {
        align-items: stretch;
    }
    
    .btn-large {
        width: 100%;
        max-width: 300px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    .hero {
        min-height: 60vh;
    }
    
    .hero-content {
        padding: 70px 1rem 30px 1rem;
    }
    
    .hero-headline {
        font-size: 1.8rem;
        line-height: 1.1;
    }
    
    .hero-subheadline {
        font-size: 0.95rem;
        margin-bottom: 1.5rem;
    }
    
    .hero-buttons .btn {
        max-width: 250px;
        padding: 0.9rem 1.5rem;
        font-size: 0.95rem;
    }
    
    .step-card,
    .preview-card,
    .testimonial-card {
        padding: 2rem 1.5rem;
    }
    
    .popup-form-section {
        padding: 1.5rem 1rem;
    }
    
    .final-cta h2 {
        font-size: 2rem;
    }
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Focus styles for accessibility */
*:focus {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

/* Loading animation for images */
img {
    transition: opacity 0.3s ease;
}

img[data-loaded="false"] {
    opacity: 0;
}

img[data-loaded="true"] {
    opacity: 1;
}