/* Blog-specific styles */

/* Category color classes */
.category-blue { --category-color: #2563eb; }
.category-green { --category-color: #16a34a; }
.category-purple { --category-color: #9333ea; }
.category-orange { --category-color: #ea580c; }

/* Blog hero gradient overlays */
.blog-hero-gradient {
    background: linear-gradient(135deg, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.4) 100%);
}

/* Article cards */
.article-card {
    transition: all 0.3s ease;
    overflow: hidden;
}

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

.article-card .article-image {
    position: relative;
    overflow: hidden;
    height: 12rem;
}

.article-card .article-image::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent 0%, rgba(0,0,0,0.1) 100%);
}

/* Article content typography */
.article-content {
    font-size: 1.125rem;
    line-height: 1.75;
    color: #374151;
}

.article-content h1 {
    font-size: 2.25rem;
    font-weight: 800;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: #111827;
}

.article-content h2 {
    font-size: 1.875rem;
    font-weight: 700;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: #111827;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 0.5rem;
}

.article-content h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    color: #374151;
}

.article-content h4 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
    color: #4b5563;
}

.article-content p {
    margin-bottom: 1.25rem;
}

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

.article-content li {
    margin-bottom: 0.5rem;
}

.article-content blockquote {
    border-left: 4px solid #3b82f6;
    padding-left: 1rem;
    margin: 1.5rem 0;
    font-style: italic;
    color: #6b7280;
}

.article-content code {
    background-color: #f3f4f6;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-size: 0.875em;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
}

.article-content pre {
    background-color: #1f2937;
    color: #f3f4f6;
    padding: 1rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    margin-bottom: 1.25rem;
}

.article-content pre code {
    background-color: transparent;
    padding: 0;
    font-size: 0.875rem;
}

.article-content table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.25rem;
}

.article-content table th {
    background-color: #f9fafb;
    font-weight: 600;
    text-align: left;
    padding: 0.75rem;
    border-bottom: 2px solid #e5e7eb;
}

.article-content table td {
    padding: 0.75rem;
    border-bottom: 1px solid #e5e7eb;
}

.article-content table tr:hover {
    background-color: #f9fafb;
}

.article-content strong {
    font-weight: 700;
    color: #111827;
}

.article-content em {
    font-style: italic;
    color: #4b5563;
}

.article-content a {
    color: #2563eb;
    text-decoration: underline;
    transition: color 0.2s;
}

.article-content a:hover {
    color: #1d4ed8;
}

/* Table of Contents */
.toc-wrapper {
    position: sticky;
    top: 2rem;
    max-height: calc(100vh - 4rem);
    overflow-y: auto;
}

.toc-wrapper::-webkit-scrollbar {
    width: 4px;
}

.toc-wrapper::-webkit-scrollbar-track {
    background: #f3f4f6;
}

.toc-wrapper::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 2px;
}

.toc-wrapper ul {
    list-style: none;
    padding-left: 0;
}

.toc-wrapper ul ul {
    padding-left: 1.5rem;
}

.toc-wrapper a {
    display: block;
    padding: 0.375rem 0.75rem;
    margin-left: -0.75rem;
    color: #6b7280;
    text-decoration: none;
    border-left: 2px solid transparent;
    transition: all 0.2s;
    font-size: 0.875rem;
}

.toc-wrapper a:hover {
    color: #111827;
    border-left-color: #3b82f6;
    background-color: #f3f4f6;
}

.toc-wrapper a.active {
    color: #2563eb;
    border-left-color: #2563eb;
    font-weight: 600;
}

/* Search and filter animations */
.search-input {
    transition: all 0.3s ease;
}

.search-input:focus {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.filter-button {
    transition: all 0.2s ease;
}

.filter-button:hover {
    transform: translateY(-1px);
}

.filter-button.active {
    transform: translateY(0);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

/* Loading states */
.htmx-request .htmx-indicator {
    opacity: 1;
}

.htmx-indicator {
    opacity: 0;
    transition: opacity 0.2s ease;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .article-content {
        font-size: 1rem;
    }
    
    .article-content h1 {
        font-size: 1.875rem;
    }
    
    .article-content h2 {
        font-size: 1.5rem;
    }
    
    .article-content h3 {
        font-size: 1.25rem;
    }
}

/* Print styles */
@media print {
    .toc-wrapper,
    .blog-cta,
    .share-section,
    .related-articles,
    nav {
        display: none;
    }
    
    .article-content {
        max-width: 100%;
    }
    
    .article-content a {
        text-decoration: none;
        color: inherit;
    }
    
    .article-content a::after {
        content: " (" attr(href) ")";
        font-size: 0.875em;
        color: #6b7280;
    }
}