/* General Setup */
body {
    margin: 0;
    padding: 0;
    font-family: 'Lora', serif; /* Nice serif font for reading */
    background-color: #81b29a;
    color: #333;
    line-height: 1.6;
}

h1, h2, h3, .logo, .nav-links a {
    font-family: 'Montserrat', sans-serif; /* Clean sans-serif for headers */
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* Navigation */
.navbar {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem 1rem;
    background-color: #81b29a;
    border-bottom: 1px solid #ddd;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.nav-links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 20px;
}

.nav-links a {
    text-decoration: none;
    color: #555;
    font-size: 0.9rem;
    font-weight: 400;
}

.nav-links a:hover, .nav-links a.active {
    color: #000;
    border-bottom: 1px solid #000;
}

/* Toggle button (hidden on desktop by default) */
.nav-toggle {
    display: none;
    background-color: #81b29a;      /* same green as body */
    color: #333;                     /* or #000 if you prefer */
    border: 1px solid #555;
    padding: 0.4rem 0.75rem;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    margin-bottom: 1rem;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;               /* remove native button styling */
}

/* Main Layout */
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 3rem 1rem;
    text-align: center;
}

/* Book Section */
.hero h1 {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.subtitle {
    font-size: 1.2rem;
    margin-bottom: 3rem;
    color: #666;
}

.book-feature {
    display: flex;
    flex-direction: column; /* Stacks image and text on mobile */
    align-items: center;
    gap: 2rem;
}

.book-cover {
    width: 100%;
    max-width: 250px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.15);
}

blockquote {
    border-left: 3px solid #333;
    margin: 1rem 0;
    padding-left: 1rem;
    font-style: italic;
    color: #444;
}

.author-tag {
    margin-top: 1.5rem;
    font-weight: bold;
}

.smaller {
    font-weight: normal;
    font-size: 0.9rem;
    color: #666;
}

/* Footer */
footer {
    background-color: #222;
    color: #fff;
    text-align: center;
    padding: 3rem 1rem;
    margin-top: 2rem;
}

footer a {
    color: #fff;
    text-decoration: none;
    margin: 0 5px;
}

footer a:hover {
    text-decoration: underline;
}

/* Styling for General Pages (About/Contact) */
.page-content {
    text-align: left;
    max-width: 700px;
    margin: 0 auto;
}

.page-content h1 {
    text-align: center;
    margin-bottom: 2rem;
}

.page-content h2 {
    margin-top: 2rem;
    border-bottom: 1px solid #eee;
    padding-bottom: 0.5rem;
}

.profile-photo {
    display: block;
    max-width: 300px;
    height: auto;
    margin: 0 auto;   /* centers horizontally */
}

.contact-page {
    text-align: center;
}

.contact-methods {
    margin-top: 2rem;
    padding: 2rem;
    border: 1px solid #ddd;
    border-radius: 8px;
}

.contact-methods h2 {
    border-bottom: none;
    margin-bottom: 0.5rem;
}

/* Specific Styles for Book Detail Pages */
.book-details .subtitle {
    font-style: italic;
    margin-bottom: 3rem;
}

.book-info {
    display: flex;
    flex-direction: column; /* Stack vertically on mobile */
    align-items: flex-start;
    gap: 40px;
    text-align: left;
}

.book-cover-large {
    width: 100%;
    max-width: 300px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.15);
    flex-shrink: 0; /* Prevents image from shrinking */
}

/* Desktop Layout (side-by-side) */
@media (min-width: 768px) {
    .book-info {
        flex-direction: row;
    }
    .book-info.reverse-layout {
        flex-direction: row-reverse; /* For Physics for Poets */
    }
    .book-text {
        flex-grow: 1;
    }
}

/* Buy Button Styling */
.buy-button {
    display: inline-block;
    background-color: #555;
    color: white;
    padding: 12px 24px;
    text-decoration: none;
    border-radius: 5px;
    margin-top: 2rem;
    font-weight: 700;
    transition: background-color 0.3s;
    letter-spacing: 1px;
}

.buy-button:hover {
    background-color: #000;
}

/* Mobile navigation behaviour */
@media (max-width: 767px) {
    .navbar {
        align-items: center;
    }

    .nav-toggle {
        display: block;       /* show button on small screens */
    }

    #nav-links {
        display: none;        /* hidden until button is pressed */
        width: 100%;
    }

    .nav-links {
        flex-direction: column;
        gap: 10px;
        align-items: center;
    }
}

/* Mobile navigation behaviour */
@media (max-width: 767px) {
    .nav-toggle {
        display: block;
    }

    #nav-links {
        display: block;   /* fallback: visible even if JS fails */
        width: 100%;
    }

    .nav-links {
        flex-direction: column;
        gap: 10px;
        align-items: center;
    }
}