/* =========================================================================
   REST API PAGE — loaded ON TOP of mcp-tools-page.css, which already owns the
   hero, the conventions grid, the tool catalog, the FAQ and the CTA. This file
   only adds the REST-specific blocks: quick start, endpoints, auth, responses.
   ========================================================================= */


/* =========================================================================
   REST API PAGE — QUICK START
   ========================================================================= */

.ap-quickstart {
  background: #dbeafe;
  position: relative;
  z-index: 1;
}

.ap-quickstart::before {
  content: "";
  position: absolute;
  top: -79px;
  left: 0;
  width: 100%;
  height: 80px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 80' preserveAspectRatio='none'%3E%3Cpath d='M0,0 C480,80 960,0 1440,60 L1440,80 L0,80 Z' fill='%23dbeafe'/%3E%3C/svg%3E");
  background-size: 100% 100%;
  pointer-events: none;
  z-index: 2;
}

/* THE CURL COMMANDS ARE LONG — ONE COLUMN SO NO COMMAND IS CUT OFF MID-LINE */

.ap-quickstart .ap-quickstart__blocks {
  display: flex;
  flex-direction: column;
  gap: 25px;
  max-width: 900px;
  margin: 0 auto;
}

.ap-quickstart .ap-quickstart__note {
  margin: 25px auto 0;
  max-width: 900px;
  text-align: center;
  color: var(--color-muted);
  line-height: 1.7;
}



/* =========================================================================
   REST API PAGE — CODE BLOCK (shared by quick start, auth and responses)
   ========================================================================= */

