/* ==========================================================
   CELENTIS DOCS — Stylesheet
   Uses theme CSS variables from celentis/assets/css/main.css
   ========================================================== */

/* ── WRAPPER ────────────────────────────────────────────────── */
.cd-wrap {
  padding-top: 80px; /* clear 70px fixed header */
  min-height: 100vh;
  background: var(--bg);
}

/* ── THREE-COLUMN LAYOUT ────────────────────────────────────── */
.cd-layout {
  display: grid;
  grid-template-columns: 280px 1fr 260px;
  grid-template-areas: "sidebar content toc";
  gap: 24px;
  align-items: start;
}
.cd-wrap .cd-layout {
  padding-top: 2rem;
  padding-bottom: 5rem;
}

/* ============================================================
   LEFT SIDEBAR
   ============================================================ */
.cd-sidebar-left {
  grid-area: sidebar;
  background: var(--bg-2);
  border: 1px solid var(--hairline);
  border-radius: 6px;
  position: sticky;
  top: 84px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--hairline) var(--bg-2);
}
.cd-sidebar-left::-webkit-scrollbar        { width: 4px; }
.cd-sidebar-left::-webkit-scrollbar-track  { background: var(--bg-2); }
.cd-sidebar-left::-webkit-scrollbar-thumb  { background: var(--hairline); border-radius: 2px; }
.cd-sidebar-left::-webkit-scrollbar-thumb:hover { background: var(--blue); }

