/* 🌍 Global Variables */
:root {
    --primary-color: #f04e30;
    --secondary-color: #222;
    --background-color: #1a120b; /* Matches the header */
    --text-color: #fff;
    --light-text-color: #ddd;
    --max-width: 1200px; /* Matches header image width */
    --font-family: "Arial", sans-serif;
}

.desktop-only {
    display: block;
}

.mobile-only {
    display: none;
}

/* Hide and show images based on screen size */
@media (max-width: 768px) {
    .desktop-only {
        display: none;
    }

    .mobile-only {
        display: block;
        width: 100%;
        height: 80px;
        object-fit: contain;
    }
}


/* 🌍 Reset and Global Styles */
body, html {
    font-family: var(--font-family);
    margin: 0;
    padding: 0;
    background-color: var(--background-color);
    color: var(--text-color);
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* 🏷 Header */
.header {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: var(--max-width);
    z-index: 1000;
}

.header-image {
    display: block;
    width: 100%;
}

/* 🔗 Navigation Bar */
.navbar {
    width: 100%;
    background: var(--secondary-color);
    text-align: center;
    padding: 15px 0;
    margin-top: 240px; /* Pushes navbar below the header */
}

.navbar a {
    color: white;
    text-decoration: none;
    margin: 0 20px;
    font-size: 18px;
    font-weight: bold;
    transition: color 0.3s ease-in-out;
}

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

/* 📜 Content Area */
.content {
    flex: 1;
    width: 1150px;
    max-width: var(--max-width);
    background: #f5e6cc; /* Light beige */
    color: #000; /* Black text */
    padding: 20px;
    overflow-y: auto;
    text-align: center;
}

/* 📜 Books Grid */
.books-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    padding: 20px;
    text-align: center;
}

/* 📖 Book Item */
.book-item {
    cursor: pointer;
    transition: transform 0.3s ease-in-out;
}

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

/* 📌 Ensure All Book Covers Have the Same Height */
.book-item img {
    width: auto; /* Ensures the width adjusts automatically */
    height: 300px; /* Set a fixed height */
    object-fit: cover; /* Ensures the image is cropped properly */
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}


.book-item h3 {
    margin-top: 10px;
    font-size: 18px;
}

/* 📌 Modal (Hidden by Default) */
.modal {
    display: none; 
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px; /* Ensures it doesn't touch the edges */
}

/* 📌 Modal Content */
.modal-content {
    background: white;
    padding: 20px;
    border-radius: 10px;
    width: 90%; /* Make it wider */
    max-width: 600px; /* Set max width */
    max-height: 80vh; /* Prevent it from going off the screen */
    overflow-y: auto; /* Enables scrolling if content is too long */
    text-align: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

/* 📌 Modal Image */
.modal img {
    width: 100%;
    max-width: 300px; /* Slightly larger */
    border-radius: 8px;
    margin-bottom: 15px;
}

/* ❌ Close Button */
.close-btn {
    background: #d9534f;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.3s ease-in-out;
    width: 100%;
    max-width: 200px;
    margin-top: 15px;
}

/* Ensure Close Button is Sticky at the Bottom */
.modal-content .close-btn {
    position: sticky;
    bottom: 0;
    background: #c9302c;
}

/* 📌 Purchase Button (Always Visible) */
.modal-content .button {
    display: block;
    width: 100%;
    max-width: 250px;
    padding: 10px;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: bold;
    margin: 15px auto;
    text-align: center;
}

.modal-content .button:hover {
    background: #d43f21;
}

.close-btn:hover {
    background: #c9302c;
}

/* 📌 Footer */
.footer {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 1150px;
    max-width: var(--max-width);
    background: var(--secondary-color);
    color: var(--text-color);
    text-align: center;
    padding: 15px 0;
    font-size: 14px;
    z-index: 1000;
}

/* 📰 Blog Grid */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); /* Responsive columns */
    gap: 20px;
    padding: 20px;
    justify-content: center;
}

