/* /developers/: the Context API, the MCP server, the Object API and webhooks.
 * Tokens come from knowledge.css. Logical properties, so RTL needs no overrides. */

.dev-section .section-sub { max-width: 72ch; }
.dev-muted { color: var(--muted); max-width: 72ch; }
.dev-after { margin-top: 20px; }
@media (min-width: 761px) {
  .dev-section > .container > .dev-after { margin-inline: auto; text-align: center; }
}

/* Two columns: copy beside a code sample. */
.dev-two {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: 40px;
  align-items: start;
  margin-top: 36px;
}
.dev-section > .dev-two { margin-top: 0; }
.dev-two-copy h2 { margin: 6px 0 14px; }
.dev-two-copy h3 { margin: 0 0 10px; font-size: 19px; color: var(--ink); }
.dev-two-copy p { color: var(--ink-2); line-height: 1.6; }
.dev-two-copy p + p { margin-top: 12px; }

.dev-ticks { list-style: none; margin: 16px 0; padding: 0; display: grid; gap: 10px; }
.dev-ticks li {
  position: relative;
  padding-inline-start: 26px;
  color: var(--ink-2);
  line-height: 1.55;
}
.dev-ticks li::before {
  content: "";
  position: absolute;
  inset-inline-start: 2px;
  top: 0.45em;
  width: 12px;
  height: 7px;
  border-inline-start: 2px solid var(--good);
  border-bottom: 2px solid var(--good);
  transform: rotate(-45deg);
}
[dir="rtl"] .dev-ticks li::before { transform: rotate(45deg) scaleX(-1); }
.dev-ticks code, .dev-trust code { font-size: 0.9em; }

/* Code samples, always labelled "Example". */
.dev-code {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}
.dev-code figcaption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--bg-raise);
}
.dev-code-lang { font-size: 12px; color: var(--faint); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.dev-code pre {
  margin: 0;
  padding: 18px;
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.6;
  background: var(--panel);
  color: var(--ink);
  direction: ltr;
  text-align: left;
}
.dev-code pre code { background: none; padding: 0; color: inherit; white-space: pre; }

/* Tables: the context table and the route table. */
.dev-table-wrap { margin-top: 26px; overflow-x: auto; }
.cmp.dev-table { width: 100%; min-width: 0; border-collapse: collapse; }
.dev-table th, .dev-table td { padding: 14px 16px; vertical-align: top; text-align: start; }
.dev-table tbody th { color: var(--ink); font-weight: 600; font-size: 14px; }
.dev-table td code { display: block; width: fit-content; max-width: 100%; margin: 0 0 6px; font-size: 12px; overflow-wrap: anywhere; }
.dev-table td code:last-child { margin-bottom: 0; }
.dev-table code.dev-tool { background: var(--brand-tint); color: var(--brand-b); }
.dev-routes tbody th code { font-weight: 650; }

@media (max-width: 640px) {
  .dev-table-wrap.table-wrap { border: 0; background: none; overflow: visible; }
  .dev-table-wrap.table-wrap::before { display: none; }
  .cmp.dev-table, .dev-table tbody, .dev-table tr, .dev-table th, .dev-table td { display: block; }
  .dev-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .dev-table tr {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
    padding: 12px 14px;
    margin-bottom: 12px;
  }
  .table-wrap .cmp.dev-table th, .table-wrap .cmp.dev-table td { padding: 4px 0; border: 0; background: none; }
  .dev-table td[data-label]::before {
    content: attr(data-label);
    display: block;
    font-size: 11px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--faint);
    margin: 6px 0 2px;
  }
  .dev-routes td[data-label="Path"]::before { display: none; }
  .dev-routes tr { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 10px; }
  .dev-routes td[data-label="Does"] { grid-column: 1 / -1; }
}

/* Hero panel: one context call, with example data. */
.dev-panel {
  width: 100%;
  max-width: 520px;
  margin-inline: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-pop);
  overflow: hidden;
  text-align: start;
}
.dev-panel-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--bg-raise);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  color: var(--ink-2);
}
.dev-panel-bar .example-pill { margin-inline-start: auto; }
.dev-dots { display: inline-flex; gap: 5px; }
.dev-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
.dev-panel-ask { display: flex; gap: 12px; align-items: baseline; padding: 16px 18px 6px; }
.dev-panel-who {
  flex: none;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--brand-a);
}
.dev-panel-ask p { margin: 0; color: var(--ink); font-size: 15px; font-weight: 550; }
.dev-panel-list { list-style: none; margin: 0; padding: 8px 18px 4px; display: grid; gap: 8px; }
.dev-panel-list li {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: var(--bg);
  font-size: 13px;
  line-height: 1.45;
}
.dev-panel-list b { color: var(--ink); font-weight: 600; }
.dev-panel-list span { color: var(--ink-2); }
.dev-panel-foot {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 8px 18px 16px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
}
.dev-lock {
  flex: none;
  width: 10px;
  height: 8px;
  margin-top: 4px;
  border-radius: 2px;
  background: var(--good);
  box-shadow: 0 -4px 0 -1px transparent;
  position: relative;
}
.dev-lock::before {
  content: "";
  position: absolute;
  left: 1px;
  bottom: 6px;
  width: 4px;
  height: 4px;
  border: 2px solid var(--good);
  border-bottom: 0;
  border-radius: 4px 4px 0 0;
}

/* Trust grid. */
.dev-trust {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-top: 26px;
}
.dev-trust > div {
  padding: 20px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.dev-trust h3 { margin: 0 0 8px; font-size: 16px; color: var(--ink); }
.dev-trust p { margin: 0; color: var(--ink-2); font-size: 14px; line-height: 1.55; }

@media (max-width: 980px) {
  .dev-two { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .dev-trust { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .dev-trust { grid-template-columns: minmax(0, 1fr); }
  .dev-panel-list li { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .dev-code pre { font-size: 12px; padding: 14px; }
}
