/* Docs: a sidebar of sections on the left, one page of reading on the right, like most product docs sites.
   Below 960px the sidebar sits above the page as a wrapped list. */
.docs {
  display: grid;
  gap: clamp(28px, 4vw, 64px);
  padding-block: clamp(104px, 12vw, 150px) clamp(56px, 8vw, 110px);
}

@media (min-width: 960px) {
  .docs {
    grid-template-columns: 240px minmax(0, 1fr);
    align-items: start;
  }
  .docs-side {
    position: sticky;
    top: 96px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
  }
}

.docs-side {
  font-size: 15px;
}

.docs-side h2 {
  font: 500 12px/1 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--wm-1);
  margin: 0 0 10px;
}

.docs-side ul {
  list-style: none;
  margin: 0 0 26px;
  padding: 0;
  display: grid;
  gap: 2px;
}

.docs-side a {
  display: block;
  padding: 6px 10px;
  border-radius: 8px;
  color: var(--ink-2);
}

.docs-side a:hover {
  color: var(--ink);
  background: var(--panel);
}

.docs-side a[aria-current="page"] {
  color: var(--ink);
  background: var(--panel);
  box-shadow: inset 2px 0 0 var(--atlo);
}

@media (max-width: 959px) {
  .docs-side ul {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }
  .docs-side a {
    border: 1px solid var(--hairline);
  }
}

.docs-main {
  min-width: 0;
  max-width: 78ch;
}

.docs-head {
  margin-bottom: clamp(28px, 4vw, 48px);
  padding-bottom: clamp(24px, 3vw, 36px);
  border-bottom: 1px solid var(--hairline);
}

.docs-head h1 {
  font-size: clamp(34px, 5vw, 64px);
  margin-bottom: 18px;
}

.docs-main h2 {
  font-size: clamp(24px, 2.6vw, 34px);
  line-height: 1.1;
  margin: 2.2em 0 0.7em;
  scroll-margin-top: 96px;
}

.docs-main section:first-of-type h2 {
  margin-top: 0;
}

.docs-main h3 {
  margin-top: 1.6em;
  scroll-margin-top: 96px;
}

.docs-main li {
  margin-bottom: 0.4em;
}

.docs-main code {
  font: 500 0.86em/1.5 var(--mono);
  color: var(--ink);
  overflow-wrap: anywhere;
}

.docs-main .install-command,
.docs-main .install-picker {
  margin: 0 0 1.4em;
}

.docs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  margin: 0 0 1.6em;
}

.docs-table th,
.docs-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--hairline);
  text-align: left;
  vertical-align: top;
}

.docs-table thead th {
  color: var(--ink);
  font-weight: 600;
}

/* Long commands wrap at their spaces, so the "What it does" column keeps its room instead of being pushed out of view. */
.docs-table td:first-child {
  width: 46%;
}

.docs-table td:first-child code {
  overflow-wrap: normal;
}

@media (max-width: 640px) {
  .docs-table td:first-child code {
    overflow-wrap: anywhere;
  }
}

.docs-note {
  margin: 0 0 1.4em;
  padding: 16px 20px;
  border: 1px solid var(--hairline);
  border-left: 3px solid var(--atlo);
  border-radius: 10px;
  background: var(--panel);
}

.docs-note p:last-child {
  margin-bottom: 0;
}

.docs-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin: 0 0 1.4em;
  padding: 0;
  list-style: none;
}

.docs-cards li {
  margin: 0;
}

/* The whole card is one link: picture on top, then the title and its line of text. */
.docs-cards a {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--ink-2);
  text-decoration: none;
}

.docs-cards a:hover {
  border-color: var(--wm-3);
}

.docs-cards img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 11;
  object-fit: cover;
  object-position: left top;
  border-bottom: 1px solid var(--hairline);
  background: #0b1120;
}

.docs-card-body {
  display: block;
  padding: 16px 18px 18px;
  font-size: 15px;
  line-height: 1.5;
}

.docs-card-body span {
  display: block;
}

.docs-cards strong {
  display: block;
  color: var(--ink);
  margin-bottom: 6px;
}

/* A screenshot in the reading column, with a short caption under it. */
.docs-shot {
  margin: 0 0 1.6em;
}

.docs-shot img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--hairline);
  border-radius: 12px;
  background: #0b1120;
}

.docs-shot figcaption {
  margin-top: 10px;
  font-size: 14px;
  color: var(--ink-2);
}

.docs-pager {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: clamp(40px, 6vw, 72px);
  padding-top: 24px;
  border-top: 1px solid var(--hairline);
}

.docs-pager a {
  display: grid;
  gap: 4px;
  color: var(--ink);
}

.docs-pager span {
  font: 500 12px/1 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--wm-1);
}

.docs-pager .next {
  margin-left: auto;
  text-align: right;
}

.footer-docs {
  margin-top: 16px;
  font-size: 14px;
}
