/* Professional Blog Card Styles - 3 per row with equal heights */
.blog-card {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: all 0.3s ease;
    margin-bottom: 1.5rem;
    position: relative;
    /* Ensure equal heights */
    height: 100%;
    display: flex;
    flex-direction: column;
}


.blog-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 15px 25px rgba(0, 0, 0, 0.1), 0 6px 10px rgba(0, 0, 0, 0.06);
}

.blog-card-inner {
    height: 100%;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.slider-card .blog-image-wrapper {
    position: relative;
    overflow: hidden;
    height: 350px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    flex-shrink: 0;
}

.most-read-card .blog-content h3 {
    font-size: 20px;
    text-align: start;
}

.most-read-card .blog-footer {
    justify-content: flex-start;
}

.most-read-card .blog-image-wrapper {
    position: relative;
    overflow: hidden;
    height: 250px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    flex-shrink: 0;
}

.blog-image-link {
    display: block;
    height: 100%;
    width: 100%;
    position: relative;
}

.blog-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Ensures full coverage while maintaining aspect ratio */
    object-position: center;
    /* Center the image */
    transition: transform 0.4s ease;
    display: block;
    /* Remove any inline spacing */
}

.blog-card:hover .blog-image {
    transform: scale(1.05);
}

.blog-image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(76, 180, 143, 0.9), rgba(58, 155, 122, 0.9));
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.blog-card:hover .blog-image-overlay {
    opacity: 1;
}

.read-article-text {
    color: white;
    font-weight: 600;
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Category Badge */
.blog-category-badge {
    position: absolute;
    top: 16px;
    left: 16px;
    background: rgba(255, 255, 255, 0.95);
    color: #4cb48f;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    backdrop-filter: blur(10px);
    z-index: 2;
}

/* Content Section - Flexible height */
.blog-content {
    padding: 18px;
    flex: 1;
    /* Takes up remaining space */
    display: flex;
    flex-direction: column;
}

/* Title - Fixed sizing */
.blog-title {
    margin: 0 0 10px 0;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.3;
    /* Limit title to 2 lines for consistency */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.6em;
    /* Reserve space for 2 lines */
}

.blog-title-link {
    color: #1f2937;
    text-decoration: none;
    transition: color 0.3s ease;
}

.blog-title-link:hover {
    color: #4cb48f;
}

/* Excerpt - Flexible but consistent */
.blog-excerpt {
    color: #6b7280;
    line-height: 1.5;
    margin-bottom: 16px;
    flex: 1;
    /* Takes up available space */
    font-size: 14px;
    /* Limit excerpt for consistency */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Footer Section - Always at bottom */
.blog-footer {
    display: flex;
    justify-content: flex-end;
    padding-top: 12px;
    border-top: 1px solid #f3f4f6;
    margin-top: auto;
    /* Pushes to bottom */
}

/* Read More Button */
.blog-read-more {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #4cb48f;
    text-decoration: none;
    font-weight: 600;
    font-size: 13px;
    padding: 6px 12px;
    border-radius: 6px;
    transition: all 0.3s ease;
    background: rgba(76, 180, 143, 0.1);
}

.blog-read-more:hover {
    background: #4cb48f;
    color: white;
    transform: translateX(3px);
}

/* Grid Layout - Equal heights enforced */
.blog-grid,
.blog-grid-3col {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: 1fr;
    /* Forces equal row heights */
    gap: 1.5rem;
    margin: 2rem 0;
    align-items: stretch;
    /* Ensures cards stretch to fill */
}

/* Alternative: Auto-fit for responsive 3 columns */
.blog-grid-auto {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    grid-auto-rows: 1fr;
    /* Forces equal row heights */
    gap: 1.5rem;
    margin: 2rem 0;
    align-items: stretch;
}

/* Alternative: 2-column layout */
.blog-grid-2col {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 1fr;
    /* Forces equal row heights */
    gap: 1.5rem;
    margin: 2rem 0;
    align-items: stretch;
}

/* Responsive Design */
@media (max-width: 1024px) {

    .blog-grid,
    .blog-grid-3col {
        grid-template-columns: repeat(2, 1fr);
    }

    .blog-grid-auto {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
}

@media (max-width: 768px) {
    .blog-card {
        margin-bottom: 1.5rem;
        border-radius: 12px;
    }

    .slider-card .blog-image-wrapper {
        height: 180px;
        /* Slightly smaller on mobile */
    }

    .blog-content {
        padding: 16px;
    }

    .blog-title {
        font-size: 16px;
        min-height: 2.4em;
    }

    .blog-footer {
        justify-content: flex-end;
        padding-top: 12px;
    }

    .blog-read-more {
        padding: 6px 12px;
        font-size: 13px;
    }

    .blog-grid,
    .blog-grid-2col,
    .blog-grid-3col,
    .blog-grid-auto {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

@media (max-width: 480px) {
    .blog-content {
        padding: 14px;
    }

    .blog-title {
        font-size: 15px;
    }

    .blog-excerpt {
        font-size: 13px;
        -webkit-line-clamp: 2;
        /* Fewer lines on very small screens */
    }

    .slider-card .blog-image-wrapper {
        height: 160px;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .blog-card {
        background: #1f2937;
        color: #f9fafb;
    }

    .blog-title-link {
        color: #f9fafb;
    }

    .blog-title-link:hover {
        color: #4cb48f;
    }

    .blog-excerpt {
        color: #d1d5db;
    }

    .blog-footer {
        border-top-color: #374151;
    }

    .blog-category-badge {
        background: rgba(31, 41, 55, 0.95);
        color: #4cb48f;
    }
}

/* Loading Animation */
.blog-card[data-aos="fade-up"] {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.blog-card[data-aos="fade-up"].aos-animate {
    opacity: 1;
    transform: translateY(0);
}

/* Special Effects */
.blog-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #4cb48f, #3a9b7a);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.blog-card:hover::before {
    transform: scaleX(1);
}

/* Featured Article Variant */
.blog-card.featured {
    grid-column: span 2;
}

.blog-card.featured .slider-card .blog-image-wrapper {
    height: 280px;
}

.blog-card.featured .blog-title {
    font-size: 24px;
    min-height: 3.6em;
}

@media (max-width: 768px) {
    .blog-card.featured {
        grid-column: span 1;
    }

    .blog-card.featured .slider-card .blog-image-wrapper {
        height: 180px;
    }

    .blog-card.featured .blog-title {
        font-size: 16px;
        min-height: 2.4em;
    }
}