/* Blog-specific styles */
.nav-brand a {
    text-decoration: none;
    color: inherit;
}

.blog-header {
    background: var(--gradient-hero);
    color: white;
    padding: 3rem 0;
    text-align: center;
}

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

.blog-header p {
    font-size: 1.1rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto 2rem;
}

/* Search Functionality */
.blog-search-container {
    max-width: 500px;
    margin: 0 auto;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 1rem;
    color: rgba(255, 255, 255, 0.7);
    z-index: 2;
}

.search-input {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    padding-right: 3rem;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 1rem;
    backdrop-filter: blur(8px);
    transition: all 0.3s ease;
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.search-input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
}

.search-clear {
    position: absolute;
    right: 1rem;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: all 0.2s ease;
    display: none;
}

.search-clear:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

.search-input:not(:placeholder-shown) + .search-clear {
    display: block;
}

.search-results-count {
    text-align: center;
    margin-top: 1rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    font-size: 0.9rem;
    opacity: 0.9;
    display: none;
}

.search-highlight {
    background: rgba(255, 235, 59, 0.3);
    color: inherit;
    padding: 0.1em 0;
    border-radius: 2px;
}

.blog-content {
    padding: 4rem 0;
    background: var(--bg-secondary);
}

.blog-layout {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 3rem;
    max-width: 1200px;
    margin: 0 auto;
}

.blog-sidebar {
    background: var(--bg-primary);
    padding: 2rem;
    border-radius: 10px;
    box-shadow: var(--shadow-md);
    height: fit-content;
    position: sticky;
    top: 100px;
}

.category-filter-section h3 {
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-size: 1.2rem;
}

.category-filters {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.category-filter {
    background: none;
    border: none;
    padding: 0.75rem 1rem;
    text-align: left;
    border-radius: 6px;
    cursor: pointer;
    color: var(--text-secondary);
    font-weight: 500;
    transition: all 0.3s ease;
}

.category-filter:hover {
    background: var(--bg-secondary);
    color: var(--accent-primary);
}

.category-filter.active {
    background: var(--accent-primary);
    color: white;
}

.blog-main {
    min-height: 400px;
}

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

.no-posts {
    grid-column: 1 / -1;
    text-align: center;
    color: #64748b;
    font-style: italic;
    padding: 2rem;
}

.error {
    grid-column: 1 / -1;
    text-align: center;
    color: #dc2626;
    padding: 2rem;
    background: #fef2f2;
    border-radius: 8px;
    border: 1px solid #fecaca;
}

.reading-time {
    font-size: 0.8rem;
    opacity: 0.8;
}

/* Blog Post Styles */
.post-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 4rem 0;
}

.post-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.post-meta-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    font-size: 1rem;
    opacity: 0.9;
}

.post-meta-header .post-category {
    background: rgba(255,255,255,0.2);
    padding: 0.5rem 1rem;
    border-radius: 20px;
}

.post-article {
    max-width: 800px;
    margin: 0 auto;
    padding: 4rem 2rem;
    background: white;
    margin-top: -2rem;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    position: relative;
    z-index: 10;
}

.post-content h3 {
    color: #1e293b;
    margin: 2rem 0 1rem;
    font-size: 1.5rem;
}

.post-content h4 {
    color: #374151;
    margin: 1.5rem 0 0.75rem;
    font-size: 1.25rem;
}

.post-content p {
    margin-bottom: 1.5rem;
    line-height: 1.7;
    color: #374151;
}

.post-content ul, .post-content ol {
    margin-bottom: 1.5rem;
    padding-left: 2rem;
}

.post-content li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
    color: #374151;
}

.post-content blockquote {
    border-left: 4px solid #2563eb;
    padding-left: 1.5rem;
    margin: 2rem 0;
    font-style: italic;
    color: #64748b;
    background: #f8fafc;
    padding: 1.5rem;
    border-radius: 0 8px 8px 0;
}

.post-content code {
    background: #f1f5f9;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9em;
    color: #be185d;
}

.code-block {
    background: #1e293b;
    color: #e2e8f0;
    padding: 1.5rem;
    border-radius: 8px;
    margin: 2rem 0;
    overflow-x: auto;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    line-height: 1.6;
}

.code-block pre {
    margin: 0;
    padding: 0;
    background: none;
    color: inherit;
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
    white-space: pre;
    overflow: visible;
}

.code-block pre code {
    background: none;
    color: inherit;
    font-family: inherit;
    font-size: inherit;
    padding: 0;
    border-radius: 0;
}

/* Override Prism.js default background to use our dark theme */
.code-block pre[class*="language-"] {
    background: none;
    margin: 0;
    padding: 0;
}

.code-block code[class*="language-"] {
    background: none;
}

.post-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid #e2e8f0;
}

.nav-link-post {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: #64748b;
    transition: color 0.3s ease;
}

.nav-link-post:hover {
    color: #2563eb;
}

.nav-link-post .nav-label {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.nav-link-post .nav-title {
    font-weight: 600;
}

/* Responsive Blog Layout */
@media (max-width: 1024px) {
    .blog-layout {
        grid-template-columns: 200px 1fr;
        gap: 2rem;
    }
    
    .blog-sidebar {
        padding: 1.5rem;
    }
}

@media (max-width: 768px) {
    .blog-layout {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .blog-sidebar {
        position: static;
        order: 2;
    }
    
    .category-filters {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .category-filter {
        flex: 0 0 auto;
        text-align: center;
    }
    
    .posts-grid {
        grid-template-columns: 1fr;
    }
    
    .post-title {
        font-size: 2rem;
    }
    
    .post-article {
        padding: 2rem 1rem;
        margin-top: -1rem;
    }
    
    .post-navigation {
        flex-direction: column;
        gap: 1rem;
    }
}

@media (max-width: 768px) {
    .search-input {
        padding: 0.875rem 0.875rem 0.875rem 2.5rem;
        padding-right: 2.5rem;
        font-size: 0.95rem;
    }
    
    .search-input::placeholder {
        font-size: 0.9rem;
    }
    
    .search-icon {
        left: 0.75rem;
        width: 18px;
        height: 18px;
    }
    
    .search-clear {
        right: 0.75rem;
        padding: 0.4rem;
    }
}

@media (max-width: 480px) {
    .blog-header {
        padding: 2rem 0;
    }
    
    .blog-header h1 {
        font-size: 2rem;
    }
    
    .blog-header p {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .search-input {
        padding: 0.75rem 0.75rem 0.75rem 2.25rem;
        padding-right: 2.25rem;
        font-size: 0.9rem;
        border-radius: 10px;
    }
    
    .search-input::placeholder {
        font-size: 0.85rem;
    }
    
    .search-results-count {
        font-size: 0.85rem;
        padding: 0.4rem 0.75rem;
    }
    
    .post-meta-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
}