/* AI Wiki — reusable theme layer on top of Bootstrap 5.3 (dev-sky palette) */
:root {
  --wiki-navy: #26439c;
  --wiki-navy-dark: #1b2f73;
  --wiki-blue: #0089ed;
  --wiki-sky: #00bef7;
  --wiki-gold: #f8c912;
  --wiki-shadow: 0 0 30px rgba(1, 41, 112, 0.08);
  --bs-body-font-family: Roboto, "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --bs-body-color: #444;
  --bs-heading-color: var(--wiki-navy);
  --bs-link-color: var(--wiki-navy);
  --bs-link-color-rgb: 38, 67, 156;
  --bs-link-hover-color: #0071c5;
  --bs-link-hover-color-rgb: 0, 113, 197;
}

/* navigation */
#menu li.dropdown {
  padding-top: 8px !important;
}

#menu li.dropdown a {
  text-decoration: none;
  color: rgba(0,0,0,.55);
}


body.wiki > main {
  padding-top: 60px;
}

:focus-visible { outline: 3px solid var(--wiki-blue); outline-offset: 2px; }

.icon {
  width: 1em; height: 1em; flex-shrink: 0; vertical-align: -0.125em;
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}

/* Buttons */
.btn-brand {
  --bs-btn-color: #fff; --bs-btn-bg: var(--wiki-navy); --bs-btn-border-color: var(--wiki-navy);
  --bs-btn-hover-color: #fff; --bs-btn-hover-bg: var(--wiki-navy-dark); --bs-btn-hover-border-color: var(--wiki-navy-dark);
  --bs-btn-active-color: #fff; --bs-btn-active-bg: var(--wiki-navy-dark); --bs-btn-active-border-color: var(--wiki-navy-dark);
}
.btn-outline-brand {
  --bs-btn-color: var(--wiki-navy); --bs-btn-border-color: rgba(38, 67, 156, 0.35);
  --bs-btn-hover-color: #fff; --bs-btn-hover-bg: var(--wiki-navy); --bs-btn-hover-border-color: var(--wiki-navy);
  --bs-btn-active-color: #fff; --bs-btn-active-bg: var(--wiki-navy-dark); --bs-btn-active-border-color: var(--wiki-navy-dark);
}

