/* =========================================================
   Solin System Technical Blog Content Design System
   - Shared by published blog articles and Toast UI WYSIWYG
   ========================================================= */

.blog-content,
#editorSection .toastui-editor-ww-container .toastui-editor-contents {
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
    font-size: 16px;
    line-height: 1.9;
    color: var(--bs-secondary-emphasis);
    word-break: keep-all;
    overflow-wrap: anywhere;
}

#editorSection .toastui-editor-ww-container .toastui-editor-contents {
    padding: 40px 48px 56px;
}

.blog-content > :first-child,
#editorSection .toastui-editor-ww-container .toastui-editor-contents > :first-child {
    margin-top: 0 !important;
}

.blog-content > :last-child,
#editorSection .toastui-editor-ww-container .toastui-editor-contents > :last-child {
    margin-bottom: 0 !important;
}

/* Headings */
.blog-content h2,
#editorSection .toastui-editor-ww-container .toastui-editor-contents h2 {
    margin: 56px 0 22px;
    padding-bottom: 14px;
    font-size: 28px;
    line-height: 1.4;
    font-weight: 700;
    color: var(--bs-secondary-emphasis);
    border-bottom: 1px solid rgba(var(--bs-secondary-rgb), 0.14);
}

.blog-content h3,
#editorSection .toastui-editor-ww-container .toastui-editor-contents h3 {
    margin: 38px 0 14px;
    font-size: 21px;
    line-height: 1.5;
    font-weight: 700;
    color: var(--bs-secondary-emphasis);
}

/* H1 is reserved for the blog post title. The admin UI also validates this. */
#editorSection .toastui-editor-ww-container .toastui-editor-contents h1 {
    position: relative;
    padding: 12px 14px;
    border: 1px dashed rgba(var(--bs-danger-rgb), 0.45);
    border-radius: 8px;
    background: rgba(var(--bs-danger-rgb), 0.04);
}

/* Paragraph / emphasis / links */
.blog-content p,
#editorSection .toastui-editor-ww-container .toastui-editor-contents p {
    margin: 0 0 20px;
    line-height: inherit;
}

.blog-content strong,
#editorSection .toastui-editor-ww-container .toastui-editor-contents strong {
    font-weight: 700;
    color: var(--bs-secondary-emphasis);
}

.blog-content a,
#editorSection .toastui-editor-ww-container .toastui-editor-contents a {
    color: var(--bs-primary);
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

/* Callout: blockquote is the standard technical key-point block. */
.blog-content blockquote,
#editorSection .toastui-editor-ww-container .toastui-editor-contents blockquote {
    margin: 30px 0;
    padding: 22px 26px;
    color: var(--bs-secondary-emphasis);
    background: rgba(var(--bs-primary-rgb), 0.055);
    border: 0;
    border-left: 4px solid var(--bs-primary);
    border-radius: 0 12px 12px 0;
}

.blog-content blockquote p:last-child,
#editorSection .toastui-editor-ww-container .toastui-editor-contents blockquote p:last-child {
    margin-bottom: 0;
}

.blog-content blockquote strong:first-child,
#editorSection .toastui-editor-ww-container .toastui-editor-contents blockquote strong:first-child {
    color: var(--bs-primary);
}

/* Top-level lists become information summary blocks. Nested lists stay simple. */
.blog-content > ul,
.blog-content > ol,
#editorSection .toastui-editor-ww-container .toastui-editor-contents > ul,
#editorSection .toastui-editor-ww-container .toastui-editor-contents > ol {
    margin: 24px 0 30px;
    padding: 22px 28px 22px 48px;
    background: rgba(var(--bs-secondary-rgb), 0.045);
    border: 1px solid rgba(var(--bs-secondary-rgb), 0.10);
    border-radius: 12px;
}

.blog-content li,
#editorSection .toastui-editor-ww-container .toastui-editor-contents li {
    margin-bottom: 9px;
    line-height: 1.75;
}

.blog-content li:last-child,
#editorSection .toastui-editor-ww-container .toastui-editor-contents li:last-child {
    margin-bottom: 0;
}

.blog-content li > ul,
.blog-content li > ol,
#editorSection .toastui-editor-ww-container .toastui-editor-contents li > ul,
#editorSection .toastui-editor-ww-container .toastui-editor-contents li > ol {
    margin-top: 10px;
    margin-bottom: 6px;
}

/* Images */
.blog-content img,
#editorSection .toastui-editor-ww-container .toastui-editor-contents img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 38px auto 14px;
    border-radius: 12px;
    border: 1px solid rgba(var(--bs-secondary-rgb), 0.10);
}

