/* Documentation: sidebar + reading column, on top of the site's styles.css. */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip {
  position: absolute;
  left: 1rem;
  top: -3rem;
  z-index: 20;
  padding: 0.5rem 0.9rem;
  border-radius: 8px;
  background: var(--text);
  color: #0b0b0f;
  font-weight: 550;
  text-decoration: none;
}

.skip:focus {
  top: 0.6rem;
}

.nav-links a[aria-current='page'] {
  color: var(--text);
}

.docs {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 3.5rem;
  align-items: start;
  padding-block: 2.5rem 5rem;
}

/* Sidebar */

.side {
  position: sticky;
  top: 60px;
  max-height: calc(100vh - 60px);
  overflow-y: auto;
  padding: 1rem 0.5rem 2rem 0;
  scrollbar-width: thin;
}

.side-search input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--bg-raise);
  color: var(--text);
  font: inherit;
  font-size: 0.875rem;
}

.side-search input::placeholder {
  color: var(--text-3);
}

.side-group {
  margin: 1.6rem 0 0.4rem;
  color: var(--text-3);
  font-size: 0.8rem;
  font-weight: 550;
}

.side-group a {
  color: var(--text-2);
  text-decoration: none;
  font-size: 0.9rem;
}

.side-group a[aria-current='page'],
.side-group a:hover {
  color: var(--text);
}

.side-list,
.side-sub {
  list-style: none;
  margin: 0;
  padding: 0;
}

.side-list a {
  display: block;
  padding: 0.3rem 0.65rem;
  margin-left: -0.65rem;
  border-radius: 6px;
  color: var(--text-2);
  text-decoration: none;
  font-size: 0.9rem;
  line-height: 1.4;
}

.side-list a:hover {
  color: var(--text);
  background: rgb(255 255 255 / 0.04);
}

.side-list a[aria-current='page'] {
  color: var(--text);
  background: rgb(167 139 250 / 0.12);
}

.side-sub {
  margin: 0.2rem 0 0.5rem 0.2rem;
  border-left: 1px solid var(--line-strong);
}

.side-sub a {
  margin-left: 0;
  padding: 0.22rem 0.75rem;
  border-radius: 0;
  color: var(--text-3);
  font-size: 0.84rem;
}

.side-sub a:hover {
  background: none;
  color: var(--text);
}

.side-toggle {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--bg-raise);
  color: var(--text);
  font: inherit;
  font-weight: 550;
  font-size: 0.95rem;
  cursor: pointer;
}

.side-toggle::after {
  content: '+';
  color: var(--text-3);
  font-size: 1.2rem;
  line-height: 1;
}

.side-toggle[aria-expanded='true']::after {
  content: '\2212';
}

/* Reading column */

.doc {
  min-width: 0;
  max-width: 46rem;
  padding-top: 0.6rem;
}

.crumb {
  margin: 0 0 0.6rem;
  font-size: 0.875rem;
}

.crumb a {
  color: var(--violet);
  text-decoration: none;
}

.crumb a:hover {
  text-decoration: underline;
}

.doc h1 {
  font-size: clamp(2rem, 4vw, 2.75rem);
  letter-spacing: -0.035em;
  line-height: 1.1;
}

.doc h2 {
  position: relative;
  margin: 3.2rem 0 0.9rem;
  padding-top: 2.2rem;
  border-top: 1px solid var(--line);
  font-size: 1.55rem;
  letter-spacing: -0.025em;
  line-height: 1.2;
  scroll-margin-top: 76px;
}

.doc h3 {
  position: relative;
  margin: 2rem 0 0.5rem;
  font-size: 1.08rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  scroll-margin-top: 76px;
}

.anchor {
  margin-left: 0.5rem;
  color: var(--text-3);
  text-decoration: none;
  font-weight: 500;
  opacity: 0;
  transition: opacity 0.15s ease;
}

h2:hover .anchor,
h3:hover .anchor,
.anchor:focus-visible {
  opacity: 1;
}

.anchor:hover {
  color: var(--violet);
}

.doc p,
.doc li,
.doc dd {
  color: var(--text-2);
}

.doc p {
  margin: 0 0 1rem;
}

.doc strong,
.doc dt {
  color: var(--text);
  font-weight: 600;
}

.doc .lead {
  margin: 1.1rem 0 0;
  font-size: 1.15rem;
  line-height: 1.55;
  color: var(--text-2);
}

.doc a:not(.anchor):not(.pager-link):not(.btn):not(.plain) {
  color: var(--violet);
  text-decoration: underline;
  text-decoration-color: rgb(167 139 250 / 0.4);
  text-underline-offset: 3px;
}

.doc a:not(.anchor):not(.pager-link):not(.btn):not(.plain):hover {
  text-decoration-color: var(--violet);
}

.doc ul,
.doc ol {
  margin: 0 0 1.2rem;
  padding-left: 1.3rem;
}

.doc li {
  margin: 0.35rem 0;
}

.doc li::marker {
  color: var(--text-3);
}

/* Numbered procedures */

.doc ol.steps-list {
  list-style: none;
  counter-reset: s;
  padding-left: 0;
}

.doc ol.steps-list > li {
  counter-increment: s;
  position: relative;
  padding-left: 2.3rem;
  margin: 0.7rem 0;
}

.doc ol.steps-list > li::before {
  content: counter(s);
  position: absolute;
  left: 0;
  top: 0.05rem;
  width: 1.55rem;
  height: 1.55rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgb(167 139 250 / 0.14);
  color: var(--violet);
  font-size: 0.8rem;
  font-weight: 600;
}

/* Definition lists (pane header, statuses) */

.doc dl {
  margin: 0 0 1.4rem;
  border-top: 1px solid var(--line);
}

