/* Blueprint CMS docs: header, menu (left), content, "On this page" (right) */

:root {
  --color-bg: #fff;
  --scroll-shadow: rgba(0, 0, 0, 0.22);
  --color-bg-dimmed: #f5f5f4;
  --color-text: #1c1c1e;
  --color-text-dimmed: #6b6b70;
  --color-border: #e6e6e3;
  --color-accent: #068ef5;
  --color-code-bg: #f3f3f1;
  /* code blocks are dark in both color schemes (speed-highlight's atom-dark theme) */
  --color-pre-bg: #161b22;
  --color-pre-text: #abb2bf;
  --color-pre-border: #2c2c30;
  --color-mark: #fff3c4;
  /* Inter (https://rsms.me/inter/), the variable version where it's supported */
  --font-sans: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  /* Fira Code (https://github.com/tonsky/FiraCode) from jsDelivr, without its ligatures (see code, pre, kbd) */
  --font-mono: "Fira Code", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --header-height: 56px;
  --menu-width: 270px;
  --toc-width: 220px;
  --layout-max-width: 1440px;
}

@supports (font-variation-settings: normal) {
  :root {
    --font-sans: InterVariable, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: #161618;
    --scroll-shadow: rgba(0, 0, 0, 0.6);
    --color-bg-dimmed: #1e1e21;
    --color-text: #ececee;
    --color-text-dimmed: #9b9ba2;
    --color-border: #2c2c30;
    --color-accent: #068ef5;
    --color-code-bg: #212125;
    --color-mark: #4a3f12;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-padding-top: calc(var(--header-height) + 16px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  /* Inter's contextual alternates and ligatures, off by default in Chrome */
  font-feature-settings: "liga" 1, "calt" 1;
  background: var(--color-bg);
  color: var(--color-text);
  font: 17px/1.65 var(--font-sans);
}

a {
  color: var(--color-accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Header */

/* the bar spans the window, its content is as wide as the layout */
.docs-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg);
}

.docs-header-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: var(--layout-max-width);
  height: var(--header-height);
  margin: 0 auto;
  padding: 0 24px;
}

.docs-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--color-text);
  font-weight: 700;
  white-space: nowrap;
  padding-left: 6px;
}

.docs-logo:hover {
  text-decoration: none;
}

.docs-version {
  margin-left: -8px;
  color: var(--color-text-dimmed);
  font-size: 0.6rem;
  white-space: nowrap;
  height: 0.6rem;
}

.docs-header-links {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-left: auto;
}

.docs-header-link {
  color: var(--color-text-dimmed);
  font-size: 0.9rem;
  white-space: nowrap;
}

.docs-github {
  display: flex;
  color: var(--color-text-dimmed);
}

.docs-github:hover {
  color: var(--color-text);
}

.docs-menu-toggle {
  display: none;
  padding: 6px 12px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: var(--color-bg);
  color: var(--color-text);
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
}

/* Search */

.docs-search {
  position: relative;
  flex: 0 1 280px;
  min-width: 0;
  margin-left: 24px;
}

.docs-search-input {
  width: 100%;
  height: 34px;
  padding: 0 32px 0 12px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: var(--color-bg-dimmed);
  color: var(--color-text);
  font: inherit;
  font-size: 0.9rem;
}

.docs-search-input:focus {
  border-color: var(--color-accent);
  outline: none;
  background: var(--color-bg);
}

.docs-search-key {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  padding: 0 6px;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  color: var(--color-text-dimmed);
  font: 12px/17px var(--font-mono);
  pointer-events: none;
}

.docs-search-input:focus + .docs-search-key,
.docs-search-input:not(:placeholder-shown) + .docs-search-key {
  display: none;
}

.docs-search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: max(100%, 340px);
  max-height: min(420px, 70vh);
  margin: 0;
  padding: 6px;
  overflow-y: auto;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-bg);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  list-style: none;
}

.docs-search-results a {
  display: block;
  padding: 8px 10px;
  border-radius: 6px;
  color: var(--color-text);
  font-size: 0.9rem;
}

.docs-search-results a:hover {
  text-decoration: none;
}

.docs-search-results a.is-active {
  background: var(--color-bg-dimmed);
}

.docs-search-results small {
  display: block;
  margin-top: 2px;
  color: var(--color-text-dimmed);
  font-size: 0.8rem;
}

.docs-search-empty {
  padding: 8px 10px;
  color: var(--color-text-dimmed);
  font-size: 0.8rem;
}

/* Layout */

.docs-layout {
  display: grid;
  grid-template-columns: var(--menu-width) minmax(0, 1fr) var(--toc-width);
  max-width: var(--layout-max-width);
  margin: 0 auto;
}

/* Menu */

.docs-menu {
  position: sticky;
  top: var(--header-height);
  height: calc(100vh - var(--header-height));
  overflow-y: auto;
  padding: 28px 16px 48px 24px;
  border-right: 1px solid var(--color-border);
  font-size: 0.95rem;
}

