/*
 * Documentation layout, on top of the marketing site's styles.css.
 *
 * Only what a documentation site needs and a marketing site does not: a
 * persistent sidebar, a reading column narrower than a landing page's, and
 * code blocks that scroll. Everything else -- colour, type, the zero radius,
 * the absence of shadows -- comes from the shared stylesheet, because docs that
 * look like a different company undo the credibility they exist to build.
 */

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

@media (max-width: 60rem) {
  .docs-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.5rem;
  }
}

/* Sticky on desktop so the shape of the documentation stays visible while
   reading; static on mobile, where a sticky sidebar eats the screen. */
.docs-nav {
  position: sticky;
  top: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
  font-size: 0.875rem;
}

@media (max-width: 60rem) {
  .docs-nav {
    position: static;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--line);
  }
}

.docs-nav-group {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.docs-nav-group > p {
  margin: 0;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gray-mid);
}

.docs-nav a {
  color: var(--gray-dark);
  text-decoration: none;
  line-height: 1.45;
}

.docs-nav a:hover {
  color: var(--black);
  text-decoration: underline;
}

.docs-nav a[aria-current="page"] {
  color: var(--hotrod);
  font-weight: 500;
}

/* External destinations are a large part of this site's job -- the reference,
   the console, the registry. Marking them keeps "leaving the docs" honest. */
.docs-nav a[data-external]::after {
  content: " ↗";
  color: var(--gray-mid);
}

.docs-main {
  min-width: 0;
  max-width: 44rem;
  display: flex;
  flex-direction: column;
  gap: 2.25rem;
}

.docs-main > section {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.docs-main h1 {
  font-size: 2.25rem;
  font-weight: 600;
  letter-spacing: -0.022em;
  line-height: 1.1;
  margin: 0;
  text-wrap: balance;
}

.docs-main h2 {
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: -0.012em;
  margin: 0;
  padding-top: 0.4rem;
  text-wrap: balance;
}

.docs-main h3 {
  font-size: 1rem;
  font-weight: 500;
  margin: 0;
}

.docs-main p {
  margin: 0;
  color: var(--gray-dark);
  line-height: 1.65;
}

.docs-main ul {
  margin: 0;
  padding-left: 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  color: var(--gray-dark);
}

.docs-lead {
  font-size: 1.0625rem;
  color: var(--gray-dark);
}

.docs-code {
  margin: 0;
  padding: 1rem 1.15rem;
  background: var(--gray-surface);
  border: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  line-height: 1.65;
  color: var(--black);
  overflow-x: auto;
  white-space: pre;
}

.docs-main :not(pre) > code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--gray-surface);
  border: 1px solid var(--line);
  padding: 0.05em 0.3em;
}

.docs-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
}

.docs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  background: var(--white);
}

.docs-table th,
.docs-table td {
  text-align: left;
  padding: 0.6rem 0.85rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.docs-table th {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--gray-dark);
  background: var(--gray-surface);
  white-space: nowrap;
}

.docs-table tbody tr:last-child td {
  border-bottom: 0;
}

/* A callout, not an alert. The design system reserves the tinted-panel-with-a
   -bar shape for errors, so this is a plain left rule in the brand red. */
.docs-note {
  border-left: 3px solid var(--hotrod);
  padding: 0.15rem 0 0.15rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.docs-note > p {
  color: var(--gray-dark);
}

.docs-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.docs-card {
  background: var(--white);
  padding: 1.15rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

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

.docs-card h3 a:hover {
  color: var(--hotrod);
}

.docs-card p {
  font-size: 0.9rem;
}

/* The reference is an embedded third-party UI; it gets the full width the
   sidebar leaves and none of the reading column's constraints. */
.docs-main.is-wide {
  max-width: none;
}

.swagger-shell {
  border: 1px solid var(--line);
  background: var(--white);
}

.swagger-shell .swagger-ui .topbar {
  display: none;
}

.spec-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  border: 1px solid var(--line);
  border-bottom: 0;
}

.spec-picker button {
  appearance: none;
  border: 0;
  border-right: 1px solid var(--line);
  background: var(--gray-surface);
  color: var(--gray-dark);
  font-family: inherit;
  font-size: 0.8125rem;
  padding: 0.55rem 1rem;
  cursor: pointer;
}

.spec-picker button:last-child {
  border-right: 0;
}

.spec-picker button[aria-pressed="true"] {
  background: var(--white);
  color: var(--black);
  box-shadow: inset 0 2px 0 var(--hotrod);
}
