/* ==========================================================================
   1. GLOBAL RESET & ALIGNMENT
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Georgia, "Times New Roman", Times, serif;
    line-height: 1.6;
    color: #000;
    background-color: #fff;
    text-align: left; /* Strict left alignment */
}

.container {
    max-width: 100%;   /* Allows the content to span the whole browser */
    padding: 0 40px;   /* Adjusts the gap from the very edge of the screen */
}

/* ==========================================================================
   2. HEADER & NAVIGATION LINES (Fixes the Overlap)
   ========================================================================== */
h1 {
    font-size: 2.5rem;
    font-weight: normal;
    padding: 20px 0 10px 0;
}


.top-line {
    clear: both;
    display: block;
    width: 99%;         /* Keeps the small side gaps you liked */
    margin: 0 auto;     /* 0 margin on top/bottom keeps it tight to the nav */
    border-bottom: 1px solid #000;
}

nav {
    padding: 5px 0; /* Changed from 10px to 5px to bring lines closer to text */
}
nav a {
    text-decoration: underline;
    color: #0000EE;
}

.separator {
    margin: 0 10px;
    color: #000;
}

/* ==========================================================================
   3. PROFILE PHOTO (Fixes the "Huge" Image)
   ========================================================================== */
.profile-photo {
    width: 350px;      /* Controls size so it isn't huge */
    height: auto;
    float: right;      /* Moves it all the way to the right */
    margin-left: 30px; /* Space between text and image */
    margin-bottom: 20px;
}

/* This ensures the intro text doesn't look weird next to the photo */
.intro-section {
    padding-top: 10px;
    overflow: auto; /* Contains the float */
}

/* ==========================================================================
   4. BLOG STYLES (3-Column Grid)
   ========================================================================== */
.blog-grid-3 {
    display: flex;
    gap: 20px;
    margin: 30px 0;
}

.blog-grid-3 > div {
    flex: 1; /* Creates equal 3 columns */
}

.blog-grid-3 img {
    width: 100%;
    height: auto; /* Keeps original ratio for beetle photos */
    border: 1px solid #ddd;
}

.post-date {
    color: #666;         /* This is the gray color */
    font-size: 0.9rem;   /* Makes it slightly smaller than main text */
    margin-bottom: 20px; /* Adds space before your first paragraph starts */
}

/* ==========================================================================
   5. MOBILE FIX
   ========================================================================== */
@media (max-width: 768px) {
    .profile-photo {
        float: none;
        display: block;
        margin: 0 0 20px 0;
        width: 100%; /* Photo fills screen on phone */
    }
}

/* ==========================================================================
   6. BLOG INDEX PAGE STYLES (Preview List)
   ========================================================================== */

/* This aligns the image and text side-by-side */
.blog-entry {
    display: flex;
    gap: 30px;
    margin-bottom: 40px;
    align-items: flex-start;
}

/* This fixes the "Big Pictures" issue */
.blog-entry:first-of-type {
    margin-top: 40px;
} 
.blog-preview-img {
    width: 200px;         /* Adjust this to make the preview smaller or larger */
    height: auto;        /* Preserves the original aspect ratio */
    border: 1px solid #ddd;
    flex-shrink: 0;      /* Prevents the image from being squished */
}

.blog-text h2 {
    margin-top: 0;
    font-size: 1.5rem;
}

.post-date {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 10px;
}

.read-more {
    display: inline-block;
    margin-top: 10px;
    color: #0000EE;
    text-decoration: underline;
}

.blog-divider {
    border: 0;
    border-top: 1px solid #eee;
    margin: 40px 0;
}
/* ==========================================================================
   7. INDIVIDUAL BLOG POST STYLES
   ========================================================================== */

.full-post p {
    margin-bottom: 20px;
}

/* The 3-Column Grid using Flexbox */
.blog-grid-3 {
    display: flex;
    gap: 20px; 
    justify-content: flex-start; /* Keeps them grouped to the left */
}

.blog-grid-3 > div {
    flex: 0 1 auto; /* Prevents the boxes from stretching to fill the whole width */
}

.blog-grid-3 img {
    width: 100%;        /* Keeps them responsive to the column width */
    max-width: 400px;   /* Limits the actual size so they don't get 'Too Big' */
    height: auto;       /* This is the magic line that preserves the ratio */
    display: block;
    margin-bottom: 10px;
    border: 1px solid #ddd;
}

.text-muted {
    font-size: 0.85rem;
    color: #666;
    margin-top: 8px;
    line-height: 1.3;
}

/* Mobile: Stack the 3 columns into 1 */
@media (max-width: 768px) {
    .blog-grid-3 {
        flex-direction: column;
    }
}

/* Mobile: Stack them vertically so the image isn't too tiny */
@media (max-width: 768px) {
    .blog-entry {
        flex-direction: column;
    }
    .blog-preview-img {
        width: 100%;
        max-width: 300px;
    }
}