/* Pluralytics overrides for Swagger UI.
 *
 * Focus is the info/description block, which carries a lot of prose and three markdown
 * tables that Swagger UI renders essentially unstyled. Aim is Apiary's reading
 * experience: a constrained measure, clear section breaks, and real tables.
 *
 * Swagger UI's own topbar is omitted (no standalone preset), so .pl-header replaces it.
 */

:root {
  --pl-ink: #1b1b2f;
  --pl-ink-soft: #3d3d5c;
  --pl-rule: #e3e6ec;
  --pl-bg-soft: #f7f8fa;
  --pl-accent: #2c6fbb;
  --pl-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --pl-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --pl-measure: 78ch;
}

body { margin: 0; background: #fff; }

/* ---------------------------------------------------------------- page header */

.pl-header {
  background: var(--pl-ink);
  color: #fff;
  padding: 1.1rem 2rem;
  font: 400 15px/1.4 var(--pl-sans);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 1rem;
}
.pl-header h1 { font-size: 1.15rem; margin: 0; font-weight: 600; letter-spacing: -0.01em; }
.pl-badge {
  background: var(--pl-ink-soft); border-radius: 999px;
  padding: 0.15rem 0.6rem; font-size: 0.75rem; letter-spacing: 0.02em;
}
.pl-header a { color: #9fd0ff; text-decoration: none; }
.pl-header a:hover { text-decoration: underline; }
.pl-header .pl-spacer { flex: 1 1 auto; }

.pl-note {
  background: #fff8e1;
  border-bottom: 1px solid #f0e0a8;
  color: #5c4a00;
  padding: 0.7rem 2rem;
  font: 400 13.5px/1.5 var(--pl-sans);
}
.pl-note code {
  background: #fff0c2; padding: 0.05rem 0.3rem; border-radius: 3px;
  font-family: var(--pl-mono); font-size: 0.92em;
}

/* ------------------------------------------------------------------ info block */

.swagger-ui .info { margin: 2.5rem 0 2rem; }

/* Swagger UI's title block, shown in the page body above the Welcome section. It reads
   info.title from the spec, so it stays correct if the title ever changes.
   Sized clearly above the h2 section headings so the hierarchy is unambiguous. */
.swagger-ui .info hgroup.main { display: block; margin: 0 0 1.75rem; }

.swagger-ui .info hgroup.main .title {
  font-family: var(--pl-sans);
  font-size: 2.1rem;
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--pl-ink);
  margin: 0;
  padding: 0;
  border: 0;
}

/* The version renders as "0.4.0" here while the header badge says "Beta 0.4"; showing
   both invites the question of which is authoritative. The badge wins — it is visible
   while scrolled. */
.swagger-ui .info hgroup.main .title small,
.swagger-ui .info hgroup.main .title .version-stamp,
.swagger-ui .info hgroup.main pre.version { display: none; }

/* Swagger UI renders the server URL here too, which duplicates the servers dropdown. */
.swagger-ui .info hgroup.main .base-url { display: none; }

.swagger-ui .info .description {
  max-width: var(--pl-measure);
  font-family: var(--pl-sans);
  font-size: 15px;
  line-height: 1.65;
  color: #2c2c38;
}

.swagger-ui .info .description h2 {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--pl-ink);
  letter-spacing: -0.01em;
  margin: 2.6rem 0 0.9rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--pl-rule);
}
.swagger-ui .info .description h2:first-child { margin-top: 0; }

.swagger-ui .info .description h3 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--pl-ink-soft);
  margin: 1.8rem 0 0.6rem;
}

.swagger-ui .info .description p { margin: 0.85rem 0; }

.swagger-ui .info .description ul { margin: 0.85rem 0; padding-left: 1.3rem; }
.swagger-ui .info .description li { margin: 0.35rem 0; }

.swagger-ui .info .description a { color: var(--pl-accent); text-decoration: none; }
.swagger-ui .info .description a:hover { text-decoration: underline; }

.swagger-ui .info .description code {
  font-family: var(--pl-mono);
  font-size: 0.88em;
  background: var(--pl-bg-soft);
  border: 1px solid var(--pl-rule);
  border-radius: 3px;
  padding: 0.08em 0.35em;
  color: #b1365f;
}

.swagger-ui .info .description strong { font-weight: 600; color: var(--pl-ink); }

/* Tables. Swagger UI ships almost no styling for markdown tables, and the description
   has three that carry real reference content — rate limits, error shapes, and the
   attribute ID list. Left unstyled they read as run-together text. */
.swagger-ui .info .description table {
  border-collapse: collapse;
  width: 100%;
  margin: 1.2rem 0 1.6rem;
  font-size: 13.5px;
  display: table;
}
.swagger-ui .info .description thead th {
  background: var(--pl-bg-soft);
  color: var(--pl-ink);
  font-weight: 600;
  text-align: left;
  border: 1px solid var(--pl-rule);
  padding: 0.5rem 0.7rem;
  white-space: nowrap;
}
.swagger-ui .info .description tbody td {
  border: 1px solid var(--pl-rule);
  padding: 0.45rem 0.7rem;
  vertical-align: top;
}
.swagger-ui .info .description tbody tr:nth-child(even) { background: #fcfcfd; }

/* The attribute ID table is long and two-column-paired; keep it scrollable rather than
   letting it stretch the measure. */
.swagger-ui .model-box table,
.swagger-ui .renderedMarkdown table { display: table; width: 100%; }

/* ----------------------------------------------------- servers + auth bar */

.swagger-ui .scheme-container {
  background: var(--pl-bg-soft);
  box-shadow: none;
  border-top: 1px solid var(--pl-rule);
  border-bottom: 1px solid var(--pl-rule);
  padding: 1.1rem 0;
  margin: 0 0 2rem;
}

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

.swagger-ui .opblock-tag {
  font-family: var(--pl-sans);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--pl-ink);
  border-bottom: 1px solid var(--pl-rule);
}
.swagger-ui .opblock-tag small { font-weight: 400; color: #5b6472; }

.swagger-ui .opblock .opblock-summary-path { font-family: var(--pl-mono); font-weight: 500; }
.swagger-ui .opblock .opblock-summary-description { font-family: var(--pl-sans); color: #4a5260; }

/* Descriptions inside operations get the same table and code treatment, since several
   properties document their constraints as markdown tables too. */
.swagger-ui .renderedMarkdown table { border-collapse: collapse; margin: 0.8rem 0; font-size: 13px; }
.swagger-ui .renderedMarkdown th,
.swagger-ui .renderedMarkdown td { border: 1px solid var(--pl-rule); padding: 0.35rem 0.6rem; text-align: left; }
.swagger-ui .renderedMarkdown thead th { background: var(--pl-bg-soft); font-weight: 600; }

@media (max-width: 700px) {
  .pl-header, .pl-note { padding-left: 1rem; padding-right: 1rem; }
  :root { --pl-measure: 100%; }
}
