/* Universal Styles */
:root {
    /* Define color variables for easy changes and consistency */
    --primary-color: #5d4037; /* Darker brown */
    --secondary-color: #2e7d32; /* Darker green */
    --text-color-dark: #333;
    --text-color-light: #fff;
    --accent-grey: grey;
    --background-light: rgb(255, 255, 243); /* Your existing off-white/cream */
    --footer-bg-color: #2c3e50; /* Deep charcoal for footer */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    /* Using system fonts for performance and native feel */
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

html {
    scroll-behavior: smooth; /* Smooth scrolling for anchor links */
}

body {
    line-height: 1.6;
    color: var(--text-color-dark);
    overflow-x: hidden; /* Prevent horizontal scroll due to potential overflows */
    -webkit-font-smoothing: antialiased; /* Better font rendering for macOS/iOS */
    -moz-osx-font-smoothing: grayscale; /* Better font rendering for macOS/iOS */
}

a {
    text-decoration: none;
    color: var(--accent-grey);
    transition: color 0.3s ease; /* Smooth hover effect */
}

a:hover,
a:focus {
    color: var(--primary-color); /* Change link color on hover/focus */
}
.banner {
    margin: -10px auto;
}

img {
    max-width: 100%;
    height: auto;
    display: block; /* Removes extra space below images */
}

h1, h2, h3, h4, h5, h6 {
    line-height: 1.2; /* Better line height for headings */
    margin-bottom: 0.5em; /* Add some space below headings */
}
h1 {
    text-align: center;
    color: crimson;
    font-size: clamp(2em, 8vw, 4em);
}
h2 {
    font-size: 1.1em;
}

/* Screen Reader Only Class for Accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Header */
.site-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background-color: #fff; /* Assuming a white background for the header */
    box-shadow: 0 2px 5px rgba(0,0,0,0.1); /* Subtle shadow for depth */
    position: sticky; /* Makes header stick to top */
    top: 0;
    z-index: 1000; /* Ensures header is above other content */
}

.logo-link {
    display: flex; /* Align logo image better if it has space around it */
    align-items: center;
}

.logo {
    width: 120px; /* Adjust as needed for your logo size */
    height: auto;
}

/* Navigation */
.main-nav ul {
    display: flex;
    list-style: none;
    gap: 25px; /* Space between navigation items */
    transition: transform 0.3s ease-in-out;
}

.main-nav a {
    font-size: 1.1em;
    font-weight: 500;
    padding: 8px 0; /* Add more vertical padding for clickable area */
    position: relative; /* For underline effect */
}

.main-nav a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -3px;
    left: 0;
    background-color: var(--primary-color);
    transition: width 0.3s ease-in-out;
}

.main-nav a:hover::after,
.main-nav a:focus::after {
    width: 100%;
}

/* Mobile Navigation Toggle (Hidden by default on desktop) */
.menu-toggle {
    display: none; /* Hide on larger screens */
    background: none;
    border: none;
    font-size: 1.8em;
    color: var(--primary-color);
    cursor: pointer;
    padding: 10px;
    z-index: 1001; /* Ensure toggle is above the menu */
}

/* About Us Section */
.about-us-section {
    padding: 60px 20px;
    max-width: 900px;
    margin: 0 auto;
}
.about-us-section p {
    font-size: clamp(1em, 2vw, 1.5em);
}

.subscription {
    padding: 0px 20px;
    max-width: 900px;
    margin: 0 auto;
}
.sub {
    display: flex;
    flex-wrap: nowrap;
    gap: 20px;
    margin-bottom: 15px;
}
.sub p {
    font-weight: 500;
}
button {
    border: 2px transparent;
    border-radius: 10px;
    background-color: var(--secondary-color);
    color: white;
    text-align: center;
    font-size: 1em;
    padding: 0 5px;
}

/* Footer */
.site-footer {
    background-color: #5d4037;
    color: var(--text-color-light);
    padding: 40px 20px 20px;
    text-align: center;
}

.footer-contact-info {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.footer-contact-info address {
    font-style: normal;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 5px;
}

.footer-contact-info .icon {
    width: 25px;
    height: 25px;
    filter: invert(100%);
    display: inline-block;
    vertical-align: middle;
}

.footer-contact-info p,
.footer-contact-info a {
    color: var(--text-color-light);
    font-size: 1em;
    margin: 0;
}

.footer-contact-info a:hover {
    text-decoration: underline;
}

/* New styling for the contact icons in the footer */
.contact-icon {
    width: 20px;
    height: 20px;
    filter: invert(100%);
    display: inline-block;
    vertical-align: middle;
    margin-right: 5px;
}

.footer-copyright p {
    font-size: 0.9em;
    opacity: 0.8;
    margin-top: 20px;
}


/* ========================================= */
/* MEDIA QUERIES FOR RESPONSIVENESS          */
/* ========================================= */

/* For screens up to 1024px wide (desktops, large tablets) */
@media (max-width: 1024px) {
    .site-header {
        padding: 10px;
    }
    .logo {
        width: 100px;
    }
    .main-nav ul {
        gap: 20px;
    }
}

/* For screens up to 768px wide (tablets and smaller) */
@media (max-width: 768px) {
    /* Mobile navigation */
    .menu-toggle {
        display: block;
    }
    .main-nav ul {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 60px;
        right: 0;
        width: 250px;
        background-color: #fff;
        box-shadow: 0 5px 15px rgba(0,0,0,0.1);
        border-radius: 8px;
        padding: 20px;
        transform: translateX(100%);
        transition: transform 0.3s ease-in-out;
    }
    .main-nav ul[data-visible="true"] {
        display: flex;
        transform: translateX(0);
    }
    .main-nav li {
        margin: 10px 0;
        text-align: center;
    }
    .main-nav a {
        padding: 10px;
        display: block;
        font-size: 1.2em;
    }
    .main-nav a::after {
        display: none;
    }


    .footer-contact-info address,
    .footer-contact-info a {
        font-size: 0.9em;
    }
}

/* For screens up to 480px wide (small mobile phones) */
@media (max-width: 480px) {
    .site-header {
        padding: 10px;
    }
    .logo {
        width: 80px;
    }
    .main-nav ul {
        width: 100%;
        border-radius: 0;
        right: 0;
    }

    .hero-banner h1 {
        font-size: clamp(1.8em, 8vw, 2.5em);
    }
    .hero-banner .tagline {
        font-size: clamp(1em, 5vw, 1.4em);
    }

    .books-container {
        gap: 20px;
    }
    .book-item {
        width: 100%;
    }
    .buy-now-btn {
        font-size: 0.9em;
        padding: 8px;
    }

    .footer-contact-info address,
    .footer-contact-info a {
        font-size: 0.9em;
    }
}
