/* ── Vike docs styling — 1rem = 16px ── */

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

html {
  font-size: 100% !important;
}

/* ── Colors ── */

:root {
  --md-accent-fg-color: #6366f1;
  --md-accent-fg-color--transparent: rgba(99, 102, 241, 0.12);
  --md-typeset-a-color: #6366f1;
}

/* ── Header — 64px ── */

.md-header {
  height: 4rem !important;           /* 64px */
  min-height: 4rem !important;
  background: var(--md-default-bg-color) !important; /* same as body */
  box-shadow: none !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important; /* subtle line */
}

[data-md-color-scheme="default"] .md-header {
  border-bottom: 1px solid #e2e8f0 !important;
}

.md-header__inner {
  position: relative !important;
  height: 4rem !important;
  display: flex !important;
  align-items: center !important;
  max-width: 100% !important;        /* override Material 61rem cap */
  padding: 0 10vw !important;        /* match main layout edges */
  margin: 0 !important;              /* override auto centering */
}

.md-header__button.md-logo {
  padding: 0 !important;
  margin-right: 0.75rem !important;
}

.md-header__button.md-logo img {
  height: 1.5rem !important;         /* 24px */
  width: auto !important;
}

.md-header__title,
.md-header__topic,
.md-header__topic .md-ellipsis {
  font-size: 1.125rem !important;    /* 18px */
  font-weight: 300 !important;
}

/* ── Search — centered, wide, pill ── */

.md-header .md-search {
  position: absolute !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  width: 22rem !important;           /* 352px — calmer, doesn't dominate header */
}

.md-search__form {
  border-radius: 1.25rem !important; /* 20px pill */
  background: rgba(255, 255, 255, 0.04) !important;
  border: 0.0625rem solid rgba(255, 255, 255, 0.1) !important;
  height: 2.25rem !important;        /* 36px — fits nicely in 64px header */
  width: 100% !important;
}

[data-md-color-scheme="default"] .md-search__form {
  background: #f1f5f9 !important;
  border: 0.0625rem solid #e2e8f0 !important;
}

.md-search__form:hover {
  background: rgba(255, 255, 255, 0.12) !important;
}

[data-md-color-scheme="default"] .md-search__form:hover {
  background: #e8ecf1 !important;
}

.md-search__inner {
  width: 100% !important;            /* expand to fill search container */
}

.md-search__input {
  font-size: 0.875rem !important;    /* 14px */
  height: 2.25rem !important;
  padding-left: 2.5rem !important;   /* leave room for icon */
}

.md-search__icon[for="__search"] {
  top: 50% !important;
  transform: translateY(-50%) !important;
  left: 0.875rem !important;
  height: 1rem !important;
  width: 1rem !important;
}

.md-search__input::placeholder {
  opacity: 0.5;
}

/* ── Layout — centered 3-panel ── */
/* 10vw edge | 13vw left-nav | 2vw gap | 50vw content | 1vw gap | 14vw right-toc | 10vw edge */

.md-main {
  margin-top: 0 !important;          /* reduce header-to-content gap */
}

.md-main__inner {
  max-width: 100% !important;
  padding: 0 10vw !important;        /* 10% edge padding each side */
  padding-top: 0 !important;         /* minimize header-to-content gap */
  margin-top: 0 !important;          /* override Material default 1.5rem */
  display: flex !important;
}

.md-sidebar--primary {
  width: 13vw !important;            /* 13% of viewport */
  flex-shrink: 0 !important;
}

.md-sidebar--secondary {
  width: 14vw !important;            /* 14% of viewport */
  flex-shrink: 0 !important;
}

/* Force TOC visible in RIGHT sidebar only (not the copy nested in left nav) */
.md-sidebar--secondary .md-nav--secondary .md-nav__link,
.md-sidebar--secondary .md-nav--secondary .md-nav__item {
  visibility: visible !important;
}

.md-sidebar--secondary .md-nav--secondary .md-nav__list {
  display: block !important;
}

.md-sidebar--secondary .md-nav--secondary {
  display: block !important;
  visibility: visible !important;
}

