/*
 * API reference — Codecaptives
 *
 * THE PALETTE IS COPIED, NOT INVENTED
 *
 * Every colour below is a token from frontend/subdomains/wireview/app/globals.css,
 * verbatim, in OKLCH. Nothing here is a new hue.
 *
 * That is a deliberate constraint rather than an accident of convenience. The
 * previous page was Swagger UI's default, which brings its own brand green and a
 * five-colour method rainbow (blue GET, green POST, red DELETE, orange PUT,
 * purple PATCH). None of those are Codecaptives colours, and together they read
 * as a foreign widget. Here the method is carried by WEIGHT and a single
 * foreground tone; `destructive` is the one accent used, and only where the
 * response genuinely is an error.
 *
 * IF THE BRAND PALETTE CHANGES, THIS FILE NEEDS THE SAME EDIT. It is a copy, not
 * a link — a <link> to another origin's stylesheet would be a cross-origin
 * dependency on the marketing site for the API docs to render.
 */

:root {
  --background: oklch(1 0 0);
  --foreground: oklch(0.13 0.028 261.692);
  --card: oklch(1 0 0);
  --secondary: oklch(0.967 0.003 264.542);
  --muted: oklch(0.967 0.003 264.542);
  --muted-foreground: oklch(0.551 0.027 264.364);
  --accent: oklch(0.967 0.003 264.542);
  --destructive: oklch(0.577 0.245 27.325);
  --border: oklch(0.928 0.006 264.531);
  --ring: oklch(0.707 0.022 261.325);
  --primary: oklch(0.21 0.034 264.665);
  --primary-foreground: oklch(0.985 0.002 247.839);
  --radius: 0.625rem;
  --mono: var(--font-geist-mono), ui-monospace, "SFMono-Regular", Menlo, monospace;
}

.dark {
  --background: oklch(0.13 0.028 261.692);
  --foreground: oklch(0.985 0.002 247.839);
  --card: oklch(0.13 0.028 261.692);
  --secondary: oklch(0.278 0.033 256.848);
  --muted: oklch(0.278 0.033 256.848);
  --muted-foreground: oklch(0.707 0.022 261.325);
  --accent: oklch(0.278 0.033 256.848);
  --destructive: oklch(0.637 0.237 25.331);
  --border: oklch(0.278 0.033 256.848);
  --ring: oklch(0.446 0.03 256.802);
  --primary: oklch(0.985 0.002 247.839);
  --primary-foreground: oklch(0.21 0.034 264.665);
}

* {
  border-color: var(--border);
}

html,
body {
  background: var(--background);
  color: var(--foreground);
}

body {
  margin: 0;
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--foreground);
  text-underline-offset: 3px;
}

code,
pre,
textarea,
input {
  font-family: var(--mono);
}

code {
  font-size: 0.92em;
  background: var(--muted);
  border-radius: 4px;
  padding: 1px 5px;
}

.dim {
  color: var(--muted-foreground);
}

.small {
  font-size: 12px;
}

.skip {
  position: absolute;
  left: -9999px;
}

.skip:focus {
  left: 12px;
  top: 12px;
  z-index: 10;
  background: var(--primary);
  color: var(--primary-foreground);
  padding: 8px 14px;
  border-radius: 8px;
}

/* ------------------------------------------------------------------ top */

.top {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in oklab, var(--background) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.top-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.wordmark {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  text-decoration: none;
  font-size: 16px;
}

.wm-name {
  font-weight: 600;
  letter-spacing: -0.01em;
}

.wm-sep {
  color: var(--border);
}

.wm-sub {
  color: var(--muted-foreground);
}

.top-meta {
  margin-left: auto;
  display: flex;
  gap: 8px;
  align-items: center;
}

.pill {
  font-size: 11px;
  color: var(--muted-foreground);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 10px;
  text-decoration: none;
}

.pill-link:hover {
  color: var(--foreground);
  border-color: var(--ring);
}

/* --------------------------------------------------------------- layout */

.layout {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 40px;
}

@media (max-width: 900px) {
  .layout {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .side {
    position: static !important;
    height: auto !important;
  }
}

.side-sticky {
  position: sticky;
  top: 84px;
  padding: 24px 0;
}

.filter {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--foreground);
  padding: 8px 12px;
  font-size: 13px;
}

.filter:focus {
  outline: none;
  border-color: var(--ring);
}

.side-nav {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.side-nav a {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--muted-foreground);
  text-decoration: none;
}

.side-nav a:hover {
  background: var(--accent);
  color: var(--foreground);
}

.side-nav a span {
  color: var(--muted-foreground);
  font-size: 11px;
}

.side-foot {
  margin-top: 22px;
  font-size: 11px;
  line-height: 1.8;
}

/* ---------------------------------------------------------------- intro */

main {
  padding: 32px 0 80px;
  min-width: 0;
}

.intro h1 {
  margin: 0 0 6px;
  font-size: 30px;
  letter-spacing: -0.03em;
}

.intro p {
  margin: 0 0 18px;
  max-width: 72ch;
}

.base {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  background: var(--card);
}

.base code {
  background: transparent;
  padding: 0;
  font-size: 13px;
}

.copy {
  background: var(--muted);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--muted-foreground);
  font-family: var(--mono);
  font-size: 11px;
  padding: 3px 9px;
  cursor: pointer;
}

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

