/* --- CSS Custom Properties for easy theme management --- */
:root {
    --primary-color: #3f51b5;
    --primary-darker: #1a237e;
    --text-color: #333;
    --text-soft: #4a4a4a;
    --background-start: #e0f7fa;
    --background-end: #bbdefb;
    --white: #ffffff;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --shadow-stronger: rgba(0, 0, 0, 0.2);
}

/* --- Global Styles & Animated Background --- */
body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, var(--background-start), var(--background-end));
    background-size: 200% 200%;
    color: var(--text-color);
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    animation: gradientShift 10s ease infinite;
    box-sizing: border-box;
}

*, *::before, *::after {
    box-sizing: inherit;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* OVERRIDE FOR BLOG: The blog content should start at the top, not centered */
main {
    flex-grow: 1;
    display: block; 
    padding: 40px 20px;
}

/* --- Top Navigation Bar (Original CSS) --- */
.topnav {
    background-color: var(--white);
    box-shadow: 0 4px 15px var(--shadow-color);
    padding: 12px 25px;
    display: flex;
    justify-content: flex-start;
    gap: 35px;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.topnav .menu-header { display: flex; align-items: center; }
.nav-logo { height: 45px; width: 45px; border-radius: 50%; margin-right: 12px; object-fit: cover; }
.topnav .logo-link { color: var(--primary-darker); font-size: 1.7em; font-weight: 700; text-decoration: none; display: flex; align-items: center; transition: color 0.3s ease, transform 0.2s ease; }
.topnav .logo-link:hover { color: var(--primary-color); transform: scale(1.02); }
.topnav .menu-icon { display: none; cursor: pointer; padding: 10px; }
.topnav .menu-icon .bar { width: 28px; height: 3px; background-color: var(--text-color); margin: 5px 0; transition: 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55); }
.menu-icon.change .bar:nth-child(1) { transform: rotate(-45deg) translate(-6px, 6px); }
.menu-icon.change .bar:nth-child(2) { opacity: 0; }
.menu-icon.change .bar:nth-child(3) { transform: rotate(45deg) translate(-7px, -7px); }
.topnav .menu-links { display: flex; transition: transform 0.3s ease-in-out; list-style: none; margin: 0; padding: 0; }
.topnav a { color: var(--text-soft); text-align: center; padding: 15px 20px; text-decoration: none; font-size: 17px; font-weight: 500; transition: color 0.3s; position: relative; }
.topnav a::after { content: ''; position: absolute; width: 0; height: 2px; background-color: var(--primary-color); left: 50%; bottom: 10px; transform: translateX(-50%); transition: width 0.3s ease-out; }
.topnav a:hover::after, .topnav a.active::after { width: 60%; }
.topnav a:hover { color: var(--primary-color); }
.topnav a.active { color: var(--primary-color); font-weight: 600; }

/* --- Footer Styles (Original CSS) --- */
footer {
    background-color: var(--primary-darker);
    color: #f0f0f0;
    text-align: center;
    padding: 20px 0;
    font-size: 0.9em;
    box-shadow: 0 -2px 10px var(--shadow-color);
    margin-top: auto; 
}

/* ========================================================== */
/* BLOG SPECIFIC STYLES (Updated) */
/* ========================================================== */

/* Blog List Header */
.blog-list-header {
    max-width: 1200px;
    margin: 0 auto 40px auto;
    text-align: center;
}
.blog-list-header h1 {
    font-size: 2.5em;
    color: var(--primary-darker);
    margin-bottom: 5px;
}

/* **NEW IMAGE STYLE** */
.blog-post-image {
    width: 100%;
    height: 200px; /* Fixed height for a consistent grid look */
    object-fit: cover; /* Ensures image covers the box without distortion */
    border-radius: 10px; 
    margin-bottom: 15px;
}

/* 1. BLOG CONTAINER (Grid Layout) */
#blog-posts-container {
    max-width: 1200px;
    margin: 0 auto; 
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
}

/* 2. INDIVIDUAL BLOG CARD STYLING */
.blog-post-item {
    background: var(--white);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 15px; 
    padding: 25px;
    box-shadow: 0 5px 15px var(--shadow-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between; 
    text-decoration: none;
    color: inherit;
}

.blog-post-item:hover {
    transform: translateY(-8px); 
    box-shadow: 0 15px 30px var(--shadow-stronger);
}

.blog-post-item h2 {
    font-size: 1.3em;
    font-weight: 700;
    color: var(--primary-color);
    margin-top: 0;
    margin-bottom: 10px;
    line-height: 1.4;
}

.blog-post-item p.summary {
    font-size: 0.9em;
    color: var(--text-soft);
    margin-bottom: 20px;
    flex-grow: 1; 
}

.blog-post-item p.date {
    font-size: 0.85em;
    color: #888;
    margin: 0 0 15px 0;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    font-weight: 500;
}

.read-more-link {
    display: inline-block;
    color: var(--primary-darker); 
    text-decoration: none;
    font-weight: 700;
    transition: color 0.3s ease;
}

/* 3. PAGINATION STYLING */
#pagination-container {
    max-width: 1200px;
    margin: 30px auto 0 auto;
    text-align: center;
}

.pagination-btn {
    background-color: var(--primary-color);
    color: var(--white);
    border: none;
    padding: 10px 15px;
    margin: 0 5px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.3s, transform 0.2s;
    box-shadow: 0 0 5px var(--shadow-color);
}

.pagination-btn:hover:not(:disabled) {
    background-color: var(--primary-darker);
    transform: translateY(-2px);
}

.pagination-btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    box-shadow: none;
}

.pagination-page-number {
    background-color: var(--white);
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.pagination-page-number.active {
    background-color: var(--primary-darker);
    color: var(--white);
    border-color: var(--primary-darker);
    font-weight: 700;
}
        
/* --- Responsive Layout (Original CSS) --- */
@media screen and (max-width: 600px) {
    .topnav { flex-wrap: wrap; padding: 10px 15px; }
    .topnav .menu-header { width: 100%; }
    .topnav .menu-icon { display: block; }
    .topnav .menu-links { display: none; flex-direction: column; width: 100%; position: absolute; top: 70px; left: 0; background-color: var(--white); box-shadow: 0 2px 5px var(--shadow-stronger); border-radius: 0 0 10px 10px; }
    .topnav .menu-links.show { display: flex; }
    .topnav a { padding: 12px 18px; text-align: left; border-bottom: 1px solid var(--shadow-color); border-radius: 0; color: var(--text-soft); }
    .topnav a:hover { background-color: rgba(0, 0, 0, 0.05); }
    .topnav a.active { background-color: rgba(0, 0, 0, 0.1); }
    /* Blog Specific Mobile */
    #blog-posts-container { grid-template-columns: 1fr; padding: 0 15px; gap: 20px; }
    .pagination-btn { padding: 8px 12px; margin: 0 3px; }
        }
