/* ── Knowledge base ──────────────────────────────────────────────────────── */

.knowledge-hero {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    color: #fff;
    padding: 3.5rem 0;
}

.knowledge-hero .lead { color: rgba(255,255,255,.75) !important; }

.knowledge-stat-card {
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.12);
    border-radius: .75rem;
    min-width: 90px;
    padding: 1rem 1.25rem;
    text-align: center;
}

/* ── Article cards ───────────────────────────────────────────────────────── */

.knowledge-article-card {
    transition: transform .15s ease, box-shadow .15s ease;
    border-radius: .75rem !important;
}

.knowledge-article-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 .5rem 1.5rem rgba(0,0,0,.12) !important;
}

.knowledge-article-card .card-img-top {
    border-radius: .75rem .75rem 0 0;
    object-fit: cover;
}

.knowledge-article-row-card {
    border-radius: .5rem;
    transition: background-color .1s;
}

.knowledge-article-row-card:hover { background-color: var(--bs-light); }

/* ── Article detail body ─────────────────────────────────────────────────── */

.knowledge-article-body {
    font-size: 1.05rem;
    line-height: 1.85;
    color: #2c2c2c;
}

[data-bs-theme="dark"] .knowledge-article-body { color: #d4d4d4; }

.knowledge-article-body h2 {
    font-size: 1.45rem;
    font-weight: 700;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    padding-bottom: .4rem;
    border-bottom: 2px solid var(--bs-warning);
}

.knowledge-article-body h3 {
    font-size: 1.15rem;
    font-weight: 600;
    margin-top: 1.8rem;
    margin-bottom: .75rem;
}

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

.knowledge-article-body li { margin-bottom: .35rem; }

.knowledge-article-body strong { color: #111; }

[data-bs-theme="dark"] .knowledge-article-body strong { color: #f0f0f0; }

.knowledge-article-body blockquote {
    border-left: 4px solid var(--bs-warning);
    background: #fffbf0;
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    border-radius: 0 .375rem .375rem 0;
    font-style: italic;
}

[data-bs-theme="dark"] .knowledge-article-body blockquote {
    background: rgba(255,193,7,.08);
}

.knowledge-article-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: .93rem;
}

.knowledge-article-body th {
    background: #f8f9fa;
    padding: .55rem .8rem;
    text-align: left;
    font-weight: 600;
    border: 1px solid #dee2e6;
}

[data-bs-theme="dark"] .knowledge-article-body th {
    background: rgba(255,255,255,.05);
    border-color: rgba(255,255,255,.1);
}

.knowledge-article-body td {
    padding: .5rem .8rem;
    border: 1px solid #dee2e6;
    vertical-align: top;
}

[data-bs-theme="dark"] .knowledge-article-body td { border-color: rgba(255,255,255,.1); }

.knowledge-article-body tr:nth-child(even) td { background: rgba(0,0,0,.02); }

/* ── Article figures and image placeholders ──────────────────────────────── */

.knowledge-article-body figure {
    margin: 1.5rem 0;
    text-align: center;
}

.knowledge-article-body figure img {
    max-width: 100%;
    border-radius: 6px;
    height: auto;
}

.knowledge-article-body figure figcaption {
    font-size: .875rem;
    color: #6c757d;
    margin-top: .4rem;
    font-style: italic;
}

.knowledge-article-body figure.article-image-placeholder {
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    padding: 2rem 1.5rem;
}

.knowledge-article-body figure.article-image-placeholder img { display: none; }

[data-bs-theme="dark"] .knowledge-article-body figure.article-image-placeholder {
    background: rgba(255,255,255,.04);
    border-color: rgba(255,255,255,.15);
}

[data-bs-theme="dark"] .knowledge-article-body figure figcaption { color: #8a8a8a; }

/* ── Rarity badges ───────────────────────────────────────────────────────── */

.rarity-Common       { background-color: #6c757d !important; color: #fff !important; }
.rarity-Uncommon     { background-color: #198754 !important; color: #fff !important; }
.rarity-Scarce       { background-color: #0d6efd !important; color: #fff !important; }
.rarity-Rare         { background-color: #6f42c1 !important; color: #fff !important; }
.rarity-VeryRare     { background-color: #dc3545 !important; color: #fff !important; }
.rarity-ExtremelyRare { background: linear-gradient(90deg,#c0392b,#e67e22) !important; color: #fff !important; }

/* ── TOC sidebar ─────────────────────────────────────────────────────────── */

.knowledge-toc {
    font-size: .85rem;
    max-height: 320px;
    overflow-y: auto;
}

.knowledge-toc .toc-link {
    color: #777;
    display: block;
    padding: .2rem 0;
    line-height: 1.3;
    text-decoration: none;
}

.knowledge-toc .toc-link:hover { color: var(--bs-warning); }
.knowledge-toc .toc-link.toc-active { color: var(--bs-warning) !important; font-weight: 600; }

/* ── Learning path cards ─────────────────────────────────────────────────── */

.learning-path-card {
    border-left: 4px solid var(--bs-warning) !important;
    border-radius: .75rem !important;
    transition: transform .15s ease, box-shadow .15s ease;
}

.learning-path-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 .5rem 1.5rem rgba(0,0,0,.12) !important;
}

/* ── Tag pills ───────────────────────────────────────────────────────────── */

.knowledge-tag-pill {
    transition: opacity .1s;
    text-decoration: none;
    font-size: .82rem;
    padding: .4em .85em;
}

.knowledge-tag-pill:hover { opacity: .82; }

/* ── Glossary ────────────────────────────────────────────────────────────── */

.glossary-letter-anchor { scroll-margin-top: 80px; }

.glossary-term-card {
    border-left: 3px solid transparent;
    transition: border-color .15s;
}

.glossary-term-card:hover { border-left-color: var(--bs-warning); }

/* ── mcc-term tooltip marker ─────────────────────────────────────────────── */

.mcc-term {
    border-bottom: 1px dashed var(--bs-warning);
    cursor: help;
}

/* ── Difficulty chip colours ─────────────────────────────────────────────── */

.difficulty-Beginner     { color: #198754; }
.difficulty-Intermediate { color: #fd7e14; }
.difficulty-Advanced     { color: #dc3545; }
.difficulty-Expert       { color: #6f42c1; }