.md-content {
  flex: 1 1 auto !important;
  min-width: 0 !important;
  max-width: none !important;
  margin-left: 2vw !important;        /* 2vw gap to left sidebar */
  margin-right: 1vw !important;      /* 1vw gap to right TOC */
}

.md-content__inner {
  padding-top: 1.4rem !important;    /* header → h1 gap */
  margin-top: 0 !important;
}

.md-content__inner::before {
  display: none !important;          /* removes empty spacer Material adds */
}

.md-sidebar--primary .md-sidebar__inner {
  padding-top: 0 !important;
}

.md-sidebar--secondary .md-sidebar__inner {
  padding-top: 0.6rem !important;    /* align TOC title with left nav + h1 */
}

.md-content__inner {
  max-width: 100%;
}

/* ── Typography ── */

.md-typeset {
  font-size: 1rem !important;        /* 16px — paragraph / body text */
  line-height: 1.6 !important;
}

.md-typeset h1 {
  font-size: 1.5rem !important;      /* 24px */
  font-weight: 400 !important;       /* regular — outranks H2 weight 300 */
  line-height: 1.3 !important;       /* ~31px box */
  letter-spacing: -0.015em !important;
  margin: 0 0 0.5rem !important;     /* small gap before first H2 */
  max-width: 72ch;
}

.md-typeset h2 {
  font-size: 1.2rem !important;      /* 19.2px */
  font-weight: 300 !important;       /* light */
  line-height: 1.4 !important;       /* ~27px box */
  letter-spacing: -0.01em !important;
  margin: 1.25rem 0 0.6rem !important; /* 20px above, 9.6px below */
  max-width: 72ch;
}

.md-typeset h3 {
  max-width: 72ch;
}

.md-typeset ul,
.md-typeset ol {
  margin: 0 !important;              /* H2 bottom margin controls the gap */
}

.md-typeset h3 {
  font-size: 1.375rem !important;    /* 22px — Material default */
  font-weight: 400 !important;
  line-height: 1.5 !important;       /* 33px */
  margin: 1rem 0 0.35rem !important;
}

.md-typeset h4 {
  font-weight: 400 !important;
}

.md-typeset p {
  margin: 0.75rem 0 !important;
  line-height: 1.75rem !important;   /* 28px box */
  max-width: 72ch;                   /* readable measure — tables/pre unaffected */
}

.md-typeset ul,
.md-typeset ol {
  max-width: 72ch;
}

/* Drop HR separators — H2 top margin carries the visual break */
.md-typeset hr {
  display: none !important;
}

/* Blockquote — muted sample/hint style, not a callout */
.md-typeset blockquote {
  font-size: 0.9rem !important;
  color: rgba(255, 255, 255, 0.6) !important;
  border-left: 0.15rem solid rgba(99, 102, 241, 0.4) !important;
  padding-left: 0.85rem !important;
  margin: 0.75rem 0 !important;
}

[data-md-color-scheme="default"] .md-typeset blockquote {
  color: rgba(0, 0, 0, 0.6) !important;
}

/* Section anchor — replace Material's ¶ with # and reveal on heading hover */
.md-typeset .headerlink {
  font-size: 0 !important;            /* hide the ¶ glyph */
  opacity: 0;
  transition: opacity 0.15s ease;
}

.md-typeset .headerlink::before {
  content: "#";
  font-size: 0.9rem;
  font-weight: 400;
  margin-left: 0.4rem;
  color: var(--md-accent-fg-color);
}

.md-typeset h1:hover .headerlink,
.md-typeset h2:hover .headerlink,
.md-typeset h3:hover .headerlink,
.md-typeset h4:hover .headerlink,
.md-typeset h5:hover .headerlink,
.md-typeset h6:hover .headerlink {
  opacity: 0.65;
}

/* Credits metadata pill — the <p> immediately preceding each <table> */
.md-typeset p:has(+ table) {
  display: inline-block;
  font-size: 0.78rem !important;
  font-weight: 500 !important;
  line-height: 1 !important;
  padding: 0.3rem 0.6rem !important;
  margin: 0.25rem 0 0.75rem !important;
  background: rgba(99, 102, 241, 0.18);
  color: #818cf8;
  border-radius: 0.25rem;
  letter-spacing: 0.02em;
}