/* 📌 Blog Card */
.blog-card {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease-in-out;
    text-align: center;
}

.blog-card:hover {
    transform: translateY(-5px);
}

/* 🖼️ Blog Thumbnail (Small & Uniform) */
.blog-thumbnail {
    width: 100%;
    height: 150px; /* Fixed thumbnail size */
    object-fit: cover; /* Ensures consistent cropping */
    border-radius: 8px 8px 0 0; /* Rounded top */
}

/* 📄 Blog Content */
.blog-content {
    padding: 15px;
    text-align: left;
}

/* 🏷️ Category Tag */
.category-tag {
    background: #f04e30;
    color: white;
    font-size: 12px;
    font-weight: bold;
    padding: 5px 10px;
    border-radius: 20px;
    display: inline-block;
    margin-bottom: 10px;
}

/* 📝 Blog Meta Info */
.blog-meta {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #777;
    margin-top: 10px;
}

/* 📄 Blog Post Container */
.post-container {
    max-width: 1150;
    margin: auto;
    padding: 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    text-align: left;
}

/* 🖼 Blog Post Image */
.post-image img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    margin-bottom: 15px;
}

/* 📜 Blog Post Meta */
.post-meta {
    font-size: 14px;
    color: #777;
    margin-bottom: 15px;
}

/* 📝 Blog Post Content */
.post-content {
    font-size: 16px;
    line-height: 1.8;
    text-align: left;
}

/* 🎨 Ensure Images in Posts Fit Nicely */
.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    display: block;
    margin: 10px auto;
}

/* 🏷️ Ensure Headings in Blog Content Look Good */
.post-content h3 {
    font-size: 20px;
    margin-top: 15px;
}

/* 🏷️ Ensure Horizontal Rules Are Styled Nicely */
.post-content hr {
    border: 0;
    height: 1px;
    background: #ccc;
    margin: 20px 0;
}


/* 🔙 Back Button */
.back-button {
    display: inline-block;
    margin-top: 20px;
    padding: 10px 15px;
    background: #f04e30;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    transition: background 0.3s ease-in-out;
}

.back-button:hover {
    background: #d43f21;
}


/* 📱 Responsive Adjustments */
@media (max-width: 768px) {
    .content {
        padding: 180px 10px 60px;
    }

    .navbar a {
        font-size: 16px;
        margin: 0 10px;
    }

    .modal-content {
        width: 95%;
        max-width: 400px;
    }
}

/* 🔄 Smooth Fade-in Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* 📌 Reviews Container */
.reviews-container {
    max-width: 900px;
    margin: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
    text-align: left; /* Aligns everything inside the container to the left */
}

/* 📖 Review Card */
.review-card {
    background: #fff;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s;
    border: 1px solid #ddd;
    cursor: pointer;
}

.review-card:hover {
    transform: scale(1.02);
}


/* 👤 Review Header (Align Everything Left) */
.review-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 16px;
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
}

/* 👤 Reviewer Name */
.reviewer-name {
    color: #0073bb;
    font-weight: bold;
    text-align: left; /* Ensure name is left-aligned */
}

/* ⭐ Rating */
.review-rating {
    color: #ff9900;
    text-align: left; /* Align stars to the left */
}

/* 📖 Review Excerpt */
.review-excerpt {
    font-size: 14px;
    color: #555;
    margin: 5px 0;
    line-height: 1.5;
    text-align: left; /* Ensures text is aligned left */
}

/* ⏳ Review Date */
.review-date {
    font-size: 12px;
    color: #777;
    text-align: left; /* Align date left */
}

/* 📌 Review Modal */
.modal {
    display: none; /* Hidden by default */
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5); /* Semi-transparent background */
    justify-content: center;
    align-items: center;
    padding: 20px;
}

/* 🎨 Modal Content */
.modal-content {
    background: #ffffff; /* White background for readability */
    padding: 20px;
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
    text-align: left;
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.3);
    color: #333; /* Dark text for readability */
}

