/* Base Styling & Typography */
body {
    background-color: #222222; 
    color: #e5e5e5; 
    font-family: "Palatino", "Palatino Linotype", "Book Antiqua", serif;
    margin: 0;
    padding: 50px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.5;
}

a {
    color: #60a5fa;
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: #93c5fd;
}

/* Navigation Menu */
.main-nav {
    margin-bottom: 50px;
    font-size: 1.2rem;
    display: flex;
    gap: 30px;
    border-bottom: 1px solid #444;
    padding-bottom: 15px;
    width: 100%;
    max-width: 800px;
    justify-content: center;
}

.main-nav a.active {
    color: #ffffff;
    border-bottom: 2px solid #1e3a8a;
    padding-bottom: 5px;
}

/* Profile Card (Hero Section) */
.profile-card {
    border: 1px solid #1e3a8a; 
    background-color: #0f0f0f;
    padding: 30px;
    border-radius: 8px;
    width: 100%;
    max-width: 740px;
    display: flex;
    align-items: center;
    gap: 30px;
    margin-bottom: 60px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.6);
}

.profile-img {
    width: 150px;
    height: 150px;
    object-fit: cover;
    border-radius: 4px;
    border: 2px solid #333;
}

.profile-text h1 {
    color: #60a5fa; 
    margin: 0 0 5px 0;
    font-size: 2.2rem;
    font-weight: normal;
}

.profile-text h2 {
    font-size: 0.85rem;
    letter-spacing: 2.5px;
    margin: 0 0 15px 0;
    color: #a3a3a3;
    font-weight: normal;
}

.profile-text p {
    font-size: 1.05rem;
    font-style: italic;
    margin: 0 0 20px 0;
    color: #cccccc;
}

/* Substack Button */
.substack-btn {
    display: inline-block;
    background-color: #1e3a8a;
    color: #ffffff;
    padding: 10px 20px;
    border-radius: 4px;
    font-size: 1rem;
    border: 1px solid #3b82f6;
    transition: all 0.2s ease;
}

/* Books Section */
#latest-releases {
    width: 100%;
    max-width: 800px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    border-bottom: 1px solid #444;
    padding-bottom: 10px;
    margin-bottom: 30px;
}

.section-header h3 {
    color: #60a5fa;
    font-weight: normal;
    font-size: 1.6rem;
    margin: 0;
}

.view-all-link {
    font-size: 1rem;
    font-style: italic;
}

/* Book Grid Layout */
.book-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.book-card {
    display: flex;
    flex-direction: column;
}

.book-cover {
    width: 100%;
    height: auto;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
    margin-bottom: 15px;
    border: 1px solid #333;
}

.book-card h4 {
    margin: 0 0 5px 0;
    font-size: 1.2rem;
    color: #ffffff;
    font-weight: normal;
}

.book-card p {
    margin: 0 0 15px 0;
    font-size: 0.95rem;
    color: #999999;
}

.detail-link {
    margin-top: auto;
    font-size: 0.95rem;
    font-weight: bold;
}
/* Read More Link */
.read-more {
    font-size: 0.95rem;
    font-style: normal;
    font-weight: bold;
    margin-left: 5px;
}

/* Footer Styling */
footer {
    width: 100%;
    max-width: 800px;
    border-top: 1px solid #444;
    margin-top: 60px;
    padding-top: 20px;
    text-align: center;
    font-size: 0.85rem;
    color: #888888;
}

footer a {
    color: #888888;
}

footer a:hover {
    color: #60a5fa;
}

/* Page Content Formatting (For Bio and Book Pages) */
.page-content {
    width: 100%;
    max-width: 740px;
    background-color: #0f0f0f;
    padding: 40px;
    border-radius: 8px;
    border: 1px solid #333;
    box-shadow: 0 4px 15px rgba(0,0,0,0.4);
}

.page-content h2 {
    color: #60a5fa;
    margin-top: 0;
    border-bottom: 1px solid #444;
    padding-bottom: 10px;
    font-weight: normal;
}

/* Single Book Layout */
.single-book-layout {
    display: flex;
    gap: 40px;
    align-items: flex-start;
}

.single-book-cover {
    width: 250px;
    height: auto;
    border-radius: 4px;
    border: 1px solid #333;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

.book-meta {
    flex: 1;
}

.buy-links {
    margin-top: 25px;
    display: flex;
    gap: 15px;
}

/* Author Bio Layout */
.bio-layout {
    display: flex;
    gap: 35px;
    align-items: flex-start;
    margin-top: 25px;
}

.bio-img {
    flex: 0 0 200px; /* Forces the flexbox to stay exactly 200px wide */
    max-width: 200px; /* Absolutely prevents the raw image from expanding */
    width: 100%;
    height: auto;
    border-radius: 5px;
    border: 1px solid #333;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

.bio-text p:first-child {
    margin-top: 0;
}

/* =========================================
   Mobile Responsiveness (Phones & Small Tablets)
   ========================================= */
@media (max-width: 768px) {
    /* Reduces the massive empty space on the sides of the phone */
    body {
        padding: 25px 15px; 
    }

    /* Allows the navigation links to wrap to a second line if needed */
    .main-nav {
        flex-wrap: wrap; 
        gap: 15px;
        font-size: 1.1rem;
    }

    /* Stacks the profile picture on top of the text and centers it */
    .profile-card {
        flex-direction: column; 
        text-align: center;
        padding: 20px;
        gap: 15px;
    }

    /* Centers the Substack button when stacked */
    .substack-btn {
        margin-top: 10px;
    }

    /* Forces the 3-column book grid into a single vertical column */
    .book-grid {
        grid-template-columns: 1fr; 
        gap: 40px;
    }

    /* Stacks the book cover and text vertically on the individual book pages */
    .single-book-layout {
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }

    /* Stacks your headshot and text vertically on the Bio page */
    .bio-layout {
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }

    /* Centers the images when stacked */
    .single-book-cover,
    .bio-img {
        margin-bottom: 10px;
    }
}