/* ==========================================================================
   SurePay — API reference (api.html)
   Three panes: nav, prose, code. Everything on the page is generated from
   src/api.json by docs.py, so this file only ever describes layout.
   ========================================================================== */

:root { --doc-top: 82px; --doc-side: 300px; }

/* the site header sits on a dark band everywhere else; here the page is white
   from the first pixel, so it needs its own resting state */
.doc-page { padding-top: var(--doc-top); }
body.is-docs .site-header { background: var(--navy-deep); }
/* the condense-on-scroll would change the header height and drag the sticky
   panes with it, so on this page the header keeps one height */
body.is-docs .site-header .wrap,
body.is-docs.is-scrolled .site-header .wrap { padding-block: 18px; }
body.is-docs.is-scrolled .site-header { background: var(--navy-deep); }

.doc { display: grid; grid-template-columns: var(--doc-side) minmax(0, 1fr); align-items: start; }
.doc__scrim { display: none; }
.doc__main { min-width: 0; }

/* ── sidebar ──────────────────────────────────────────────────────────── */
.doc__side {
  position: sticky; top: var(--doc-top); height: calc(100vh - var(--doc-top));
  display: flex; flex-direction: column; overflow: hidden;
  border-right: 1px solid var(--line); background: #FBFCFE;
}
.doc__search { position: relative; display: flex; align-items: center; padding: 18px 18px 14px; }
.doc__search svg { position: absolute; left: 32px; width: 16px; height: 16px; color: var(--muted); pointer-events: none; }
.doc__search input {
  width: 100%; height: 42px; padding: 0 14px 0 40px; font: inherit; font-size: .9rem;
  color: var(--ink); background: #FFFFFF; border: 1px solid var(--line); border-radius: 10px;
}
.doc__search input:focus { outline: 2px solid var(--sky); outline-offset: 1px; border-color: transparent; }

