/**
 * Blog Cards Styling
 * Beautiful and modern blog card designs with hover effects
 */

/* ===== BLOG SECTION ===== */
.blog-sec {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    position: relative;
}

.blog-sec::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="0.5" fill="%23000" opacity="0.02"/><circle cx="75" cy="75" r="0.5" fill="%23000" opacity="0.02"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.5;
    z-index: 1;
}

.blog-sec .container {
    position: relative;
    z-index: 2;
}

/* ===== BLOG CARD STYLES ===== */
.blog-card {
    background: #fff;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #e9ecef;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
}

.blog-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
    z-index: 1;
}

.blog-card:hover::before {
    left: 100%;
}

.blog-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    border-color: var(--primary-color, #007bff);
}

/* ===== BLOG IMAGE ===== */
.blog-img {
    position: relative;
    overflow: hidden;
    height: 250px;
    background: #f8f9fa;
}

.blog-img a {
    display: block;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.blog-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.blog-card:hover .blog-img img {
    transform: scale(1.08);
}

.blog-img::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0, 123, 255, 0.1), rgba(40, 167, 69, 0.1));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.blog-card:hover .blog-img::after {
    opacity: 1;
}

/* ===== BLOG CONTENT ===== */
.blog-content {
    padding: 2rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 2;
}

/* ===== BLOG META ===== */
.blog-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 0.85rem;
    color: #6c757d;
    font-weight: 500;
}

.blog-date {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.blog-date::before {
    content: '\f073';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: var(--primary-color, #007bff);
    font-size: 0.8rem;
}

.blog-category {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.75rem;
    background: linear-gradient(135deg, var(--primary-color, #007bff), var(--secondary-color, #28a745));
    color: white;
    border-radius: 15px;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.blog-category::before {
    content: '\f02b';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 0.7rem;
}

/* ===== BLOG TITLE ===== */
.blog-content h3 {
    font-size: 1.4rem;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 1rem;
    color: #212529;
}

.blog-content h3 a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
    position: relative;
}

.blog-content h3 a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-color, #007bff), var(--secondary-color, #28a745));
    transition: width 0.3s ease;
}

.blog-card:hover .blog-content h3 a {
    color: var(--primary-color, #007bff);
}

.blog-card:hover .blog-content h3 a::after {
    width: 100%;
}

/* ===== BLOG EXCERPT ===== */
.blog-content p {
    color: #6c757d;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    flex: 1;
    font-size: 0.95rem;
}

/* ===== READ MORE BUTTON ===== */
.read-more {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary-color, #007bff);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    position: relative;
    margin-top: auto;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.read-more i {
    transition: transform 0.3s ease;
    font-size: 0.8rem;
}

.read-more:hover {
    color: var(--secondary-color, #28a745);
    text-decoration: none;
    transform: translateX(3px);
}

.read-more:hover i {
    transform: translateX(5px);
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .blog-img {
        height: 220px;
    }
    
    .blog-content {
        padding: 1.5rem;
    }
    
    .blog-content h3 {
        font-size: 1.25rem;
    }
    
    .blog-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

@media (max-width: 576px) {
    .blog-img {
        height: 200px;
    }
    
    .blog-content {
        padding: 1.25rem;
    }
    
    .blog-content h3 {
        font-size: 1.1rem;
    }
    
    .blog-content p {
        font-size: 0.9rem;
    }
}

/* ===== LOADING ANIMATION ===== */
.blog-card.loading {
    opacity: 0;
    transform: translateY(30px);
}

.blog-card.loaded {
    animation: slideInUp 0.6s ease forwards;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== ACCESSIBILITY ===== */
.blog-card:focus-within {
    outline: 2px solid var(--primary-color, #007bff);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .blog-card,
    .blog-img img,
    .read-more,
    .blog-content h3 a::after {
        transition: none;
        animation: none;
    }
    
    .blog-card:hover {
        transform: none;
    }
    
    .blog-card:hover .blog-img img {
        transform: none;
    }
}

/* ===== BLOG SECTION HEADER ===== */
.blog-sec .text-center h2 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #212529;
    margin-bottom: 1rem;
    position: relative;
}

.blog-sec .text-center h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color, #007bff), var(--secondary-color, #28a745));
    border-radius: 2px;
}

.blog-sec .text-center p {
    font-size: 1.1rem;
    color: #6c757d;
    margin-bottom: 0;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* ===== VIEW ALL POSTS BUTTON ===== */
.blog-sec .themeBtn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, var(--primary-color, #007bff), var(--secondary-color, #28a745));
    color: white;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.blog-sec .themeBtn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.blog-sec .themeBtn:hover::before {
    left: 100%;
}

.blog-sec .themeBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 123, 255, 0.4);
    color: white;
    text-decoration: none;
}

.blog-sec .themeBtn i {
    transition: transform 0.3s ease;
}

.blog-sec .themeBtn:hover i {
    transform: translateX(3px);
}

/* ===== ADDITIONAL MOBILE ENHANCEMENTS ===== */
@media (max-width: 480px) {
    .blog-sec {
        padding: 40px 0;
    }
    
    .blog-sec .text-center h2 {
        font-size: 2rem;
    }
    
    .blog-sec .text-center p {
        font-size: 1rem;
        padding: 0 10px;
    }
    
    .blog-img {
        height: 180px;
    }
    
    .blog-content {
        padding: 1rem;
    }
    
    .blog-content h3 {
        font-size: 1rem;
        line-height: 1.4;
    }
    
    .blog-content p {
        font-size: 0.85rem;
        line-height: 1.5;
    }
    
    .blog-meta {
        font-size: 0.75rem;
        gap: 0.5rem;
    }
    
    .blog-category {
        font-size: 0.65rem;
        padding: 0.2rem 0.5rem;
    }
    
    .read-more {
        font-size: 0.8rem;
    }
    
    .blog-sec .themeBtn {
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
    }
}

/* ===== HIGH CONTRAST MODE SUPPORT ===== */
@media (prefers-contrast: high) {
    .blog-card {
        border: 2px solid #000;
    }
    
    .blog-card:hover {
        border-color: #007bff;
    }
    
    .blog-category {
        background: #000 !important;
        color: #fff !important;
    }
}

/* ===== PRINT STYLES ===== */
@media print {
    .blog-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    .blog-card:hover {
        transform: none;
    }
    
    .blog-img::after,
    .blog-card::before {
        display: none;
    }
    
    .read-more {
        display: none;
    }
    
    .blog-sec .themeBtn {
        display: none;
    }
}
