/* Dispatch API documentation (guest general_page and signed-in panel).
 * Linked from app/modules/api/views/index.php only when the Dispatch theme is active,
 * so the same rules serve both layouts without duplicating them in two theme files.
 * Tokens fall back to the Dispatch values when a layout does not define them. */

.api-documentation.dispatch-api-docs {
  --api-ink: var(--dispatch-ink, #102B36);
  --api-muted: var(--dispatch-muted, #526C75);
  --api-line: var(--dispatch-line, #A6C9D1);
  --api-line-soft: var(--dispatch-line-soft, #D4E7EA);
  --api-surface: var(--dispatch-surface, #FFFFFF);
  --api-signal: var(--dispatch-signal, #0878B8);
  --api-signal-soft: var(--dispatch-signal-soft, #D2EDF4);
  --api-condensed: var(--dispatch-condensed, "IBM Plex Sans Condensed", "Arial Narrow", sans-serif);
  align-items: flex-start;
}

/* Sections: real inner padding, no collapse controls, one heading level each. */
.api-documentation.dispatch-api-docs .card {
  margin-bottom: 24px;
  border: 1px solid var(--api-line);
  background: var(--api-surface);
}
.api-documentation.dispatch-api-docs .card-header {
  min-height: 0;
  padding: 24px 24px 0;
  border: 0;
  background: transparent;
}
.api-documentation.dispatch-api-docs .card-options {
  display: none;
}
.api-documentation.dispatch-api-docs .card-body {
  padding: 16px 24px 24px;
}
.api-documentation.dispatch-api-docs .card-title {
  margin: 0;
  color: var(--api-ink);
  font-family: var(--api-condensed);
  font-size: 22px;
  line-height: 1.2;
}
.api-documentation.dispatch-api-docs .api-page-title {
  font-size: clamp(28px, 3vw, 34px);
}
.api-documentation.dispatch-api-docs .card-body p,
.api-documentation.dispatch-api-docs .alert {
  max-width: 75ch;
}
.api-documentation.dispatch-api-docs .lead {
  color: var(--api-ink);
  font-size: 17px;
  font-weight: 400;
}
.api-documentation.dispatch-api-docs h3 {
  margin: 24px 0 8px;
  color: var(--api-ink);
  font-family: var(--api-condensed);
  font-size: 16px;
  font-weight: 600;
}
.api-documentation.dispatch-api-docs .api-code-example:first-of-type h3 {
  margin-top: 16px;
}

/* Tables: light header row and one divider style; monospace stays inside code. */
.api-documentation.dispatch-api-docs .table thead th,
.api-documentation.dispatch-api-docs .table thead td {
  border-top: 0;
  border-bottom: 1px solid var(--api-line);
  background: transparent;
  color: var(--api-muted);
  font-family: var(--api-condensed);
  font-size: 13px;
  font-weight: 600;
}
.api-documentation.dispatch-api-docs .table td {
  border-color: var(--api-line-soft);
  background: transparent;
}
.api-documentation.dispatch-api-docs .table-bordered,
.api-documentation.dispatch-api-docs .table-bordered td,
.api-documentation.dispatch-api-docs .table-bordered th {
  border-right: 0;
  border-left: 0;
}
.api-documentation.dispatch-api-docs .table tr > td:first-child {
  color: var(--api-muted);
}

/* "On this page": a sticky side menu on wide screens; the in-card list stays for
 * narrower ones. */
.api-documentation.dispatch-api-docs .dispatch-api-docs-nav {
  display: none;
}
@media (min-width: 1200px) {
  .api-documentation.dispatch-api-docs {
    display: grid;
    grid-template-columns: 200px minmax(0, 1fr);
    column-gap: 32px;
    margin-right: 0;
    margin-left: 0;
  }
  .api-documentation.dispatch-api-docs > [class*="col-"] {
    grid-column: 2;
    width: auto;
    max-width: 880px;
    flex: none;
    padding-right: 0;
    padding-left: 0;
  }
  .api-documentation.dispatch-api-docs .dispatch-api-docs-nav {
    position: sticky;
    top: 96px;
    display: block;
    grid-column: 1;
    grid-row: 1 / span 20;
    align-self: start;
  }
  .api-documentation.dispatch-api-docs .dispatch-api-docs-nav strong {
    display: block;
    margin-bottom: 8px;
    color: var(--api-ink);
    font-family: var(--api-condensed);
    font-size: 15px;
  }
  .api-documentation.dispatch-api-docs .dispatch-api-docs-nav ul {
    margin: 0;
    padding: 0;
    list-style: none;
  }
  .api-documentation.dispatch-api-docs .dispatch-api-docs-nav a {
    display: block;
    padding: 6px 0;
    color: var(--api-signal);
    font-size: 15px;
  }
  .api-documentation.dispatch-api-docs .api-docs-toc {
    display: none;
  }
}
@media (max-width: 575.98px) {
  .api-documentation.dispatch-api-docs .card-header {
    padding: 20px 16px 0;
  }
  .api-documentation.dispatch-api-docs .card-body {
    padding: 12px 16px 20px;
  }
}

/* Same warning, link and row treatment in the guest and signed-in layouts. */
/* !important: the vendor colour skin (assets/plugins/boostrap/colors.css) forces a coral .alert-warning. */
.api-documentation.dispatch-api-docs .alert-warning {
  border: 1px solid #D8C69B;
  border-radius: 0;
  background: var(--dispatch-sun-soft, #FFF3B7) !important;
  color: var(--api-ink);
}
.api-documentation.dispatch-api-docs .api-docs-toc a {
  color: var(--api-signal);
}
.api-documentation.dispatch-api-docs .table tbody tr,
.api-documentation.dispatch-api-docs .table tbody tr:nth-of-type(odd) {
  background: transparent;
}
.api-documentation.dispatch-api-docs .card-title {
  font-weight: 600;
}