[data-md-color-scheme="default"] .md-typeset p:has(+ table) {
  background: rgba(99, 102, 241, 0.12);
  color: #4f46e5;
}

.md-typeset p:has(+ table) strong {
  font-weight: 500 !important;
}

.md-typeset li {
  line-height: 1.75rem !important;   /* 28px box */
  margin: 0.2rem 0 !important;       /* tight vertical spacing between items */
}

.md-typeset li > p {
  margin: 0 !important;              /* no extra air inside list items */
}

.md-typeset pre,
.md-typeset pre > code {
  line-height: 1.55 !important;      /* ~22px per line — tighter code blocks */
}

.md-typeset code:not(pre code) {
  line-height: 1.5 !important;       /* sits flush with surrounding prose */
  padding: 0.1rem 0.35rem !important;
}

/* Inside table cells: shrink code line-height so rows stay compact */
.md-typeset table td code:not(pre code),
.md-typeset table th code:not(pre code) {
  line-height: 1.4 !important;
}

.md-typeset .tabbed-labels > label {
  height: auto !important;
  font-size: 0.82rem !important;     /* 13.12px */
  font-weight: 400 !important;       /* defeat the strong override */
  line-height: 1.4 !important;
  letter-spacing: 0.01em;
  opacity: 0.65;
  padding: 0.35rem 0.9rem 0.4rem !important; /* tighter header, still gap before underline */
}

.md-typeset .tabbed-labels > label:hover {
  opacity: 0.85;
}

.md-typeset .tabbed-set > input:checked + label {
  opacity: 1;
  font-weight: 500 !important;
}

/* Thin accent underline under active tab — override Material's thicker default */
.md-typeset .tabbed-set {
  --md-accent-fg-color: #6366f1;
}

.md-typeset .tabbed-labels {
  box-shadow: 0 -0.05rem 0 rgba(255, 255, 255, 0.08) inset !important;
}

.md-typeset .tabbed-labels > label::after {
  height: 0.1rem !important;
}

/* Bold text (strong, button) — medium weight, not full bold */
.md-typeset strong,
.md-typeset b,
.md-typeset .md-button {
  font-weight: 500 !important;
}

/* Content links — smaller than surrounding text, thinner underline */
.md-typeset a:not(.md-button):not(.md-nav__link):not(.headerlink) {
  font-size: 0.82rem !important;     /* 13.12px */
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

/* Ordered-list markers — quieter so step text is the focal point */
.md-typeset ol li::marker {
  font-size: 0.85rem;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.45);
}

[data-md-color-scheme="default"] .md-typeset ol li::marker {
  color: rgba(0, 0, 0, 0.45);
}

/* ── Navigation — Material default sizes ── */

.md-nav__link {
  font-size: 0.9625rem !important;   /* 15.4px */
  font-weight: 300 !important;
}

.md-nav__title {
  font-size: 0.9625rem !important;
  font-weight: 500 !important;
}

/* TOC link — fixed geometry across all states (no reflow from scroll-spy
   class flips). Active entry gets an indigo color highlight (you-are-here). */
.md-sidebar--secondary .md-nav__link,
.md-sidebar--secondary .md-nav__link:hover,
.md-sidebar--secondary .md-nav__link:focus,
.md-sidebar--secondary .md-nav__link--active,
.md-sidebar--secondary .md-nav__link--in-viewport,
.md-sidebar--secondary .md-nav__link--passed,
.md-sidebar--secondary .md-nav__link--blurred,
.md-sidebar--secondary .md-nav__item--active > .md-nav__link {
  font-size: 0.9625rem !important;
  font-weight: 300 !important;
  line-height: 1.5rem !important;
  padding: 0 !important;
  margin: 0 !important;
  border: none !important;
  box-shadow: none !important;
  text-decoration: none !important;
  letter-spacing: 0 !important;
  transform: none !important;
  transition: none !important;
  opacity: 1 !important;
  color: rgba(255, 255, 255, 0.6) !important;
  -webkit-font-smoothing: antialiased;
}

[data-md-color-scheme="default"] .md-sidebar--secondary .md-nav__link {
  color: rgba(0, 0, 0, 0.6) !important;
}