.doc dl > div {
  display: grid;
  grid-template-columns: minmax(9rem, 13rem) minmax(0, 1fr);
  gap: 0.3rem 1.4rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--line);
}

.doc dd {
  margin: 0;
}

kbd {
  display: inline-block;
  padding: 0.05rem 0.42rem;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: rgb(255 255 255 / 0.04);
  color: var(--text);
  font-family: inherit;
  font-size: 0.82em;
  font-weight: 550;
  line-height: 1.5;
  white-space: nowrap;
}

/* UI labels (button names) */

.ui {
  color: var(--text);
  font-weight: 550;
}

/* Callouts */

.note,
.warn {
  margin: 1.4rem 0;
  padding: 1rem 1.2rem;
  border-radius: 10px;
  border: 1px solid rgb(167 139 250 / 0.3);
  background: rgb(167 139 250 / 0.06);
}

.warn {
  border-color: rgb(251 191 36 / 0.35);
  background: rgb(251 191 36 / 0.05);
}

.note p:last-child,
.warn p:last-child,
.note ul:last-child,
.warn ul:last-child {
  margin-bottom: 0;
}

.callout-title {
  display: block;
  margin-bottom: 0.25rem;
  color: var(--text);
  font-weight: 600;
}

.soon {
  margin: 1.2rem 0 0;
  display: flex;
  gap: 0.8rem;
  align-items: flex-start;
}

/* Figures */

.doc figure {
  margin: 1.8rem 0 2rem;
}

.doc figure .frame {
  box-shadow: 0 0 0 1px rgb(0 0 0 / 0.6), 0 24px 60px -30px rgb(0 0 0 / 0.8);
}

.doc figcaption {
  margin-top: 0.7rem;
  color: var(--text-3);
  font-size: 0.875rem;
}

.doc .frame-narrow {
  max-width: 700px;
}

/* Tables */

.table-wrap {
  margin: 0 0 1.4rem;
  overflow-x: auto;
}

.doc table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.doc th,
.doc td {
  padding: 0.7rem 1rem 0.7rem 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.doc th {
  color: var(--text-3);
  font-size: 0.82rem;
  font-weight: 550;
  border-bottom-color: var(--line-strong);
}

.doc td {
  color: var(--text-2);
}

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

/* Pager */

.pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
}

.pager-link {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 1rem 1.2rem;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  color: var(--text);
  text-decoration: none;
  font-weight: 550;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.pager-link span {
  color: var(--text-3);
  font-size: 0.82rem;
  font-weight: 500;
}

.pager-link:hover {
  border-color: rgb(167 139 250 / 0.5);
  background: rgb(167 139 250 / 0.05);
}

.pager-next {
  text-align: right;
  align-items: flex-end;
}

/* Index: search and table of contents */

.search-box {
  margin: 2.4rem 0 0.5rem;
}

.search-box label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text);
  font-weight: 550;
}

.search-box input {
  width: 100%;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--bg-raise);
  color: var(--text);
  font: inherit;
  font-size: 1.05rem;
}

.search-box input::placeholder {
  color: var(--text-3);
}

.search-box input:focus-visible {
  outline: 2px solid var(--violet);
  outline-offset: 2px;
  border-radius: 10px;
}

.search-status {
  min-height: 1.4rem;
  margin: 0.6rem 0 0;
  color: var(--text-3);
  font-size: 0.875rem;
}

.doc-index h2.toc-group {
  margin-top: 2.4rem;
  padding-top: 1.8rem;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
}

.toc-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.toc-card {
  padding: 1.2rem 1.3rem 1rem;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--bg-raise);
}

.toc-card h3 {
  margin: 0;
  font-size: 1rem;
}

.toc-card h3 a {
  color: var(--text);
  text-decoration: none;
}

.toc-card h3 a:hover {
  color: var(--violet);
}

.doc .toc-desc {
  margin: 0.35rem 0 0.7rem;
  color: var(--text-3);
  font-size: 0.875rem;
  line-height: 1.5;
}

.doc .toc-sections {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.doc .toc-sections li {
  margin: 0;
  padding: 0.38rem 0;
  font-size: 0.9rem;
}

.doc .toc-sections li + li {
  border-top: 1px solid rgb(255 255 255 / 0.04);
}

.doc .toc-sections a {
  color: var(--text-2);
  text-decoration: none;
}

.doc .toc-sections a:hover {
  color: var(--text);
}

.doc .hit-snippet {
  margin: 0.2rem 0 0.15rem;
  color: var(--text-3);
  font-size: 0.84rem;
  line-height: 1.5;
}

.hit-snippet mark {
  background: rgb(167 139 250 / 0.22);
  color: var(--text);
  border-radius: 3px;
  padding: 0 0.1em;
}

.searching .toc-grid {
  grid-template-columns: 1fr;
}

.search-empty {
  margin-top: 1.5rem;
}

/* Smaller screens */

@media (max-width: 900px) {
  .docs {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding-top: 1.2rem;
  }

  .side {
    position: static;
    max-height: none;
    overflow: visible;
    padding: 0;
  }

  .js .side-toggle {
    display: flex;
  }

  .js .side-panel {
    display: none;
    margin-top: 0.6rem;
    padding: 0.4rem 1rem 1rem;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--bg-raise);
  }

  .js .side.open .side-panel {
    display: block;
  }

  .side-search {
    margin-top: 0.6rem;
  }

  .toc-grid {
    grid-template-columns: 1fr;
  }

  .doc dl > div {
    grid-template-columns: 1fr;
  }

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

  .pager-next {
    text-align: left;
    align-items: flex-start;
  }

  .doc td:first-child {
    white-space: normal;
  }
}

@media (min-width: 901px) {
  .side-toggle {
    display: none !important;
  }
}