/* Header */
.wiki-hero {
  background: linear-gradient(135deg, var(--wiki-navy-dark) 0%, var(--wiki-navy) 55%, #0071c5 100%);
  border-bottom: 4px solid var(--wiki-gold);
  color: #fff;
}
.wiki-hero :focus-visible { outline-color: var(--wiki-gold); }
.wiki-hero-meta { color: rgba(255, 255, 255, 0.88); }
.wiki-logo {
  display: inline-grid; place-items: center; width: 3rem; height: 3rem;
  border-radius: 0.875rem; background: var(--wiki-gold); color: var(--wiki-navy-dark);
  font-weight: 800; font-size: 1.125rem; letter-spacing: 0.02em;
}
.wiki-search { border-radius: 0.875rem; box-shadow: 0 12px 32px rgba(1, 20, 70, 0.28); overflow: hidden; }
.wiki-search .input-group-text, .wiki-search .form-control, .wiki-search .btn { background: #fff; border: 0; }
.wiki-search .input-group-text { color: var(--wiki-navy); }
.wiki-search .form-control:focus { box-shadow: none; }
.wiki-search:focus-within { box-shadow: 0 0 0 0.25rem rgba(248, 201, 18, 0.75), 0 12px 32px rgba(1, 20, 70, 0.28); }
.wiki-search .btn { color: #555; }
.wiki-search .btn:hover { color: var(--wiki-navy); }
.wiki-scope { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; }

/* Surfaces */
.wiki-surface { background: #fff; border-radius: 15px; box-shadow: var(--wiki-shadow); }
@media (min-width: 992px) {
  .wiki-sticky { position: sticky; top: 1rem; max-height: calc(100vh - 2rem); overflow-y: auto; }
}
.detail-heading {
  display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.625rem;
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--wiki-navy);
}
.detail-heading::before { content: ""; width: 1.25rem; height: 3px; border-radius: 2px; background: var(--wiki-gold); }

/* Topic navigation */
.wiki-nav { display: grid; gap: 0.125rem; }
.nav-item-btn {
  display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; width: 100%;
  padding: 0.4375rem 0.625rem; border: 0; border-radius: 0.5rem; background: transparent;
  color: var(--bs-body-color); text-align: start; font-size: 0.9375rem; line-height: 1.3;
  transition: background-color 0.2s ease-out, color 0.2s ease-out;
}
.nav-item-btn:hover { background: rgba(0, 190, 247, 0.1); color: var(--wiki-navy); }
.nav-item-btn.is-active { background: rgba(38, 67, 156, 0.08); color: var(--wiki-navy); font-weight: 600; box-shadow: inset 3px 0 0 var(--wiki-gold); }
.nav-item-btn.is-domain { font-weight: 600; }
.nav-count {
  flex-shrink: 0; min-width: 2rem; padding: 0.0625rem 0.4375rem; border-radius: 999px;
  background: var(--bs-secondary-bg); color: #555; font-size: 0.75rem; font-weight: 500; text-align: center;
}
.nav-item-btn.is-active .nav-count { background: var(--wiki-navy); color: #fff; }
.nav-toggle {
  display: inline-grid; place-items: center; flex-shrink: 0; width: 2rem; padding: 0;
  border: 0; border-radius: 0.5rem; background: transparent; color: var(--wiki-navy);
}
.nav-toggle:hover { background: rgba(0, 190, 247, 0.1); }
.nav-toggle .icon { transition: transform 0.2s ease-out; }
.nav-toggle[aria-expanded="true"] .icon { transform: rotate(90deg); }
.nav-cats { margin: 0.125rem 0 0.375rem 2.125rem; padding-left: 0.5rem; border-left: 2px solid rgba(0, 190, 247, 0.35); display: grid; gap: 0.125rem; }
.nav-cats .nav-item-btn { font-size: 0.875rem; }

.topic-drawer {
  margin: 0; padding: 0; width: min(22rem, 90vw); height: 100%; max-height: 100%;
  border: 0; border-radius: 0 15px 15px 0; box-shadow: var(--wiki-shadow);
}
.topic-drawer::backdrop { background: rgba(0, 0, 0, 0.55); }

/* Result cards */
.entry-card {
  display: block; width: 100%; padding: 0.875rem 1rem; text-align: start;
  background: #fff; border: 1px solid rgba(38, 67, 156, 0.1); border-radius: 0.75rem;
  color: var(--bs-body-color); box-shadow: 0 1px 2px rgba(1, 41, 112, 0.04);
  transition: border-color 0.2s ease-out, box-shadow 0.2s ease-out, transform 0.2s ease-out;
}
.entry-card:hover { border-color: rgba(0, 190, 247, 0.6); box-shadow: 0 8px 24px rgba(1, 41, 112, 0.1); transform: translateY(-1px); }
.entry-card.is-active { border-color: var(--wiki-navy); background: #f5f8ff; box-shadow: inset 4px 0 0 var(--wiki-gold), 0 8px 24px rgba(1, 41, 112, 0.1); }
.entry-card-title { color: var(--wiki-navy); font-weight: 600; }
.entry-abbr { background: rgba(0, 190, 247, 0.14); color: var(--wiki-navy); font-weight: 600; }
.line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.wiki-mark { padding: 0 0.1em; border-radius: 0.2em; background: rgba(248, 201, 18, 0.5); color: inherit; }

/* Detail */
.detail-title { color: var(--wiki-navy); font-weight: 700; }
.detail-definition { font-size: 1.125rem; line-height: 1.75; color: #333; }
.detail-section { padding-top: 1.25rem; margin-top: 1.25rem; border-top: 1px solid var(--bs-border-color-translucent); }
.wiki-chip { background: var(--bs-secondary-bg); color: #333; border: 1px solid var(--bs-border-color-translucent); font-weight: 500; white-space: normal; text-align: start; }
.wiki-placeholder { color: #555; text-align: center; padding: 3rem 1rem; }
.wiki-placeholder .icon { font-size: 2.5rem; color: var(--wiki-sky); margin-bottom: 1rem; }
.wiki-detail-bar { position: sticky; top: 0; z-index: 1; padding: 0.75rem 1rem; background: #fff; border-bottom: 1px solid var(--bs-border-color-translucent); }
@media (max-width: 991.98px) {
  .wiki-detail { display: none; }
  .wiki-detail.is-open { display: block; position: fixed; inset: 0; z-index: 1055; overflow-y: auto; border-radius: 0; }
}

/* Footer */
.wiki-footer { background: #333; color: rgba(255, 255, 255, 0.85); }
.wiki-footer a { color: #fff; }
.wiki-footer a:hover { color: var(--wiki-gold); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
  .entry-card:hover { transform: none; }
}

/* dev-sky content layout — reusable article/documentation layer. Load after Bootstrap 5.3 and common.css. */

/* Page header (compact hero variant): <header class="ds-hero ds-page-header"> */
.ds-page-header { padding-block: 3rem 3.5rem; }
.ds-page-header .ds-hero-lead { max-width: 46rem; }
.ds-crumbs { --bs-breadcrumb-divider-color: rgba(255, 255, 255, 0.6); --bs-breadcrumb-item-active-color: rgba(255, 255, 255, 0.85); font-size: 0.875rem; }
.ds-crumbs a { color: #fff; text-decoration: none; }
.ds-crumbs a:hover { color: var(--ds-gold); }
.ds-meta { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; font-size: 0.875rem; color: rgba(255, 255, 255, 0.85); }

/* Two-column layout: TOC + article */
.ds-layout { padding-block: 3rem 4.5rem; }
@media (min-width: 992px) {
  .ds-sticky { position: sticky; top: 5.5rem; max-height: calc(100vh - 7rem); overflow-y: auto; }
}

/* Table of contents: <nav class="ds-toc"><ol><li><a href="#id"> */
.ds-toc { padding: 1.25rem; }
.ds-toc-title { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ds-navy); margin-bottom: 0.75rem; }
.ds-toc ol { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.125rem; }
.ds-toc a {
  display: block; padding: 0.375rem 0.75rem; border-radius: 0.5rem; color: var(--ds-text);
  text-decoration: none; font-size: 0.9375rem; line-height: 1.35; transition: background-color 0.3s ease-out, color 0.3s ease-out;
}
.ds-toc a:hover { background: rgba(0, 190, 247, 0.1); color: var(--ds-navy); }
.ds-toc a.is-active { background: rgba(38, 67, 156, 0.08); color: var(--ds-navy); font-weight: 600; box-shadow: inset 3px 0 0 var(--ds-gold); }
.ds-toc .ds-toc-sub a { padding-left: 1.5rem; font-size: 0.875rem; }

/* Article typography */
.ds-prose { font-size: 1.0625rem; line-height: 1.75; }
.ds-prose > section { scroll-margin-top: 5.5rem; }
.ds-prose > section + section { margin-top: 4rem; }
.ds-prose h3 { font-size: 1.1875rem; font-weight: 600; color: var(--ds-navy); margin-top: 2rem; margin-bottom: 0.75rem; scroll-margin-top: 5.5rem; }
.ds-prose p, .ds-prose li { text-wrap: pretty; }
.ds-prose ul:not([class]), .ds-prose ol:not([class]) { padding-left: 1.25rem; }
.ds-prose li + li { margin-top: 0.375rem; }
.ds-prose code:not(pre code) { padding: 0.1em 0.35em; border-radius: 0.25rem; background: rgba(38, 67, 156, 0.07); color: var(--ds-navy-dark); font-size: 0.875em; }
.ds-lead { font-size: 1.1875rem; line-height: 1.7; color: #444; }

/* Method / topic header: tile + heading */
.ds-topic-head { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.25rem; }
.ds-topic-head .ds-section-title { margin-bottom: 0; }
.ds-acronym {
  display: inline-grid; place-items: center; flex-shrink: 0; min-width: 4rem; height: 4rem; padding-inline: 0.75rem;
  border-radius: 15px; font-weight: 800; font-size: 1.25rem; letter-spacing: 0.04em;
}
.ds-acronym-sm { min-width: 2.75rem; height: 2rem; border-radius: 0.5rem; font-size: 0.8125rem; }

/* Tones — combine with .ds-acronym, .ds-tone-bar, table headers */
.ds-tone-sky { background: rgba(0, 190, 247, 0.16); color: var(--ds-navy-dark); }
.ds-tone-gold { background: rgba(248, 201, 18, 0.32); color: var(--ds-navy-dark); }
.ds-tone-navy { background: var(--ds-navy); color: #fff; }

/* Key facts grid: <dl class="ds-facts"><div><dt><dd> */
.ds-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 1rem; margin: 1.5rem 0; }
.ds-facts > div { padding: 1.125rem 1.25rem; background: #fff; border-radius: 15px; box-shadow: var(--ds-shadow); border-top: 3px solid var(--ds-sky); }
.ds-facts dt { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ds-navy); margin-bottom: 0.375rem; }
.ds-facts dd { margin: 0; font-size: 0.9875rem; line-height: 1.55; }

/* Callouts */
.ds-callout { display: flex; gap: 0.875rem; padding: 1rem 1.25rem; margin: 1.5rem 0; border-radius: 15px; background: #f5f8ff; border: 1px solid rgba(38, 67, 156, 0.12); }
.ds-callout > .icon { margin-top: 0.3rem; font-size: 1.25rem; color: var(--ds-blue); }
.ds-callout p:last-child { margin-bottom: 0; }
.ds-callout-tip { background: #fffbea; border-color: rgba(248, 201, 18, 0.55); }
.ds-callout-tip > .icon { color: #b58e00; }

/* Example block: scenario + code */
.ds-example { margin: 1.75rem 0; background: #fff; border-radius: 15px; box-shadow: var(--ds-shadow); overflow: hidden; }
.ds-example-body { padding: 1.25rem 1.5rem; }
.ds-example-label { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ds-navy); margin-bottom: 0.5rem; }

/* Code block: <figure class="ds-code"><figcaption class="ds-code-head">…<button data-copy>…</figcaption><pre><code> */
.ds-code { margin: 0; background: #14204a; color: #e6ecff; }
.ds-code + .ds-code { border-top: 1px solid rgba(255, 255, 255, 0.1); }
.ds-code-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.5rem 0.75rem 0.5rem 1.25rem; background: #1b2a5e; font-size: 0.8125rem; color: rgba(255, 255, 255, 0.85); }
.ds-code pre { margin: 0; padding: 1rem 1.25rem; overflow-x: auto; font-size: 0.8125rem; line-height: 1.6; }
.ds-code code { color: inherit; white-space: pre; }
.btn-code { --bs-btn-color: rgba(255, 255, 255, 0.9); --bs-btn-border-color: rgba(255, 255, 255, 0.25); --bs-btn-hover-color: var(--ds-navy-dark); --bs-btn-hover-bg: var(--ds-gold); --bs-btn-hover-border-color: var(--ds-gold); --bs-btn-padding-y: 0.125rem; --bs-btn-padding-x: 0.625rem; --bs-btn-font-size: 0.8125rem; }

/* Numbered steps */
.ds-steps { list-style: none; padding: 0; margin: 1.5rem 0; display: grid; gap: 1rem; counter-reset: ds-step; }
.ds-steps > li { position: relative; padding-left: 3rem; counter-increment: ds-step; }
.ds-steps > li::before {
  content: counter(ds-step); position: absolute; left: 0; top: 0; display: grid; place-items: center;
  width: 2rem; height: 2rem; border-radius: 50%; background: var(--ds-navy); color: #fff; font-weight: 700; font-size: 0.875rem;
}
.ds-steps strong { color: var(--ds-navy); }

/* Comparison table */
.ds-table-wrap { background: #fff; border-radius: 15px; box-shadow: var(--ds-shadow); overflow-x: auto; margin: 1.5rem 0; }
.ds-table { --bs-table-bg: transparent; margin: 0; min-width: 46rem; font-size: 0.9375rem; line-height: 1.55; }
.ds-table th, .ds-table td { padding: 0.875rem 1rem; vertical-align: top; }
.ds-table thead th { border-bottom: 2px solid var(--ds-sky); color: var(--ds-navy); font-weight: 700; }
.ds-table tbody th { width: 18%; color: var(--ds-navy); font-weight: 600; background: #f8faff; }
.ds-table-head { display: flex; align-items: center; gap: 0.5rem; }

/* Decision cards */
.ds-choice { height: 100%; padding: 1.25rem 1.5rem; background: #fff; border-radius: 15px; box-shadow: var(--ds-shadow); }
.ds-choice-q { font-weight: 600; color: var(--ds-navy); margin-bottom: 0.75rem; }

/* Sources */
.ds-sources { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.75rem; font-size: 0.9375rem; }
.ds-sources a { display: inline-flex; align-items: flex-start; gap: 0.375rem; }
.ds-sources .icon { margin-top: 0.3rem; }

