/* ===================================
   BLOG SYSTEM CSS
   ================================= */

/* Blog Header */
.blog-header {
    background: linear-gradient(135deg, var(--primary-50), var(--secondary-50));
    padding: 6rem 0 4rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.blog-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 1000 100" fill="rgba(255,255,255,0.1)"><polygon points="0,0 1000,0 1000,100 0,80"/></svg>') no-repeat bottom;
    background-size: cover;
}

.blog-header-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    margin: 0 auto;
}

.blog-title {
    font-size: 3.5rem;
    font-weight: 800;
    color: var(--primary-900);
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--primary-600), var(--secondary-600));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.blog-subtitle {
    font-size: 1.2rem;
    color: var(--primary-700);
    margin-bottom: 2.5rem;
    line-height: 1.6;
}

/* Categories Filter */
.categories-filter {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 2rem;
}

.category-btn {
    padding: 0.75rem 1.5rem;
    border: 2px solid var(--primary-200);
    background: white;
    color: var(--primary-600);
    border-radius: 2rem;
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.category-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-500), var(--secondary-500));
    transition: left 0.3s ease;
    z-index: 0;
}

.category-btn span {
    position: relative;
    z-index: 1;
}

.category-btn:hover::before,
.category-btn.active::before {
    left: 0;
}

.category-btn:hover,
.category-btn.active {
    color: white;
    border-color: var(--primary-500);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(44, 82, 130, 0.25);
}

/* Blog Posts Section */
.blog-posts {
    padding: 5rem 0;
    background: var(--gray-50);
}

.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

/* Post Cards */
.post-card {
    background: white;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    position: relative;
    height: fit-content;
}

.post-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.post-image {
    position: relative;
    height: 220px;
    overflow: hidden;
}

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

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

.post-category {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: linear-gradient(135deg, var(--primary-500), var(--secondary-500));
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 1.5rem;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.post-content {
    padding: 1.5rem;
}

.post-title {
    margin-bottom: 1rem;
}

.post-title a {
    color: var(--primary-900);
    text-decoration: none;
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.4;
    transition: color 0.3s ease;
}

.post-title a:hover {
    color: var(--primary-600);
}

.post-excerpt {
    color: var(--gray-600);
    line-height: 1.6;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.post-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--gray-200);
    font-size: 0.85rem;
    color: var(--gray-500);
}

.post-read-more {
    color: var(--primary-600);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.post-read-more:hover {
    color: var(--primary-700);
    transform: translateX(4px);
}

/* Newsletter Card */
.newsletter-card {
    background: linear-gradient(135deg, var(--primary-600), var(--secondary-600));
    color: white;
    padding: 2rem;
    border-radius: 1rem;
    text-align: center;
    position: relative;
    overflow: hidden;
    grid-column: 1 / -1;
    max-width: 600px;
    margin: 2rem auto 0;
    justify-self: center;
}

.newsletter-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: pulse 4s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.05); opacity: 0.8; }
}

.newsletter-content {
    position: relative;
    z-index: 2;
}

.newsletter-content h3 {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.newsletter-content p {
    margin-bottom: 1.5rem;
    opacity: 0.9;
    line-height: 1.5;
}

.newsletter-form {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
    justify-content: center;
}

.newsletter-form input {
    flex: 1;
    min-width: 250px;
    padding: 0.875rem 1rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.95);
    color: var(--gray-800);
}

.newsletter-form input::placeholder {
    color: var(--gray-500);
}

.newsletter-form input:focus {
    outline: none;
    background: white;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3);
}

.newsletter-form .btn {
    padding: 0.875rem 1.5rem;
    background: white;
    color: var(--primary-600);
    border: none;
    font-weight: 600;
    white-space: nowrap;
}

.newsletter-form .btn:hover {
    background: var(--gray-100);
    transform: translateY(-1px);
}

.newsletter-content small {
    opacity: 0.8;
    font-size: 0.8rem;
}

/* Load More Section */
.load-more-section {
    text-align: center;
    margin-top: 3rem;
}

.load-more-btn {
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 500;
    min-width: 200px;
}

/* Blog CTA Section */
.blog-cta {
    background: linear-gradient(135deg, var(--primary-900), var(--primary-700));
    color: white;
    padding: 5rem 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.blog-cta::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 1000 300" fill="rgba(255,255,255,0.05)"><circle cx="200" cy="150" r="100"/><circle cx="800" cy="100" r="80"/><circle cx="600" cy="250" r="120"/></svg>') no-repeat center;
    background-size: cover;
}

.blog-cta .cta-content {
    position: relative;
    z-index: 2;
    max-width: 700px;
    margin: 0 auto;
}

.blog-cta h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.blog-cta p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.9;
    line-height: 1.6;
}

.cta-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.cta-buttons .btn {
    padding: 1rem 2rem;
    font-size: 1rem;
    min-width: 180px;
}

.cta-buttons .btn-primary {
    background: white;
    color: var(--primary-600);
}

.cta-buttons .btn-primary:hover {
    background: var(--gray-100);
    transform: translateY(-2px);
}

.cta-buttons .btn-outline {
    border-color: rgba(255, 255, 255, 0.5);
    color: white;
    background: transparent;
}

.cta-buttons .btn-outline:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: white;
}

/* Responsive Design */
@media (max-width: 768px) {
    .blog-header {
        padding: 4rem 0 3rem;
    }
    
    .blog-title {
        font-size: 2.5rem;
    }
    
    .blog-subtitle {
        font-size: 1.1rem;
    }
    
    .categories-filter {
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 0.5rem;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    
    .categories-filter::-webkit-scrollbar {
        display: none;
    }
    
    .category-btn {
        white-space: nowrap;
        flex-shrink: 0;
    }
    
    .posts-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .post-image {
        height: 200px;
    }
    
    .post-content {
        padding: 1.25rem;
    }
    
    .post-title a {
        font-size: 1.1rem;
    }
    
    .newsletter-card {
        margin: 1.5rem auto 0;
        padding: 1.5rem;
    }
    
    .newsletter-form {
        flex-direction: column;
    }
    
    .newsletter-form input {
        min-width: auto;
    }
    
    .blog-cta h2 {
        font-size: 2rem;
    }
    
    .blog-cta p {
        font-size: 1.1rem;
    }
    
    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .cta-buttons .btn {
        min-width: 250px;
    }
}

@media (max-width: 480px) {
    .blog-title {
        font-size: 2rem;
    }
    
    .post-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .newsletter-content h3 {
        font-size: 1.3rem;
    }
}