.docs-menu ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.docs-menu ul ul {
  margin: 2px 0 6px 10px;
  padding-left: 10px;
  border-left: 1px solid var(--color-border);
}

.docs-menu a {
  display: block;
  padding: 3px 8px;
  border-radius: 6px;
  color: var(--color-text-dimmed);
}

.docs-menu a:hover {
  background: var(--color-bg-dimmed);
  color: var(--color-text);
  text-decoration: none;
}

.docs-menu a[aria-current="page"] {
  background: var(--color-bg-dimmed);
  color: var(--color-text);
  font-weight: 600;
}

.docs-menu summary {
  display: flex;
  align-items: center;
  list-style: none;
  cursor: pointer;
}

.docs-menu summary::-webkit-details-marker {
  display: none;
}

/* the arrow toggles, the link navigates */
.docs-menu summary::before {
  content: "";
  flex-shrink: 0;
  width: 6px;
  height: 6px;
  margin: 0 2px 0 -12px;
  border-right: 1.5px solid var(--color-text-dimmed);
  border-bottom: 1.5px solid var(--color-text-dimmed);
  transform: rotate(-45deg);
  transition: transform 0.15s;
}

.docs-menu details[open] > summary::before {
  transform: rotate(45deg);
}

.docs-menu summary a {
  flex: 1;
}

/* sections (guides, reference, examples) */
.docs-menu > ul > li {
  margin-bottom: 18px;
}

.docs-menu > ul > li > details > summary a {
  color: var(--color-text);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.docs-menu > ul > li > details > summary::before {
  display: none;
}

.docs-menu > ul > li > details > ul {
  margin-left: 0;
  padding-left: 0;
  border-left: 0;
}

/* Content */

.docs-main {
  min-width: 0;
  max-width: 820px;
  padding: 32px 56px 80px;
}

.docs-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 4px;
  font-size: 0.9rem;
}

.docs-breadcrumb a {
  color: var(--color-text-dimmed);
}

.docs-breadcrumb a:not(:last-child)::after {
  content: "/";
  margin-left: 6px;
  color: var(--color-border);
}

.docs-main h1 {
  margin: 0 0 24px;
  font-size: 2.5rem;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.docs-text h2 {
  margin: 48px 0 12px;
  padding-top: 24px;
  border-top: 1px solid var(--color-border);
  font-size: 1.5rem;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.docs-text h3 {
  margin: 32px 0 8px;
  font-size: 1.25rem;
}

.docs-text h2 a.anchor,
.docs-text h3 a.anchor {
  margin-left: 8px;
  color: var(--color-border);
  font-weight: 400;
  opacity: 0;
}

.docs-text h2:hover a.anchor,
.docs-text h3:hover a.anchor {
  opacity: 1;
}

.docs-text p,
.docs-text ul,
.docs-text ol {
  margin: 0 0 16px;
}

.docs-text li + li {
  margin-top: 4px;
}

code,
pre,
kbd,
[class*="shj-lang-"] {
  font-family: var(--font-mono);
  font-variant-ligatures: none;
  font-feature-settings: "liga" 0, "calt" 0;
}

.docs-text code {
  padding: 2px 5px;
  border-radius: 4px;
  background: var(--color-code-bg);
  font: 0.86em/1.5 var(--font-mono);
}

.docs-text pre {
  position: relative;
  margin: 0 0 20px;
  padding: 16px 20px;
  overflow-x: auto;
  border: 1px solid var(--color-pre-border);
  border-radius: 8px;
  background: var(--color-pre-bg);
  color: var(--color-pre-text);
}

.docs-text pre code {
  padding: 0;
  background: none;
  color: inherit;
  font-size: 0.95rem;
  line-height: 1.5;
}

/* highlighted code (speed-highlight): only the token colors of the theme, the box is ours */
.docs-text pre [class*="shj-lang-"] {
  display: block;
  max-width: none;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  font: 0.95rem/1.5 var(--font-mono);
  white-space: pre;
}

.docs-copy {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 2px 8px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  background: var(--color-pre-bg);
  color: #a9a9b0;
  font: 12px var(--font-sans);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s;
}

.docs-text pre:hover .docs-copy,
.docs-copy:focus {
  opacity: 1;
}

/* wide tables scroll; a subtle shadow at the left/right edge shows that there is more. The covers (page background,
   `local`) scroll with the content and hide the shadows (`scroll`, fixed to the edges) at the end they've reached */
.docs-text table {
  display: block;
  width: 100%;
  margin: 0 0 24px;
  overflow-x: auto;
  border-collapse: collapse;
  font-size: 0.95rem;
  background:
    linear-gradient(to right, var(--color-bg) 30%, transparent) left / 40px 100% no-repeat local,
    linear-gradient(to left, var(--color-bg) 30%, transparent) right / 40px 100% no-repeat local,
    radial-gradient(farthest-side at 0 50%, var(--scroll-shadow), transparent) left / 16px 100% no-repeat scroll,
    radial-gradient(farthest-side at 100% 50%, var(--scroll-shadow), transparent) right / 16px 100% no-repeat scroll;
}

.docs-text th,
.docs-text td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--color-border);
  text-align: left;
  vertical-align: top;
}