/* 📌 Reviewer Name */
#modal-reviewer {
    font-size: 20px;
    font-weight: bold;
    color: #222; /* Darker text */
}

/* ⭐ Rating */
#modal-rating {
    font-size: 18px;
    color: #ff9900; /* Amazon-style yellow stars */
}

/* 📖 Review Text */
#modal-content {
    font-size: 16px;
    line-height: 1.5;
    color: #333; /* Ensure text is visible */
}

/* 📅 Date */
#modal-date {
    font-size: 14px;
    color: #666;
}

/* ❌ Close Button */
.close-btn {
    background: #d9534f;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.3s ease-in-out;
    width: 100%;
    max-width: 200px;
    margin-top: 15px;
    display: block;
    text-align: center;
}

.close-btn:hover {
    background: #c9302c;
}

/* 📖 Author Section */
.author-container {
    display: flex;
    align-items: flex-start; /* Aligns image to the top of text */
    max-width: 900px;
    margin: auto;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1);
}

/* 👤 Author Image (Smaller Size) */
.author-image {
    width: 200px; /* Reduced from 150px */
    height: auto;
    border-radius: 8px;
    margin-right: 15px;
}

/* 📜 Author Text */
.author-text {
    flex: 1;
    text-align: left;
}

.author-text h1 {
    font-size: 24px;
    color: #222;
    margin-bottom: 10px;
}

.author-text p {
    font-size: 16px;
    color: #555;
    line-height: 1.6;
}


/* 🌍 Mobile-Friendly Adjustments */
@media (max-width: 768px) {
    /* Hide Header Image on Mobile */
    .header {
        display: none;
    }

    /* Placeholder for Mobile Header */
    .mobile-header {
        display: block;
        width: 100%;
        text-align: center;
        background: var(--secondary-color);
        color: var(--text-color);
        padding: 20px 0;
        font-size: 24px;
        font-weight: bold;
    }

    /* Adjust Navigation */
    .navbar {
        display: flex;
        flex-direction: column;
        align-items: center;
        padding: 10px 0;
        margin-top: 0;
    }

    .navbar a {
        display: block;
        padding: 10px;
        width: 100%;
        text-align: center;
        font-size: 16px;
    }

    /* Stack Content */
    .content {
        width: 95%;
        padding: 20px;
        font-size: 14px;
    }

    /* Adjust Author Section */
    .author-container {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .author-image {
        width: 80px;
        margin: 0 auto 10px;
    }

    /* Footer Adjustments */
    .footer {
        width: 100%;
        font-size: 12px;
        padding: 10px 0;
    }

/* 📱 Mobile Adjustments */
@media (max-width: 768px) {
    body, html {
        overflow-x: hidden;
        text-align: center;
    }

    /* Hide large header image */
    .header-image {
        display: none;
    }

    /* Replace with a placeholder */
    .header {
        width: 100%;
        height: 80px;
        background: url('images/placeholder.png') no-repeat center center;
        background-size: contain;
    }

    /* Responsive Navbar */
    .navbar {
        display: flex;
        flex-direction: column;
        text-align: center;
        padding: 10px 0;
    }

    .navbar a {
        display: block;
        padding: 10px;
        font-size: 16px;
    }

    /* Adjust Content Layout */
    .content {
        width: 95%;
        padding: 20px;
        font-size: 16px;
    }

    /* Blog Grid Responsive */
    .blog-grid {
        display: flex;
        flex-direction: column;
        gap: 15px;
        width: 100%;
        padding: 10px;
    }

    /* Blog Cards */
    .blog-card {
        width: 100%;
        max-width: 95%;
        margin: auto;
    }

    .blog-thumbnail {
        width: 100%;
        height: auto;
        object-fit: cover;
        border-radius: 8px;
    }

    /* Adjust Blog Content */
    .blog-content {
        padding: 10px;
        text-align: center;
    }

    /* Blog Meta */
    .blog-meta {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 5px;
        font-size: 14px;
    }

    /* Footer */
    .footer {
        font-size: 12px;
        padding: 10px;
    }
}


