/* Knowledge Base Module - Article Detail Styles (kb- prefix) */

/* ─── Article Container ─── */
.kb-article {
    background: #ffffff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

/* ─── Article Header ─── */
.kb-article-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #e9ecef;
}

.kb-article-category {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #3172ae;
    background-color: rgba(49, 114, 174, 0.08);
    padding: 4px 10px;
    border-radius: 4px;
    display: inline-block;
    margin-bottom: 0.75rem;
}

.kb-article-title {
    font-size: 2.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.3;
    color: #2c3e50;
}

.kb-article-meta {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    font-size: 0.9rem;
    color: #6c757d;
}

.kb-article-meta span {
    display: flex;
    align-items: center;
}

/* ─── Article Content ─── */
.kb-article-content {
    font-size: 1.05rem;
    line-height: 1.8;
    color: #343a40;
}

.kb-article-content h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    color: #2c3e50;
    padding-top: 0.5rem;
}

.kb-article-content h3 {
    font-size: 1.35rem;
    font-weight: 600;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    color: #2c3e50;
}

.kb-article-content p {
    margin-bottom: 1.25rem;
}

.kb-article-content ul,
.kb-article-content ol {
    margin-bottom: 1.25rem;
    padding-left: 1.5rem;
}

.kb-article-content li {
    margin-bottom: 0.5rem;
    line-height: 1.7;
}

.kb-article-content a {
    color: #3172ae;
    text-decoration: underline;
}

.kb-article-content a:hover {
    color: #285f8f;
}

.kb-article-content table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
}

.kb-article-content table th,
.kb-article-content table td {
    padding: 0.75rem 1rem;
    border: 1px solid #dee2e6;
    text-align: left;
}

.kb-article-content table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #2c3e50;
}

.kb-article-content table tr:hover {
    background-color: #f8f9fa;
}

.kb-article-content blockquote {
    border-left: 4px solid #3172ae;
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    background: #f8f9fa;
    border-radius: 0 8px 8px 0;
    color: #495057;
}

.kb-article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1rem 0;
}

.kb-article-content code {
    background-color: #f1f3f5;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
    color: #c7254e;
}

.kb-article-content pre {
    background-color: #2c3e50;
    color: #f8f9fa;
    padding: 1.25rem;
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: 1.5rem;
}

.kb-article-content pre code {
    background: none;
    padding: 0;
    color: inherit;
}

/* ─── Sidebar ─── */
.kb-sidebar-container {
    margin-top: 3rem;
}

.kb-sidebar {
    position: sticky;
    top: 100px;
}

/* Table of Contents */
.kb-toc-card {
    background: #ffffff;
    padding: 1.25rem;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    margin-bottom: 1rem;
}

.kb-toc-card h5 {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.75rem;
    color: #2c3e50;
}

.kb-toc-nav {
    max-height: 400px;
    overflow-y: auto;
}

.kb-toc-nav a {
    display: block;
    padding: 6px 0;
    font-size: 0.85rem;
    color: #6c757d;
    text-decoration: none;
    border-left: 2px solid transparent;
    padding-left: 12px;
    transition: all 0.15s ease;
}

.kb-toc-nav a:hover {
    color: #3172ae;
    border-left-color: #3172ae;
}

.kb-toc-nav a.kb-toc-active {
    color: #3172ae;
    font-weight: 600;
    border-left-color: #3172ae;
}

.kb-toc-nav a.kb-toc-h3 {
    padding-left: 24px;
    font-size: 0.8rem;
}

/* Related Articles */
.kb-related-card {
    background: #ffffff;
    padding: 1.25rem;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    margin-bottom: 1rem;
}

.kb-related-card h5 {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.75rem;
    color: #2c3e50;
}

.kb-related-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.kb-related-list li {
    padding: 8px 0;
    border-bottom: 1px solid #f1f3f5;
}

.kb-related-list li:last-child {
    border-bottom: none;
}

.kb-related-list a {
    color: #3172ae;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
}

.kb-related-list a:hover {
    text-decoration: underline;
}

/* CTA Cards */
.kb-cta-card {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.kb-cta-card h5 {
    font-weight: 600;
    color: #2c3e50;
}

.kb-cta-card p {
    font-size: 0.9rem;
    color: #6c757d;
    margin-bottom: 0.75rem;
}

/* ─── Responsive ─── */
@media (max-width: 991px) {
    .kb-sidebar-container {
        margin-top: 2rem;
    }

    .kb-sidebar {
        position: static;
    }
}

@media (max-width: 768px) {
    .kb-article {
        padding: 1.25rem;
    }

    .kb-article-title {
        font-size: 1.75rem;
    }

    .kb-article-meta {
        gap: 0.75rem;
    }

    .kb-article-content h2 {
        font-size: 1.5rem;
    }

    .kb-article-content h3 {
        font-size: 1.2rem;
    }
}

/* ---------------------------------------------------------------
   Wider container on KB article pages.
   Bootstrap 4 caps .container at 1140px from the xl breakpoint up;
   we want article pages to breathe at 1400px on large screens.
   Scoped via `main.container` so it only affects the article shell
   on this page (the KB index doesn't use .container at all).
--------------------------------------------------------------- */
@media (min-width: 1200px) {
    main.container {
        max-width: 1400px;
    }
}
