/* Blog Styles */

/* Blog Hero */
.blog-hero {
    padding: 140px 5% 60px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    text-align: center;
}

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

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

/* Blog Main */
.blog-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 60px 5%;
}

/* Blog Grid */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

/* Blog Card */
.blog-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--card-shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.blog-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--card-shadow-hover);
}

.blog-card-category {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.blog-card h2 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    line-height: 1.3;
}

.blog-card h2 a {
    color: var(--text-dark);
    text-decoration: none;
    transition: color 0.3s ease;
}

.blog-card h2 a:hover {
    color: var(--primary-color);
}

.blog-card p {
    color: var(--text-light);
    font-size: 0.95rem;
    flex-grow: 1;
    margin-bottom: 1rem;
}

.blog-card-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.blog-card-tag {
    background: var(--background-alt);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-dark);
}

.blog-card-read {
    font-size: 0.85rem;
    color: var(--text-light);
}

.blog-card-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: color 0.3s ease;
}

.blog-card-link:hover {
    color: var(--primary-dark);
}

/* Blog CTA Section */
.blog-cta-section {
    background: linear-gradient(135deg, #1e3a5f 0%, #2d5a87 100%);
    padding: 60px 5%;
    color: white;
    text-align: center;
}

.blog-cta-content {
    max-width: 700px;
    margin: 0 auto;
}

.blog-cta-content h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.blog-cta-content p {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-bottom: 2rem;
}

.blog-cta-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-bottom: 2rem;
}

.blog-cta-stat {
    display: flex;
    flex-direction: column;
}

.blog-cta-stat .stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--secondary-color);
}

.blog-cta-stat .stat-label {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Article Page Styles */
.article-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 120px 5% 60px;
}

.article-header {
    margin-bottom: 2rem;
}

.article-category {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.article-header h1 {
    font-size: 2.5rem;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    color: var(--text-light);
    font-size: 0.9rem;
}

.article-content {
    line-height: 1.8;
}

.article-content h2 {
    font-size: 1.5rem;
    margin: 2.5rem 0 1rem;
    color: var(--text-dark);
}

.article-content h3 {
    font-size: 1.25rem;
    margin: 2rem 0 0.75rem;
    color: var(--text-dark);
}

.article-content p {
    margin-bottom: 1.25rem;
    color: var(--text-dark);
}

.article-content ul, 
.article-content ol {
    margin: 1rem 0 1.5rem 1.5rem;
}

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

/* KaTeX Math Styling */
.katex {
    font-size: 1.1em;
}

.katex-display {
    margin: 1rem 0;
    overflow-x: auto;
    overflow-y: hidden;
}

.article-content .katex-display > .katex {
    text-align: center;
}

/* Math formulas */
.formula-box {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-left: 4px solid var(--primary-color);
    padding: 1.5rem;
    margin: 1.5rem 0;
    border-radius: 0 8px 8px 0;
    overflow-x: auto;
}

.formula-box .formula {
    font-size: 1.1rem;
    text-align: center;
    margin: 0.5rem 0;
    color: var(--text-dark);
}

.formula-box .katex-display {
    margin: 0.5rem 0;
}

.formula-box .formula-label {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-top: 0.75rem;
    text-align: center;
    font-family: 'Inter', sans-serif;
}

/* Example boxes */
.example-box {
    background: #fffbeb;
    border: 1px solid #fcd34d;
    border-radius: 8px;
    padding: 1.5rem;
    margin: 1.5rem 0;
}

.example-box h4 {
    color: #92400e;
    margin-bottom: 0.75rem;
    font-size: 1rem;
}

.example-box p {
    margin-bottom: 0.75rem;
}

.example-box .solution {
    background: white;
    padding: 1rem;
    border-radius: 6px;
    margin-top: 1rem;
}

.example-box .solution p {
    margin-bottom: 0.5rem;
}

.example-box .solution .katex {
    font-size: 1.05em;
}

/* Info boxes */
.info-box {
    background: #eff6ff;
    border: 1px solid #93c5fd;
    border-radius: 8px;
    padding: 1.5rem;
    margin: 1.5rem 0;
}

.info-box h4 {
    color: var(--primary-dark);
    margin-bottom: 0.75rem;
    font-size: 1rem;
}

.info-box .katex {
    font-size: 1.05em;
}

/* Warning boxes */
.warning-box {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    border-radius: 8px;
    padding: 1.5rem;
    margin: 1.5rem 0;
}

.warning-box h4 {
    color: #991b1b;
    margin-bottom: 0.75rem;
    font-size: 1rem;
}

/* Step list */
.steps-list {
    counter-reset: step-counter;
    list-style: none;
    margin-left: 0;
    padding-left: 0;
}

.steps-list li {
    position: relative;
    padding-left: 3rem;
    margin-bottom: 1.5rem;
}

.steps-list li::before {
    counter-increment: step-counter;
    content: counter(step-counter);
    position: absolute;
    left: 0;
    top: 0;
    width: 2rem;
    height: 2rem;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
}

/* Floating CTA Banner */
.floating-cta {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(37, 99, 235, 0.3);
    z-index: 999;
    max-width: 320px;
    animation: slideUp 0.5s ease;
    display: none;
}

.floating-cta.show {
    display: block;
}

.floating-cta-close {
    position: absolute;
    top: 8px;
    right: 10px;
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.floating-cta-close:hover {
    opacity: 1;
}

.floating-cta h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    padding-right: 1.5rem;
}

.floating-cta p {
    font-size: 0.85rem;
    opacity: 0.9;
    margin-bottom: 1rem;
}

.floating-cta-btn {
    display: inline-block;
    background: white;
    color: var(--primary-color);
    padding: 0.6rem 1.2rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: transform 0.3s ease;
}

.floating-cta-btn:hover {
    transform: scale(1.05);
}

@keyframes slideUp {
    from {
        transform: translateY(100px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Blog Footer */
.blog-footer {
    background: var(--text-dark);
    color: white;
    padding: 2rem 5%;
    text-align: center;
}

.blog-footer .footer-content {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
}

.blog-footer a {
    color: white;
    opacity: 0.8;
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.blog-footer a:hover {
    opacity: 1;
}

/* Table styling */
.article-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
}

.article-content th {
    background: var(--primary-color);
    color: white;
    padding: 1rem;
    text-align: left;
    font-weight: 600;
}

.article-content th .katex {
    color: white;
}

.article-content td {
    padding: 1rem;
    border-bottom: 1px solid var(--background-alt);
}

.article-content td .katex {
    font-size: 1.05em;
}

.article-content tr:last-child td {
    border-bottom: none;
}

.article-content tr:hover {
    background: var(--background-alt);
}

/* Responsive */
@media (max-width: 768px) {
    .blog-hero {
        padding: 120px 5% 40px;
    }
    
    .blog-hero h1 {
        font-size: 2rem;
    }
    
    .blog-cta-stats {
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .article-header h1 {
        font-size: 1.75rem;
    }
    
    .floating-cta {
        left: 20px;
        right: 20px;
        max-width: none;
    }
    
    .article-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}