/* Tables: preserve readability and allow horizontal scrolling on narrow screens. */
.blog-content table,
#editorSection .toastui-editor-ww-container .toastui-editor-contents table {
    display: block;
    width: 100%;
    max-width: 100%;
    margin: 30px 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-collapse: collapse;
    border-spacing: 0;
}

.blog-content th,
.blog-content td,
#editorSection .toastui-editor-ww-container .toastui-editor-contents th,
#editorSection .toastui-editor-ww-container .toastui-editor-contents td {
    min-width: 140px;
    padding: 12px 14px;
    vertical-align: top;
    line-height: 1.65;
    color: var(--bs-secondary-emphasis);
    border: 1px solid rgba(var(--bs-secondary-rgb), 0.14);
    background: #fff;
}

.blog-content th,
#editorSection .toastui-editor-ww-container .toastui-editor-contents th {
    font-weight: 700;
    background: rgba(var(--bs-secondary-rgb), 0.055);
}

/* Code */
.blog-content :not(pre) > code,
#editorSection .toastui-editor-ww-container .toastui-editor-contents :not(pre) > code {
    padding: 0.16em 0.4em;
    border-radius: 5px;
    color: var(--bs-primary);
    background: rgba(var(--bs-primary-rgb), 0.08);
    font-size: 0.92em;
    word-break: break-word;
}

.blog-content pre,
#editorSection .toastui-editor-ww-container .toastui-editor-contents pre {
    max-width: 100%;
    margin: 28px 0;
    padding: 20px 22px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 12px;
    background: #111827;
    color: #e5e7eb;
    line-height: 1.7;
    white-space: pre;
    word-break: normal;
}

.blog-content pre code,
#editorSection .toastui-editor-ww-container .toastui-editor-contents pre code {
    padding: 0;
    color: inherit;
    background: transparent;
    white-space: inherit;
}

/* Section separator */
.blog-content hr,
#editorSection .toastui-editor-ww-container .toastui-editor-contents hr {
    margin: 48px 0;
    border: 0;
    border-top: 1px solid rgba(var(--bs-secondary-rgb), 0.14);
    opacity: 1;
}

/* Keep editor content visually close to the published article. */
#editorSection .toastui-editor-ww-container {
    background: #fff;
}

@media (max-width: 767.98px) {
    .blog-content,
    #editorSection .toastui-editor-ww-container .toastui-editor-contents {
        max-width: 100%;
        font-size: 15px;
        line-height: 1.82;
        word-break: keep-all;
        overflow-wrap: anywhere;
    }

    #editorSection .toastui-editor-ww-container .toastui-editor-contents {
        padding: 24px 20px 36px;
    }

    .blog-content h2,
    #editorSection .toastui-editor-ww-container .toastui-editor-contents h2 {
        margin-top: 42px;
        margin-bottom: 18px;
        padding-bottom: 12px;
        font-size: 23px;
    }

    .blog-content h3,
    #editorSection .toastui-editor-ww-container .toastui-editor-contents h3 {
        margin-top: 30px;
        margin-bottom: 12px;
        font-size: 19px;
    }

    .blog-content blockquote,
    #editorSection .toastui-editor-ww-container .toastui-editor-contents blockquote {
        margin: 24px 0;
        padding: 18px 20px;
    }

    .blog-content > ul,
    .blog-content > ol,
    #editorSection .toastui-editor-ww-container .toastui-editor-contents > ul,
    #editorSection .toastui-editor-ww-container .toastui-editor-contents > ol {
        margin: 20px 0 26px;
        padding: 18px 20px 18px 40px;
    }

    .blog-content img,
    #editorSection .toastui-editor-ww-container .toastui-editor-contents img {
        margin-top: 28px;
        border-radius: 10px;
    }

    .blog-content th,
    .blog-content td,
    #editorSection .toastui-editor-ww-container .toastui-editor-contents th,
    #editorSection .toastui-editor-ww-container .toastui-editor-contents td {
        min-width: 130px;
        padding: 10px 12px;
        font-size: 13px;
    }

    .blog-content pre,
    #editorSection .toastui-editor-ww-container .toastui-editor-contents pre {
        margin: 22px 0;
        padding: 16px 18px;
        border-radius: 10px;
        font-size: 13px;
    }

    .blog-content hr,
    #editorSection .toastui-editor-ww-container .toastui-editor-contents hr {
        margin: 38px 0;
    }
}
