/* CSS Variables - Customizable Theme */
:root {
    --primary-color: #841818;
    --primary-dark: #6B1414;
    --secondary-color: #D8A878;
    --accent-color: #D8A878;
    --background-color: #ffffff;
    --surface-color: #FEF2E4;
    --text-primary: #333333;
    --text-secondary: #666666;
    --border-color: rgba(132, 24, 24, 0.1);
    --heading-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --body-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --base-size: 16px;
}

/* Reset */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--body-font);
    font-size: var(--base-size);
    color: var(--text-primary);
    background: var(--background-color);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Navigation */
.header {
    background: var(--background-color);
    border-bottom: 1px solid var(--border-color);
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    z-index: 100 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.3s ease;
}

.nav {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    font-family: var(--heading-font);
}

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

.nav-links a {
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.95rem;
    transition: color 0.2s;
}

.nav-links a:hover {
    color: var(--primary-color);
}

.nav-links a.active {
    color: var(--accent-color);
    font-weight: 600;
    position: relative;
}

.nav-links a.active::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent-color);
}

/* Hamburger Menu */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 101;
}

.hamburger-line {
    width: 25px;
    height: 3px;
    background: var(--text-primary);
    border-radius: 3px;
    transition: all 0.3s ease;
}

.hamburger.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.hamburger.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.hamburger.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* Hero Section */
.hero {
    padding: 6rem 1.5rem;
    padding-top: calc(6rem + 60px);
    text-align: left;
    background: var(--background-color);
    border-bottom: 1px solid var(--border-color);
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.hero-headline {
    font-family: var(--heading-font);
    font-size: 3rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.hero-description {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    line-height: 1.6;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.875rem 2rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: var(--primary-color);
    color: #ffffff;
}

.btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* Content Section */
.content-section {
    padding: 5rem 0;
    background: var(--surface-color);
}

/* Add padding to first section after fixed header */
body > section:first-of-type,
body > .hero:first-of-type {
    margin-top: 60px;
}

.about-heading {
    font-family: var(--heading-font);
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 2rem;
    color: var(--text-primary);
    text-align: left;
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: stretch;
}

.about-image {
    width: 100%;
    margin: 0 auto;
    display: flex;
    align-items: stretch;
    min-height: 100%;
}

.about-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    min-height: 100%;
}

.image-placeholder {
    width: 100%;
    aspect-ratio: 3/4;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    font-weight: bold;
    text-align: left;
    padding: 2rem;
}

.about-text {
    text-align: left;
}

.about-text p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* Features Section */
.features-section {
    padding: 5rem 0;
    background: var(--background-color);
}

.features-section h2 {
    font-family: var(--heading-font);
    font-size: 2rem;
    font-weight: 700;
    text-align: left;
    margin-bottom: 3rem;
    color: var(--text-primary);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.feature-card {
    border: 2px solid #841818;
    border: 2px solid #841818;
    background: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    text-align: left;
    transition: transform 0.2s, box-shadow 0.2s;
}

.feature-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.feature-card h3 {
    font-family: var(--heading-font);
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.feature-card p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Books Section */
.books-section {
    padding: 5rem 0;
    background: var(--surface-color);
}

.books-section h2 {
    font-family: var(--heading-font);
    font-size: 2rem;
    font-weight: 700;
    text-align: left;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.books-section .section-intro {
    text-align: left;
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 700px;
    margin: 0 auto 3rem;
    line-height: 1.7;
}

.books-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.book-card {
    background: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: left;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}

.book-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.book-cover {
    width: 100%;
    aspect-ratio: 2/3;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 1.5rem;
    background: #ffffff;
}

.book-card h3 {
    font-family: var(--heading-font);
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.book-card p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.btn-secondary {
    background: var(--accent-color);
    color: #ffffff;
}

.btn-secondary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* CTA Section */
.cta-section {
    padding: 5rem 0;
    text-align: left;
}

.cta-section h2 {
    font-family: var(--heading-font);
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.cta-section p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Footer */
.footer {
    padding: 2rem 0;
    text-align: left;
    border-top: 1px solid var(--border-color);
    background: var(--surface-color);
}

.footer p {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Contact Form */
.contact-form {
    max-width: 600px;
    margin: 3rem auto 0;
    background: var(--surface-color);
    padding: 2.5rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    text-align: left;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    font-size: 1rem;
    font-family: var(--body-font);
    color: var(--text-primary);
    background: var(--background-color);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(132, 24, 24, 0.1);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #999;
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.contact-form .btn {
    width: 100%;
    margin-top: 0.5rem;
    font-size: 1.05rem;
}

.form-success {
    margin-top: 1.5rem;
    padding: 1rem;
    background: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 8px;
    text-align: left;
}

.form-success p {
    color: #155724;
    font-weight: 600;
    margin: 0;
}

/* Responsive - Mobile First */

/* Tablet specific (480px to 1024px) - Covers all tablet devices including smaller ones */
@media (min-width: 480px) and (max-width: 1024px) {
    /* Show hamburger menu on tablets */
    .hamburger {
        display: flex;
        flex-shrink: 0;
    }

    .nav-links {
        display: none;
        flex-direction: column;
        gap: 0;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--background-color);
        border-top: 1px solid var(--border-color);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        padding: 0;
        margin: 0;
        z-index: 100;
    }

    .nav-links.active {
        display: flex;
    }

    .nav-links li {
        width: 100%;
        text-align: left;
        border-bottom: 1px solid var(--border-color);
    }

    .nav-links li:last-child {
        border-bottom: none;
    }

    .nav-links a {
        display: block;
        padding: 1rem;
        font-size: 1rem;
        width: 100%;
    }

    .nav {
        padding: 1rem;
        position: relative;
    }

    .nav-logo {
        flex-shrink: 1;
        min-width: 0;
    }
    /* About section - 2 columns on ALL tablets */
    .about-heading {
        font-size: 1.75rem;
        margin-bottom: 1.5rem;
    }

    .about-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .about-image {
        width: 100%;
        order: 2;
    }

    .about-text {
        text-align: left;
    }

    .about-text p {
        font-size: 1rem;
        padding: 0;
    }

    /* Books grid - 2 columns on tablet */
    .books-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }

    .book-card {
        padding: 1.25rem;
    }

    .book-cover {
        aspect-ratio: 2/3;
        max-height: 280px;
    }

    .book-cover > div {
        padding: 1rem !important;
        font-size: 1rem !important;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .book-card h3 {
        font-size: 1.1rem;
    }

    .book-card p {
        font-size: 0.9rem;
        margin-bottom: 1.25rem;
    }

    .btn {
        padding: 0.75rem 1.5rem;
        font-size: 0.95rem;
    }
}

/* Mobile only (below 480px) */
@media (max-width: 479px) {
    /* Books grid - 1 column on mobile */
    .books-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    /* Base adjustments */
    body {
        padding: 0;
        overflow-x: hidden;
    }

    html {
        overflow-x: hidden;
    }

    .container {
        width: 100%;
        max-width: 100%;
        padding: 0 1rem;
        box-sizing: border-box;
    }

    /* Header - Ensure sticky on mobile (already set globally with !important) */

    /* Navigation - Hamburger menu */
    .nav {
        padding: 1rem;
        position: relative;
    }

    .nav-logo {
        font-size: 1.1rem;
        flex-shrink: 1;
        min-width: 0;
    }

    .hamburger {
        display: flex;
        flex-shrink: 0;
    }

    .nav-links {
        display: none;
        flex-direction: column;
        gap: 0;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--background-color);
        border-top: 1px solid var(--border-color);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        padding: 0;
        margin: 0;
        z-index: 100;
    }

    .nav-links.active {
        display: flex;
    }

    .nav-links li {
        width: 100%;
        text-align: left;
        border-bottom: 1px solid var(--border-color);
    }

    .nav-links li:last-child {
        border-bottom: none;
    }

    .nav-links a {
        display: block;
        padding: 1rem;
        font-size: 1rem;
        width: 100%;
    }

    /* Hero Section */
    .hero {
        padding: 3rem 1rem;
    }

    .hero-headline {
        font-size: 1.75rem;
        margin-bottom: 1rem;
    }

    .hero-description {
        font-size: 1rem;
        margin-bottom: 1.5rem;
        line-height: 1.5;
    }

    .hero-content {
        padding: 0 0.5rem;
    }

    /* Sections */
    .content-section,
    .features-section,
    .books-section,
    .cta-section {
        padding: 3rem 0;
    }

    /* About section - Stack on mobile with image below heading */
    .about-heading {
        font-size: 1.5rem;
        margin-bottom: 1.5rem;
    }

    .about-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .about-image {
        width: 100%;
        order: 2;
    }

    .about-text {
        text-align: left;
    }

    .features-section h2,
    .books-section h2,
    .cta-section h2 {
        font-size: 1.5rem;
        margin-bottom: 1rem;
    }

    .about-text p {
        font-size: 1rem;
        padding: 0;
    }

    .cta-section p {
        font-size: 1rem;
        padding: 0 0.5rem;
    }

    /* Grids - Stack on mobile only */
    .features-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    /* Cards */
    .feature-card,
    .book-card {
        padding: 1.5rem;
    }

    .feature-card h3,
    .book-card h3 {
        font-size: 1.1rem;
    }

    .feature-card p,
    .book-card p {
        font-size: 0.9rem;
    }

    /* Buttons */
    .btn {
        padding: 0.75rem 1.5rem;
        font-size: 0.95rem;
        width: 100%;
        max-width: 300px;
    }

    /* Center Learn More buttons on mobile */
    .book-card .btn {
        margin: 0 auto;
        display: block;
    }

    /* Contact Form */
    .contact-form {
        padding: 1.5rem;
        margin: 2rem auto 0;
    }

    .form-group input,
    .form-group textarea {
        font-size: 0.95rem;
        padding: 0.75rem;
    }

    .contact-form .btn {
        max-width: 100%;
    }

    /* Footer */
    .footer {
        padding: 1.5rem 0;
    }

    .footer p {
        font-size: 0.85rem;
        line-height: 1.8;
        margin-bottom: 0.5rem;
    }

    .footer p:last-child {
        margin-bottom: 0;
    }

    .footer a {
        display: block;
        margin: 0.25rem 0;
    }

    .footer-contact {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
        margin-top: 0.5rem;
        font-size: 0.9rem;
    }

    .footer-separator {
        display: none;
    }

    .footer-item {
        display: block;
        white-space: nowrap;
    }
}

/* Small mobile (480px and below) */
@media (max-width: 480px) {
    .hero-headline {
        font-size: 1.5rem;
    }

    .hero-description {
        font-size: 0.95rem;
    }

    .hero {
        padding: 2.5rem 0.75rem;
    }

    .content-section h2,
    .features-section h2,
    .books-section h2,
    .cta-section h2 {
        font-size: 1.35rem;
    }

    .nav-logo {
        font-size: 1rem;
    }

    .feature-card,
    .book-card {
        padding: 1.25rem;
    }

    .contact-form {
        padding: 1.25rem;
    }
}

/* Desktop adjustments for book images - Standard desktop (1025px+) */
@media (min-width: 1025px) {
    .book-cover {
        height: 450px !important;
    }
    
    .book-cover img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
        object-position: center !important;
    }
}

/* Large desktop screens (1440px+) */
@media (min-width: 1440px) {
    .book-cover {
        height: 500px !important;
    }
}

/* Extra large desktop screens (1920px+) */
@media (min-width: 1920px) {
    .book-cover {
        height: 550px !important;
    }
}

/* Large screens - Optimize spacing */
@media (min-width: 1400px) {
    .container {
        max-width: 1400px;
    }

    .hero-headline {
        font-size: 3.5rem;
    }

    .hero-description {
        font-size: 1.35rem;
    }
}
