/* The Storefront SDK developer docs. No external assets: system fonts, no images. */

:root {
  --bg: #fbfbfa;
  --surface: #ffffff;
  --text: #1c1f24;
  --muted: #5b6370;
  --faint: #8a919c;
  --accent: #2448b8;
  --accent-text: #1f3f9f;
  --tint: rgb(28 31 36 / 0.045);
  --tint-strong: rgb(28 31 36 / 0.08);
  --accent-tint: rgb(36 72 184 / 0.07);
  --warn-tint: rgb(196 120 0 / 0.1);
  --hairline: rgb(28 31 36 / 0.09);
  --code-bg: #f3f4f2;
  --focus: #2448b8;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", Consolas, "Liberation Mono", monospace;
  --radius: 10px;
  --header: 3.5rem;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111317;
    --surface: #171a1f;
    --text: #e6e8eb;
    --muted: #a3aab5;
    --faint: #7d8591;
    --accent: #8ea8ff;
    --accent-text: #a9bcff;
    --tint: rgb(230 232 235 / 0.05);
    --tint-strong: rgb(230 232 235 / 0.09);
    --accent-tint: rgb(142 168 255 / 0.1);
    --warn-tint: rgb(255 184 77 / 0.1);
    --hairline: rgb(230 232 235 / 0.1);
    --code-bg: #1b1f25;
    --focus: #8ea8ff;
    color-scheme: dark;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header) + 1rem);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent-text);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

a:hover {
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: 4px;
}

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 20;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  background: var(--surface);
}

.skip:focus {
  top: 0.75rem;
}

/* ─── Header ─────────────────────────────────────────────────────────────── */

.top {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: var(--header);
  padding: 0 clamp(1rem, 3vw, 2rem);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  box-shadow: 0 1px 0 var(--hairline);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
  color: var(--text);
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
}

.brand-mark {
  flex: none;
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 7px;
  background: linear-gradient(
    135deg,
    var(--accent),
    color-mix(in srgb, var(--accent) 55%, #18b38a)
  );
}

.brand-sub {
  overflow: hidden;
  color: var(--muted);
  font-weight: 500;
  text-overflow: ellipsis;
}

.versions {
  display: flex;
  gap: 0.4rem;
  flex: none;
}

.versions span {
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: var(--tint-strong);
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 550;
  font-variant-numeric: tabular-nums;
}

/* ─── Layout ─────────────────────────────────────────────────────────────── */

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  max-width: 80rem;
  margin: 0 auto;
}

.side {
  display: none;
}

.main {
  min-width: 0;
  padding: 1.25rem 1rem 3rem;
}

@media (min-width: 60rem) {
  .layout {
    grid-template-columns: 16.5rem minmax(0, 1fr);
    gap: clamp(1.5rem, 3vw, 3.5rem);
    padding: 0 clamp(1rem, 3vw, 2rem);
  }

  .side {
    display: block;
    position: sticky;
    top: var(--header);
    align-self: start;
    max-height: calc(100vh - var(--header));
    overflow-y: auto;
    padding: 1.75rem 0.25rem 2rem 0;
    scrollbar-width: thin;
  }

  .main {
    padding: 2.25rem 0 4rem;
  }

  .mobile-nav {
    display: none;
  }
}

/* ─── Navigation ─────────────────────────────────────────────────────────── */

