/*
 * Knowledge base article styles (Issue #4384).
 *
 * A global stylesheet rather than a component's .razor.css on purpose: the article body is
 * stored HTML rendered through MarkupString, and Blazor's CSS isolation only scopes elements
 * the component's own markup creates. The same rules style the customer article page, the
 * admin editor and its preview, so what the editor shows is what the customer sees.
 */

.kb-article-body {
    font-size: 0.97rem;
    line-height: 1.6;
    color: #2d3748;
}

.kb-article-body h2 { font-size: 1.2rem; font-weight: 600; color: #1a365d; margin: 1.4rem 0 0.6rem; }
.kb-article-body h3 { font-size: 1.05rem; font-weight: 600; color: #1a365d; margin: 1.2rem 0 0.5rem; }
.kb-article-body h4 { font-size: 0.97rem; font-weight: 600; color: #1a365d; margin: 1rem 0 0.4rem; }
.kb-article-body > :first-child { margin-top: 0; }
.kb-article-body p { margin: 0 0 0.85rem; }
.kb-article-body ul,
.kb-article-body ol { margin: 0 0 0.9rem; padding-left: 1.5rem; }
.kb-article-body li { margin-bottom: 0.35rem; }
.kb-article-body blockquote {
    border-left: 3px solid #cbd5e0;
    margin: 0 0 0.9rem;
    padding: 0.25rem 0 0.25rem 0.9rem;
    color: #4a5568;
}
.kb-article-body kbd {
    background: #edf2f7;
    border: 1px solid #cbd5e0;
    border-radius: 4px;
    color: #2d3748;
    font-size: 0.85em;
    padding: 0.05rem 0.35rem;
}

/* Screenshots: never wider than the column, framed so a white screenshot doesn't melt into
   the page, and clickable to see full size (knowledge-base.js opens the viewer). */
.kb-article-body img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 0.5rem 0 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
    cursor: zoom-in;
}

/* The tip callout the editor can insert. */
.kb-article-body .kb-tip {
    display: block;
    background: #fffbeb;
    border: 1px solid #f6e05e;
    border-left-width: 4px;
    border-radius: 8px;
    padding: 0.7rem 0.9rem;
    margin: 0 0 1rem;
}
.kb-article-body .kb-tip::before {
    content: "Tip";
    display: block;
    font-weight: 600;
    color: #975a16;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.2rem;
}
.kb-article-body .kb-tip > :last-child { margin-bottom: 0; }

/* Full-size image viewer. Prefixed kb- to stay clear of Bootstrap's modal classes. */
.kb-lightbox {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: rgba(15, 23, 42, 0.85);
    cursor: zoom-out;
}
.kb-lightbox img {
    max-width: 100%;
    max-height: 100%;
    border-radius: 6px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    background: #fff;
}
.kb-lightbox-close {
    position: absolute;
    top: 0.75rem;
    right: 1rem;
    border: 0;
    background: transparent;
    color: #fff;
    font-size: 1.75rem;
    line-height: 1;
    cursor: pointer;
}

/* The admin editor: the same article styles, in an editable box. */
.kb-article-body.kb-editor {
    min-height: 320px;
    padding: 1rem 1.1rem;
    border: 1px solid #cbd5e0;
    border-radius: 0 0 8px 8px;
    background: #fff;
    outline: none;
}
.kb-article-body.kb-editor:focus { border-color: #3182ce; box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.15); }
.kb-article-body.kb-editor img { cursor: pointer; }
.kb-article-body.kb-editor img.kb-selected { outline: 3px solid #3182ce; outline-offset: 2px; }