/* Search */
.cd-sidebar-search {
  padding: 1rem 1rem 0;
}
.cd-search-form {
  position: relative;
}
.cd-search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--ink-mute, #6F8597);
  pointer-events: none;
}
.cd-search-input {
  width: 100%;
  box-sizing: border-box;
  background: var(--void, #081116);
  border: 1px solid var(--rule, #223E54);
  border-radius: var(--r-sm, 6px);
  color: var(--ink, #E3EDF4);
  font-family: var(--sans, "IBM Plex Sans", system-ui, sans-serif);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: .02em;
  padding: 8px 10px 8px 34px;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.cd-search-input:focus { border-color: var(--beam, #5FB6D4); box-shadow: 0 0 0 1px rgba(95,182,212,.2); }
.cd-search-input::placeholder { color: var(--ink-mute, #6F8597); }

/* Search results dropdown */
.cd-search-results {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--bg-2);
  border: 1px solid var(--hairline);
  border-radius: 6px;
  overflow: hidden;
  z-index: 300;
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
}
.cd-search-result-item {
  display: block;
  padding: .6rem 1rem;
  border-bottom: 1px solid var(--hairline-soft);
  text-decoration: none;
  transition: background .15s;
}
.cd-search-result-item:last-child { border-bottom: none; }
.cd-search-result-item:hover { background: var(--bg-3); }
.cd-search-result-title {
  display: block;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 700;
  color: var(--fg);
  letter-spacing: .04em;
}
.cd-search-result-cat {
  display: inline-block;
  font-family: var(--font);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-top: 2px;
}
.cd-search-result-excerpt {
  display: block;
  font-family: var(--font);
  font-size: 12px;
  color: var(--fg-dim);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cd-search-no-results {
  padding: .75rem 1rem;
  font-family: var(--font);
  font-size: 13px;
  color: var(--fg-dim);
  text-align: center;
}

/* Hub link */
.cd-sidebar-hub-link {
  display: flex;
  align-items: center;
  gap: .4rem;
  padding: .7rem 1rem;
  margin: .5rem 1rem .25rem;
  font-family: var(--font);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--fg-dim);
  text-decoration: none;
  border-radius: 4px;
  transition: color .2s, background .2s;
}
.cd-sidebar-hub-link svg { width: 14px; height: 14px; flex-shrink: 0; }
.cd-sidebar-hub-link:hover { color: var(--fg); background: var(--bg-3); }

/* Nav */
.cd-sidebar-nav { padding: .5rem 0 1rem; }
.cd-sidebar-empty {
  padding: .5rem 1rem;
  font-size: 13px;
  color: var(--fg-dim);
}

/* Nav group */
.cd-nav-group { border-top: 1px solid var(--hairline-soft); }
.cd-nav-group:first-child { border-top: none; }

.cd-nav-group-header {
  width: 100%;
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .6rem 1rem;
  font-family: var(--font);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--accent);
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: background .2s;
}
.cd-nav-group-header:hover { background: var(--bg-3); }
.cd-nav-group-icon { font-size: 14px; flex-shrink: 0; }
.cd-nav-group-title { flex: 1; }
.cd-nav-group-count {
  background: var(--bg-3);
  color: var(--blue);
  border: 1px solid var(--blue-border);
  border-radius: 3px;
  padding: 0 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
  flex-shrink: 0;
}
.cd-nav-group-chevron {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  color: var(--fg-dim);
  transition: transform .2s;
}
.cd-nav-group.is-open .cd-nav-group-chevron { transform: rotate(180deg); }

/* Doc list */
.cd-nav-doc-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.cd-nav-doc-list--child { padding-left: .75rem; }

.cd-nav-doc-item {}
.cd-nav-doc-link {
  display: block;
  padding: .45rem 1rem .45rem 1.75rem;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--fg-muted);
  text-decoration: none;
  border-left: 2px solid transparent;
  transition: color .18s, background .18s, border-color .18s;
}
.cd-nav-doc-link:hover {
  color: var(--fg);
  background: var(--bg-3);
  border-left-color: var(--blue-active);
}
.cd-nav-doc-item.is-current .cd-nav-doc-link {
  color: var(--blue);
  background: var(--bg-3);
  border-left-color: var(--blue-active);
}

/* Subcategory label */
.cd-nav-subcat { margin-top: .25rem; }
.cd-nav-subcat-label {
  display: block;
  padding: .3rem 1rem .3rem 1.75rem;
  font-family: var(--font);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--fg-dim);
}

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.cd-content {
  grid-area: content;
  background: var(--bg-3);
  border: 1px solid var(--hairline);
  border-radius: 6px;
  padding: 2.5rem;
  min-width: 0; /* prevent grid blowout */
}

/* Breadcrumb */
.cd-breadcrumb {
  display: flex;
  align-items: center;
  gap: .4rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}
.cd-breadcrumb-link {
  font-family: var(--font);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .08em;
  color: var(--fg-dim);
  text-decoration: none;
  transition: color .18s;
}
.cd-breadcrumb-link:hover { color: var(--blue); }
.cd-breadcrumb-sep {
  font-size: 12px;
  color: var(--hairline);
}
.cd-breadcrumb-current {
  font-family: var(--font);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .08em;
  color: var(--fg-muted);
}

/* Entry header */
.cd-entry-header { margin-bottom: 2rem; }
.cd-entry-title {
  font-family: var(--font) !important;
  font-size: clamp(1.8rem, 3vw, 2.6rem) !important;
  font-weight: 700 !important;
  color: var(--fg) !important;
  letter-spacing: .02em;
  line-height: 1.1;
  margin-bottom: .75rem;
}
.cd-entry-meta {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
}
.cd-meta-item {
  display: flex;
  align-items: center;
  gap: .35rem;
  font-family: var(--font);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .08em;
  color: var(--fg-dim);
}
.cd-meta-item svg { width: 13px; height: 13px; flex-shrink: 0; }

/* Entry content */
.cd-entry-content {
  color: var(--fg-muted);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.85;
}
.cd-entry-content h1,
.cd-entry-content h2,
.cd-entry-content h3,
.cd-entry-content h4,
.cd-entry-content h5,
.cd-entry-content h6 {
  font-family: var(--font) !important;
  font-weight: 700 !important;
  color: var(--fg) !important;
  letter-spacing: .04em;
  margin: 2rem 0 .75rem;
  scroll-margin-top: 90px;
}
.cd-entry-content h2 {
  font-size: 1.5rem !important;
  padding-bottom: .5rem;
  border-bottom: 1px solid var(--hairline-soft);
}
.cd-entry-content h3 { font-size: 1.2rem !important; }
.cd-entry-content h4 { font-size: 1rem !important; color: var(--fg-muted) !important; }
.cd-entry-content h5,
.cd-entry-content h6 { font-size: .9rem !important; color: var(--fg-dim) !important; }

.cd-entry-content p { margin-bottom: 1rem; }
.cd-entry-content strong { color: var(--fg); }
.cd-entry-content em { color: var(--fg-muted); font-style: italic; }

.cd-entry-content a { color: var(--blue); text-decoration: none; }
.cd-entry-content a:hover { color: var(--fg); text-decoration: underline; }

.cd-entry-content ul,
.cd-entry-content ol {
  padding-left: 1.5rem;
  margin-bottom: 1.25rem;
}
.cd-entry-content li { margin-bottom: .35rem; }
.cd-entry-content ul > li::marker { color: var(--accent); }
.cd-entry-content ol > li::marker { color: var(--blue); }

.cd-entry-content blockquote {
  border-left: 3px solid var(--blue-active);
  background: var(--bg-2);
  margin: 1.5rem 0;
  padding: 1rem 1.5rem;
  border-radius: 0 6px 6px 0;
  color: var(--fg-muted);
}
.cd-entry-content blockquote p:last-child { margin-bottom: 0; }

.cd-entry-content code {
  background: var(--bg-2);
  border: 1px solid var(--hairline);
  border-radius: 4px;
  padding: 2px 7px;
  font-family: var(--mono);
  font-size: .86rem;
  color: var(--blue);
  letter-spacing: 0;
}
.cd-entry-content pre {
  background: var(--bg);
  border: 1px solid var(--hairline);
  border-radius: 6px;
  padding: 1.25rem;
  overflow-x: auto;
  margin-bottom: 1.25rem;
}
.cd-entry-content pre code {
  background: none;
  border: none;
  padding: 0;
  color: var(--fg-muted);
  font-size: .88rem;
}

.cd-entry-content hr {
  border: none;
  border-top: 1px solid var(--hairline);
  margin: 2rem 0;
}

.cd-entry-content table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
  font-size: .94rem;
}
.cd-entry-content table th {
  background: var(--bg-2);
  color: var(--fg);
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  font-size: .8rem;
  padding: .6rem 1rem;
  border: 1px solid var(--hairline);
  text-align: left;
}
.cd-entry-content table td {
  padding: .6rem 1rem;
  border: 1px solid var(--hairline);
  color: var(--fg-muted);
  vertical-align: top;
}
.cd-entry-content table tr:nth-child(even) td { background: var(--bg-2); }

.cd-entry-content img {
  max-width: 100%;
  border-radius: 6px;
  border: 1px solid var(--hairline);
  margin: .75rem 0;
}

/* Gutenberg block compatibility */
.cd-entry-content .wp-block-paragraph,
.cd-entry-content .wp-block-list,
.cd-entry-content .wp-block-heading {
  color: inherit;
}
.cd-entry-content .wp-block-code,
.cd-entry-content .wp-block-preformatted {
  background: var(--bg);
  border: 1px solid var(--hairline);
  border-radius: 6px;
  padding: 1.25rem;
  color: var(--fg-muted);
  font-family: var(--mono);
  font-size: .88rem;
}
.cd-entry-content .wp-block-quote {
  border-left: 3px solid var(--blue-active);
  background: var(--bg-2);
  margin: 1.5rem 0;
  padding: 1rem 1.5rem;
  border-radius: 0 6px 6px 0;
  color: var(--fg-muted);
}
.cd-entry-content .wp-block-separator {
  border: none;
  border-top: 1px solid var(--hairline);
  margin: 2rem 0;
}
.cd-entry-content .wp-block-table table {
  width: 100%;
  border-collapse: collapse;
}
.cd-entry-content .wp-block-table td,
.cd-entry-content .wp-block-table th {
  border: 1px solid var(--hairline);
  padding: .6rem 1rem;
  color: var(--fg-muted);
}
.cd-entry-content .wp-block-table th {
  background: var(--bg-2);
  color: var(--fg);
  font-weight: 700;
}

/* Empty content fallback */
.cd-content-empty {
  padding: 2rem 0;
  color: var(--fg-dim);
  font-family: var(--font);
  font-size: 14px;
  font-style: italic;
}

/* ── FEEDBACK ──────────────────────────────────────────────── */
.cd-feedback {
  margin-top: 2.5rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--hairline-soft);
}
.cd-feedback-label {
  font-family: var(--font);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--fg-dim);
  margin-bottom: .75rem;
}
.cd-feedback-buttons {
  display: flex;
  gap: .75rem;
}
.cd-feedback-btn {
  display: flex;
  align-items: center;
  gap: .5rem;
  background: var(--bg-2);
  border: 1px solid var(--hairline);
  border-radius: 6px;
  color: var(--fg-muted);
  padding: 8px 18px;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .06em;
  cursor: pointer;
  transition: border-color .2s, color .2s, background .2s;
}
.cd-feedback-btn svg { width: 16px; height: 16px; }
.cd-feedback-btn:hover { border-color: var(--blue-active); color: var(--blue); }
.cd-feedback-btn.is-voted.cd-feedback-yes { border-color: var(--accent); color: var(--accent); }
.cd-feedback-btn.is-voted.cd-feedback-no  { border-color: var(--blue);   color: var(--blue);   }
.cd-feedback-count {
  background: var(--bg-3);
  border-radius: 3px;
  padding: 0 5px;
  font-size: 11px;
  font-weight: 700;
}
.cd-feedback-thanks {
  display: none;
  align-items: center;
  gap: .5rem;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: .06em;
}
.cd-feedback-thanks.is-visible {
  display: flex;
}
.cd-feedback-thanks svg { width: 18px; height: 18px; }
.cd-feedback-question.cd-is-hidden { display: none; }

/* ── PREV / NEXT NAV ───────────────────────────────────────── */
.cd-doc-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--hairline-soft);
}
.cd-doc-nav-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  background: var(--bg-2);
  border: 1px solid var(--hairline);
  border-radius: 6px;
  padding: .875rem 1.25rem;
  text-decoration: none;
  transition: border-color .2s, background .2s;
  max-width: 48%;
}
.cd-doc-nav-item:hover {
  border-color: var(--blue-active);
  background: var(--bg-3);
}
.cd-doc-nav-next { margin-left: auto; text-align: right; }
.cd-doc-nav-item svg { width: 18px; height: 18px; color: var(--fg-dim); flex-shrink: 0; }
.cd-doc-nav-item small {
  display: block;
  font-family: var(--font);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--fg-dim);
  margin-bottom: 3px;
}
.cd-doc-nav-item span {
  display: block;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--fg-muted);
}