.nav-title {
  margin: 1.5rem 0 0.4rem 0.75rem;
  color: var(--faint);
  font-size: 0.75rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.nav-title:first-child {
  margin-top: 0;
}

.side ul,
.mobile-nav ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.side a,
.mobile-nav a {
  display: block;
  padding: 0.3rem 0.75rem;
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.9375rem;
  line-height: 1.4;
  text-decoration: none;
}

.side a:hover,
.mobile-nav a:hover {
  background: var(--tint);
  color: var(--text);
}

.side a[aria-current="page"],
.mobile-nav a[aria-current="page"] {
  background: var(--accent-tint);
  color: var(--accent-text);
  font-weight: 600;
}

.side .toc {
  margin: 0.15rem 0 0.4rem 0.75rem;
}

.side .toc a {
  padding: 0.2rem 0.75rem;
  font-size: 0.875rem;
}

.mobile-nav {
  margin: 0 0 1.5rem;
  border-radius: var(--radius);
  background: var(--tint);
}

.mobile-nav summary {
  padding: 0.7rem 1rem;
  font-weight: 600;
  cursor: pointer;
}

.mobile-nav nav {
  padding: 0 0.5rem 0.75rem;
}

.mobile-nav .nav-title {
  margin-top: 0.9rem;
}

/* ─── Article ────────────────────────────────────────────────────────────── */

.prose {
  max-width: 48rem;
}

.prose > :first-child {
  margin-top: 0;
}

.prose h1 {
  margin: 0 0 1rem;
  font-size: clamp(1.85rem, 1.4rem + 1.6vw, 2.4rem);
  font-weight: 720;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.prose h2 {
  margin: 2.75rem 0 0.75rem;
  font-size: 1.5rem;
  font-weight: 680;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.prose h3 {
  margin: 2rem 0 0.5rem;
  font-size: 1.15rem;
  font-weight: 650;
  line-height: 1.35;
}

.prose h4 {
  margin: 1.5rem 0 0.4rem;
  font-size: 1rem;
  font-weight: 650;
}

.prose h2 a.h,
.prose h3 a.h,
.prose h4 a.h {
  color: inherit;
  text-decoration: none;
}

.prose a.h:hover::after {
  content: " #";
  color: var(--faint);
  font-weight: 400;
}

.prose p,
.prose ul,
.prose ol {
  margin: 0 0 1rem;
}

.prose ul,
.prose ol {
  padding-left: 1.4rem;
}

.prose li + li {
  margin-top: 0.3rem;
}

.prose li > ul,
.prose li > ol {
  margin: 0.3rem 0 0;
}

.prose strong {
  font-weight: 650;
}

.prose hr {
  height: 1px;
  margin: 2.5rem 0;
  border: 0;
  background: var(--hairline);
}

.prose code {
  padding: 0.1em 0.35em;
  border-radius: 5px;
  background: var(--tint-strong);
  font-family: var(--mono);
  font-size: 0.875em;
  overflow-wrap: anywhere;
}

.prose a code {
  color: inherit;
}

.prose pre {
  position: relative;
  margin: 0 0 1.25rem;
  padding: 1rem 1.1rem;
  overflow-x: auto;
  border-radius: var(--radius);
  background: var(--code-bg);
  font-size: 0.875rem;
  line-height: 1.6;
  tab-size: 2;
}

.prose pre code {
  padding: 0;
  background: none;
  font-size: inherit;
  overflow-wrap: normal;
  white-space: pre;
}

.code {
  position: relative;
}

/* Room for the copy button, so it never sits on the first line. */
.code pre {
  padding-right: 4.75rem;
}

.code .copy {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  padding: 0.25rem 0.6rem;
  border: 0;
  border-radius: 7px;
  background: color-mix(in srgb, var(--code-bg) 88%, var(--text));
  color: var(--muted);
  font: 600 0.75rem/1.4 var(--font);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s;
}

.code:hover .copy,
.code .copy:focus-visible,
.code .copy[data-state] {
  opacity: 1;
}

@media (hover: none) {
  .code .copy {
    opacity: 1;
  }
}

.code .copy:hover {
  color: var(--text);
}

.prose blockquote {
  margin: 0 0 1.25rem;
  padding: 0.85rem 1.1rem;
  border-radius: var(--radius);
  background: var(--accent-tint);
}

.prose blockquote.warn {
  background: var(--warn-tint);
}

.prose blockquote > :last-child {
  margin-bottom: 0;
}

/* Tables scroll on their own on narrow screens. */
.table-wrap {
  margin: 0 0 1.25rem;
  overflow-x: auto;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 0 0 1px var(--hairline);
}

.prose table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.9375rem;
  line-height: 1.5;
}

.prose th,
.prose td {
  padding: 0.55rem 0.85rem;
  text-align: left;
  vertical-align: top;
}

.prose th {
  background: var(--tint);
  font-weight: 620;
  white-space: nowrap;
}

.prose tr + tr td,
.prose tbody tr:first-child td {
  box-shadow: inset 0 1px 0 var(--hairline);
}

.prose td code {
  white-space: nowrap;
}

/* The prose column keeps a readable width; on a phone the table scrolls sideways instead. */
.prose td:last-child {
  min-width: 13rem;
}

/* ─── Pager and footer ───────────────────────────────────────────────────── */

.pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  max-width: 48rem;
  margin: 3rem 0 0;
}

.pager a {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  background: var(--tint);
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
}

.pager a:hover {
  background: var(--tint-strong);
}

.pager-next {
  grid-column: 2;
  text-align: right;
}

.pager-label {
  color: var(--faint);
  font-size: 0.8125rem;
  font-weight: 500;
}

.foot {
  max-width: 48rem;
  margin-top: 2.5rem;
  color: var(--faint);
  font-size: 0.875rem;
}

.foot a {
  color: inherit;
}

@media (max-width: 30rem) {
  .brand-sub,
  .versions span + span {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
