/* BitWeaver / DeepGate brand overrides for MkDocs Material */

:root {
  /* Primary: white header with dark text */
  --md-primary-fg-color: #ffffff;
  --md-primary-fg-color--light: #f8f8f8;
  --md-primary-fg-color--dark: #e5e7eb;
  --md-primary-bg-color: #111827;
  --md-primary-bg-color--light: #374151;

  /* Accent: DeepGate blue */
  --md-accent-fg-color: #2563eb;
  --md-accent-fg-color--transparent: rgba(37, 99, 235, 0.1);
  --md-accent-bg-color: #2563eb;
  --md-accent-bg-color--light: rgba(37, 99, 235, 0.1);

  /* Links */
  --md-typeset-a-color: #2563eb;
}

/* Body font — match the platform */
body {
  font-family: 'Inter', sans-serif;
}

/* ── Header ──────────────────────────────────────────── */
/* Match BitWeaver SharedHeader exactly: white bg, 64px height, Inter font */

.md-header {
  background-color: #ffffff;
  border-bottom: 1px solid #e5e7eb;
  box-shadow: none;
  color: #111827;
  height: 64px;
}

.md-header__inner {
  height: 64px;
}

/* Logo — always visible, match SharedHeader 28px logo with 12px gap to title */
.md-header__button.md-logo {
  display: inline-block !important;
  color: #111827;
  margin-right: 0;
  padding-right: 0;
}

.md-header__button.md-logo img,
.md-header__button.md-logo svg {
  height: 28px;
  width: auto;
  filter: none;
}

/* Site title — sit tight against the logo */
/* Higher specificity to beat Material's [dir=ltr] .md-header__title rule */
.md-header .md-header__title,
[dir=ltr] .md-header__title {
  color: #111827;
  font-family: 'Inter', sans-serif;
  margin-left: 0;
  padding-left: 6px;
}

.md-header__title > .md-header__ellipsis {
  padding-left: 0;
}

.md-header__topic,
.md-header__topic:first-child {
  color: #111827;
  font-size: 18px;
  font-weight: 500;
}

/* Site-name anchor in the header — inherit color, no underline, show pointer. */
.md-header__link {
  color: inherit;
  text-decoration: none;
}
.md-header__link:hover,
.md-header__link:focus {
  color: inherit;
  text-decoration: none;
  opacity: 0.7;
}

/* Page subtitle — match SharedHeader nav link style: 14px, weight 500 */
.md-header__topic + .md-header__topic {
  color: #374151;
  font-size: 14px;
  font-weight: 500;
}

/* Header buttons (search, repo, etc) — match nav link color */
.md-header .md-header__button {
  color: #374151;
}

.md-header .md-header__button:hover {
  color: #2563eb;
}

/* ── Version badge ──────────────────────────────────── */

.md-version {
  display: flex;
  align-items: center;
  margin-left: 12px;
  flex-shrink: 0;
}

.md-version__current {
  font-size: 0.75rem;
  font-weight: 500;
  color: #374151;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
  padding: 4px 10px;
  white-space: nowrap;
}

/* Dropdown list (opens when clicking the version badge) */
.md-version__list {
  font-size: 0.85rem;
  color: #374151;
}

.md-version__link {
  color: #374151;
  font-weight: 500;
}

.md-version__link:hover {
  color: #2563eb;
}

/* ── Search ──────────────────────────────────────────── */

.md-search__input {
  background-color: #f3f4f6;
  color: #111827;
}

.md-search__input::placeholder {
  color: #6b7280;
}

.md-search__icon {
  color: #6b7280;
}

/* ── Tabs (navigation.tabs) ──────────────────────────── */

.md-tabs {
  background-color: #ffffff;
  border-bottom: 1px solid #e5e7eb;
}

/* Center the tab list vertically in the tabs bar so the tab link's
   top/bottom spacing is symmetric. Material's default adds a top margin
   only, which makes "SDK" look pushed-up against the bottom divider. */
.md-tabs__list {
  align-items: center;
}

.md-tabs__item {
  height: auto;
  padding-top: 0;
}

