/* ============================================================================
   BLOG STYLES
   ============================================================================ */

:root {
    --blog-primary: var(--primary);
    --blog-secondary: var(--text-secondary);
    --blog-accent: var(--primary-dark);
    --blog-text: var(--text-primary);
    --blog-light-bg: var(--background);
    --blog-border: var(--border);
}

/* Header */
.blog-header {
    background: white;
    border-bottom: 1px solid var(--blog-border);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.blog-header .header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.blog-header h1 a {
    font-size: 1.5rem;
    color: var(--blog-primary);
    text-decoration: none;
    font-weight: 700;
}

.blog-header nav {
    display: flex;
    gap: 2rem;
}

.blog-header nav a {
    color: var(--blog-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.blog-header nav a:hover,
.blog-header nav a.active {
    color: var(--blog-primary);
}

/* Hero */
.blog-hero {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 150px 20px 100px;
    text-align: center;
    margin-top: 70px;
    position: relative;
    overflow: hidden;
}

.blog-hero .container {
    position: relative;
    z-index: 2;
}

.blog-hero h1 {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.blog-hero p {
    font-size: 1.25rem;
    opacity: 0.9;
}

/* Container */
.blog-container {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 3rem;
    margin-top: 3rem;
    margin-bottom: 3rem;
}

.blog-main {
    min-width: 0;
}

/* Search */
.blog-search {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.blog-search input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 1px solid var(--blog-border);
    border-radius: 8px;
    font-size: 1rem;
}

.blog-search button {
    padding: 0.75rem 1.5rem;
    background: var(--blog-primary);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.3s;
}

.blog-search button:hover {
    background: var(--blog-accent);
}

/* Posts Grid */
.posts-grid {
    display: grid;
    gap: 2rem;
}

.post-card {
    background: white;
    border: 1px solid var(--blog-border);
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
}

.post-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.1);
}

.post-card-image {
    width: 100%;
    height: 250px;
    object-fit: cover;
    background: var(--blog-light-bg);
}

.post-card-content {
    padding: 1.5rem;
}

.post-card-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    color: var(--blog-secondary);
}

.post-category {
    background: var(--blog-primary);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.post-card h2 {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--blog-text);
    line-height: 1.3;
}

.post-excerpt {
    color: var(--blog-secondary);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.post-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid var(--blog-border);
    font-size: 0.875rem;
    color: var(--blog-secondary);
}

.post-views {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.read-more {
    color: var(--blog-primary);
    font-weight: 600;
    text-decoration: none;
    transition: color 0.3s;
}

.read-more:hover {
    color: var(--blog-accent);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 3rem;
}

.pagination button {
    padding: 0.75rem 1.25rem;
    border: 1px solid var(--blog-border);
    background: white;
    color: var(--blog-text);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.pagination button:hover:not(:disabled) {
    background: var(--blog-primary);
    color: white;
    border-color: var(--blog-primary);
}

.pagination button.active {
    background: var(--blog-primary);
    color: white;
    border-color: var(--blog-primary);
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-info {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: var(--blog-secondary);
    font-size: 0.875rem;
}

/* Sidebar */
.blog-sidebar {
    position: sticky;
    top: 100px;
    align-self: start;
}

.sidebar-widget {
    background: white;
    border: 1px solid var(--blog-border);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.sidebar-widget h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--blog-text);
}

.categories-list {
    list-style: none;
}

.categories-list li {
    margin-bottom: 0.5rem;
}

.categories-list a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.75rem;
    color: var(--blog-secondary);
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.3s;
}

.categories-list a:hover,
.categories-list a.active {
    background: var(--blog-light-bg);
    color: var(--blog-primary);
}

.category-count {
    background: var(--blog-border);
    color: var(--blog-secondary);
    padding: 0.125rem 0.5rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.popular-posts {
    list-style: none;
}

.popular-posts li {
    padding: 1rem 0;
    border-bottom: 1px solid var(--blog-border);
}

.popular-posts li:last-child {
    border-bottom: none;
}

.popular-posts a {
    color: var(--blog-text);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.popular-posts a:hover {
    color: var(--blog-primary);
}

.popular-post-meta {
    font-size: 0.75rem;
    color: var(--blog-secondary);
    margin-top: 0.25rem;
}

/* Loading & Messages */
.loading {
    text-align: center;
    padding: 100px 0 4rem;
    color: var(--blog-secondary);
}

.no-posts {
    text-align: center;
    padding: 4rem 0;
    color: var(--blog-secondary);
}

.no-posts h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

/* Footer */
.blog-footer {
    background: var(--blog-text);
    color: white;
    text-align: center;
    padding: 2rem 0;
    margin-top: 4rem;
}

/* Responsive */
@media (max-width: 968px) {
    .blog-container {
        grid-template-columns: 1fr;
    }
    
    .blog-sidebar {
        position: static;
    }
    
    .blog-hero h1 {
        font-size: 2rem;
    }
    
    .blog-header nav {
        gap: 1rem;
    }
}

@media (max-width: 640px) {
    .blog-hero {
        padding: 2rem 0;
    }
    
    .blog-hero h1 {
        font-size: 1.75rem;
    }
    
    .blog-hero p {
        font-size: 1rem;
    }
    
    .blog-search {
        flex-direction: column;
    }
    
    .post-card-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .pagination {
        flex-wrap: wrap;
    }
}
