/* --- Google Font & Color Variables --- */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700&display=swap');

:root {
    --primary-color: #2E5339; /* Green from logo */
    --text-color: #333333;
    --background-color: #F9F9F9;
    --light-grey: #EAEAEA;
    --white-color: #ffffff;
}

/* --- Basic Reset & Body Styles --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
}

/* --- Header & Navigation Bar --- */
.header {
    background-color: var(--white-color);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 1rem 5%;
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.nav-logo img {
    height: 40px; /* Adjust height as needed */
}

.nav-menu {
    list-style: none;
    display: flex;
    gap: 2rem;
}

.nav-link {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 600;
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: var(--primary-color);
}

/* --- Hero Section --- */
.hero {
    background: linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.5)), url('https://images.unsplash.com/photo-1457369804613-52c61a468e7d?q=80&w=2070') center/cover no-repeat;
    color: var(--white-color);
    text-align: center;
    padding: 6rem 1rem;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

.btn {
    background-color: var(--primary-color);
    color: var(--white-color);
    padding: 12px 24px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 600;
    transition: background-color 0.3s ease;
}

.btn:hover {
    background-color: #1a3a22; /* A darker green */
}

/* --- Featured Books Section --- */
.featured-books, .external-links {
    padding: 4rem 5%;
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

h2 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    position: relative;
    display: inline-block;
}

h2::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: var(--primary-color);
    margin: 0.5rem auto 0;
}

/* --- Updated Book Grid for 3 Books per Row --- */
.book-grid {
    display: grid;
    /* This tells the browser to create exactly 3 equal columns */
    grid-template-columns: repeat(3, 1fr); 
    gap: 2rem;
    margin-top: 2rem;
}

.book-card {
    background: var(--white-color);
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    padding: 1.5rem;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.book-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.15);
}

.book-card img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.book-card h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.book-card .author {
    color: #777;
    margin-bottom: 1rem;
}

.book-card .price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.75rem;
    display: block;
}

.btn-buy {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    padding: 10px 20px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 600;
    display: inline-block;
    transition: all 0.3s ease;
}

.btn-buy:hover {
    background: var(--primary-color);
    color: var(--white-color);
}

/* --- External Links & Socials Section --- */
.external-links {
    background-color: var(--light-grey);
}

.social-icons {
    margin-top: 2rem;
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.social-icons a {
    text-decoration: none;
    color: var(--text-color);
    font-size: 1.2rem;
    padding: 10px 20px;
    border: 1px solid #ccc;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.social-icons a:hover {
    background-color: var(--primary-color);
    color: var(--white-color);
    border-color: var(--primary-color);
}

.social-icons i {
    margin-right: 0.5rem;
}


/* --- Footer --- */
.footer {
    background-color: var(--text-color);
    color: var(--white-color);
    text-align: center;
    padding: 1.5rem 5%;
}

/* --- About Us Page Styles --- */

/* A shorter hero section for internal pages */
.hero-short {
    background: linear-gradient(rgba(0,0,0,0.6), rgba(0,0,0,0.6)), url('https://images.unsplash.com/photo-1457369804613-52c61a468e7d?q=80&w=2070') center/cover no-repeat;
    color: var(--white-color);
    text-align: center;
    padding: 4rem 1rem;
}

.page-content {
    padding: 4rem 5%;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
}

.text-center {
    text-align: center;
}

.lead-paragraph {
    font-size: 1.1rem;
    max-width: 800px;
    margin: 1rem auto 0 auto;
    color: #555;
}

.light-bg {
    background-color: #fdfdfd;
}

/* Story Section Layout */
.story-container {
    display: flex;
    align-items: center;
    gap: 3rem;
}

.story-image {
    flex-basis: 40%;
}

.story-image img {
    max-width: 100%;
    height: auto;
    border-radius: 50%; /* Creates a circular image */
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}

.story-text {
    flex-basis: 60%;
}

.story-text h3 {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.story-text h3 {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

/* Add space between paragraphs in the story section */
.story-text p {
    margin-bottom: 1.5em; 
}

/* Values Section Layout */
.values-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-top: 3rem;
}

.value-card {
    padding: 2rem;
    border: 1px solid var(--light-grey);
    border-radius: 8px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.value-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.value-card i {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.value-card h3 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}

/* --- Responsive Adjustment for Mobile --- */
@media (max-width: 768px) {
    .book-grid {
        /* On phones, show only 1 book per row for better readability */
        grid-template-columns: 1fr;
    }
}

/* --- Optional: Tablet Adjustment --- */
@media (min-width: 769px) and (max-width: 1024px) {
    .book-grid {
        /* On tablets, 2 books per row looks best */
        grid-template-columns: repeat(2, 1fr);
    }
}

/* --- Contact Page Styles --- */

.contact-container {
    display: flex;
    gap: 3rem;
}

.contact-info, .contact-form {
    flex: 1; /* This makes both columns take up equal space */
}

.contact-info h3, .contact-form h3 {
    font-size: 1.8rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}

.contact-details {
    list-style: none;
    margin: 1.5rem 0;
}

.contact-details li {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.contact-details li i {
    font-size: 1.5rem;
    color: var(--primary-color);
    width: 40px; /* Gives the text some space */
}

/* Form Styling */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 5px rgba(46, 83, 57, 0.5);
}

.map-section {
    /* The iframe handles its own styling, we just need the section container */
    width: 100%;
    height: 450px;
}

/* --- Responsive Design for Contact Page --- */
@media (max-width: 768px) {
    .contact-container {
        flex-direction: column;
    }
}

/* --- Library Page Styles --- */

.library-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
    flex-wrap: wrap; /* Allows items to wrap on smaller screens */
    gap: 1.5rem; /* Adds space between items when they wrap */
}

/* --- Responsive Design for Library Toolbar --- */
@media (max-width: 768px) {
    .library-toolbar {
        flex-direction: column;
        align-items: stretch; /* Makes both items take full width */
    }

    .search-bar input {
        width: 100%; /* Expands to fill the available space */
    }
}

/* --- Product Detail Page Styles --- */

.product-details-container {
    display: flex;
    gap: 3rem; /* Space between image and text */
}

/* Left Column: Image */
.product-image {
    flex: 1; /* Takes up 1 part of the space */
    max-width: 400px;
}

.product-image img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

/* Right Column: Info */
.product-info {
    flex: 2; /* Takes up 2 parts of the space, so it's wider */
}

.product-info h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-color);
    line-height: 1.3;
}

.author-detail {
    font-size: 1.2rem;
    color: #555;
    margin-top: 0.5rem;
}

.price-detail {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 1.5rem 0;
}

.description {
    margin: 1.5rem 0;
    line-height: 1.7;
}

.description h3, .description h4 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

.description ul {
    list-style-type: disc;
    padding-left: 20px;
}

.product-buy-btn {
    font-size: 1.2rem;
    padding: 15px 30px; /* Make the button bigger */
}

.product-buy-btn i {
    margin-left: 8px;
}

/* Responsive design for product page */
@media (max-width: 768px) {
    .product-details-container {
        flex-direction: column;
    }
}