/* Blog Page Styles */

/* Hero Section */
.hero-section {
    background: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)), url('social.webp');
    background-size: cover;
    background-position: center;
    color: white;
    text-align: center;
    padding: 100px 20px;
    margin-bottom: 30px; /* Reduced margin */
}

.hero-content h1 {
    font-size: 3rem;
    margin-bottom: 20px;
    animation: fadeIn 1s ease-in-out;
}

.hero-content p {
    font-size: 1.2rem;
    max-width: 800px;
    margin: 0 auto;
    animation: fadeIn 1.2s ease-in-out;
}

/* Blog Grid */
.blog-section {
    padding: 20px 0 50px; /* Reduced top padding */
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    align-items: center; /* Center content horizontally */
}

/* Category Filters - Positioned at the top */
.blog-categories {
    width: 100%;
    margin-bottom: 30px;
    text-align: center;
}

.blog-categories h2 {
    margin-bottom: 20px;
    color: var(--primary-color);
    font-size: 1.8rem;
}

.category-filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-bottom: 30px;
}

.category-btn {
    padding: 8px 16px;
    background-color: #f0f0f0;
    border: none;
    border-radius: 20px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px; /* Ensure buttons have consistent width */
}

.category-btn:hover {
    background-color: #e0e0e0;
}

.category-btn.active {
    background-color: var(--primary-color);
    color: white;
}

/* Blog Grid - Centered below categories */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
    margin-bottom: 50px;
    width: 100%;
    justify-content: center;
}

.blog-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%; /* Make all cards the same height */
    display: flex;
    flex-direction: column;
}

.blog-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

.blog-image {
    height: 200px;
    overflow: hidden;
}

.blog-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.blog-card:hover .blog-image img {
    transform: scale(1.1);
}
.blog-image.contain-image img {
    object-fit: contain;
    background-color: #fff; /* Optional: Adds white background */
}


.blog-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1; /* Allow content to expand */
}

.blog-content h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: var(--primary-color);
    line-height: 1.3;
}

.blog-meta {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    font-size: 0.9rem;
    color: #666;
    flex-wrap: wrap; /* Allow wrapping on small screens */
}

.blog-meta span {
    margin-right: 10px;
    margin-bottom: 5px;
}

/* Category label styling */
.blog-category {
    margin-bottom: 15px;
}

.category-label {
    display: inline-block;
    padding: 4px 10px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.blog-excerpt {
    margin-bottom: 15px;
    line-height: 1.6;
    flex-grow: 1; /* Push the read more button to the bottom */
}

.read-more {
    display: inline-block;
    padding: 8px 15px;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-weight: 500;
    transition: background 0.3s ease;
    align-self: flex-start; /* Align to the start of the flex container */
    margin-top: auto; /* Push to the bottom of the card */
}

.read-more:hover {
    background: var(--secondary-color);
}

.blog-tags {
    margin-top: 15px;
    display: flex;
    flex-wrap: wrap;
}

.tag {
    display: inline-block;
    padding: 5px 10px;
    background: #f0f0f0;
    border-radius: 20px;
    font-size: 0.8rem;
    margin-right: 5px;
    margin-bottom: 5px;
    color: #333;
}

/* No posts message styling */
.no-posts {
    text-align: center;
    padding: 40px 20px;
    font-size: 1.2rem;
    color: #666;
    background: #f9f9f9;
    border-radius: 10px;
    width: 100%;
    grid-column: 1 / -1; /* Span all columns */
}

/* Single Blog Post - Centered */
.single-post {
    max-width: 800px;
    width: 100%;
    margin: 0 auto;
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.post-header {
    margin-bottom: 30px;
    text-align: center; /* Center the header */
}

.post-header h1 {
    font-size: 2.5rem;
    margin-bottom: 15px;
    color: var(--primary-color);
}

.post-meta {
    display: flex;
    justify-content: center; /* Center meta information */
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    color: #666;
}

.post-meta span {
    margin: 0 10px;
}

.post-featured-image {
    width: 100%;
    height: 400px;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 30px;
}

.post-featured-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-content {
    line-height: 1.8;
    font-size: 1.1rem;
}

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

.post-content h2 {
    margin: 30px 0 15px;
    color: var(--primary-color);
}

.post-content img {
    max-width: 100%;
    border-radius: 5px;
    margin: 20px 0;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .blog-grid {
        grid-template-columns: 1fr;
        max-width: 500px; /* Limit width on mobile for better readability */
    }
    
    .hero-content h1 {
        font-size: 2.5rem;
    }
    
    .post-header h1 {
        font-size: 2rem;
    }
    
    .post-featured-image {
        height: 250px;
    }
    
    .category-filters {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .category-btn {
        margin-bottom: 10px;
        min-width: 100px;
    }
}

@media (max-width: 480px) {
    .blog-grid {
        max-width: 100%;
    }
    
    .category-btn {
        min-width: 80px;
        font-size: 0.8rem;
        padding: 6px 12px;
    }
}