/* ============================================================
   RIGHT SIDEBAR — TOC
   ============================================================ */
.cd-sidebar-right {
  grid-area: toc;
  background: var(--bg-2);
  border: 1px solid var(--hairline);
  border-radius: 6px;
  padding: 1.25rem;
  position: sticky;
  top: 84px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--hairline) var(--bg-2);
}
.cd-sidebar-right::-webkit-scrollbar       { width: 4px; }
.cd-sidebar-right::-webkit-scrollbar-track { background: var(--bg-2); }
.cd-sidebar-right::-webkit-scrollbar-thumb { background: var(--hairline); border-radius: 2px; }
.cd-sidebar-right::-webkit-scrollbar-thumb:hover { background: var(--blue); }

.cd-toc-title {
  font-family: var(--font) !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  letter-spacing: .22em !important;
  color: var(--accent) !important;
  text-transform: uppercase;
  margin: 0 0 .75rem;
  padding-bottom: .5rem;
  border-bottom: 1px solid var(--hairline-soft);
}
.cd-toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.cd-toc-list li { border-bottom: 1px solid var(--hairline-soft); }
.cd-toc-list li:last-child { border-bottom: none; }
.cd-toc-list a {
  display: block;
  padding: .45rem .5rem;
  font-family: var(--font);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--fg-dim);
  text-decoration: none;
  border-left: 2px solid transparent;
  transition: color .18s, border-color .18s;
  line-height: 1.4;
}
.cd-toc-list a:hover {
  color: var(--fg);
  border-left-color: var(--blue-active);
}
.cd-toc-list li.is-active > a {
  color: var(--blue);
  border-left-color: var(--blue-active);
}
/* H3 and H4 indent */
.cd-toc-list .cd-toc-h3 a { padding-left: 1rem; font-size: 11px; }
.cd-toc-list .cd-toc-h4 a { padding-left: 1.75rem; font-size: 11px; color: var(--fg-dim); }
.cd-toc-empty {
  font-family: var(--font);
  font-size: 12px;
  color: var(--fg-dim);
  margin: 0;
}

