/* ==========================================================================
   D2 Blog Enhanced Layout
   Adds: hero image, 3-column grid (TOC | Content | Sidebar), callouts,
   checklists, case boxes, CTA banners, related articles cards.
   Works on top of d2-system.css — uses same tokens.
   ========================================================================== */

/* Variable aliases for SVG illustrations (maps to D2 design system tokens) */
:root {
    --d2-bg-main: #07131f;
    --d2-card-bg: #0f1c2e;
    --d2-card-hover: #162032;
    --d2-border: #1e293b;
    --d2-accent: #2ebfa5;
    --d2-accent-hover: #0d9488;
    --d2-accent-light: #2ebfa5;
    --d2-text-main: #f8fafc;
    --d2-text-muted: #94a3b8;
    --d2-text-subtle: #64748b;
}

/* ===== Blog Hero Image ===== */
.blog-hero-img {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
    border-radius: 16px;
    border: 1px solid var(--line-d);
    margin-top: 28px;
}
.blog-hero-cap {
    font-size: .82rem;
    color: var(--slate);
    margin-top: 8px;
}

/* ===== 3-Column Layout ===== */
.blog-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 48px;
    padding: 60px 0;
}
@media (min-width: 1024px) {
    .blog-layout {
        grid-template-columns: 190px 1fr 260px;
    }
}

/* ===== Left Sidebar: Table of Contents ===== */
.blog-toc {
    position: sticky;
    top: 100px;
    align-self: start;
}
.blog-toc-title {
    font-family: var(--ff-mono);
    font-size: .7rem;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--slate);
    margin-bottom: 14px;
}
.blog-toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
    border-left: 2px solid var(--line-d);
}
.blog-toc-list li a {
    display: block;
    padding: 6px 0 6px 14px;
    font-size: .8rem;
    color: rgba(255,255,255,.55);
    border-left: 2px solid transparent;
    margin-left: -2px;
    transition: color .2s, border-color .2s;
    text-decoration: none;
}
.blog-toc-list li a:hover {
    color: var(--teal);
    border-left-color: var(--teal);
}

