.blog-container {
    max-width: 1200px;
    margin: 80px auto 40px;
    padding: 0 20px;
}

.blog-container h1 {
    text-align: center;
    margin-bottom: 40px;
    color: #333;
    font-size: 2.5em;
}

.blog-posts {
    display: grid;
    gap: 30px;
    grid-template-columns: 1fr;
}

.blog-post {
    background: #ffffff;
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.blog-post:hover {
    transform: translateY(-5px);
}

.blog-post h2 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.8em;
}

.post-meta {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    color: #666;
    font-size: 0.9em;
}

.post-meta .category {
    color: #007bff;
}

.blog-post p {
    color: #555;
    line-height: 1.6;
    margin-bottom: 20px;
}

.read-more {
    display: inline-block;
    color: #007bff;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.read-more:hover {
    color: #0056b3;
}

@media (min-width: 768px) {
    .blog-posts {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 767px) {
    .blog-container {
        margin: 100px auto 30px; /* Increased to 100px to clear the navbar */
    }
    
    .blog-post {
        padding: 20px;
    }
    
    .blog-post h2 {
        font-size: 1.5em;
    }
}

/* --- Single Article Page Styling --- */

/* Wrapper for the individual article */
.single-article {
    background: #ffffff;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    max-width: 800px; /* Limits width for better readability */
    margin: 0 auto;   /* Centers the article */
}

/* Header area (Title & Date) */
.article-header {
    text-align: center;
    border-bottom: 1px solid #eee;
    padding-bottom: 2rem;
    margin-bottom: 2rem;
}

.article-title {
    font-size: 2.5rem;
    color: #333;
    margin-bottom: 1rem;
    line-height: 1.2;
}

/* The actual text content */
.article-content {
    font-size: 1.1rem;
    line-height: 1.8; /* Improves reading comfort */
    color: #444;
}

.article-content p {
    margin-bottom: 1.5rem;
}

.article-content h3 {
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    color: #222;
    font-size: 1.5rem;
}

.article-content ul, 
.article-content ol {
    margin-bottom: 1.5rem;
    padding-left: 2rem;
}

.article-content li {
    margin-bottom: 0.5rem;
}

/* Footer area with Back button */
.article-footer {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid #eee;
}

/* Dark Mode Adjustments */
[data-theme="dark"] .single-article {
    background: var(--card-background); /* Dark background for card */
}

[data-theme="dark"] .article-title,
[data-theme="dark"] .article-content h3 {
    color: var(--text-color); /* White text */
}

[data-theme="dark"] .article-content {
    color: #cccccc; /* Light gray text for readability */
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .single-article {
        padding: 20px;
    }
    .article-title {
        font-size: 2rem;
    }
}

/* Styling for images inside blog posts */
.article-content img {
    max-width: 100%;       /* Ensures image never exceeds the article width */
    height: auto;          /* Maintains the aspect ratio */
    border-radius: 8px;    /* Adds nice rounded corners */
    margin: 2rem 0;        /* Adds space above and below the image */
    display: block;        /* Makes it a block element so we can center it */
    box-shadow: 0 4px 10px rgba(0,0,0,0.1); /* Optional: adds a subtle shadow */
}

/* Optional: To Center the image */
.article-content img.centered {
    margin-left: auto;
    margin-right: auto;
}

/* Utility class to remove shadow */
.article-content img.no-shadow {
    box-shadow: none;
}