/* Active (you-are-here) — indigo accent, color only, no layout effect */
.md-sidebar--secondary .md-nav__link--active,
.md-sidebar--secondary .md-nav__item--active > .md-nav__link {
  color: var(--md-accent-fg-color) !important;
}

.md-sidebar--secondary .md-nav__link:hover {
  color: var(--md-accent-fg-color) !important;
}

/* TOC item = outer gap between entries (link itself has zero padding/margin) */
.md-sidebar--secondary .md-nav--secondary .md-nav__item {
  padding: 0.2rem 0 !important;
  margin: 0 !important;
}

.md-sidebar--secondary .md-nav__title {
  font-weight: 500 !important;
}

/* ── Tables — Material default ── */

.md-typeset table:not([class]) th,
.md-typeset table:not([class]) td,
.md-typeset th,
.md-typeset td {
  font-size: 0.88rem !important;     /* 14.08px — Material default */
  padding: 0.55rem 1rem !important;  /* 8.8px / 16px */
  line-height: 1 !important;
  vertical-align: middle !important; /* center content across the row */
}

.md-typeset th {
  font-weight: 700 !important;
}

/* Nav item spacing a bit looser */
.md-nav__item {
  padding: 0.125rem 0 !important;
}

.md-nav--secondary .md-nav__item {
  padding: 0.125rem 0 !important;
}

/* Section labels in left nav (e.g. "MCP") — category, not a link */
.md-nav__item--section > .md-nav__link,
.md-nav__item--nested > .md-nav__link {
  font-size: 0.72rem !important;
  font-weight: 600 !important;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.55;
  margin-top: 0.9rem !important;
  pointer-events: none;              /* labels, not navigation */
}

.md-nav__item--section > .md-nav__link:first-child,
.md-nav__item--nested > .md-nav__link:first-child {
  margin-top: 0 !important;
}

/* ── Code ── */

.md-typeset code {
  font-size: 0.935rem !important;    /* 14.96px — Material default */
}

/* Code block container — subtle bordered widget */
.md-typeset .highlight {
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 0.35rem;
  overflow: hidden;
}

[data-md-color-scheme="default"] .md-typeset .highlight {
  border-color: rgba(0, 0, 0, 0.08);
}

.md-typeset .highlight pre {
  padding: 0.8rem 1rem !important;
  margin: 0 !important;
}

/* Tabbed code widget — whole tab-set (labels + code) is one grey box */
.md-typeset .tabbed-set {
  background: var(--md-code-bg-color) !important;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 0.35rem;
  overflow: hidden;
  margin: 1rem 0;
}

[data-md-color-scheme="default"] .md-typeset .tabbed-set {
  border-color: rgba(0, 0, 0, 0.08);
}

/* All children transparent so the outer grey shows through uniformly */
.md-typeset .tabbed-set .tabbed-labels,
.md-typeset .tabbed-set .tabbed-content,
.md-typeset .tabbed-set .tabbed-block,
.md-typeset .tabbed-set .highlight,
.md-typeset .tabbed-set .highlight pre,
.md-typeset .tabbed-set .highlight > pre > code {
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
}

/* Tab-label row — subtle divider below */
.md-typeset .tabbed-set .tabbed-labels {
  padding: 0 0.5rem !important;
  margin: 0 !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
}

[data-md-color-scheme="default"] .md-typeset .tabbed-set .tabbed-labels {
  border-bottom-color: rgba(0, 0, 0, 0.08) !important;
}

/* Active left-nav item — thin accent bar, no layout shift */
.md-sidebar--primary .md-nav__link--active {
  position: relative;
}

.md-sidebar--primary .md-nav__link--active::before {
  content: "";
  position: absolute;
  left: -0.55rem;
  top: 0.2rem;
  bottom: 0.2rem;
  width: 2px;
  background: var(--md-accent-fg-color);
  border-radius: 1px;
}

/* ── Hide nav title from sidebar ── */

.md-nav--primary > .md-nav__title {
  display: none !important;
}

/* ── Social links ── */

.md-social__link svg {
  max-height: 1rem;
}