/* ============================================================
   DOCS HUB — ARCHIVE PAGE
   ============================================================ */

/* Hero */
.cd-hub-hero {
  padding: 2.5rem 0 2rem;
  border-bottom: 1px solid var(--hairline-soft);
}
.cd-hub-hero-inner {
  /* max-width intentionally removed — uses .container width so content
     aligns with the rest of the page */
}
.cd-hub-title {
  font-family: var(--font) !important;
  font-size: clamp(2.2rem, 5vw, 3.5rem) !important;
  font-weight: 700 !important;
  color: var(--fg) !important;
  letter-spacing: .02em;
  line-height: 1.05;
  margin: .5rem 0 .75rem;
}
.cd-hub-subtitle {
  font-family: var(--font);
  font-size: 1rem;
  color: var(--fg-muted);
  line-height: 1.6;
  margin-bottom: 2rem;
  max-width: 540px;
}
.cd-hub-search-wrap {
  max-width: 720px;
}
.cd-hub-search-wrap .cd-search-input {
  border-radius: 999px;
  font-size: 0.95rem;
  padding: 16px 24px 16px 48px;
}
.cd-hub-search-wrap .cd-search-icon {
  width: 18px;
  height: 18px;
  left: 18px;
}

/* ⌘K badge — hub search only */
.cd-search-kbd {
  display: none;
}
.cd-hub-search-wrap .cd-search-kbd {
  display: flex;
  align-items: center;
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--mono, "JetBrains Mono", ui-monospace, monospace);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: .08em;
  color: var(--ink-mute, #6F8597);
  background: var(--panel, #122632);
  border: 1px solid var(--rule, #223E54);
  border-radius: var(--r-xs, 4px);
  padding: 3px 7px;
  pointer-events: none;
  user-select: none;
  white-space: nowrap;
}

/* Category grid */
.cd-wrap .cd-hub-grid-wrap { padding: 3rem 32px 6rem; }
.cd-hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.25rem;
}
.cd-hub-card {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  background: var(--bg-2);
  border: 1px solid var(--hairline);
  border-radius: 6px;
  padding: 1.5rem;
  text-decoration: none;
  transition: background .2s, box-shadow .2s, border-color .2s;
}
.cd-hub-card:hover {
  background: var(--bg-3);
  border-color: var(--blue-border);
  box-shadow: 0 0 0 1px var(--blue-border);
}
.cd-hub-card-icon {
  font-size: 2rem;
  line-height: 1;
  flex-shrink: 0;
}
.cd-hub-card-body { flex: 1; min-width: 0; }
.cd-hub-card-title {
  font-family: var(--font) !important;
  font-size: 1.1rem !important;
  font-weight: 700 !important;
  color: var(--fg) !important;
  letter-spacing: .04em;
  margin: 0 0 .35rem;
}
.cd-hub-card-desc {
  font-family: var(--font);
  font-size: 13px;
  color: var(--fg-muted);
  line-height: 1.5;
  margin-bottom: .5rem;
}
.cd-hub-card-meta {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
}
.cd-hub-card-count {
  font-family: var(--font);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .1em;
  color: var(--blue);
  background: var(--bg-3);
  border: 1px solid var(--blue-border);
  border-radius: 3px;
  padding: 1px 7px;
}
.cd-hub-card-updated {
  font-family: var(--font);
  font-size: 11px;
  letter-spacing: .06em;
  color: var(--fg-dim);
}
.cd-hub-card-arrow {
  width: 16px;
  height: 16px;
  color: var(--fg-dim);
  flex-shrink: 0;
  margin-top: .2rem;
  transition: transform .2s, color .2s;
}
.cd-hub-card:hover .cd-hub-card-arrow {
  transform: translateX(3px);
  color: var(--blue);
}

/* ── CATEGORY VIEW ──────────────────────────────────────────── */
.cd-wrap .cd-cat-view {
  padding-top: 2rem;
  padding-bottom: 6rem;
}
.cd-cat-view .cd-breadcrumb { margin-bottom: 1.5rem; }

.cd-cat-header {
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
  background: var(--bg-2);
  border: 1px solid var(--hairline);
  border-radius: 6px;
  padding: 1.5rem 2rem;
  margin-bottom: 2rem;
}
.cd-cat-header-icon { font-size: 2.5rem; line-height: 1; flex-shrink: 0; }
.cd-cat-header-title {
  font-family: var(--font) !important;
  font-size: 1.8rem !important;
  font-weight: 700 !important;
  color: var(--fg) !important;
  letter-spacing: .02em;
  margin: 0 0 .3rem;
}
.cd-cat-header-desc {
  font-family: var(--font);
  font-size: 14px;
  color: var(--fg-muted);
  margin-bottom: .5rem;
}
.cd-cat-header-count {
  font-family: var(--font);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  color: var(--blue);
  background: var(--bg-3);
  border: 1px solid var(--blue-border);
  border-radius: 3px;
  padding: 2px 8px;
}

/* Doc list in category view */
.cd-doc-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.cd-doc-list-item {}
.cd-doc-list-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: var(--bg-2);
  border: 1px solid var(--hairline);
  border-radius: 6px;
  padding: 1rem 1.25rem;
  text-decoration: none;
  transition: background .2s, border-color .2s;
}
.cd-doc-list-link:hover {
  background: var(--bg-3);
  border-color: var(--blue-border);
}
.cd-doc-list-body { flex: 1; min-width: 0; }
.cd-doc-list-title {
  display: block;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 700;
  color: var(--fg);
  letter-spacing: .04em;
  margin-bottom: .2rem;
}
.cd-doc-list-excerpt {
  display: block;
  font-family: var(--font);
  font-size: 12px;
  color: var(--fg-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cd-doc-list-meta {
  flex-shrink: 0;
  white-space: nowrap;
}
.cd-wrap .cd-doc-list-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: .3rem;
}
.cd-wrap .cd-doc-list-meta span:first-child {
  font-family: var(--font);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  color: var(--fg-muted);
}
.cd-doc-list-meta-updated {
  font-family: var(--font);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .04em;
  color: var(--fg-dim);
}

/* ── DIRECT DOCS SECTION (general articles in a parent category) */
.cd-direct-section {
  margin-bottom: 2rem;
}
.cd-direct-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .5rem 0 .625rem;
  margin-bottom: .5rem;
  border-bottom: 1px solid var(--hairline);
}
.cd-direct-header-label {
  font-family: var(--font);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--fg-dim);
}
.cd-direct-header-count {
  font-family: var(--font);
  font-size: 11px;
  font-weight: 600;
  color: var(--fg-dim);
}

