/*
 * DaoAI Blog Article — Redesign
 * Dark theme + Left TOC + Unified Typography
 * Applied to all en-us/daoaiblog/ and daoaiblog/ article pages
 */

/* ── Dark background for entire page ──────────────────── */
body.hs-blog-post,
.body-wrapper.hs-blog-post {
    background-color: #0b0f19 !important;
}

/* ── Hero ──────────────────────────────────────────────── */
.blog-post__hero {
    background: #0b0f19 !important;
    padding-top: 130px !important;
    padding-bottom: 56px !important;
    padding-left: 1.5rem !important;
    padding-right: 1.5rem !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
}

.blog-post_hero-content {
    max-width: 860px !important;
    margin: 0 auto !important;
    text-align: left !important;
}

.blog-post-hero__header,
#hs_cos_wrapper_blog_hero .blog-post-hero__header {
    color: #ffffff !important;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif !important;
    font-size: clamp(1.75rem, 4vw, 2.75rem) !important;
    font-weight: 700 !important;
    line-height: 1.25 !important;
    letter-spacing: -0.015em !important;
    margin: 0 !important;
}

.blog-post-hero__subheader,
.blog-post-hero__subheader * {
    color: #6b7280 !important;
    font-family: 'Inter', sans-serif !important;
    font-size: 0.875rem !important;
    margin-top: 0.75rem !important;
    letter-spacing: 0.02em !important;
}

/* ── Content area background ───────────────────────────── */
.blog-post__content-wrapper,
.content-wrapper,
.dnd_area-row-3-background-layers,
.body-wrapper {
    background-color: #0b0f19 !important;
}

/* ── Two-column layout: TOC (left) + Article (right) ───── */
.blog-post__content-wrapper {
    display: flex !important;
    flex-direction: row !important;
    align-items: flex-start !important;
    gap: 2.5rem !important;
    max-width: 1240px !important;
    margin: 0 auto !important;
    padding: 3rem 1.5rem !important;
}

/* Hide the HubSpot "Related Articles" right column */
.blog-post__related {
    display: none !important;
}

/* Main article content column */
.blog-post__content {
    flex: 1 1 0;
    min-width: 0;
    max-width: 780px;
}

/* ── TOC sidebar ───────────────────────────────────────── */
#blog-toc {
    flex: 0 0 210px;
    width: 210px;
    position: sticky;
    top: 88px;
    max-height: calc(100vh - 108px);
    overflow-y: auto;
    background: #111827;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 10px;
    padding: 1rem 1.1rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

#blog-toc::-webkit-scrollbar { width: 3px; }
#blog-toc::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 2px; }

#blog-toc .toc-label {
    font-family: 'Inter', sans-serif;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.13em;
    text-transform: uppercase;
    color: #4b5563;
    margin-bottom: 0.65rem;
    padding-bottom: 0.55rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

#blog-toc ul {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

#blog-toc li {
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
}

#blog-toc a {
    display: block;
    font-family: 'Inter', sans-serif;
    font-size: 0.77rem;
    font-weight: 400;
    color: #9ca3af;
    text-decoration: none !important;
    padding: 0.3rem 0.45rem;
    border-left: 2px solid transparent;
    border-radius: 0 4px 4px 0;
    line-height: 1.45;
    transition: color 0.15s, background 0.15s, border-color 0.15s;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#blog-toc a:hover {
    color: #e5e7eb;
    background: rgba(255, 255, 255, 0.04);
}

#blog-toc a.toc-active {
    color: #38bdf8;
    border-left-color: #38bdf8;
    background: rgba(56, 189, 248, 0.07);
    font-weight: 500;
}

#blog-toc li.toc-h3 > a {
    padding-left: 1.1rem;
    font-size: 0.72rem;
    color: #6b7280;
}

#blog-toc li.toc-h3 > a:hover,
#blog-toc li.toc-h3 > a.toc-active {
    color: #93c5fd;
    background: rgba(147, 197, 253, 0.06);
}

/* ── Article body — all typography ────────────────────── */
.blog-post__body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif !important;
    color: #d1d5db !important;
    background: transparent !important;
    line-height: 1.85;
}

.blog-post__body p {
    font-family: 'Inter', sans-serif !important;
    font-size: 1rem !important;
    line-height: 1.85 !important;
    color: #d1d5db !important;
    margin-bottom: 1.2rem !important;
}

/* Override HubSpot inline font-size 28px used as Section heading (≈ h2) */
.blog-post__body p[style*="font-size: 28px"],
.blog-post__body p[style*="font-size:28px"] {
    font-family: 'Inter', sans-serif !important;
    font-size: 1.45rem !important;
    font-weight: 700 !important;
    color: #ffffff !important;
    line-height: 1.3 !important;
    letter-spacing: -0.01em !important;
    margin-top: 2.25rem !important;
    margin-bottom: 0.6rem !important;
}

/* Override HubSpot inline font-size 20px used as Sub-heading (≈ h3) */
.blog-post__body p[style*="font-size: 20px"],
.blog-post__body p[style*="font-size:20px"] {
    font-family: 'Inter', sans-serif !important;
    font-size: 1.15rem !important;
    font-weight: 600 !important;
    color: #e5e7eb !important;
    line-height: 1.4 !important;
    margin-top: 1.75rem !important;
    margin-bottom: 0.5rem !important;
}