.dnav { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 4px 12px 40px; }
.dnav__g + .dnav__g { margin-top: 22px; }
.dnav__g h2 { margin: 0 0 6px; padding: 0 10px; }
.dnav__g h2 a {
  font-size: .7rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted); line-height: 1.5;
}
.dnav__g h2 a:hover { color: var(--ink); }
.dnav a { display: flex; align-items: center; gap: 9px; }
.dnav ul a {
  padding: 6px 10px; border-radius: 8px; font-size: .875rem; color: var(--body);
  transition: background-color .14s ease, color .14s ease;
}
.dnav ul a span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dnav ul a:hover { background: #EFF1F9; color: var(--ink); }
.dnav ul a.is-active { background: rgba(64,64,209,.1); color: var(--indigo-deep); font-weight: 600; }
.dnav__empty { padding: 8px 24px 24px; font-size: .86rem; color: var(--muted); }

/* method badges — one scale for the nav (i) and one for headings (span) */
.m {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-style: normal;
  font-weight: 700; letter-spacing: .04em; border-radius: 5px;
}
.dnav .m { width: 44px; height: 19px; font-size: .58rem; }
.ep__path .m { height: 24px; padding: 0 9px; font-size: .68rem; margin-right: 2px; }
.m--get    { background: #E4F6EC; color: #16794A; }
.m--post   { background: #E7E7FA; color: #3A3ACB; }
.m--put    { background: #FFF3DC; color: #8A5D0B; }
.m--patch  { background: #FFF3DC; color: #8A5D0B; }
.m--delete { background: #FDE9E8; color: #B0362A; }
.m--doc    { background: #EEF0F7; color: #5C657D; }

/* ── sticky action bar ────────────────────────────────────────────────── */
.doc__bar {
  position: sticky; top: var(--doc-top); z-index: 20;
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  padding: 14px clamp(20px, 3vw, 46px);
  background: rgba(255,255,255,.86); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.doc__base { display: flex; align-items: center; gap: 10px; min-width: 0; font-size: .84rem; color: var(--muted); }
.doc__base span { font-weight: 700; letter-spacing: .1em; text-transform: uppercase; font-size: .68rem; }
.doc__base code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .82rem; color: var(--ink);
  padding: .2em .5em; border-radius: 6px; background: #F2F4FA; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.doc__pm { margin-left: auto; }
.doc__pm svg { flex: none; }
.doc__menu { display: none; align-items: center; gap: 8px; font-size: .88rem; font-weight: 600; color: var(--ink); }
.doc__menu svg { width: 20px; height: 20px; }

/* ── content ──────────────────────────────────────────────────────────── */
.doc__scroll { padding: 0 clamp(20px, 3vw, 46px) 80px; }
.fam { scroll-margin-top: calc(var(--doc-top) + 70px); }
.fam__head { padding: 54px 0 4px; }
.fam__head p { margin-top: .8rem; max-width: 70ch; font-size: .96rem; line-height: 1.7; color: var(--body); }

.ep {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 44%);
  gap: clamp(24px, 3vw, 44px); align-items: start;
  padding: 34px 0 38px; border-top: 1px solid var(--line-2);
  scroll-margin-top: calc(var(--doc-top) + 70px);
}
.fam__head + .ep { border-top: 0; }
.ep--ref, .ep__wide { display: block; }
.ep--ref { grid-template-columns: minmax(0, 1fr); }
.ep__copy { min-width: 0; }
.ep__copy > p { margin-bottom: .9rem; font-size: .94rem; line-height: 1.72; color: var(--body); max-width: 62ch; }
.ep__path { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 1rem !important; }
.ep__path code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .86rem; font-weight: 600;
  color: var(--ink); padding: .22em .55em; border-radius: 6px; background: #F2F4FA; word-break: break-all;
}
.ep__copypath { display: inline-flex; padding: 5px; border-radius: 6px; color: var(--muted); }
.ep__copypath svg { width: 15px; height: 15px; }
.ep__copypath:hover { color: var(--indigo); background: #F2F4FA; }
.ep__copypath.is-done { color: var(--ok); }
.ep__note {
  margin: 1.1rem 0; padding: 13px 16px; border-radius: 11px;
  background: rgba(80,179,246,.09); border-left: 3px solid var(--sky);
  font-size: .89rem; line-height: 1.6; color: var(--body);
}
.ep__nocode { font-size: .84rem; color: var(--muted); padding-top: 6px; }

/* ── parameter tables ─────────────────────────────────────────────────── */
.dt__wrap { overflow-x: auto; border: 1px solid var(--line-2); border-radius: 12px; }
.dt { width: 100%; border-collapse: collapse; font-size: .86rem; }
.dt th {
  padding: 10px 14px; text-align: left; white-space: nowrap;
  font-size: .68rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase;
  color: var(--muted); background: #F6F7FC; border-bottom: 1px solid var(--line-2);
}
.dt td { padding: 11px 14px; vertical-align: top; line-height: 1.6; color: var(--body); border-bottom: 1px solid #F2F4F9; }
.dt tr:last-child td { border-bottom: 0; }
.dt td.k {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .82rem;
  font-weight: 600; color: var(--ink); white-space: nowrap;
}
.ep--ref .dt__wrap { max-height: 640px; overflow-y: auto; }
.ep--ref .dt th { position: sticky; top: 0; z-index: 1; }

/* ── code rail ────────────────────────────────────────────────────────── */
.ep__code { position: sticky; top: calc(var(--doc-top) + 78px); display: grid; gap: 14px; min-width: 0; }
.cb { margin: 0; border-radius: 14px; overflow: hidden; background: #0C1424; box-shadow: 0 18px 44px -26px rgba(5,10,26,.7); }
.cb figcaption {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px 9px 16px;
  background: #111C33; border-bottom: 1px solid rgba(255,255,255,.07);
}
.cb__t { font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: #8B97B8; }
.cb__tabs { display: flex; gap: 2px; margin-left: auto; }
.cb__tabs button {
  padding: 4px 10px; border-radius: 6px; font-size: .74rem; font-weight: 600; color: #8B97B8;
  transition: background-color .14s ease, color .14s ease;
}
.cb__tabs button:hover { color: #D5DCF0; }
.cb__tabs button[aria-selected="true"] { background: rgba(255,255,255,.11); color: #FFFFFF; }
.cb__copy {
  display: inline-flex; align-items: center; gap: 6px; margin-left: auto; padding: 5px 10px;
  border-radius: 7px; font-size: .74rem; font-weight: 600; color: #8B97B8;
  transition: background-color .14s ease, color .14s ease;
}
.cb__tabs + .cb__copy { margin-left: 0; }
.cb__copy svg { width: 14px; height: 14px; }
.cb__copy:hover { background: rgba(255,255,255,.09); color: #FFFFFF; }
.cb__copy.is-done { color: #6FDF9B; }
.cb pre { margin: 0; padding: 16px 18px 18px; overflow-x: auto; max-height: 480px; }
.cb code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
  font-size: .76rem; line-height: 1.65; color: #C7D0E6; white-space: pre;
}
.t-key { color: #C4A9F5; } .t-str { color: #9FE6B4; } .t-num { color: #7FC4F8; }
.t-bool { color: #F5B36B; } .t-cmd { color: #7FC4F8; } .t-flag { color: #8B97B8; }

.doc__foot { padding-top: 42px; font-size: .86rem; color: var(--muted); }

/* ── responsive ───────────────────────────────────────────────────────── */
@media (max-width: 1180px) {
  .ep { grid-template-columns: minmax(0, 1fr); }
  .ep__code { position: static; }
}
@media (max-width: 900px) {
  :root { --doc-side: 0px; }
  .doc { grid-template-columns: minmax(0, 1fr); }
  .doc__menu { display: inline-flex; }
  .doc__pm span { display: none; }
  .doc__side {
    position: fixed; inset: var(--doc-top) auto 0 0; z-index: 60; width: min(320px, 86vw);
    transform: translateX(-102%); transition: transform .28s cubic-bezier(.22,.61,.36,1);
    box-shadow: 0 24px 60px -20px rgba(10,18,38,.4);
  }
  .doc__side.is-open { transform: none; }
  .doc__scrim { position: fixed; inset: 0; z-index: 55; background: rgba(10,18,38,.42); }
  .doc__scrim.is-open { display: block; }
  .doc__base { order: 3; width: 100%; }
}
@media (prefers-reduced-motion: reduce) { .doc__side { transition: none; } }
.fam__head kbd {
  display: inline-block; min-width: 20px; padding: 1px 6px; margin: 0 1px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .78em; text-align: center;
  color: var(--ink); background: #F2F4FA; border: 1px solid var(--line); border-bottom-width: 2px;
  border-radius: 5px;
}
.fam__head code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .86em;
  padding: .12em .38em; border-radius: 5px; background: rgba(64,64,209,.08); color: var(--indigo-deep);
}

/* one page-level h1; families are h2 and endpoints h3 below it */
.doc__h1 { padding: 46px 0 0; font-size: clamp(2rem, 3.4vw, 2.9rem); letter-spacing: -.04em; }
.fam__head h2 { font-size: clamp(1.7rem, 2.6vw, 2.3rem); letter-spacing: -.035em; }
.ep__copy h3 { font-size: 1.3rem; letter-spacing: -.03em; margin-bottom: .7rem; color: var(--ink); text-transform: none; }
.ep__copy h4 { margin: 1.9rem 0 .7rem; font-size: .7rem; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--muted); }

/* back up to the developers landing page */
.doc__up { display: inline-flex; align-items: center; gap: 5px; flex: none;
  padding: 6px 12px 6px 8px; border-radius: 9px; font-size: .84rem; font-weight: 600;
  color: var(--body); transition: background-color .16s ease, color .16s ease; }
.doc__up svg { width: 16px; height: 16px; }
.doc__up:hover { background: #F2F4FA; color: var(--indigo-deep); }
@media (max-width: 900px) { .doc__up span, .doc__up { font-size: .8rem; } }

/* the reference is a full-bleed layout, so its header is too: the wordmark
   lines up with the sidebar search and the nav sits at the right edge */
body.is-docs .site-header .wrap {
  max-width: none;
  padding-inline: 20px clamp(20px, 3vw, 46px);
}
