/* Infinite API docs — this page's own layout and components.
   Colours, radii, shadows, type and glass come from the shared Infinite
   Script tokens (theme.css); panels, buttons and badges from ui.css; the
   header and footer from site-chrome.css. Those three are verbatim copies of
   infinite-services' (its scripts/sync-shared-css.sh keeps them so); edit
   them there, never here. This file only consumes their tokens. */

/* Google Sans, self-hosted: a font CDN is unreachable from much of the
   audience. One variable file per Latin subset covers weights 400–700; the
   same files as the other Infinite Script sites. Licenses:
   ../ASSET-LICENSES.txt. */
@font-face {
  font-family: "Google Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/google-sans-latin.woff2") format("woff2");
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212,
    U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Google Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/google-sans-latin-ext.woff2") format("woff2");
  unicode-range:
    U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304,
    U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB,
    U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --content-max: 1120px;
  --nav-top: 64px;
  --nav-height: 50px;
}

* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-top) + var(--nav-height) + 10px);
}
body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  color: var(--text);
  line-height: 1.5;
}
::selection {
  background: var(--accent-fill);
  color: #fff;
}

.wrap {
  flex: 1 0 auto;
  width: min(100%, calc(var(--content-max) + 2 * var(--page-gutter)));
  margin: 0 auto;
  padding: 28px var(--page-gutter) 56px;
}
.appbar,
.site-footer {
  padding-inline: max(var(--page-gutter), (100% - var(--content-max)) / 2);
}

/* The introduction and its copyable reference share one panel. */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  align-items: center;
  gap: 32px;
  padding: clamp(22px, 3.6vw, 40px);
}
.hero h1 {
  margin: 0;
  font-size: clamp(32px, 4vw, 44px);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.12;
}
.hero-desc {
  max-width: 48ch;
  margin: 10px 0 0;
  color: var(--dim);
  font-size: 15px;
  text-wrap: pretty;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}
.hero-reference {
  width: 100%;
  max-width: 360px;
  justify-self: end;
}
.hero-meta {
  margin: 8px 2px 0;
  color: var(--faint);
  font-size: 12px;
}
.hero-meta span {
  margin-inline: 3px;
}

/* Keep the jump links available while reading the reference. */
.doc-nav {
  position: sticky;
  z-index: 10;
  top: var(--nav-top);
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: var(--nav-height);
  margin: 18px 0;
  padding: 5px;
  border: 1px solid var(--border);
  border-radius: var(--r-control);
  background: var(--glass-float);
  -webkit-backdrop-filter: var(--glass-filter);
  backdrop-filter: var(--glass-filter);
  box-shadow: var(--shadow-sm);
}
.doc-nav-label {
  align-self: stretch;
  display: flex;
  align-items: center;
  margin-right: 5px;
  padding: 0 16px;
  border-right: 1px solid var(--border);
  color: var(--dim);
  font-size: 12px;
  font-weight: 600;
}
.doc-nav a {
  display: grid;
  place-items: center;
  min-height: 38px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: var(--r-small);
  color: var(--dim);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}
.doc-nav a:hover {
  background: var(--surface-2);
  color: var(--text);
}
.doc-nav a[aria-current="location"] {
  border-color: color-mix(in oklch, var(--accent), transparent 78%);
  background: color-mix(in oklch, var(--accent), transparent 90%);
  color: var(--accent-text);
}

/* One surface per service. Internal dividers keep related endpoints together. */
.section {
  --section-gutter: clamp(18px, 3vw, 32px);
}
.section + .section {
  margin-top: 20px;
}
.section-head {
  padding: 22px var(--section-gutter) 19px;
  border-bottom: 1px solid var(--border);
}
.section-head h2 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.2;
}
.section-head .badge {
  letter-spacing: normal;
}
.section-desc {
  max-width: 78ch;
  margin: 6px 0 0;
  color: var(--dim);
  font-size: 14px;
  text-wrap: pretty;
}
.endpoints {
  padding-inline: var(--section-gutter);
}
.endpoint {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.9fr);
  align-items: start;
  gap: 16px 28px;
  padding: 23px 0;
}
.endpoint + .endpoint {
  border-top: 1px solid var(--border);
}
.endpoint-intro:only-child {
  grid-column: 1 / -1;
}
.endpoint-methods {
  display: flex;
  gap: 5px;
}
.method {
  padding: 2px 8px;
  background: var(--ok-soft);
  color: var(--ok-text);
  font-size: 11px;
  letter-spacing: 0.05em;
  line-height: 1.35;
}
.method.post {
  background: color-mix(in oklch, var(--warn), transparent 87%);
  color: var(--warn-text);
}
.endpoint h3 {
  margin: 7px 0 0;
  font-size: 16px;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.endpoint p {
  max-width: 66ch;
  margin: 6px 0 0;
  color: var(--dim);
  font-size: 14px;
  text-wrap: pretty;
}
.endpoint-details {
  display: grid;
  gap: 10px;
  min-width: 0;
}
code {
  font-family: var(--mono);
}
code.param {
  color: var(--accent-text);
  font-size: 0.95em;
}

/* Tables and code examples use the same inset material and toolbar rhythm. */
.params-wrap,
.snippet {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--r-control);
}
.params-wrap {
  background: var(--surface);
  overflow-x: auto;
}
.params {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.params th,
.params td {
  padding: 8px 12px;
  text-align: left;
  vertical-align: top;
}
.params th {
  border-bottom: 1px solid var(--border);
  background: var(--inset);
  color: var(--dim);
  font-size: 12px;
  font-weight: 600;
}
.params td {
  color: var(--dim);
  overflow-wrap: anywhere;
}
.params tr + tr td {
  border-top: 1px solid var(--border);
}
.params td.name,
.params td:nth-child(2):not(:last-child) {
  white-space: nowrap;
}
.required {
  color: var(--warn-text);
  font-style: normal;
  font-weight: 600;
}
.demo {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.demo img {
  height: 20px;
  max-width: 100%;
  object-fit: contain;
}

.snippet {
  background: var(--inset);
}
.snippet-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 39px;
  padding: 5px 8px 5px 13px;
  border-bottom: 1px solid var(--border);
  border-radius: var(--r-small) var(--r-small) 0 0;
  background: var(--glass-control);
}
.snippet-label {
  color: var(--dim);
  font-size: 12px;
  font-weight: 600;
}
.copy-btn {
  min-width: 58px;
  padding-block: 5px;
}
.snippet pre,
.base-url {
  display: block;
  margin: 0;
  padding: 12px 13px;
  color: var(--text);
  font-size: 12.5px;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.base-url {
  font-size: 13px;
}

@media (max-width: 820px) {
  .endpoint {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 720px) {
  .wrap {
    padding-top: 18px;
    padding-bottom: 34px;
  }
  .hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
  }
  .hero-reference {
    justify-self: start;
  }
  .doc-nav {
    margin-block: 14px;
  }
  .doc-nav-label {
    display: none;
  }
  .doc-nav a {
    flex: 1;
    padding-inline: 6px;
  }
  .params th,
  .params td {
    padding-inline: 7px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
