/* Global Styles */

[data-theme="colorful"] {
    --primary-color: #825fa3;
    --secondary-color: #744579;
    --accent-color: #52a483;
    --background-color: #d1fce8;
    --surface-color: white;
    --text-color: #2c3e35;
    --text-inverse: white;
    --text-header: #6a4c70ff;
}

[data-theme="dark"] {
    --primary-color: #744579;
    --secondary-color: #5a4576;
    --accent-color: #2a7d6d;
    --background-color: #1e1e1e;
    --surface-color: black;
    --text-color: #e0e0e0;
    --text-inverse: white;
    --text-header: #8f6eaf;
}

[data-theme="light"] {
    --primary-color: #825fa3;
    --secondary-color: #744579;
    --accent-color: #4a8a6f;
    --background-color: #ffffff;
    --surface-color: #ffffff;
    --text-color: #2a2a2a;
    --text-inverse: white;
    --text-header: #5a4576;
}


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

html, body {
    height: 100%;
}

body {
    font-family:'Segoe UI', Tahoma, Geneva, Verdana, sans-serif, serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    position: relative;
}

/* Star pattern overlay - only affects the background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('starpattern.png');
    background-repeat: repeat;
    opacity: 0.15; 
    z-index: -1;
    pointer-events: none;
}

/* Invert star pattern for dark mode */
[data-theme="dark"] body::before {
    filter: invert(1);
}

/* Hamburger Menu - Hidden on desktop */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    background: var(--secondary-color);
    border: 3px solid rgba(255, 255, 255, 0.5);
    border-radius: 10px;
    padding: 10px;
    cursor: pointer;
    box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.hamburger span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: white;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.hamburger:hover {
    background-color: var(--accent-color);
}