.ap-code {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ap-code.ap-code--narrow {
  max-width: 900px;
  margin: 25px auto 0;
}

.ap-code .ap-code__label {
  margin: 0;
  font-weight: 700;
  color: var(--color-ink);
}

.ap-code pre {
  margin: 0;
  padding: 25px;
  border-radius: 12px;
  background: var(--color-ink);
  overflow-x: auto;
}

.ap-code pre code {
  color: #4fbefe;
  font-family: 'Courier New', Courier, monospace;
  font-size: 14px;
  white-space: pre;
  line-height: 1.7;
}

.ap-code .ap-code__caption {
  margin: 0;
  color: var(--color-muted);
  line-height: 1.7;
}


/* =========================================================================
   REST API PAGE — ENDPOINTS
   ========================================================================= */

.ap-endpoints {
  background: var(--color-surface);
  position: relative;
  z-index: 1;
}

.ap-endpoints::before {
  content: "";
  position: absolute;
  top: -79px;
  left: 0;
  width: 100%;
  height: 80px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 80' preserveAspectRatio='none'%3E%3Cpath d='M0,0 C480,80 960,0 1440,60 L1440,80 L0,80 Z' fill='%23ffffff'/%3E%3C/svg%3E");
  background-size: 100% 100%;
  pointer-events: none;
  z-index: 2;
}

.ap-endpoints .ap-endpoints__table-wrap {
  overflow-x: auto;
  max-width: 1000px;
  margin: 0 auto;
}

.ap-endpoints .ap-endpoints__table {
  width: 100%;
  border-collapse: collapse;
}

.ap-endpoints .ap-endpoints__table td {
  padding: 25px 10px;
  border-top: 1px solid var(--color-border);
  vertical-align: top;
  line-height: 1.7;
}

.ap-endpoints .ap-endpoints__table .ap-endpoints__verb-cell {
  width: 1%;
}

.ap-endpoints .ap-endpoints__table .ap-endpoints__path-cell code {
  font-family: 'Courier New', Courier, monospace;
  font-size: 14px;
  font-weight: 700;
  color: var(--color-primary);
  white-space: nowrap;
}

.ap-endpoints .ap-endpoints__table .ap-endpoints__purpose-cell {
  color: var(--color-muted);
  min-width: 250px;
}

.ap-verb {
  display: inline-block;
  padding: 0 10px;
  border-radius: 50px;
  font-family: 'Courier New', Courier, monospace;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.ap-verb.ap-verb--post {
  background: #dbeafe;
  color: #1c6fa8;
}

.ap-verb.ap-verb--get {
  background: #e2e8f0;
  color: #334155;
}


/* =========================================================================
   REST API PAGE — AUTHENTICATION
   ========================================================================= */

.ap-auth {
  background: var(--color-background);
  position: relative;
  z-index: 1;
}

.ap-auth::before {
  content: "";
  position: absolute;
  top: -79px;
  left: 0;
  width: 100%;
  height: 80px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 80' preserveAspectRatio='none'%3E%3Cpath d='M0,0 C480,80 960,0 1440,60 L1440,80 L0,80 Z' fill='%23f6f7fc'/%3E%3C/svg%3E");
  background-size: 100% 100%;
  pointer-events: none;
  z-index: 2;
}


/* =========================================================================
   REST API PAGE — RESPONSES
   ========================================================================= */

.ap-responses {
  background: #dbeafe;
  position: relative;
  z-index: 1;
}

.ap-responses::before {
  content: "";
  position: absolute;
  top: -79px;
  left: 0;
  width: 100%;
  height: 80px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 80' preserveAspectRatio='none'%3E%3Cpath d='M0,0 C480,80 960,0 1440,60 L1440,80 L0,80 Z' fill='%23dbeafe'/%3E%3C/svg%3E");
  background-size: 100% 100%;
  pointer-events: none;
  z-index: 2;
}

.ap-responses .ap-callout {
  max-width: 1000px;
  margin: 0 auto 50px;
  padding: 25px;
  border-radius: 12px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
}

.ap-responses .ap-callout .ap-callout__title {
  margin: 0 0 10px;
  font-size: 18px;
  font-weight: 700;
  color: var(--color-ink);
}

.ap-responses .ap-callout .ap-callout__body {
  margin: 0;
  color: var(--color-muted);
  line-height: 1.7;
}

.ap-responses .ap-callout .ap-callout__body code {
  font-family: 'Courier New', Courier, monospace;
  font-size: 14px;
  color: var(--color-primary);
}

.ap-responses .ap-responses__subtitle {
  max-width: 1000px;
  margin: 50px auto 25px;
  font-size: 18px;
  font-weight: 700;
  color: var(--color-ink);
}

.ap-responses .ap-responses__lead {
  max-width: 1000px;
  margin: 0 auto;
  color: var(--color-muted);
  line-height: 1.7;
}

.ap-responses .ap-endpoints__table-wrap {
  overflow-x: auto;
  max-width: 1000px;
  margin: 0 auto;
}

.ap-responses .ap-endpoints__table-wrap .ap-status__table {
  width: 100%;
  border-collapse: collapse;
  background: var(--color-surface);
  border-radius: 12px;
  overflow: hidden;
}

.ap-responses .ap-endpoints__table-wrap .ap-status__table thead th {
  padding: 10px 25px;
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-muted);
  background: var(--color-background);
}

.ap-responses .ap-endpoints__table-wrap .ap-status__table tbody td {
  padding: 10px 25px;
  border-top: 1px solid var(--color-border);
  vertical-align: top;
  line-height: 1.7;
  color: var(--color-muted);
}

.ap-responses .ap-endpoints__table-wrap .ap-status__table tbody .ap-status__code {
  width: 1%;
  white-space: nowrap;
}

.ap-responses .ap-endpoints__table-wrap .ap-status__table tbody .ap-status__code code {
  font-family: 'Courier New', Courier, monospace;
  font-size: 14px;
  font-weight: 700;
  color: var(--color-ink);
}


/* =========================================================================
   REST API PAGE — MOBILE WAVE OVERRIDES
   ========================================================================= */

@media (max-width: 767px) {

  .ap-quickstart::before,
  .ap-endpoints::before,
  .ap-auth::before,
  .ap-responses::before {
    height: 50px;
    top: -49px;
  }


  /* THE ENDPOINT ROWS STACK INSTEAD OF SCROLLING SIDEWAYS — A CHOPPED SENTENCE READS AS BROKEN */

  .ap-endpoints .ap-endpoints__table,
  .ap-endpoints .ap-endpoints__table tbody,
  .ap-endpoints .ap-endpoints__table tr,
  .ap-endpoints .ap-endpoints__table td {
    display: block;
    width: auto;
  }

  .ap-endpoints .ap-endpoints__table tr {
    padding: 25px 0;
    border-top: 1px solid var(--color-border);
  }

  .ap-endpoints .ap-endpoints__table td {
    padding: 0 0 10px;
    border-top: 0;
  }

  .ap-endpoints .ap-endpoints__table .ap-endpoints__verb-cell {
    width: auto;
  }

  .ap-endpoints .ap-endpoints__table .ap-endpoints__path-cell code {
    white-space: normal;
    word-break: break-all;
  }

  .ap-endpoints .ap-endpoints__table .ap-endpoints__purpose-cell {
    min-width: 0;
  }


  /* THE STATUS AND ERROR-TYPE TABLES KEEP THEIR COLUMNS BUT STOP FORCING A WIDE ROW */

  .ap-responses .ap-endpoints__table-wrap .ap-status__table thead th,
  .ap-responses .ap-endpoints__table-wrap .ap-status__table tbody td {
    padding: 10px;
  }

}
