﻿body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f8fafc;
}

.header {
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    color: white;
    padding: 4rem 0 3rem;
    position: relative;
    overflow: hidden;
}

.header::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="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.3;
}

.blog-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 0rem;
    position: relative;
    z-index: 1;
}

.header-content {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.header h1 {
    font-size: 2.5rem !important;
    font-weight: 700 !important;
    margin-bottom: 1rem !important;
    background: linear-gradient(45deg, #ffffff, #e0f2fe) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
}

.header p {
    font-size: 0.9rem !important;
    opacity: 0.9 !important;
    margin-bottom: 2rem !important;
}

.search-bar {
    position: relative;
    max-width: 500px;
    margin: 0 auto;
}

.search-input {
    width: 100%;
    padding: 1rem 1.5rem 1rem 3rem;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

    .search-input:focus {
        outline: none;
        background: white;
        box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
        transform: translateY(-2px);
    }

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
}

.filters-section {
    font-size: 0.8rem;
    background: white;
    padding: 2rem 0;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

.filters {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
}

.filter-chip {
    padding: 0.30rem 1.5rem !important;
    border: 2px solid #e5e7eb;
    border-radius: 50px;
    background: white;
    color: #374151;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    position: relative;
    overflow: hidden;
}

    .filter-chip:hover {
        border-color: #3b82f6;
        color: #1e40af;
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
    }

    .filter-chip.active {
        background: linear-gradient(135deg, #3b82f6, #1e40af);
        color: white;
        border-color: #1e40af;
        box-shadow: 0 4px 16px rgba(59, 130, 246, 0.3);
    }

.sort-dropdown {
    padding: 0.75rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

    .sort-dropdown:hover {
        border-color: #3b82f6;
    }

.blog-grid {
    padding: 3rem 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

.blog-card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    transition: all 0.4s ease;
    position: relative;
    cursor: pointer;
}

    .blog-card:hover {
        transform: translateY(-8px);
        box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    }

.blog-image {
    width: 100%;
    height: 220px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
    overflow: hidden;
}

    .blog-image::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        height: 50%;
        background: linear-gradient(transparent, rgba(0, 0, 0, 0.3));
    }

.blog-content {
    padding: 1.5rem;
}

.blog-meta {
    display: flex;
    flex-wrap: wrap; /* ADD THIS */
    gap: 0.5rem; /* OPTIONAL: reduce spacing */
    margin-bottom: 1rem;
    font-size: 0.875rem;
    color: #6b7280;
}

.blog-category {
    background: linear-gradient(135deg, #3b82f6, #1e40af);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-weight: 500;
    font-size: 0.55rem;
    white-space: nowrap; /* Keeps tag text in one line */
}

.blog-date {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.7rem;
}

.blog-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: #1f2937;
    line-height: 1.4;
}

.blog-excerpt {
    color: #6b7280;
    line-height: 1.6;
    margin-bottom: 1rem;
    font-size: 0.8rem;
}

.read-more {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #3b82f6;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 0.8rem;
}

    .read-more:hover {
        color: #1e40af;
        transform: translateX(4px);
    }

.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    padding: 3rem 0;
}

.page-btn {
    font-size: 0.85rem;
    padding: 0.20rem 1rem;
    border: 2px solid #e5e7eb;
    background: white;
    color: #374151;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 44px;
    text-align: center;
}

    .page-btn:hover {
        border-color: #3b82f6;
        color: #1e40af;
    }

    .page-btn.active {
        background: linear-gradient(135deg, #3b82f6, #1e40af);
        color: white;
        border-color: #1e40af;
    }

.featured-section {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    padding: 3rem 0;
    margin-bottom: 2rem;
}

.featured-card {
    background: white;
    border-radius: 24px;
    overflow: hidden;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    transition: all 0.4s ease;
}

    .featured-card:hover {
        transform: translateY(-4px);
        box-shadow: 0 16px 48px rgba(0, 0, 0, 0.15);
    }

.featured-image {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
}

.featured-content {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.featured-badge {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    width: fit-content;
    margin-bottom: 1rem;
}

.newsletter {
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    color: white;
    padding: 3rem 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

    .newsletter::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"><circle cx="50" cy="50" r="2" fill="rgba(255,255,255,0.1)"/></svg>') repeat;
        opacity: 0.3;
    }

.newsletter-form {
    display: flex;
    gap: 1rem;
    max-width: 400px;
    margin: 2rem auto 0;
    position: relative;
}

.newsletter-input {
    flex: 1;
    padding: 1rem;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    line-height: 48px;
}

.newsletter-btn {
    padding: 0.4rem 2rem;
    background: white;
    color: #1e40af;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

    .newsletter-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    }

@media (max-width: 768px) {
    .filters {
        display: flex;
        flex-wrap: wrap;
        justify-content:left;
        gap: 0.5rem 0.1rem;
        padding: 0 .5rem;
    }

    .filters-section {
        padding: 1rem 0;
        position: sticky;
        top: 56px;
        background: white;
        z-index: 999;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    }

    .filter-chip {
        flex-shrink: 0;
        white-space: nowrap;
        font-size:12px;
    }

    .blog-grid {
        grid-template-columns: 1fr;
        padding: 1rem;
        gap: 1.5rem;
    }

    .blog-title {
        font-size: 1rem;
    }

    .blog-excerpt {
        font-size: 0.8rem;
    }

    .read-more {
        font-size: 0.75rem;
    }

    .pagination {
        flex-wrap: wrap;
        gap: 0.4rem;
        padding: 1.5rem 1rem;
    }

    .newsletter-form {
        flex-direction: column;
        padding: 0 1rem;
    }

    .newsletter-input,
    .newsletter-btn {
        width: 100%;
    }
    .page-btn {
        font-size: 0.75rem;
        padding: 0.4rem 0.75rem;
        min-width: 36px;
        border-radius: 8px;
        flex-shrink: 0;
    }

    .pagination {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.3rem;
        padding: 1rem;
    }
}


.loading {
    opacity: 0.6;
    pointer-events: none;
}

.fade-in {
    animation: fadeIn 0.6s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}


.shimmer {
    animation: shimmer 1.5s infinite linear;
    background: linear-gradient(to right, #f0f0f0 8%, #e0e0e0 18%, #f0f0f0 33%);
    background-size: 1000px 100%;
}

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }

    100% {
        background-position: 1000px 0;
    }
}

.blog-skeleton .blog-card {
    background-color: #fff;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.blog-image.empty-gradient {
    background-size: cover;
    background-position: center;
}

.no-articles-msg {
    text-align: center;
    font-size: 1.1rem;
    margin-top: 2rem;
    color: #555;
}