/* Navigation Styles */
nav {
    background-color: var(--primary-color);
    background-repeat: repeat-x;
    background-position: center;
    background-size: auto 100%;
    padding: 1rem 0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0 2rem;
    position: relative;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-button {
    background-color: var(--secondary-color);
    color: white;
    padding: 0.75rem 2rem;
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 600;
    border: 3px solid rgba(255, 255, 255, 0.5);
    transition: background-color 0.3s ease;
    border-radius: 10px;
    box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.nav-button:hover {
    background-color: var(--accent-color);
}

.nav-button.active {
    background-color: var(--accent-color);
}

.theme-switcher {
    position: absolute;
    right: 2rem;
    display: flex;
    gap: 0.5rem;
}

.theme-btn {
    background-color: var(--background-color);
    color: white;
    padding: 0.6rem;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.theme-btn:hover {
    background-color: var(--accent-color);
    transform: scale(1.1);
}

.theme-btn.active {
    background-color: var(--surface-color);
    border-color: white;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

/* Main Content */
.container {
    max-width: 1200px;
    margin: 3rem auto;
    padding: 0 2rem 2rem 2rem;
    flex: 1;
}

h1 {
    color: var(--text-header);
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    text-align: center;
    font-family: Curtive, serif;
}

h2 {
    color: var(--text-header);
    font-size: 2rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
    text-align: center;
    font-family: Curtive, serif;
}

p {
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.container .centertext {
    text-align: center;
}

/* Call-to-Action Buttons */
.cta-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    justify-content: center;
    flex-wrap: wrap;

}

.cta-primary,
.cta-secondary {
    display: inline-block;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: 10px;
    transition: all 0.3s ease;
    box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.cta-primary {
    background-color: var(--secondary-color);
    color: white;
    border: 4px solid rgba(119, 66, 112, 0.5);
}

.cta-primary:hover {
    background-color: var(--accent-color);
    border-color: color-mix(in srgb, var(--secondary-color) 50%, transparent);
    transform: translateY(-2px);
    box-shadow: 3px 3px 8px rgba(0, 0, 0, 0.3);
}

.cta-secondary {
    background-color: var(--secondary-color);
    color: white;
    border: 4px solid rgba(119, 66, 112, 0.5);
}

.cta-secondary:hover {
    background-color: var(--accent-color);
    border-color: color-mix(in srgb, var(--secondary-color) 50%, transparent);
    transform: translateY(-2px);
    box-shadow: 3px 3px 8px rgba(0, 0, 0, 0.3);
}

/* Newsletter Banner */
.newsletter-banner {
    margin-top: 2.5rem;
    padding: 1.5rem 2rem;
    border-radius: 20px;
    background-color: var(--background-color);
    border: 2px dashed var(--accent-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.newsletter-banner-text {
    margin: 0;
    flex: 1;
    min-width: 220px;
}

.newsletter-btn {
    flex-shrink: 0;
    white-space: nowrap;
}

@media (max-width: 480px) {
    .newsletter-banner {
        flex-direction: column;
        text-align: center;
        padding: 1.25rem 1.5rem;
    }
}


.text-page .container {
    background-color: var(--surface-color);
    padding: 3rem;
    border-radius: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

/* Blog Posts */
.blog-post {
    background-color: var(--surface-color);
    padding: 2rem;
    margin-bottom: 2rem;
    border-radius: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.blog-post:last-of-type {
    margin-bottom: 0;
}

.blog-post h3 {
    color: var(--accent-color);
    margin-bottom: 0.5rem;
}

.blog-date {
    color: var(--accent-color);
    font-style: italic;
    margin-bottom: 1rem;
}

/* Book Cards */
.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.book-card {
    background-color: var(--surface-color);
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.book-card h3 {
    color: var(--accent-color);
    margin-bottom: 1rem;
}

/* Book Cover Images */
.book-cover {
    width: 100%;
    height: auto;
    border-radius: 5px;
    margin-bottom: 1rem;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

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

/* Footer with pencil image */
footer {
    margin-top: auto;
    flex-shrink: 0;
}

.pencils {
    height: 90px;
    background-image: url('pencils.png');
    background-repeat: repeat-x;
    background-position: bottom center;
    background-size: auto 90px;
}

/* Hide pencils on light and dark themes - only show on colorful theme */
[data-theme="light"] .pencils,
[data-theme="dark"] .pencils {
    display: none;
}

/* Fix for posts subfolder */
.posts-page .pencils {
    background-image: url('../pencils.png');
}

.social-bar {
    background-color: var(--secondary-color);
    padding: 1.5rem 1rem;
    text-align: center;
}

.social-bar a {
    display: inline-block;
    background-color: var(--primary-color);
    border: 3px solid rgba(255, 255, 255, 0.2);
    box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
    color: var(--text-inverse);
    text-decoration: none;
    margin: 0 0.5rem;
    padding: 0.5rem 1.5rem;
    font-size: 1rem;
    font-weight: bold;
    border-radius: 10px;
    transition: background-color 0.3s ease;
}

.social-bar a:hover {
    background-color: var(--accent-color);

}

/* Blog Links */
.read-more {
    display: inline-block;
    color: var(--secondary-color);
    font-weight: 600;
    text-decoration: none;
    margin-top: 0.5rem;
    transition: color 0.3s ease;
}

.read-more:hover {
    color: var(--accent-color);
}

.back-link {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #e0e0e0;
}

.back-link a {
    color: var(--secondary-color);
    font-weight: 600;
    text-decoration: none;
    transition: color 0.3s ease;
}

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

/* ========================================
   RESPONSIVE DESIGN - MOBILE STYLES
   ======================================== */

/* TABLET AND BELOW (768px and smaller) */
/* This catches iPads in portrait mode and smaller */
@media (max-width: 768px) {
    
    /* Show hamburger menu */
    .hamburger {
        display: flex;
    }
    
    /* NAVIGATION - Hamburger layout */
    .nav-container {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: space-between;
        gap: 0;
        padding: 1rem;
    }
    
    /* Navigation links hidden by default on mobile */
    .nav-links {
        display: none;
        flex-direction: column;
        gap: 0.75rem;
        width: 100%;
        padding-top: 1rem;
        order: 3;
    }
    
    /* Show nav links when menu is open */
    .nav-links.open {
        display: flex;
        align-items: center;
    }
    
    /* Nav buttons take half width */
    .nav-button {
        width: 50%;
        min-width: auto;
        text-align: center;
        padding: 0.75rem 1rem;
    }
    
    /* Theme switcher stays in top row */
    .theme-switcher {
        position: static;
        margin-top: 0;
    }
    
    /* CONTENT - Reduce padding to maximize screen space */
    .container {
        padding: 0 1rem 1rem 1rem;
        margin: 2rem auto;
    }
    
    .text-page .container {
        padding: 2rem 1.5rem;
    }
    
    /* TYPOGRAPHY - Slightly smaller headings */
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    /* BOOK GRID - Single column on tablet */
    .books-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    /* FOOTER - Smaller pencils */
    .pencils {
        height: 60px;
        background-size: auto 60px;
    }
    
    .social-bar {
        padding: 1rem;
    }
    
    .social-bar a {
        margin: 0.25rem;
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
}

/* MOBILE PHONES (480px and smaller) */
/* This is for actual phone screens */
@media (max-width: 480px) {
    
    /* Even smaller headings on phones */
    h1 {
        font-size: 1.75rem;
    }
    
    h2 {
        font-size: 1.25rem;
    }
    
    /* Tighter spacing everywhere */
    .container {
        padding: 0 0.75rem 0.75rem 0.75rem;
        margin: 1.5rem auto;
    }
    
    .text-page .container {
        padding: 1.5rem 1rem;
    }
    
    /* Blog posts get less padding */
    .blog-post {
        padding: 1.5rem 1rem;
    }
    
    /* Book cards get less padding */
    .book-card {
        padding: 1.5rem 1rem;
    }
    
    /* Nav buttons slightly smaller text */
    .nav-button {
        font-size: 1rem;
        padding: 0.65rem 1rem;
    }
    
    /* Theme buttons stay same size (they're icons) */
    .theme-btn {
        width: 2.5rem;
        height: 2.5rem;
    }
    
    /* Footer pencils even smaller */
    .pencils {
        height: 45px;
        background-size: auto 45px;
    }
    
    /* Social links stack better */
    .social-bar a {
        display: inline-block;
        margin: 0.25rem;
    }
}

/* ===== BONUS CONTENT STYLES ===== */
.bonus-section {
    margin: 3rem 0;
    padding: 2rem 0;
    border-top: 2px solid var(--border-color);
}

.bonus-section:first-of-type {
    border-top: none;
}

.bonus-section h2 {
    margin-bottom: 1.5rem;
    color: var(--heading-color);
}

.bonus-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 350px));
    justify-content: center;
    gap: 1.5rem;
    margin-top: 1rem;
}

.bonus-item {
    background-color: var(--surface-color);
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
}

.bonus-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.bonus-item a {
    text-decoration: none;
    color: inherit;
}

/* Make entire card clickable */
.bonus-item a::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

.bonus-item h3 {
    margin-top: 0;
    margin-bottom: 0.75rem;
    color: var(--accent-color);
}

.bonus-item p {
    margin: 0;
    line-height: 1.6;
}

.coming-soon {
    font-style: italic;
    color: var(--text-color);
    opacity: 0.7;
    text-align: center;
    padding: 2rem;
    grid-column: 1 / -1;
}

/* Link from book cards to bonus content */
.bonus-link {
    margin-top: 1rem;
    font-weight: 600;
}

.bonus-link a {
    color: var(--link-color);
    text-decoration: none;
}

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

/* Back link at bottom of bonus content pages */
.back-link {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.back-link a {
    color: var(--link-color);
    text-decoration: none;
    font-weight: 600;
}

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

@media (max-width: 768px) {
    .bonus-grid {
        grid-template-columns: 1fr;
    }
    
    .bonus-section {
        margin: 2rem 0;
        padding: 1.5rem 0;
    }
}
