/* =====================================================
   Cyberace Knowledge Base — Public Styles
   Font: Inter | Accent: #8B1A1A (orange)
   ===================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap');

/* --- Force Inter on ALL KB elements ---------------- */
.ckb-wrap,
.ckb-wrap *,
.ckb-single-wrap,
.ckb-single-wrap *,
.ckb-faq-list,
.ckb-faq-list * {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif !important;
    box-sizing: border-box;
}

/* --- Search Bar ------------------------------------ */
.ckb-search-bar {
    position: relative;
    max-width: 600px;
    margin: 0 auto 36px;
}

.ckb-search-inner {
    display: flex;
    align-items: center;
    background: #fff;
    border: 1.5px solid #e5e7eb;
    border-radius: 12px;
    padding: 0 16px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.ckb-search-inner:focus-within {
    border-color: #8B1A1A;
    box-shadow: 0 0 0 3px rgba(240,165,0,0.12);
}

.ckb-search-icon { color: #9ca3af; flex-shrink: 0; margin-right: 10px; }

.ckb-search-input {
    flex: 1;
    border: none;
    outline: none;
    padding: 14px 0;
    font-size: 15px;
    font-family: 'Inter', sans-serif !important;
    background: transparent;
    color: #111827;
}

.ckb-search-input::placeholder { color: #9ca3af; }

.ckb-search-results {
    position: absolute;
    top: calc(100% + 6px);
    left: 0; right: 0;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.10);
    z-index: 9999;
    overflow: hidden;
}

.ckb-search-result-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    text-decoration: none;
    color: #111827;
    border-bottom: 1px solid #f3f4f6;
    transition: background 0.15s;
}

.ckb-search-result-item:last-child { border-bottom: none; }
.ckb-search-result-item:hover { background: rgba(30, 79, 168, 0.06); }

.ckb-search-result-title {
    font-size: 14px;
    font-weight: 500;
    color: #111827;
    display: block;
    margin-bottom: 2px;
    font-family: 'Inter', sans-serif !important;
}

.ckb-search-result-meta { font-size: 12px; color: #6b7280; font-family: 'Inter', sans-serif !important; }

.ckb-search-type-badge {
    font-size: 10px;
    font-weight: 600;
    background: rgba(30, 79, 168, 0.10);
    color: #92400e;
    border-radius: 4px;
    padding: 2px 6px;
    flex-shrink: 0;
    margin-top: 2px;
    font-family: 'Inter', sans-serif !important;
}

.ckb-search-no-results {
    padding: 16px;
    text-align: center;
    color: #6b7280;
    font-size: 14px;
    font-family: 'Inter', sans-serif !important;
}

/* --- Role heading ---------------------------------- */
.ckb-role-heading {
    font-size: 22px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 28px;
    font-family: 'Inter', sans-serif !important;
}

.ckb-role-badge {
    background: rgba(30, 79, 168, 0.10);
    color: #92400e;
    font-size: 13px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 20px;
    margin-right: 4px;
    font-family: 'Inter', sans-serif !important;
}

/* --- 3-Column Category Grid ----------------------- */
.ckb-categories-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

@media (max-width: 900px) { .ckb-categories-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 580px) { .ckb-categories-grid { grid-template-columns: 1fr; } }

/* --- Category Card -------------------------------- */
.ckb-cat-card {
    background: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 14px;
    overflow: hidden;
    transition: box-shadow 0.2s, transform 0.2s;
    display: flex;
    flex-direction: column;
}

.ckb-cat-card:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    transform: translateY(-1px);
}

.ckb-cat-card-header { padding: 18px 20px 14px; }

.ckb-cat-card-title {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ckb-cat-name {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
    font-family: 'Inter', sans-serif !important;
    flex: 1;
}

.ckb-count-badge {
    background: #f3f4f6;
    color: #6b7280;
    font-size: 11px;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 20px;
    font-family: 'Inter', sans-serif !important;
    flex-shrink: 0;
}

.ckb-count-badge.small { font-size: 10px; padding: 1px 6px; }

.ckb-cat-card-divider { height: 1px; background: #f0f0f0; margin: 0 20px; }

.ckb-cat-card-body {
    padding: 12px 20px 18px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ckb-article-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 0;
}

.ckb-article-link {
    font-size: 14px;
    color: #374151;
    text-decoration: none;
    font-family: 'Inter', sans-serif !important;
    transition: color 0.15s;
    line-height: 1.4;
}

.ckb-article-link:hover { color: #8B1A1A; }

.ckb-subcat-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 0 3px;
    margin-top: 4px;
}

.ckb-subcat-row.depth-1 { padding-left: 16px; }

.ckb-subcat-name {
    font-size: 13px;
    font-weight: 600;
    color: #8B1A1A;
    font-family: 'Inter', sans-serif !important;
    flex: 1;
}

.ckb-subcat-children { padding-left: 8px; }
.ckb-subcat-children.depth-1 { padding-left: 24px; }

.ckb-empty-cat {
    font-size: 13px;
    color: #9ca3af;
    font-style: italic;
    margin: 8px 0 0;
    font-family: 'Inter', sans-serif !important;
}

.ckb-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 48px 24px;
    color: #6b7280;
    font-family: 'Inter', sans-serif !important;
}

.ckb-empty svg { display: block; margin: 0 auto 16px; opacity: 0.5; }
.ckb-empty p { font-size: 15px; margin: 0; }

/* =====================================================
   FAQ Accordion
   ===================================================== */
.ckb-faq-list { display: flex; flex-direction: column; gap: 8px; }

.ckb-faq-item {
    border: 1px solid #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
}

.ckb-faq-question {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: #fff;
    border: none;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    font-family: 'Inter', sans-serif !important;
    color: #111827;
    text-align: left;
    gap: 12px;
    transition: background 0.15s;
}

.ckb-faq-question:hover { background: #fafafa; }

.ckb-faq-chevron {
    flex-shrink: 0;
    transition: transform 0.25s;
    color: #9ca3af;
}

.ckb-faq-item.open .ckb-faq-chevron { transform: rotate(180deg); color: #8B1A1A; }

.ckb-faq-answer { max-height: 0; overflow: hidden; transition: max-height 0.3s ease; }
.ckb-faq-item.open .ckb-faq-answer { max-height: 600px; }

.ckb-faq-answer-inner {
    padding: 14px 20px 18px;
    font-size: 14px;
    line-height: 1.7;
    color: #4b5563;
    border-top: 1px solid #f3f4f6;
    font-family: 'Inter', sans-serif !important;
}

/* =====================================================
   Single Article Page — Sidebar on RIGHT
   ===================================================== */
.ckb-single-wrap {
    display: grid;
    grid-template-columns: 1fr 280px;  /* Content LEFT, Sidebar RIGHT */
    gap: 32px;
    align-items: start;
    font-family: 'Inter', sans-serif !important;
}

@media (max-width: 768px) {
    .ckb-single-wrap { grid-template-columns: 1fr; }
    .ckb-sidebar { order: 2; }
    .ckb-article-content { order: 1; }
}

/* Sidebar — RIGHT side */
.ckb-sidebar {
    position: sticky;
    top: 32px;
    order: 2;  /* Forces sidebar to right */
}

.ckb-article-content {
    order: 1;  /* Forces content to left */
    min-width: 0;
}

.ckb-sidebar-inner {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 20px;
}

.ckb-sidebar-title {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #9ca3af;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f0f0f0;
    font-family: 'Inter', sans-serif !important;
}

.ckb-sidebar-tree { list-style: none; margin: 0; padding: 0; }

.ckb-tree-parent { margin-bottom: 4px; }

.ckb-tree-parent-label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    padding: 5px 6px;
    border-radius: 6px;
    transition: background 0.15s;
}

.ckb-tree-parent-label:hover { background: rgba(30, 79, 168, 0.06); }

.ckb-tree-parent-label a {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    text-decoration: none;
    flex: 1;
    font-family: 'Inter', sans-serif !important;
}

.ckb-tree-parent.active > .ckb-tree-parent-label a { color: #8B1A1A; }

.ckb-sidebar-children {
    list-style: none;
    margin: 2px 0 0 18px;
    padding: 0;
    display: none;
}

.ckb-tree-parent.open > .ckb-sidebar-children { display: block; }

.ckb-tree-article {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 6px;
    border-radius: 6px;
    transition: background 0.15s;
}

.ckb-tree-article:hover { background: rgba(30, 79, 168, 0.06); }

.ckb-tree-article a {
    font-size: 13px;
    color: #6b7280;
    text-decoration: none;
    line-height: 1.4;
    font-family: 'Inter', sans-serif !important;
}

.ckb-tree-article.current a { color: #8B1A1A; font-weight: 500; }

.ckb-tree-subcat { margin-top: 4px; }

.ckb-tree-subcat-label {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 6px;
    border-radius: 6px;
    cursor: pointer;
}

.ckb-tree-subcat-label a {
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    text-decoration: none;
    font-family: 'Inter', sans-serif !important;
}

.ckb-tree-subcat.active > .ckb-tree-subcat-label a { color: #8B1A1A; }

/* Breadcrumb */
.ckb-breadcrumb {
    font-size: 13px;
    color: #9ca3af;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    font-family: 'Inter', sans-serif !important;
}

.ckb-breadcrumb a { color: #8B1A1A; text-decoration: none; }
.ckb-breadcrumb a:hover { text-decoration: underline; }
.ckb-breadcrumb-sep { color: #d1d5db; }
.ckb-breadcrumb-current { color: #6b7280; }

/* Article title */
.ckb-article-title {
    font-size: 28px !important;
    font-weight: 700 !important;
    color: #111827 !important;
    margin: 0 0 8px !important;
    line-height: 1.3 !important;
    font-family: 'Inter', sans-serif !important;
}

.ckb-article-meta {
    font-size: 13px;
    color: #9ca3af;
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 1px solid #f0f0f0;
    font-family: 'Inter', sans-serif !important;
}

/* Article body */
.ckb-article-body {
    font-size: 15px;
    line-height: 1.8;
    color: #374151;
    font-family: 'Inter', sans-serif !important;
}

.ckb-article-body h1,
.ckb-article-body h2,
.ckb-article-body h3,
.ckb-article-body h4,
.ckb-article-body h5,
.ckb-article-body h6 {
    font-family: 'Inter', sans-serif !important;
    color: #111827 !important;
}

.ckb-article-body h2 { font-size: 20px; font-weight: 600; margin: 28px 0 12px; }
.ckb-article-body h3 { font-size: 17px; font-weight: 600; margin: 24px 0 10px; }
.ckb-article-body p  { margin: 0 0 16px; }
.ckb-article-body ul,
.ckb-article-body ol { padding-left: 24px; margin-bottom: 16px; }
.ckb-article-body li { margin-bottom: 6px; }
.ckb-article-body a  { color: #8B1A1A; }

.ckb-article-body code {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 13px;
    font-family: 'JetBrains Mono', 'Fira Code', monospace !important;
}

.ckb-article-body pre {
    background: #1f2937;
    color: #e5e7eb;
    border-radius: 8px;
    padding: 20px;
    overflow-x: auto;
    margin-bottom: 20px;
}

.ckb-article-body pre code {
    background: none;
    border: none;
    color: inherit;
    padding: 0;
}

.ckb-article-body blockquote {
    border-left: 3px solid #8B1A1A;
    margin: 0 0 16px;
    padding: 8px 16px;
    color: #6b7280;
    font-style: italic;
    background: rgba(30, 79, 168, 0.06);
    border-radius: 0 6px 6px 0;
}

/* Prev/Next */
.ckb-prev-next {
    display: flex;
    justify-content: space-between;
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid #f0f0f0;
    gap: 16px;
}

.ckb-prev-next-link {
    font-size: 14px;
    font-weight: 500;
    color: #8B1A1A;
    text-decoration: none;
    padding: 10px 16px;
    border: 1px solid rgba(30, 79, 168, 0.20);
    border-radius: 8px;
    background: rgba(30, 79, 168, 0.06);
    transition: background 0.15s, border-color 0.15s;
    max-width: 48%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-family: 'Inter', sans-serif !important;
}

.ckb-prev-next-link:hover { background: rgba(30, 79, 168, 0.10); border-color: #8B1A1A; }
.ckb-prev-next-link.next { margin-left: auto; text-align: right; }

/* --- Sidebar toggle arrow ------------------------- */
.ckb-toggle-arrow {
    flex-shrink: 0;
    transition: transform 0.2s ease;
    transform: rotate(0deg);
}

.ckb-tree-parent.open > .ckb-tree-parent-label .ckb-toggle-arrow,
.ckb-tree-subcat.open > .ckb-tree-subcat-label .ckb-toggle-arrow {
    transform: rotate(90deg);
}

.ckb-tree-parent-label,
.ckb-tree-subcat-label {
    cursor: pointer;
    user-select: none;
}
