/* docs.blpworkbench.com: the look of blpworkbench.com (site/src/styles/site.css). */
@font-face {
  font-family: 'Inter';
  src: url('/fonts/Inter-latin.woff2') format('woff2');
  font-weight: 400 800;
  font-display: swap;
}

:root {
  --ink: #0f172a;
  --body: #334155;
  --muted: #64748b;
  --line: #e2e8f0;
  --wash: #f1f5f9;
  --brand: #1d4ed8;
  --brand-soft: #dbeafe;
  --amber-soft: #fef3c7;
  --amber: #92400e;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  background: #fff;
  color: var(--body);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.65;
}

/* The header and footer stay put; only the area between them scrolls (.scroll). */
body {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

.scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

a {
  color: var(--brand);
}

.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 16px;
}

/* Header: the brand, and the version picker on the right. */
header.top {
  flex-shrink: 0;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

header.top .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 64px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
}

.brand img {
  width: 28px;
  height: 28px;
}

.brand span {
  color: var(--muted);
  font-weight: 500;
}

.picker {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

.picker label {
  color: var(--muted);
}

.picker select,
.picker button {
  font: inherit;
  padding: 5px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
}

.picker button {
  cursor: pointer;
}

/* With the script, choosing a version goes there at once. */
.picker.js button {
  display: none;
}

/* The pages on the left, the page on the right. */
.main {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 48px;
  padding-top: 32px;
  padding-bottom: 48px;
}

.main.single {
  grid-template-columns: minmax(0, 1fr);
}

/* Stays in view while the page scrolls (within the scrolling area, under the header). */
.sidebar {
  position: sticky;
  top: 32px;
  align-self: start;
  max-height: calc(100dvh - 210px);
  overflow-y: auto;
  font-size: 15px;
}

.sidebar h2 {
  margin: 18px 0 6px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.sidebar h2:first-child {
  margin-top: 0;
}

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

.sidebar a {
  display: block;
  padding: 4px 10px;
  border-radius: 6px;
  color: var(--body);
  text-decoration: none;
}

.sidebar a:hover {
  background: var(--wash);
}

.sidebar a[aria-current='page'] {
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 600;
}

main {
  min-width: 0;
  max-width: 780px;
}

.older {
  margin: 0 0 24px;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--amber-soft);
  color: var(--amber);
  font-size: 15px;
}

.older a {
  color: inherit;
  font-weight: 600;
}

h1,
h2,
h3,
h4 {
  color: var(--ink);
  line-height: 1.25;
  letter-spacing: -0.01em;
}

h1 {
  font-size: clamp(1.8rem, 4vw, 2.3rem);
  margin: 0 0 16px;
}

h1 small {
  color: var(--muted);
  font-size: 0.55em;
  font-weight: 500;
}

.lead {
  font-size: 1.1rem;
}

.toc h2 {
  font-size: 1.15rem;
  margin: 28px 0 8px;
}

.toc ul {
  margin: 0;
  padding-left: 20px;
}

/* Help text. */
.md h2 {
  font-size: 1.45rem;
  margin: 40px 0 12px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.md h3 {
  font-size: 1.15rem;
  margin: 28px 0 8px;
}

.md h4 {
  font-size: 1rem;
  margin: 22px 0 6px;
}

.md :is(h2, h3, h4) {
  scroll-margin-top: 20px;
}

.md .anchor {
  color: inherit;
  text-decoration: none;
}

.md .anchor:hover::after {
  content: ' #';
  color: var(--muted);
}

.md ul,
.md ol {
  padding-left: 24px;
}

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

.md code {
  font-size: 0.88em;
  background: var(--wash);
  padding: 1px 5px;
  border-radius: 4px;
}

.md pre {
  background: var(--wash);
  padding: 12px 14px;
  border-radius: 8px;
  overflow-x: auto;
}

.md pre code {
  background: none;
  padding: 0;
}

.md table {
  border-collapse: collapse;
  width: 100%;
  font-size: 15px;
  display: block;
  overflow-x: auto;
}

.md th,
.md td {
  border: 1px solid var(--line);
  padding: 6px 10px;
  text-align: left;
  vertical-align: top;
}

.md th {
  background: var(--wash);
}

.md blockquote {
  margin: 16px 0;
  padding: 4px 16px;
  border-left: 3px solid var(--brand);
  background: var(--wash);
  border-radius: 0 8px 8px 0;
}

.md img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 12px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.md .shot {
  display: inline-block;
  max-width: 100%;
}

.md .placeholder {
  display: block;
  margin: 12px 0;
  padding: 18px;
  border: 2px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 15px;
}

.md .ext {
  width: 0.75em;
  height: 0.75em;
  margin-left: 2px;
  vertical-align: baseline;
}

.md .video a {
  font-weight: 600;
}

.entry + .entry {
  margin-top: 8px;
}

.entry h2 small {
  color: var(--muted);
  font-size: 0.65em;
  font-weight: 500;
}

/* Previous / next page. */
.pager {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 48px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.pager a {
  display: flex;
  flex-direction: column;
  max-width: 48%;
  text-decoration: none;
  font-weight: 600;
}

.pager a[rel='next'] {
  text-align: right;
  margin-left: auto;
}

.pager small {
  color: var(--muted);
  font-weight: 500;
}

.button {
  display: inline-block;
  background: var(--brand);
  color: #fff;
  border-radius: 8px;
  padding: 10px 18px;
  font-weight: 600;
  text-decoration: none;
}

footer {
  flex-shrink: 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
  padding: 18px 0;
}

/* Phones and small tablets: the page first, the list of pages under it. */
@media (max-width: 860px) {
  .main {
    grid-template-columns: minmax(0, 1fr);
    gap: 32px;
    padding-top: 20px;
  }

  .sidebar {
    position: static;
    max-height: none;
    order: 2;
    border-top: 1px solid var(--line);
    padding-top: 20px;
  }

  header.top .wrap {
    padding-top: 10px;
    padding-bottom: 10px;
  }
}