/* Sticky pin indicator in flat lists */
.cd-sticky-pin {
  font-size: 11px;
  opacity: .7;
  margin-right: 2px;
}

/* ── SUB-CATEGORY CARD GRID ─────────────────────────────────── */
.cd-subcat-grid {
  display: grid;
  grid-template-columns: repeat( auto-fill, minmax( 380px, 1fr ) );
  gap: 1.25rem;
}

.cd-subcat-card {
  background: var(--bg-2);
  border: 1px solid var(--hairline);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: border-color .2s;
}
.cd-subcat-card:hover {
  border-color: var(--blue-border);
}

/* Card header */
.cd-subcat-card-header {
  display: flex;
  align-items: center;
  gap: .875rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--hairline);
}
.cd-subcat-card-icon {
  font-size: 1.5rem;
  line-height: 1;
  flex-shrink: 0;
}
.cd-subcat-card-meta {
  flex: 1;
  min-width: 0;
}
.cd-subcat-card-title {
  font-family: var(--font) !important;
  font-size: .9rem !important;
  font-weight: 700 !important;
  color: var(--fg) !important;
  letter-spacing: .03em;
  margin: 0 !important;
}
.cd-subcat-card-desc {
  font-family: var(--font);
  font-size: 11px;
  color: var(--fg-muted);
  margin: .2rem 0 0;
}
.cd-subcat-card-count {
  font-family: var(--font);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  color: var(--fg-dim);
  white-space: nowrap;
  flex-shrink: 0;
}