/* Semantic headings */
.blog-post__body h1 {
    font-family: 'Inter', sans-serif !important;
    font-size: 2rem !important;
    font-weight: 700 !important;
    color: #ffffff !important;
    line-height: 1.25 !important;
    letter-spacing: -0.015em !important;
    margin-top: 2.5rem !important;
    margin-bottom: 0.7rem !important;
}

.blog-post__body h2 {
    font-family: 'Inter', sans-serif !important;
    font-size: 1.45rem !important;
    font-weight: 700 !important;
    color: #ffffff !important;
    line-height: 1.3 !important;
    letter-spacing: -0.01em !important;
    margin-top: 2.25rem !important;
    margin-bottom: 0.6rem !important;
}

.blog-post__body h3 {
    font-family: 'Inter', sans-serif !important;
    font-size: 1.15rem !important;
    font-weight: 600 !important;
    color: #e5e7eb !important;
    line-height: 1.4 !important;
    margin-top: 1.75rem !important;
    margin-bottom: 0.5rem !important;
}

.blog-post__body h4 {
    font-family: 'Inter', sans-serif !important;
    font-size: 1rem !important;
    font-weight: 600 !important;
    color: #d1d5db !important;
    line-height: 1.5 !important;
    margin-top: 1.5rem !important;
    margin-bottom: 0.4rem !important;
}

.blog-post__body strong {
    color: #e5e7eb !important;
    font-weight: 600 !important;
}

.blog-post__body em {
    color: #9ca3af !important;
}

.blog-post__body a {
    color: #38bdf8 !important;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.blog-post__body a:hover {
    color: #7dd3fc !important;
}

.blog-post__body img {
    max-width: 100% !important;
    height: auto !important;
    border-radius: 8px !important;
    margin: 1.75rem auto !important;
    display: block !important;
}

.blog-post__body ul,
.blog-post__body ol {
    font-family: 'Inter', sans-serif !important;
    font-size: 1rem !important;
    color: #d1d5db !important;
    line-height: 1.85 !important;
    padding-left: 1.5rem !important;
    margin-bottom: 1.2rem !important;
}

.blog-post__body li {
    margin-bottom: 0.4rem !important;
    color: #d1d5db !important;
}

.blog-post__body blockquote {
    border-left: 3px solid #38bdf8 !important;
    padding: 0.5rem 0 0.5rem 1.25rem !important;
    margin: 1.75rem 0 !important;
    color: #9ca3af !important;
    font-style: italic !important;
    font-size: 1.05rem !important;
}

.blog-post__body hr {
    border: none !important;
    border-top: 1px solid rgba(255, 255, 255, 0.07) !important;
    margin: 2rem 0 !important;
}

.blog-post__body table {
    width: 100% !important;
    border-collapse: collapse !important;
    margin: 1.75rem 0 !important;
    font-size: 0.95rem !important;
}

.blog-post__body th,
.blog-post__body td {
    border: 1px solid rgba(255, 255, 255, 0.09) !important;
    padding: 0.75rem 1rem !important;
    color: #d1d5db !important;
    text-align: left !important;
}

.blog-post__body th {
    background: #1f2937 !important;
    font-weight: 600 !important;
    color: #ffffff !important;
}

.blog-post__body tr:nth-child(even) td {
    background: rgba(255, 255, 255, 0.02) !important;
}

.blog-post__body code {
    background: #1f2937 !important;
    color: #38bdf8 !important;
    padding: 0.15em 0.4em !important;
    border-radius: 4px !important;
    font-size: 0.88em !important;
    font-family: 'Fira Code', 'Consolas', 'Menlo', monospace !important;
}

.blog-post__body pre {
    background: #111827 !important;
    border: 1px solid rgba(255, 255, 255, 0.06) !important;
    border-radius: 8px !important;
    padding: 1.25rem !important;
    overflow-x: auto !important;
    margin: 1.5rem 0 !important;
}

/* ── Responsive ────────────────────────────────────────── */
@media (max-width: 960px) {
    .blog-post__content-wrapper {
        flex-direction: column !important;
        gap: 1.5rem !important;
        padding: 1.75rem 1rem !important;
    }

    #blog-toc {
        position: static !important;
        width: 100% !important;
        flex: none !important;
        max-height: 220px !important;
    }

    .blog-post__content {
        max-width: 100% !important;
    }
}

@media (max-width: 640px) {
    .blog-post-hero__header,
    #hs_cos_wrapper_blog_hero .blog-post-hero__header {
        font-size: 1.6rem !important;
    }

    .blog-post__hero {
        padding-top: 110px !important;
        padding-bottom: 40px !important;
    }

    .blog-post__body p[style*="font-size: 28px"],
    .blog-post__body p[style*="font-size:28px"] {
        font-size: 1.2rem !important;
    }

    .blog-post__body p[style*="font-size: 20px"],
    .blog-post__body p[style*="font-size:20px"] {
        font-size: 1.05rem !important;
    }
}
