/* --- Global Reset & Base Styles --- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Montserrat', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa; /* Light grey background */
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

a {
    color: #007bff; /* Primary link color */
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: #0056b3; /* Darker shade on hover */
    text-decoration: underline;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

h1, h2, h3, h4, h5, h6 {
    margin-bottom: 0.75em;
    font-weight: 600;
    line-height: 1.2;
}

.container {
    width: 90%;
    max-width: 1140px; 
    margin-left: auto;
    margin-right: auto;
    padding-left: 15px;
    padding-right: 15px;
}

/* --- Header --- */
.page-header {
    background-color: #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    height: 120px;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-logo img {
    height: 150px;
    vertical-align: middle;
}

.header-nav ul {
    list-style: none;
    display: flex;
    gap: 1.5rem; /* Spacing between nav items */
}

.header-nav a {
    font-weight: 500;
    color: #333;
    padding: 0.5rem 0;
    position: relative;
    text-decoration: none;
}

.header-nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: #007bff;
    transition: width 0.3s ease;
}

.header-nav a:hover::after,
.header-nav a.active::after { /* Add .active class to current page link in nav if desired */
    width: 100%;
}

.mobile-nav-toggle {
    display: none; /* Hidden on desktop */
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #333;
    cursor: pointer;
}

/* --- Main Content & Blog Section --- */
main {
    flex-grow: 1; /* Ensures footer stays at the bottom */
}

.blog-listing-section {
    padding: 3rem 0; /* More vertical padding */
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 2.5rem;
    color: #2a2a2a;
}

.blog-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); /* Responsive grid */
    gap: 2rem; /* Gap between cards */
}

.no-posts-message {
    grid-column: 1 / -1; /* Span all columns if no posts */
    text-align: center;
    font-size: 1.2rem;
    color: #777;
    padding: 2rem;
}

/* --- Blog Card --- */
.blog-card {
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden; /* Ensures image corners are rounded if image wrapper is rounded */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.blog-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12);
}

.blog-card-link {
    display: flex;
    flex-direction: column;
    height: 100%; /* Make link fill the card */
    text-decoration: none;
    color: inherit; /* Inherit text color from body/card */
}


.blog-card-image-wrapper {
    width: 100%;
    height: 200px; /* Fixed height for image container */
    overflow: hidden;
}

.blog-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Cover the area, might crop */
    transition: transform 0.3s ease;
}

.blog-card:hover .blog-card-img {
    transform: scale(1.05); /* Subtle zoom on hover */
}

.blog-card-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1; /* Allows content to fill space, pushing read-more down */
}

.blog-card-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #222;
}

.blog-meta {
    font-size: 0.85rem;
    color: #6c757d; /* Bootstrap's text-muted color */
    margin-bottom: 0.75rem;
}

.blog-author {
    font-weight: 500;
}

/* If you add dates:
.blog-date::before {
    content: "•";
    margin: 0 0.5em;
}
*/

.blog-excerpt {
    font-size: 0.95rem;
    color: #555;
    line-height: 1.5;
    margin-bottom: 1rem;
    flex-grow: 1; /* Pushes "Read More" down */
}

.read-more-link {
    display: inline-block;
    font-weight: 600;
    color: #007bff;
    margin-top: auto; /* Pushes to the bottom of the card content */
    align-self: flex-start; /* Align to the start of the flex container */
}

.read-more-link:hover {
    text-decoration: underline;
    color: #0056b3;
}

/* --- Pagination Controls --- */
.pagination-controls {
    margin-top: 3rem;
    text-align: center;
}

.pagination-controls ul {
    list-style: none;
    padding: 0;
    display: inline-flex; /* Align items in a row */
    gap: 0.5rem;
}

.pagination-link {
    display: inline-block;
    padding: 0.5em 1em;
    border: 1px solid #dee2e6; /* Light border */
    color: #007bff;
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.2s ease, color 0.2s ease;
    font-size: 0.9rem;
}

.pagination-link:hover,
.pagination-link.active {
    background-color: #007bff;
    color: #fff;
    border-color: #007bff;
}

.pagination-link.active {
    font-weight: bold;
    cursor: default;
}

.pagination-controls .disabled .pagination-link {
    color: #6c757d;
    pointer-events: none;
    background-color: #e9ecef;
    border-color: #dee2e6;
}


/* --- Footer --- */
.page-footer {
    background-color: #343a40; /* Dark background for footer */
    color: #f8f9fa; /* Light text */
    padding: 2rem 0;
    text-align: center;
    margin-top: auto; /* Pushes footer to bottom if content is short */
}

.page-footer p {
    margin: 0;
    font-size: 0.9rem;
}

.page-footer a {
    color: #adb5bd; /* Lighter link color for dark background */
}

.page-footer a:hover {
    color: #ffffff;
}


/* --- Responsive Design --- */
@media (max-width: 768px) {
    .header-nav {
        display: none; /* Hide nav by default on mobile */
        position: absolute;
        top: 100%; /* Position below header */
        left: 0;
        width: 100%;
        background-color: #ffffff;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
        flex-direction: column;
        padding: 1rem 0;
    }

    .header-nav.active {
        display: flex; /* Show when toggled */
    }

    .header-nav ul {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }

    .header-nav li {
        width: 100%;
        text-align: center;
    }
    .header-nav a {
        display: block; /* Make links full width for easier tapping */
        padding: 0.75rem 1rem;
    }
    .header-nav a::after {
      display: none; /* Optionally hide underline effect on mobile nav items */
    }


    .mobile-nav-toggle {
        display: block; /* Show hamburger icon */
    }

    .section-title {
        font-size: 2rem;
    }

    .blog-posts-grid {
        grid-template-columns: 1fr; /* Single column on smaller screens */
        gap: 1.5rem;
    }

    .blog-card-title {
        font-size: 1.15rem;
    }

    .blog-excerpt {
        font-size: 0.9rem;
    }

    .pagination-link {
        padding: 0.4em 0.8em;
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .container {
        width: 95%;
    }
    .header-logo img {
        height: 35px;
    }
    .section-title {
        font-size: 1.8rem;
        margin-bottom: 1.5rem;
    }
}