.md-tabs__link {
  color: #374151;
  opacity: 1;
  padding: 8px 12px;
  margin: 0;           /* kill Material's default margin-top: .8rem */
  border-radius: 6px;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.md-tabs__link:hover {
  color: #2563eb;
  background-color: rgba(37, 99, 235, 0.06);
  opacity: 1;
}

.md-tabs__link--active,
.md-tabs__link--active:hover {
  color: #2563eb;
  background-color: rgba(37, 99, 235, 0.12);
  font-weight: 600;
  opacity: 1;
}

/* ── Sidebar ─────────────────────────────────────────── */

.md-nav__link--active {
  color: #2563eb;
}

/* Don't auto-scroll the sidebar to center the active link on navigation. */
.md-sidebar__scrollwrap {
  scroll-behavior: auto;
  overflow-anchor: none;
}

/* ── Content ─────────────────────────────────────────── */

.md-content {
  max-width: 900px;
}

/* Extra breathing room between the sticky tabs bar and the page H1 */
.md-content__inner {
  padding-top: 2rem;
}

/* Headings — grey, medium weight. `!important` because Material's theme
   stylesheet asserts its own h1-h6 rules with equal or higher specificity;
   this is a deliberate brand override. */
.md-typeset h1,
.md-typeset h2,
.md-typeset h3,
.md-typeset h4 {
  color: #374151 !important;
  font-weight: 500 !important;
}

.md-typeset h1 {
  font-size: 2em;
  margin-top: 0.5rem;
}

.md-typeset h2 {
  font-size: 1.5em;
  margin-top: 1.6em;
}

/* mkdocstrings-generated headings (class / method / attribute names) */
.md-typeset .doc-heading {
  color: #374151 !important;
  font-weight: 500 !important;
}

/* Fix link visibility — Material inherits primary-bg-color for links in some contexts */
.md-typeset a {
  color: #2563eb;
}

.md-typeset a:hover {
  color: #1d4ed8;
}

/* Code spans inside links — inherit the link color so `[`Linear`](...)` reads
   as a link. Without this, Material's default `code` color wins and the link
   renders as dark grey. */
.md-typeset a code {
  color: inherit;
}

.md-typeset a:hover code {
  color: inherit;
}

/* Fix header home/back link — consistent with SharedHeader nav */
.md-header__button,
.md-header .md-icon {
  color: #374151;
}

/* Sidebar navigation */
.md-nav__link {
  color: #374151;
}

.md-nav__link:hover {
  color: #2563eb;
}

.md-nav__item--active > .md-nav__link {
  color: #2563eb;
  font-weight: 500;
}

/* Sidebar section headings (SDK, API Reference, etc.) and collapsible
   section labels (Models, Layers, Training, ...) — match the brand's
   grey/medium content headings instead of the default black/bold. */
.md-nav--primary .md-nav__title,
.md-nav__item--section > .md-nav__link,
label.md-nav__link {
  color: #374151 !important;
  font-weight: 500 !important;
}

/* Give the top-level sidebar section title ("SDK", "Bitweaver", "Tutorials")
   more breathing room below the horizontal tabs divider line. Material's
   default packs it too tight against the border. */
.md-sidebar--primary .md-nav--primary > .md-nav__title {
  padding-top: 1.5rem;
}

/* ── Sidebar dividers ────────────────────────────────── */

/* Left sidebar — right border, full height */
.md-sidebar--primary {
  border-right: 1px solid #e5e7eb;
}

.md-sidebar--primary .md-sidebar__inner {
  min-height: 100vh;
}

/* Right sidebar (table of contents) — left border, full height */
.md-sidebar--secondary {
  border-left: 1px solid #e5e7eb;
}

.md-sidebar--secondary .md-sidebar__inner {
  min-height: 100vh;
}

/* ── Home page link tables ───────────────────────────── */

.md-typeset table:not([class]) {
  border: none;
  box-shadow: none;
}

.md-typeset table:not([class]) thead {
  display: none;
}

.md-typeset table:not([class]) tr {
  border-bottom: 1px solid #e5e7eb;
}

.md-typeset table:not([class]) tr:hover {
  background-color: rgba(37, 99, 235, 0.03);
}

.md-typeset table:not([class]) td {
  padding: 12px 16px;
  border: none;
  vertical-align: top;
}

.md-typeset table:not([class]) td:first-child {
  width: 200px;
  white-space: nowrap;
}

/* ── Vendor grid (Supported Hardware) ────────────────── */

.vendor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin: 20px 0 8px;
}

.vendor-card {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 16px;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  height: 280px;
}

.vendor-card__logo {
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin-bottom: 12px;
}

.vendor-card__logo img {
  max-height: 40px;
  max-width: 140px;
  width: auto;
  height: auto;
}

.vendor-card__name {
  font-weight: 600;
  color: #0a0a0a;
  margin-bottom: 8px;
}

.md-typeset .vendor-card ul {
  list-style: none;
  margin: 0;
  padding: 0 4px 0 0;
  flex: 1;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #d1d5db transparent;
}

.md-typeset .vendor-card li {
  margin: 0;
  padding: 6px 0;
  border-top: 1px solid #f3f4f6;
  font-size: 0.9em;
}

.md-typeset .vendor-card li:first-child {
  border-top: none;
}

.vendor-card ul::-webkit-scrollbar {
  width: 6px;
}

.vendor-card ul::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 3px;
}

.vendor-card ul::-webkit-scrollbar-track {
  background: transparent;
}

.vendor-card li .core {
  display: block;
  color: #6b7280;
  font-size: 0.85em;
  margin-top: 2px;
}

.vendor-card li .accel {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  font-size: 0.7em;
  font-weight: 600;
  color: #2563eb;
  background: rgba(37, 99, 235, 0.1);
  border-radius: 4px;
  vertical-align: middle;
}

.vendor-card li .family {
  display: inline-block;
  padding: 1px 6px;
  font-size: 0.7em;
  font-weight: 600;
  color: #6b7280;
  background: #f3f4f6;
  border-radius: 4px;
  vertical-align: middle;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