.authnote {
  margin-top: 18px;
  max-width: 76ch;
}

.keybox {
  max-width: 520px;
}

/* --------------------------------------------------------------- groups */

.group {
  margin-top: 44px;
  scroll-margin-top: 80px;
}

.group-head {
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
  margin-bottom: 14px;
}

.group-head h2 {
  margin: 0;
  font-size: 19px;
  letter-spacing: -0.02em;
}

.group-head p {
  margin: 4px 0 0;
  font-size: 12px;
}

/* ----------------------------------------------------------- operations */

.op {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  margin-bottom: 8px;
  overflow: hidden;
}

.op[hidden] {
  display: none;
}

.op-head {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  background: transparent;
  border: 0;
  color: inherit;
  font-family: var(--mono);
  font-size: 13px;
  text-align: left;
  padding: 13px 16px;
  cursor: pointer;
}

.op-head:hover {
  background: var(--accent);
}

/*
 * The method verb.
 *
 * NO RAINBOW. The previous page used Swagger's blue/green/red/orange/purple, one
 * per verb. Those are not brand colours. Here the verb is a weight difference —
 * DELETE is heavy because it destroys something, reads are regular — and the
 * only hue in the whole component is `destructive`, used solely for DELETE.
 */
.verb {
  font-size: 10px;
  letter-spacing: 0.09em;
  color: var(--muted-foreground);
  min-width: 58px;
  flex-shrink: 0;
}

.verb-delete {
  color: var(--destructive);
  font-weight: 700;
}

.verb-post,
.verb-patch,
.verb-put {
  font-weight: 600;
}

.op-path {
  background: transparent;
  padding: 0;
  font-size: 13px;
  flex-shrink: 0;
}

.op-summary {
  color: var(--muted-foreground);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}

.badge {
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 9px;
  color: var(--foreground);
  flex-shrink: 0;
}

.badge-muted {
  color: var(--muted-foreground);
}

/* ------------------------------------------------------------ op detail */

.op-body {
  border-top: 1px solid var(--border);
  padding: 18px 16px 20px;
  display: grid;
  gap: 10px;
}

.op-body[hidden] {
  display: none;
}

.op-desc {
  margin: 0;
  max-width: 76ch;
}

.op-body h4 {
  margin: 12px 0 0;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-foreground);
  font-weight: 600;
}

.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  margin-top: 4px;
}

.tbl th {
  text-align: left;
  font-weight: 500;
  color: var(--muted-foreground);
  border-bottom: 1px solid var(--border);
  padding: 6px 10px 6px 0;
}

.tbl td {
  border-bottom: 1px solid var(--border);
  padding: 7px 10px 7px 0;
  vertical-align: top;
}

.tbl td code {
  background: transparent;
  padding: 0;
}

/* --------------------------------------------------------------- inputs */

.inputs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
  margin-top: 6px;
}

.input {
  display: block;
  font-size: 11px;
  color: var(--muted-foreground);
}

.input > span {
  display: block;
  margin-bottom: 4px;
}

.input em {
  font-style: normal;
  opacity: 0.7;
}

.input input,
.input textarea {
  width: 100%;
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--foreground);
  font-size: 13px;
  padding: 8px 11px;
}

.input input:focus,
.input textarea:focus {
  outline: none;
  border-color: var(--ring);
}

.input-block {
  margin-top: 8px;
  max-width: 640px;
}

.input textarea {
  resize: vertical;
  line-height: 1.5;
}

/* ------------------------------------------------------------ try it out */

.try {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
}

.btn {
  background: var(--primary);
  color: var(--primary-foreground);
  border: 1px solid var(--primary);
  border-radius: 8px;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  padding: 9px 18px;
  cursor: pointer;
}

.btn:hover {
  opacity: 0.88;
}

.btn[disabled] {
  opacity: 0.55;
  cursor: progress;
}

.try-meta {
  font-size: 12px;
}

.out {
  margin: 12px 0 0;
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 12px;
  line-height: 1.55;
  overflow-x: auto;
  max-height: 380px;
  white-space: pre-wrap;
  word-break: break-word;
}

.out[hidden] {
  display: none;
}

/* A non-2xx is the one place the destructive token appears. */
.out.is-error {
  border-color: var(--destructive);
}

/* --------------------------------------------------------------- footer */

.foot {
  margin-top: 64px;
  border-top: 1px solid var(--border);
  padding-top: 18px;
  font-size: 12px;
}

.foot p {
  margin: 0 0 6px;
  max-width: 78ch;
}

/* --------------------------------------------------------- reduced motion */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}