/* ===== Right Sidebar ===== */
.blog-sidebar {
    position: sticky;
    top: 100px;
    align-self: start;
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.blog-side-card {
    background: rgba(255,255,255,.03);
    border: 1px solid var(--line-d);
    border-radius: 12px;
    padding: 22px;
}
.blog-side-card h4 {
    font-size: .92rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 10px;
}
.blog-side-card p {
    font-size: .82rem;
    color: rgba(255,255,255,.55);
    line-height: 1.6;
    margin-bottom: 14px;
}
.blog-side-card .side-link {
    display: block;
    font-size: .82rem;
    font-weight: 600;
    color: #fff;
    padding: 6px 0;
    text-decoration: none;
    transition: color .2s;
}
.blog-side-card .side-link:hover {
    color: var(--teal);
}
.blog-roadmap-item {
    display: flex;
    justify-content: space-between;
    font-size: .8rem;
    padding: 8px 0;
    border-bottom: 1px dashed var(--line-d);
    color: var(--slate);
}
.blog-roadmap-item:last-child { border-bottom: none; }
.blog-roadmap-item strong { color: #fff; }

/* ===== Article Content (middle column) ===== */
.blog-content h2 {
    font-family: var(--ff-display);
    font-size: 1.4rem;
    font-weight: 700;
    color: #fff;
    margin: 40px 0 14px;
    scroll-margin-top: 100px;
}
.blog-content h3 {
    font-family: var(--ff-display);
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    margin: 28px 0 10px;
}
.blog-content p {
    font-size: .95rem;
    color: rgba(255,255,255,.65);
    line-height: 1.75;
    margin-bottom: 20px;
}
.blog-content ul, .blog-content ol {
    margin: 0 0 20px 18px;
    color: rgba(255,255,255,.65);
    font-size: .95rem;
    line-height: 1.75;
}
.blog-content li { margin-bottom: 8px; }
.blog-content strong { color: #fff; }
.blog-content a { color: var(--teal); text-decoration: none; }
.blog-content a:hover { text-decoration: underline; }
.blog-content .btn { color: var(--ink); }
.blog-content .btn:hover { text-decoration: none; }
.blog-content .btn-ghost { color: #fff; border-color: rgba(255,255,255,.3); }
.blog-content .btn-ghost:hover { border-color: var(--teal); color: var(--teal); }
.blog-cta-banner .btn { color: var(--ink); }
.blog-cta-banner .btn-ghost { color: #fff; border-color: rgba(255,255,255,.3); background: rgba(255,255,255,.05); }
.blog-cta-banner .btn-ghost:hover { border-color: var(--teal); color: var(--teal); }

/* ===== Callout Box ===== */
.blog-callout {
    background: rgba(255,255,255,.03);
    border-left: 4px solid var(--teal);
    border-radius: 0 12px 12px 0;
    padding: 20px 24px;
    margin: 28px 0;
    border-top: 1px solid var(--line-d);
    border-right: 1px solid var(--line-d);
    border-bottom: 1px solid var(--line-d);
}
.blog-callout strong {
    display: block;
    font-family: var(--ff-mono);
    font-size: .7rem;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--teal);
    margin-bottom: 8px;
}
.blog-callout p {
    margin-bottom: 0;
}

/* ===== Checklist ===== */
.blog-checklist {
    list-style: none;
    margin: 0 0 24px 0;
    padding: 0;
    border: 1px solid var(--line-d);
    border-radius: 12px;
    overflow: hidden;
    background: rgba(255,255,255,.03);
}
.blog-checklist li {
    padding: 14px 20px;
    font-size: .9rem;
    border-bottom: 1px solid var(--line-d);
    margin: 0;
    color: rgba(255,255,255,.65);
}
.blog-checklist li:last-child { border-bottom: none; }
.blog-checklist li::before {
    content: "✓ ";
    margin-right: 10px;
    color: var(--teal);
    font-weight: bold;
}

/* ===== Quote Box ===== */
.blog-quote {
    border-left: 3px solid var(--teal);
    padding: 16px 24px;
    margin: 32px 0;
    font-style: italic;
    color: #fff;
    background: rgba(46,191,165,.05);
    border-radius: 0 8px 8px 0;
    font-size: .95rem;
}

/* ===== Case Study Box ===== */
.blog-case-box {
    border: 1px solid var(--line-d);
    background: rgba(255,255,255,.03);
    border-radius: 12px;
    padding: 24px;
    margin: 28px 0;
}
.blog-case-box h3 { margin-top: 0; }
.blog-case-stats {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--line-d);
    font-size: .8rem;
    color: var(--slate);
}

/* ===== CTA Banner ===== */
.blog-cta-banner {
    background: rgba(255,255,255,.03);
    border: 1px solid var(--line-d);
    border-radius: 16px;
    padding: 36px 32px;
    margin: 48px 0;
    text-align: center;
}
.blog-cta-banner h3 {
    color: #fff;
    font-size: 1.3rem;
    margin: 0 0 10px;
}
.blog-cta-banner p {
    color: rgba(255,255,255,.6);
    font-size: .92rem;
    margin-bottom: 24px;
}
.blog-cta-banner .cta-row {
    display: flex;
    gap: 14px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ===== SVG Mockups ===== */
.blog-svg-mock {
    width: 100%;
    border-radius: 12px;
    border: 1px solid var(--line-d);
    margin: 16px 0 8px;
    background: rgba(255,255,255,.02);
    display: block;
}
.step-mock {
    width: 100%;
    height: 340px;
    border-radius: 12px;
    border: 1px solid var(--d2-border);
    margin: 16px 0 8px;
    background-color: var(--d2-card-bg);
    display: block;
}
.hero-cap {
    font-size: .82rem;
    color: var(--slate);
    margin-top: 8px;
    margin-bottom: 24px;
}

/* Original blog classes (used by SVG-rich articles) */
.blog-content .callout,
.callout {
    background: rgba(255,255,255,.03);
    border-left: 4px solid var(--teal);
    border-radius: 0 12px 12px 0;
    padding: 20px 24px;
    margin: 28px 0;
    border-top: 1px solid var(--d2-border);
    border-right: 1px solid var(--d2-border);
    border-bottom: 1px solid var(--d2-border);
}
.callout strong {
    display: block;
    font-size: .7rem;
    font-family: var(--ff-mono);
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--teal);
    margin-bottom: 8px;
}
.blog-content .checklist,
.checklist {
    list-style: none;
    margin: 0 0 24px 0;
    padding: 0;
    border: 1px solid var(--d2-border);
    border-radius: 12px;
    overflow: hidden;
    background: rgba(255,255,255,.03);
}
.checklist li {
    padding: 14px 20px;
    font-size: .9rem;
    border-bottom: 1px solid var(--d2-border);
    margin: 0;
    color: rgba(255,255,255,.65);
}
.checklist li:last-child { border-bottom: none; }
.checklist li::before {
    content: "✓ ";
    margin-right: 10px;
    color: var(--teal);
    font-weight: bold;
}
.case-box {
    border: 1px solid var(--d2-border);
    background: rgba(255,255,255,.03);
    border-radius: 12px;
    padding: 24px;
    margin: 28px 0;
}
.case-box .stats {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--d2-border);
    font-size: .8rem;
    color: var(--slate);
}
.quote-box {
    border-left: 3px solid var(--teal);
    padding: 16px 24px;
    margin: 32px 0;
    font-style: italic;
    color: #fff;
    background: rgba(46,191,165,.05);
    border-radius: 0 8px 8px 0;
    font-size: .95rem;
}
.cta-banner {
    background: rgba(255,255,255,.03);
    border: 1px solid var(--d2-border);
    border-radius: 16px;
    padding: 36px 32px;
    margin: 48px 0;
    text-align: center;
}
.cta-banner h3 {
    color: #fff;
    font-size: 1.3rem;
    margin: 0 0 10px;
}
.cta-banner p {
    color: rgba(255,255,255,.6);
    font-size: .92rem;
    margin-bottom: 24px;
}
.cta-flex {
    display: flex;
    gap: 14px;
    justify-content: center;
    flex-wrap: wrap;
}
.btn-secondary {
    border: 1px solid var(--d2-border);
    color: #fff;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: .86rem;
    background: rgba(255,255,255,.05);
    transition: all .2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}
.btn-secondary:hover { border-color: var(--teal); color: var(--teal); }

/* ===== Related Articles Section ===== */
.blog-more {
    border-top: 1px solid var(--line-d);
    padding: 64px 0;
}
.blog-more h2 {
    font-family: var(--ff-display);
    font-size: 1.4rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 32px;
}
.blog-more-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}
@media (min-width: 768px) {
    .blog-more-grid { grid-template-columns: repeat(3, 1fr); }
}
.blog-more-card {
    background: rgba(255,255,255,.03);
    border: 1px solid var(--line-d);
    border-radius: 12px;
    overflow: hidden;
    transition: border-color .3s, transform .3s;
    text-decoration: none;
    display: block;
}
.blog-more-card:hover {
    border-color: rgba(46,191,165,.4);
    transform: translateY(-3px);
}
.blog-more-card img {
    height: 180px;
    width: 100%;
    object-fit: cover;
}
.blog-more-card .card-body {
    padding: 18px;
}
.blog-more-card .card-tag {
    font-family: var(--ff-mono);
    font-size: .7rem;
    color: var(--teal);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.blog-more-card .card-body h3 {
    font-size: .95rem;
    font-weight: 700;
    line-height: 1.4;
    color: #fff;
    margin-bottom: 10px;
}
.blog-more-card .card-link {
    font-size: .82rem;
    font-weight: 600;
    color: var(--teal);
}

/* ===== Responsive ===== */
@media (max-width: 1023px) {
    .blog-toc { display: none; }
    .blog-sidebar {
        position: static;
        margin-top: 40px;
    }
    .blog-layout {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 768px) {
    .blog-hero-img { height: 240px; border-radius: 12px; }
    .blog-cta-banner { padding: 28px 20px; }
}