.docs-text th {
  font-weight: 600;
  white-space: nowrap;
}

.docs-text td:first-child {
  white-space: nowrap;
}

.docs-text blockquote {
  margin: 0 0 20px;
  padding: 12px 16px;
  border-left: 3px solid var(--color-accent);
  border-radius: 0 6px 6px 0;
  background: var(--color-bg-dimmed);
}

.docs-text blockquote p:last-child {
  margin-bottom: 0;
}

.docs-text img {
  max-width: 100%;
}

/* Previous / next */

.docs-rating {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 48px;
  color: var(--color-text-dimmed);
}

.docs-rating[hidden] {
  display: none;
}

.docs-rating button {
  display: inline-flex;
  padding: 6px 10px;
  color: inherit;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: none;
  font: inherit;
  cursor: pointer;
}

.docs-rating button:hover:not(:disabled) {
  color: var(--color-text);
  border-color: var(--color-text-dimmed);
}

.docs-icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.docs-rating button:disabled {
  opacity: 0.5;
  cursor: default;
}

.docs-pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 64px;
}

.docs-pager a {
  display: flex;
  flex-direction: column;
  padding: 14px 18px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  color: var(--color-text);
  font-weight: 600;
}

.docs-pager a:hover {
  border-color: var(--color-accent);
  text-decoration: none;
}

.docs-pager small {
  color: var(--color-text-dimmed);
  font-weight: 400;
  font-size: 0.8rem;
}

.docs-pager-next {
  grid-column: 2;
  text-align: right;
}

/* On this page */

.docs-toc {
  position: sticky;
  top: var(--header-height);
  align-self: start;
  max-height: calc(100vh - var(--header-height));
  overflow-y: auto;
  padding: 36px 24px 24px 8px;
  font-size: 0.8rem;
}

.docs-toc h2 {
  margin: 0 0 8px;
  color: var(--color-text-dimmed);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.docs-toc ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.docs-toc a {
  display: block;
  padding: 3px 0 3px 10px;
  border-left: 2px solid transparent;
  color: var(--color-text-dimmed);
}

.docs-toc a:hover {
  color: var(--color-text);
  text-decoration: none;
}

.docs-toc a.is-active {
  border-left-color: var(--color-accent);
  color: var(--color-text);
}

.docs-toc .toc-h3 a {
  padding-left: 22px;
}

/* Smaller screens: no "On this page", then the menu becomes a drawer */

@media (max-width: 1180px) {
  .docs-layout {
    grid-template-columns: var(--menu-width) minmax(0, 1fr);
  }

  .docs-toc {
    display: none;
  }
}

@media (max-width: 800px) {
  .docs-header-inner {
    gap: 12px;
    padding: 0 16px;
  }

  /* only the logo, so the search has room */
  .docs-logo-name {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .docs-search {
    position: static;
    flex: 1 1 auto;
    margin-left: 0;
  }

  .docs-version {
    display: none;
  }

  .docs-search-key {
    display: none;
  }

  /* below the header, as wide as the window */
  .docs-search-results {
    position: fixed;
    top: calc(var(--header-height) + 6px);
    left: 16px;
    right: 16px;
    width: auto;
  }

  .docs-menu-toggle {
    display: block;
  }

  .docs-layout {
    display: block;
  }

  .docs-menu {
    position: fixed;
    inset: var(--header-height) 0 0 0;
    z-index: 9;
    width: 100%;
    height: auto;
    border-right: 0;
    background: var(--color-bg);
    transform: translateX(-100%);
    transition: transform 0.2s;
  }

  .menu-open .docs-menu {
    transform: none;
  }

  .menu-open {
    overflow: hidden;
  }

  .docs-main {
    padding: 24px 16px 64px;
  }

  .docs-main h1 {
    font-size: 2rem;
  }

  .docs-pager {
    grid-template-columns: 1fr;
  }

  .docs-pager-next {
    grid-column: 1;
  }
}

/* Panel icons (docs/reference/panel-icons) */

.docs-text .icon-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 8px;
  margin: 24px 0;
  padding: 0;
  list-style: none;
}

.docs-text .icon-list li {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 16px 8px 12px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
}

.icon-list svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-list .icon-fill {
  fill: currentColor;
  fill-rule: evenodd;
  stroke: none;
}

.docs-text .icon-list code {
  padding: 0;
  background: none;
  font-size: 0.75rem;
  overflow-wrap: anywhere;
  text-align: center;
}