/* Article list inside card */
.cd-subcat-card-list {
  list-style: none;
  padding: .375rem 0;
  margin: 0;
  flex: 1;
}
.cd-subcat-card-item a {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .45rem 1.25rem;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  color: var(--fg);
  text-decoration: none;
  transition: background .15s, color .15s;
}
.cd-subcat-card-item a:hover {
  background: var(--bg-3);
  color: var(--blue);
}
.cd-subcat-card-pin {
  font-size: 10px;
  opacity: .65;
  flex-shrink: 0;
}
.cd-subcat-card-item-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Empty state inside card */
.cd-subcat-card-empty {
  font-family: var(--font);
  font-size: 12px;
  color: var(--fg-dim);
  padding: .875rem 1.25rem;
  margin: 0;
}

/* View all footer */
.cd-subcat-card-footer {
  border-top: 1px solid var(--hairline);
  padding: .625rem 1.25rem;
}
.cd-subcat-card-viewall {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: .35rem;
  font-family: var(--font);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--blue);
  text-decoration: none;
}
.cd-subcat-card-viewall:hover { text-decoration: underline; }
.cd-subcat-card-viewall svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* ── EMPTY STATE ────────────────────────────────────────────── */
.cd-empty {
  font-family: var(--font);
  font-size: 14px;
  color: var(--fg-dim);
  padding: 2rem 0;
}
.cd-empty a { color: var(--blue); text-decoration: none; }
.cd-empty a:hover { text-decoration: underline; }

