/* Blog / article diagram blocks — high contrast on white post background */

.blog-diagram-light .blog-single .blog-detail {
    color: #222;
}

/* Explorer source link injected when blogging from AI Explorer */
.blog-single .blog-detail .blog-article-body .ds-blog-explorer-source,
.blog-single .blog-detail .content .ds-blog-explorer-source {
    margin: 0 0 1rem;
    padding: 0.75rem 1rem;
    background: #f8f9fb;
    border: 1px solid #e3e7ef;
    border-radius: 8px;
    font-size: 0.95rem;
    line-height: 1.5;
    color: #333 !important;
}

.blog-single .blog-detail .ds-blog-explorer-source .ds-blog-explorer-btn {
    display: inline-block;
    margin: 0 0.5rem;
    padding: 0.35rem 0.85rem;
    background: #b5474b;
    color: #fff !important;
    border-radius: 6px;
    text-decoration: none !important;
    font-weight: 600;
}

.blog-single .blog-detail .ds-blog-explorer-source .ds-blog-explorer-btn:hover {
    background: #9a3a3e;
    color: #fff !important;
}

.blog-single .blog-detail .ds-blog-explorer-source .ds-blog-explorer-url {
    color: #b5474b !important;
    text-decoration: underline;
    word-break: break-all;
}

/* Article body — default readable text; inline editor colors must win over inheritance */
.blog-single .blog-detail .blog-article-body {
    color: #333;
}

.blog-single .blog-detail .blog-article-body :is(h1, h2, h3, h4, h5, h6, p, li, blockquote) {
    color: inherit;
}

.blog-single .blog-detail .blog-article-body .blog-article-tail,
.blog-single .blog-detail .blog-article-body .blog-article-tail :is(h1, h2, h3, h4, h5, h6, p, li, blockquote, span, div) {
    color: inherit;
}

.blog-single .blog-detail .blog-article-body a:not([style*="color"]) {
    color: #b5474b;
}

.blog-single .blog-detail .blog-article-body ul {
    list-style: disc outside;
    padding-left: 1.75em;
    margin: 0.5em 0;
}

.blog-single .blog-detail .blog-article-body ol {
    list-style: decimal outside;
    padding-left: 1.75em;
    margin: 0.5em 0;
}

.blog-single .blog-detail .blog-article-body ul > li,
.blog-single .blog-detail .blog-article-body ol > li {
    display: list-item;
    list-style: inherit;
}

.blog-single .blog-detail .blog-article-body h2,
.blog-single .blog-detail .blog-article-body h3 {
    margin-top: 1.25rem;
    margin-bottom: 0.65rem;
    font-weight: 600;
}

.blog-single .blog-detail .blog-article-body p {
    margin-bottom: 1rem;
    line-height: 1.65;
}

/* Bootstrap columns clip wide SVG without min-width:0 */
.blog-single .row > .col-lg-8,
.blog-single .row > .col-12 {
    min-width: 0;
}

.blog-single .blog-single-main,
.blog-single .blog-detail {
    overflow: visible;
    max-width: 100%;
}

/* Cover image (header upload) */
.blog-single .image img,
.blog-single .blog-post-hero img {
    width: 100% !important;
    height: auto !important;
    object-fit: cover;
}

/* Scroll wrapper added by blog-diagrams.js for inline SVG/diagram images */
.blog-single .content .blog-diagram-viewport {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: visible;
    margin: 1.25rem 0;
    padding: 0.25rem 0;
    -webkit-overflow-scrolling: touch;
}

.blog-single .content .blog-diagram-viewport svg,
.blog-single .content .blog-diagram-viewport img,
.blog-single .content .blog-diagram-viewport object.blog-diagram-object {
    display: block;
    max-width: none !important;
    width: auto !important;
    height: auto !important;
    margin: 0;
}

.blog-single .content .blog-diagram-viewport object.blog-diagram-object {
    min-width: min(100%, 320px);
    min-height: 120px;
}

.blog-single .content .ds-blog-diagram,
.blog-single .content .diagram-embed,
.blog-single .content .mermaid,
.blog-single .content figure.diagram,
.blog-single .content pre.mermaid,
.blog-single .content pre.language-mermaid,
.blog-single .content div.mermaid {
    display: block;
    margin: 1.25rem 0;
    padding: 1rem;
    background: #ffffff !important;
    border: 1px solid #d8dde6;
    border-radius: 10px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    overflow-x: auto;
    color: #111 !important;
}

.blog-single .content pre:not(.mermaid):not(.language-mermaid) {
    background: #f8f9fb !important;
    color: #111 !important;
    border: 1px solid #e3e7ef;
    border-radius: 8px;
    padding: 0.85rem 1rem;
}

.blog-single .content .ds-blog-diagram iframe,
.blog-single .content iframe[src*="/explorer"] {
    display: block;
    width: 100%;
    min-height: 420px;
    border: 0;
    background: #ffffff;
}

/* Mermaid output */
.blog-single .content .ds-blog-diagram svg,
.blog-single .content .mermaid svg {
    display: block;
    max-width: 100%;
    width: 100%;
    height: auto;
    background: #ffffff;
}

/* Regular photos inside article body */
.blog-single .content img {
    max-width: 100%;
    height: auto;
}

.blog-single .content svg .node rect,
.blog-single .content svg .node polygon,
.blog-single .content svg .node circle,
.blog-single .content svg .node ellipse,
.blog-single .content svg .actor {
    fill: #ffffff !important;
    stroke: #333333 !important;
}

.blog-single .content svg .nodeLabel,
.blog-single .content svg .label,
.blog-single .content svg .messageText,
.blog-single .content svg .loopText,
.blog-single .content svg .noteText,
.blog-single .content svg text {
    fill: #111111 !important;
    color: #111111 !important;
}

.blog-single .content svg .edgePath path,
.blog-single .content svg .flowchart-link,
.blog-single .content svg path.path {
    stroke: #b5474b !important;
}

.blog-single .content svg .edgeLabel {
    background-color: #ffffff !important;
    color: #111111 !important;
}

/* Dark inline blocks pasted from the planner — invert for readability (black only, not blue highlights) */
.blog-single .content [style*="background-color: rgb(0, 0, 0)"],
.blog-single .content [style*="background-color:rgb(0,0,0)"],
.blog-single .content [style*="background-color:#000"],
.blog-single .content [style*="background-color: #000"],
.blog-single .content [style*="background: rgb(0, 0, 0)"],
.blog-single .content [style*="background:rgb(0,0,0)"],
.blog-single .content [style*="background:#000"],
.blog-single .content [style*="background-color: black"] {
    background: #ffffff !important;
    color: #111 !important;
    border: 1px solid #d8dde6 !important;
}

.blog-single .content [style*="background-color: rgb(0, 0, 0)"] *,
.blog-single .content [style*="background-color:rgb(0,0,0)"] *,
.blog-single .content [style*="background-color:#000"] *,
.blog-single .content [style*="background: rgb(0, 0, 0)"] *,
.blog-single .content [style*="background:#000"] * {
    color: #111 !important;
}
