/* =========================
   BLOG PAGE STYLES
   ========================= */

/* Blog Hero */
.blog-hero {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    padding: 4rem 0;
    position: relative;
    overflow: hidden;
}

.blog-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M0 0h100v100H0z'/%3E%3Cpath d='M0 0l50 50-50 50z'/%3E%3C/g%3E%3C/svg%3E");
    background-size: 200px 200px;
}

.blog-hero .hero-content {
    text-align: center;
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.blog-hero h1 {
    color: var(--white);
    margin-bottom: 1rem;
    animation: fadeIn 0.8s ease;
}

.blog-hero p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.25rem;
    margin-bottom: 2rem;
    animation: fadeIn 1s ease;
}

/* Blog Search */
.blog-search {
    display: flex;
    max-width: 500px;
    margin: 0 auto;
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.search-input {
    flex: 1;
    padding: 1rem 1.5rem;
    border: none;
    font-size: 1rem;
    outline: none;
}

.search-btn {
    padding: 0 1.5rem;
    background: var(--primary);
    border: none;
    color: var(--white);
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-btn:hover {
    background: var(--primary-dark);
}

/* Blog Categories */
.blog-categories {
    background: var(--white);
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--border);
    position: static;
    top: 70px;
    z-index: 40;
}

.categories-scroll {
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
}

.categories-scroll::-webkit-scrollbar {
    height: 3px;
}

.categories-scroll::-webkit-scrollbar-track {
    background: var(--secondary);
}

.categories-scroll::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 2px;
}

.category-tag {
    padding: 0.5rem 1.25rem;
    background: var(--secondary);
    border: none;
    border-radius: 2rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.category-tag:hover {
    background: var(--primary);
    color: var(--white);
    transform: translateY(-2px);
}

.category-tag.active {
    background: var(--primary);
    color: var(--white);
}

/* Featured Section */
.featured-section {
    padding: 4rem 0 2rem;
    background: var(--secondary);
}

.featured-article {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.featured-image {
    position: relative;
    height: 400px;
}

.featured-image .image-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 5rem;
}

.featured-badge {
    position: absolute;
    top: 2rem;
    left: 2rem;
    background: var(--white);
    color: var(--primary);
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.featured-content {
    padding: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.featured-content h2 {
    margin-bottom: 1rem;
    color: var(--text-primary);
    line-height: 1.3;
}

.featured-content p {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 2rem;
}

/* Article Meta */
.article-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.article-meta .category {
    background: rgba(22, 163, 74, 0.1);
    color: var(--primary);
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-weight: 500;
}

.article-meta .date {
    color: var(--text-secondary);
}

.article-meta .read-time {
    color: var(--text-secondary);
}

.article-meta .read-time i {
    margin-right: 0.25rem;
}

/* Blog Grid Section */
.blog-grid-section {
    padding: 2rem 0 5rem;
    background: var(--secondary);
}

.blog-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 3rem;
}

/* Articles Grid */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
}

/* Blog Card */
.blog-card {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.blog-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
}

.card-image {
    height: 200px;
    overflow: hidden;
}

.card-image .image-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(22, 163, 74, 0.8), rgba(21, 128, 61, 0.8));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 3rem;
    transition: all 0.3s ease;
}

.blog-card:hover .card-image .image-placeholder {
    transform: scale(1.1);
}

.card-content {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.card-content h3 {
    margin-bottom: 0.75rem;
    color: var(--text-primary);
    line-height: 1.4;
}

.card-content p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1.5rem;
    flex: 1;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.read-time {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.read-time i {
    margin-right: 0.25rem;
}

.read-more {
    color: var(--primary);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.read-more:hover {
    gap: 0.75rem;
}

/* Blog Sidebar */
.blog-sidebar {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.sidebar-widget {
    background: var(--white);
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
}

.sidebar-widget h3 {
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-widget h3 i {
    color: var(--primary);
}

/* Newsletter Widget */
.newsletter-widget {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: var(--white);
}

.newsletter-widget h3,
.newsletter-widget p {
    color: var(--white);
}

.newsletter-widget p {
    margin-bottom: 1.5rem;
    opacity: 0.9;
}

.newsletter-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.newsletter-form input {
    padding: 0.875rem;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
}

.newsletter-widget small {
    display: block;
    margin-top: 0.5rem;
    opacity: 0.8;
    font-size: 0.875rem;
}

/* Popular Posts */
.popular-posts {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.popular-post {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: var(--secondary);
    border-radius: var(--radius);
    transition: all 0.3s ease;
}

.popular-post:hover {
    background: var(--primary);
    transform: translateX(5px);
}

.popular-post:hover h4,
.popular-post:hover .post-views {
    color: var(--white);
}

.post-number {
    width: 40px;
    height: 40px;
    background: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--primary);
    flex-shrink: 0;
}

.popular-post h4 {
    font-size: 0.9375rem;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.post-views {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

/* Download Widget */
.download-widget {
    background: linear-gradient(135deg, rgba(22, 163, 74, 0.05), rgba(22, 163, 74, 0.02));
    border: 2px solid var(--primary);
    text-align: center;
}

.download-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 2rem;
}

.download-widget h4 {
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.download-widget p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

/* Tags Cloud */
.tags-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag {
    padding: 0.375rem 0.875rem;
    background: var(--secondary);
    border-radius: 1rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

.tag:hover {
    background: var(--primary);
    color: var(--white);
    transform: translateY(-2px);
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 3rem;
}

.page-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.page-btn:hover:not(:disabled) {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

.page-btn.active {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-dots {
    padding: 0 0.5rem;
    color: var(--text-secondary);
}

/* Blog CTA */
.blog-cta {
    padding: 5rem 0;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    position: relative;
    overflow: hidden;
}

.blog-cta::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.blog-cta .cta-content {
    position: relative;
    text-align: center;
    max-width: 700px;
    margin: 0 auto;
}

.blog-cta h2 {
    color: var(--white);
    margin-bottom: 1rem;
}

.blog-cta p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.125rem;
    margin-bottom: 2rem;
}

.blog-cta .cta-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-block {
    width: 100%;
}

/* Responsive */
@media (max-width: 1024px) {
    .featured-article {
        grid-template-columns: 1fr;
    }
    
    .featured-image {
        height: 300px;
    }
    
    .blog-layout {
        grid-template-columns: 1fr;
    }
    
    .articles-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
}

@media (max-width: 768px) {
    .blog-hero {
        padding: 3rem 0;
    }
    
    .blog-hero h1 {
        font-size: 2rem;
    }
    
    .blog-hero p {
        font-size: 1.125rem;
    }
    
    .featured-content {
        padding: 2rem;
    }
    
    .articles-grid {
        grid-template-columns: 1fr;
    }
    
    .blog-sidebar {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: 2rem;
    }
}

@media (max-width: 480px) {
    .blog-search {
        flex-direction: column;
    }
    
    .search-btn {
        padding: 1rem;
    }
    
    .featured-content {
        padding: 1.5rem;
    }
    
    .sidebar-widget {
        padding: 1.5rem;
    }
    
    .pagination {
        flex-wrap: wrap;
    }
}