/* ── MOBILE SIDEBAR TOGGLE ──────────────────────────────────── */
.cd-sidebar-toggle {
  display: none;
  align-items: center;
  gap: .5rem;
  background: var(--bg-2);
  border: 1px solid var(--hairline);
  border-radius: 5px;
  padding: 8px 14px;
  font-family: var(--font);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--fg-muted);
  cursor: pointer;
  margin-bottom: 1rem;
  transition: border-color .2s, color .2s;
}
.cd-sidebar-toggle svg { width: 16px; height: 16px; }
.cd-sidebar-toggle:hover { border-color: var(--blue-active); color: var(--fg); }

/* ============================================================
   RESPONSIVE
   ============================================================ */

/* Tablet: drop right TOC sidebar */
@media (max-width: 1200px) {
  .cd-layout {
    grid-template-columns: 260px 1fr;
    grid-template-areas: "sidebar content";
  }
.cd-sidebar-right { display: none; }
}

/* Small tablet: narrower left sidebar */
@media (max-width: 900px) {
  .cd-layout {
    grid-template-columns: 220px 1fr;
  }
}

/* Mobile: single column, sidebar as drawer */
@media (max-width: 768px) {
  .cd-layout {
    grid-template-columns: 1fr;
    grid-template-areas: "content";
    padding-top: 1rem;
  }
  .cd-sidebar-left {
    display: none;
    position: fixed;
    top: 70px;
    left: 0;
    bottom: 0;
    width: 300px;
    max-height: none;
    border-radius: 0;
    border-top: none;
    border-left: none;
    border-bottom: none;
    z-index: 400;
    box-shadow: 4px 0 24px rgba(0,0,0,.5);
  }
  .cd-sidebar-left.is-open { display: block; }
  .cd-sidebar-toggle { display: flex; }
  .cd-content { padding: 1.5rem; }
  .cd-hub-grid { grid-template-columns: 1fr; }
  .cd-hub-hero { padding: 2rem 0 1.5rem; }
  .cd-doc-nav { flex-direction: column; }
  .cd-doc-nav-item { max-width: 100%; }
  .cd-doc-nav-next { text-align: left; margin-left: 0; }
  .cd-subcat-grid { grid-template-columns: 1fr; }
}

/* Mobile sidebar overlay */
.cd-sidebar-overlay {
  display: none;
  position: fixed;
  inset: 70px 0 0 0;
  background: rgba(0,0,0,.6);
  z-index: 399;
}
.cd-sidebar-overlay.is-active { display: block; }
