﻿/* blog.css - Contains only blog-specific styles with improved image handling */

/* Blog Filters */
.blog-filters {
    margin-top: 30px;
    margin-bottom: 40px;
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 15px;
}

.blog-categories {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.filter-label {
    font-weight: 600;
    color: #495057;
    margin-right: 10px;
}

.category-item {
    padding: 6px 12px;
    border-radius: 4px;
    background-color: #f1f3f5;
    color: #495057;
    text-decoration: none;
    transition: all 0.2s ease;
}

    .category-item:hover {
        background-color: #e9ecef;
        color: #212529;
    }

    .category-item.active {
        background-color: #0056b3;
        color: white;
    }

/* Blog Grid Layout */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-bottom: 40px;
    align-items: start; /* Changed from stretch to start to prevent stretching */
}

@media (max-width: 992px) {
    .blog-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .blog-grid {
        grid-template-columns: 1fr;
    }
}

/* Featured Post */
.blog-featured-post {
    grid-column: span 3;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    background-color: #f8f9fa;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 20px;
}

@media (max-width: 992px) {
    .blog-featured-post {
        grid-column: span 2;
        grid-template-columns: 1fr;
    }

    .featured-image {
        border-radius: 8px 8px 0 0; /* Change border radius for stacked layout */
    }
}

@media (max-width: 768px) {
    .blog-featured-post {
        grid-column: span 1;
    }
}

/* IMPROVED FEATURED IMAGE HANDLING - Natural image height with spacing */
.featured-image {
    width: 100%;
    overflow: hidden;
    border-radius: 8px 0 0 8px;
    background-color: #f8f9fa;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    min-height: 300px;
}

    .featured-image img {
        max-width: 100%;
        max-height: 400px;
        width: auto;
        height: auto;
        display: block;
        object-fit: contain;
    }

@media (max-width: 992px) {
    .featured-image {
        min-height: 250px;
    }

        .featured-image img {
            max-height: 350px;
        }
}

@media (max-width: 768px) {
    .featured-image {
        min-height: 200px;
    }

        .featured-image img {
            max-height: 300px;
        }
}

.featured-content {
    padding: 30px;
    display: flex;
    flex-direction: column;
}

    .featured-content h2 {
        font-size: 2rem;
        margin-bottom: 15px;
    }

        .featured-content h2 a {
            color: #333;
            text-decoration: none;
            transition: color 0.2s ease;
        }

            .featured-content h2 a:hover {
                color: #0056b3;
            }

    .featured-content .post-excerpt {
        margin-bottom: 20px;
        color: #495057;
        flex-grow: 1;
    }

    .featured-content .post-meta {
        margin-bottom: 10px;
    }

    .featured-content .post-author {
        margin-bottom: 20px;
        display: flex;
        align-items: center;
    }

.author-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 10px;
}

/* Blog Cards */
.blog-card {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background-color: white;
    height: 100%;
    display: flex;
    flex-direction: column;
}

    .blog-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    }

    /* IMPROVED BLOG CARD IMAGE HANDLING - Natural image height with fixed container */
    .blog-card .card-image {
        width: 100%;
        overflow: hidden;
        background-color: #f8f9fa;
        display: flex;
        justify-content: center;
        align-items: center;
        padding: 15px;
        height: 200px;
    }

        .blog-card .card-image img {
            max-width: 100%;
            max-height: 170px;
            width: auto;
            height: auto;
            display: block;
            transition: transform 0.5s ease, opacity 0.3s ease;
            object-fit: contain;
        }

    .blog-card:hover .card-image img {
        transform: scale(1.05);
        opacity: 0.9;
    }

@media (max-width: 768px) {
    .blog-card .card-image {
        height: 180px;
    }

        .blog-card .card-image img {
            max-height: 150px;
        }
}

.card-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

    .card-content h3 {
        font-size: 1.3rem;
        margin-bottom: 10px;
    }

        .card-content h3 a {
            color: #333;
            text-decoration: none;
            transition: color 0.2s ease;
        }

            .card-content h3 a:hover {
                color: #0056b3;
            }

.post-meta {
    display: flex;
    gap: 15px;
    font-size: 0.9rem;
    color: #6c757d;
    margin-bottom: 10px;
}

.post-category, .post-category a {
    color: #0056b3;
    text-decoration: none;
}

.post-excerpt {
    color: #6c757d;
    margin-bottom: 15px;
    flex-grow: 1;
}

.post-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

.post-author {
    display: flex;
    align-items: center;
}

.author-avatar-sm {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    margin-right: 8px;
}

.author-name {
    font-size: 0.9rem;
    color: #495057;
}

.read-more {
    font-size: 0.9rem;
    color: #0056b3;
    text-decoration: none;
    transition: color 0.2s ease;
}

    .read-more:hover {
        color: #003d7e;
    }

    .read-more i {
        font-size: 0.8rem;
        margin-left: 5px;
        transition: transform 0.2s ease;
    }

    .read-more:hover i {
        transform: translateX(3px);
    }

/* Pagination */
.blog-pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 40px 0;
}

.pagination-item {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 4px;
    background-color: #f1f3f5;
    color: #495057;
    text-decoration: none;
    transition: all 0.2s ease;
}

    .pagination-item:hover {
        background-color: #e9ecef;
        color: #212529;
    }

    .pagination-item.active {
        background-color: #0056b3;
        color: white;
    }

    .pagination-item:first-child,
    .pagination-item:last-child {
        width: auto;
        padding: 0 15px;
    }

/* Tag Cloud */
.blog-tags {
    margin-bottom: 60px;
}

    .blog-tags h3 {
        margin-bottom: 20px;
        font-size: 1.5rem;
        color: #333;
    }

.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tag-item {
    padding: 8px 16px;
    border-radius: 30px;
    background-color: #f1f3f5;
    color: #495057;
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

    .tag-item:hover {
        background-color: #0056b3;
        color: white;
    }

/* Blog CTA Section */
.blog-cta-section {
    background-color: #f8f9fa;
    padding: 60px 0;
    text-align: center;
    margin-top: 40px;
}

    .blog-cta-section h2 {
        font-size: 2rem;
        margin-bottom: 15px;
        color: #333;
    }

    .blog-cta-section p {
        font-size: 1.1rem;
        color: #6c757d;
        max-width: 700px;
        margin: 0 auto 25px;
    }

.newsletter-form {
    display: flex;
    max-width: 500px;
    margin: 0 auto;
}

    .newsletter-form input {
        flex-grow: 1;
        padding: 10px 15px;
        border: 1px solid #ced4da;
        border-radius: 4px 0 0 4px;
        font-size: 1rem;
    }

    .newsletter-form button {
        border-radius: 0 4px 4px 0;
    }

/* Responsive newsletter form for mobile */
@media (max-width: 576px) {
    .newsletter-form {
        flex-direction: column;
        align-items: center;
    }

        .newsletter-form input {
            width: 100%;
            border-radius: 4px;
            margin-bottom: 10px;
        }

        .newsletter-form button {
            width: 100%;
            border-radius: 4px;
        }
}

/* Blog error section */
.blog-error-section {
    text-align: center;
    padding: 60px 0;
}

    .blog-error-section h1 {
        font-size: 2.5rem;
        margin-bottom: 20px;
        color: #343a40;
    }

    .blog-error-section p {
        font-size: 1.1rem;
        color: #6c757d;
        margin-bottom: 30px;
    }
