/* 
 * Dynamic Blog Content Styles
 * Theme: Essos (Warm Minimalist)
 * Fonts: Space Grotesk (Headings), Inter (Body)
 * Colors: Stone (Neutral), Accent (Terracotta)
 */

/* Main Wrapper */
.blog-content {
    font-family: 'Inter', sans-serif;
    color: #44403c;
    /* stone-700 */
    line-height: 1.8;
    font-size: 1.125rem;
    /* lg text */
}

/* Headings */
.blog-content h1,
.blog-content h2,
.blog-content h3,
.blog-content h4,
.blog-content h5,
.blog-content h6 {
    font-family: 'Space Grotesk', sans-serif;
    color: #1c1917;
    /* stone-900 */
    font-weight: 700;
    margin-top: 2em;
    margin-bottom: 0.8em;
    line-height: 1.3;
    text-align: left !important;
}

.blog-content h1 {
    font-size: 2.25rem !important;
    line-height: 1.2 !important;
}

.blog-content h2 {
    font-size: 1.875rem !important;
    line-height: 1.3 !important;
}

.blog-content h3 {
    font-size: 1.5rem !important;
    line-height: 1.4 !important;
}

.blog-content h4 {
    font-size: 1.25rem !important;
    line-height: 1.5 !important;
}

/* Paragraphs */
.blog-content p {
    margin: 1.5em 0;
    text-align: left;
}

/* Images */
.blog-content img {
    border-radius: 1rem;
    /* rounded-2xl */
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    margin: 2rem auto;
    display: block;
    max-width: 100%;
    height: auto;
}

.blog-img {
    text-align: center;
    padding: 1rem;
}

/* Lists */
.blog-content ul,
.blog-content ol {
    margin: 1.5em 0 1.5em 2em;
    padding-left: 0;
    text-align: left !important;
}

.blog-content ul {
    list-style: disc outside;
}

.blog-content ol {
    list-style: decimal outside;
}

.blog-content ul li,
.blog-content ol li {
    margin-bottom: 0.5em;
    padding-left: 0.5em;
}

/* Blockquotes */
.blog-content blockquote {
    border-left: 4px solid #ea580c;
    /* accent-600 */
    background: #fff7ed;
    /* accent-50 */
    padding: 1.5rem;
    margin: 2rem 0;
    font-style: italic;
    border-radius: 0 1rem 1rem 0;
    color: #57534e;
    /* stone-600 */
}

/* Tables */
.blog-content table {
    width: 100%;
    margin: 2rem 0;
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid #e7e5e4;
    /* stone-200 */
    border-radius: 0.75rem;
    overflow: hidden;
}

.blog-content table th,
.blog-content table td {
    padding: 1rem;
    border-bottom: 1px solid #e7e5e4;
    /* stone-200 */
    text-align: left;
}

.blog-content table th {
    background-color: #f5f5f4;
    /* stone-100 */
    font-weight: 600;
    color: #1c1917;
    /* stone-900 */
}

.blog-content table tr:last-child td {
    border-bottom: none;
}

/* Helper Classes */
.blog-content hr {
    border: 0;
    border-top: 1px solid #d6d3d1;
    /* stone-300 */
    margin: 3rem 0;
}

/* --- Code Blocks (Enhanced) --- */
/* Base Styles */
.blog-content pre {
    background: linear-gradient(135deg, #1c1917 0%, #292524 100%);
    /* stone-900 to stone-800 */
    border: 1px solid #44403c;
    /* stone-700 */
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin: 1.5rem 0;
    overflow-x: auto;
    position: relative;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    font-family: 'JetBrains Mono', 'Fira Code', 'Monaco', 'Consolas', monospace;
    font-size: 0.875rem;
    line-height: 1.6;
    color: #e7e5e4;
    /* stone-200 */
    transition: all 0.3s ease;
}

.blog-content pre:hover {
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    transform: translateY(-2px);
}

/* Gradient Top Border */
.blog-content pre::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #ea580c, #f97316);
    /* accent-600 to accent-500 */
    border-radius: 0.75rem 0.75rem 0 0;
}

/* Inline Code */
.blog-content :not(pre)>code {
    font-family: 'JetBrains Mono', 'Fira Code', 'Monaco', 'Consolas', monospace;
    background: #f5f5f4;
    /* stone-100 */
    color: #ea580c;
    /* accent-600 */
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-size: 0.85em;
    font-weight: 500;
    border: 1px solid #e7e5e4;
    /* stone-200 */
}

/* Scrollbars for Code */
.blog-content pre::-webkit-scrollbar {
    height: 8px;
}

.blog-content pre::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.blog-content pre::-webkit-scrollbar-thumb {
    background: #57534e;
    /* stone-600 */
    border-radius: 4px;
}

.blog-content pre::-webkit-scrollbar-thumb:hover {
    background: #78716c;
    /* stone-500 */
}

/* Dark Mode Overrides (if .dark class is present on html/body) */
.dark .blog-content pre {
    background: #0c0a09;
    /* stone-950 */
    border-color: #292524;
}

.dark .blog-content :not(pre)>code {
    background: rgba(234, 88, 12, 0.15);
    /* accent-600 with opacity */
    color: #fdba74;
    /* accent-300 */
    border-color: rgba(234, 88, 12, 0.2);
}

/* Responsive */
@media (max-width: 768px) {
    .blog-content h1 {
        font-size: 1.75rem !important;
    }

    .blog-content h2 {
        font-size: 1.5rem !important;
    }

    .blog-content h3 {
        font-size: 1.25rem !important;
    }

    .blog-content pre {
        padding: 1rem;
        font-size: 0.8rem;
    }
}

/* Animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.blog-content pre {
    animation: fadeInUp 0.6s ease-out;
}