/* Base styles: elements and the search box, all drawn from tokens.css. Page
   layout, the header and footer, and code highlighting with the code-block
   toolbar are built on top of these elsewhere. */

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body-font);
  font-size: var(--body-size);
  line-height: 1.55;
}

h1, h2, h3 {
  font-family: var(--title-font);
  font-weight: 600;
  line-height: 1.12;
  text-wrap: balance;
  margin: 0;
}
h1 {
  font-size: calc(clamp(2rem, 5vw, 3rem) * 1.2);
  letter-spacing: -.01em;
}
h2 {
  font-size: calc(1.7rem * 1.2);
  margin-top: 2.4rem;
}
h3 {
  font-size: calc(1.2rem * 1.2);
  margin-top: 1.8rem;
}
h2, h3 {
  color: var(--heading);
}

p {
  margin: .9em 0;
}
ul {
  padding-left: 1.2em;
}
li {
  margin: .3em 0;
}
li::marker {
  color: var(--accent);
}

a {
  color: var(--link);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

code {
  font-family: var(--mono-font);
  font-size: .9em;
  background: var(--code-inline);
  padding: .1em .35em;
  border-radius: 4px;
}
pre {
  font-family: var(--mono-font);
  font-size: .93rem;
  line-height: 1.5;
  background: var(--code-bg);
  color: var(--code-ink);
  border: 1px solid var(--code-line);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin: 1.2em 0;
  overflow-x: auto;
}
/* code inside a block must not take the inline-code chip */
pre code {
  background: none;
  padding: 0;
  border-radius: 0;
  font-size: inherit;
  color: inherit;
}

table {
  border-collapse: collapse;
  width: 100%;
  font-size: .95em;
  margin: 1.2em 0;
}
th, td {
  text-align: left;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
th {
  background: var(--th-bg);
  color: var(--th-ink);
  font-weight: 500;
}
tr:nth-child(even) td {
  background: var(--surface);
}
td:first-child {
  font-weight: 500;
  white-space: nowrap;
}

/* hidden until focused: the skip link, and text for screen readers only */
.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus {
  left: 16px;
  top: 10px;
  z-index: 10;
  background: var(--bg);
  color: var(--link);
  padding: 6px 12px;
  border: 2px solid var(--accent);
  border-radius: 6px;
}
/* the skip link's target takes focus so the next Tab starts inside it, lands
   below the sticky header, and needs no ring of its own: it is not a control */
#content {
  scroll-margin-top: 96px;
}
#content:focus {
  outline: none;
}
.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* The search box and its results, which replace the sidebar while a query is
   typed. */
.search {
  position: relative;
}
.search input {
  width: 100%;
  font: inherit;
  font-size: 1.044rem;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 34px 8px 10px;
}
.search input::placeholder {
  color: var(--ink-3);
}
.search input::-webkit-search-cancel-button {
  display: none;
}
/* the "/" hint, hidden once the box has focus or text */
.search kbd {
  position: absolute;
  right: 8px;
  top: 50%;
  translate: 0 -50%;
  font-family: var(--mono-font);
  font-size: .75rem;
  line-height: 1;
  color: var(--ink-3);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 3px 6px;
  pointer-events: none;
}
.search input:focus + kbd, .search input:not(:placeholder-shown) + kbd {
  display: none;
}
@media (max-width: 760px) {
  .search kbd {
    display: none;
  }
}
/* the clear button sits where the hint does, shown while the box has text */
.search-clear {
  position: absolute;
  right: 5px;
  top: 50%;
  translate: 0 -50%;
  width: 28px;
  height: 28px;
  padding: 5px;
  border: 0;
  border-radius: 5px;
  background: none;
  color: var(--ink-3);
  cursor: pointer;
}
.search-clear:hover {
  color: var(--ink);
  background: var(--line);
}
.search-clear svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}
.search-clear[hidden] {
  display: none;
}

.search-status {
  margin: 14px 0 8px;
  font-size: .8rem;
  color: var(--ink-3);
}
.search-results ol {
  list-style: none;
  padding: 0;
  margin: 0;
}
.search-results > ol > li {
  margin: 0 0 6px;
}
.search-results li li {
  margin: 0;
}
.search-results li ol {
  margin: 0 0 0 2px;
  padding-left: 10px;
  border-left: 1px solid var(--line);
}
.hit {
  display: block;
  padding: 6px 8px;
  margin-inline: -8px;
  border-radius: 6px;
  color: var(--ink-2);
  text-decoration: none;
}
.search-results li ol .hit {
  margin-left: 0;
}
.hit:hover, .hit:focus-visible {
  background: var(--surface);
}
.hit-title {
  display: block;
  font-weight: 500;
  color: var(--heading);
}
.hit-sub {
  display: block;
  color: var(--ink);
}
.hit-text {
  display: block;
  font-size: .85em;
  line-height: 1.45;
  color: var(--ink-3);
  margin-top: 2px;
}
.hit mark {
  background: none;
  color: var(--ink);
  font-weight: 700;
}
.hit-src {
  font-family: var(--mono-font);
  font-size: .68rem;
  font-weight: 500;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--label);
  margin-right: .6em;
  vertical-align: .1em;
}
