/* Jusa for Developers: the docs site (templates/developers/).
 *
 * ON THE DAY throughout: the grey paper ground, clay for links and the one
 * primary action, Fraunces only on page titles, IBM Plex Mono for every
 * path, code and numeral. Code blocks sit on the night ground so a terminal
 * still belongs to the palette. No colour is declared here that airtime.css
 * does not already name. */

.dev { padding: clamp(2rem, 5vw, 3.5rem) 0 var(--section-pad); }
.dev-layout {
  display: grid;
  grid-template-columns: 15rem minmax(0, 1fr);
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: start;
}
@media (max-width: 900px) {
  .dev-layout { grid-template-columns: 1fr; }
}

/* ---- the sidebar ------------------------------------------------------------ */
.dev-nav {
  position: sticky; top: var(--s-5);
  font-size: var(--t-sm, .92rem);
  max-height: calc(100vh - 2 * var(--s-5)); overflow-y: auto;
  padding-right: var(--s-2);
}
.dev-nav .eyebrow { margin: var(--s-5) 0 var(--s-2); }
.dev-nav .eyebrow:first-child { margin-top: 0; }
.dev-nav ul { list-style: none; margin: 0; padding: 0; }
.dev-nav a {
  display: block; padding: 5px 10px; margin-left: -10px;
  border-radius: var(--r-ctl);
  color: var(--ink-soft); text-decoration: none;
}
.dev-nav a:hover { color: var(--accent); background: var(--accent-soft); }
.dev-nav a[aria-current="page"] { color: var(--accent); background: var(--accent-soft); font-weight: 600; }
@media (max-width: 900px) {
  .dev-nav { position: static; max-height: none; border-bottom: 1px solid var(--line); padding-bottom: var(--s-4); }
  .dev-nav ul { display: flex; flex-wrap: wrap; gap: 2px 12px; }
  .dev-nav a { margin-left: 0; padding: 4px 0; }
}

/* ---- the page ------------------------------------------------------------------ */
.dev-head { margin-bottom: var(--s-6); max-width: 46rem; }
.dev-head h1 {
  font-family: var(--f-display);
  font-variation-settings: 'opsz' 72, 'SOFT' 20, 'WONK' 0;
  font-weight: 600; font-size: clamp(2rem, 4.2vw, 3rem);
  line-height: 1.04; letter-spacing: -.024em;
  margin: var(--s-2) 0 var(--s-3); color: var(--ink);
}
.dev-head .lede { margin: 0; color: var(--ink-soft); font-size: 1.125rem; line-height: 1.55; }

.dev-body { max-width: 46rem; color: var(--ink-soft); font-size: 1.02rem; line-height: 1.68; }
.dev-body.is-wide { max-width: 64rem; }
.dev-body h2 {
  font-family: var(--f-body); font-weight: 600; font-size: 1.4rem; letter-spacing: -.012em;
  color: var(--ink); margin: var(--s-7) 0 var(--s-3); scroll-margin-top: var(--s-5);
}
.dev-body h3 {
  font-family: var(--f-body); font-weight: 600; font-size: 1.1rem;
  color: var(--ink); margin: var(--s-5) 0 var(--s-2); scroll-margin-top: var(--s-5);
}
.dev-body h2:first-child, .dev-body h3:first-child { margin-top: 0; }
.dev-body p { margin: 0 0 var(--s-4); }
.dev-body ul, .dev-body ol { margin: 0 0 var(--s-4); padding-left: 1.25rem; }
.dev-body li { margin: 0 0 var(--s-2); }
.dev-body li::marker { color: var(--accent); }
.dev-body a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px;
              text-decoration-color: var(--accent-line); }
.dev-body strong { color: var(--ink); font-weight: 600; }
.dev-body code {
  font-family: var(--f-num); font-size: .86em;
  background: var(--ground-2); border-radius: 5px; padding: 1px 5px; color: var(--ink);
}

/* Tables: hairlines, mono keys. They scroll inside themselves on a phone. */
.dev-table { width: 100%; overflow-x: auto; margin: 0 0 var(--s-5); }
.dev-body table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.dev-body th, .dev-body td { text-align: left; padding: .55rem .6rem .55rem 0; border-bottom: 1px solid var(--line);
                             vertical-align: top; }
.dev-body th { color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .08em;
               font-weight: 700; border-bottom-color: var(--line-strong); }
.dev-body td:first-child code { white-space: nowrap; }
.dev-body tr:target td { background: var(--accent-soft); }

/* Callouts: the accent bar says "read this first", nothing else. */
.callout { border-left: 3px solid var(--accent); background: var(--surface); padding: var(--s-3) var(--s-4);
           border-radius: 0 var(--r-ctl) var(--r-ctl) 0; margin: 0 0 var(--s-5); }
.callout p:last-child { margin-bottom: 0; }
.callout.is-quiet { border-left-color: var(--line-strong); }

/* Code: the night ground. */
pre.code {
  background: var(--night); color: var(--night-text);
  border-radius: var(--r-card); border: 1px solid var(--night-3);
  padding: var(--s-4) var(--s-5); margin: 0 0 var(--s-5);
  font-family: var(--f-num); font-size: .8rem; line-height: 1.7;
  overflow-x: auto; white-space: pre;
}
pre.code .c { color: var(--night-muted); }
pre.code .k { color: var(--accent-bright); }
pre.code .s { color: var(--live-bright); }

/* Language tabs over a code block: the shared .tabs underline, one pane. */
.code-tabs { margin: 0 0 var(--s-5); }
.code-tabs [role="tablist"] { display: flex; gap: var(--s-4); border-bottom: 1px solid var(--line);
                              margin-bottom: var(--s-3); }
.code-tabs [role="tab"] {
  appearance: none; background: none; border: 0; padding: 6px 0; margin-bottom: -1px; cursor: pointer;
  font: 600 .72rem/1 var(--f-num); letter-spacing: .12em; text-transform: uppercase; color: var(--muted);
  border-bottom: 2px solid transparent;
}
.code-tabs [role="tab"][aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); }
.code-tabs [role="tabpanel"][hidden] { display: none; }
.code-tabs pre.code { margin-bottom: 0; }

/* Verbs and paths. */
.verb {
  display: inline-block; min-width: 3.6rem; text-align: center;
  padding: 3px 6px; border-radius: 6px;
  font: 600 .66rem/1.2 var(--f-num); letter-spacing: .12em; text-transform: uppercase;
  background: var(--info-soft); color: var(--ink-2);
}
.verb.is-post { background: var(--accent-soft); color: var(--accent); }
.verb.is-patch, .verb.is-put { background: var(--warning-soft); color: var(--warning); }
.verb.is-delete { background: var(--danger-soft); color: var(--danger); }
.path { font-family: var(--f-num); font-size: .88rem; color: var(--ink); word-break: break-all; }

/* Cards: a grid of doors into the docs. */
.dev-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: var(--s-4);
             margin: 0 0 var(--s-6); }
.dev-card {
  display: block; padding: var(--s-4) var(--s-5); border: 1px solid var(--line); border-radius: var(--r-card);
  background: var(--surface); text-decoration: none; color: inherit;
  transition: border-color var(--t-state) var(--ease);
}
.dev-card:hover { border-color: var(--accent-line); }
.dev-card .eyebrow { margin-bottom: var(--s-2); }
.dev-card strong { display: block; color: var(--ink); font-size: 1.02rem; margin-bottom: 4px; }
.dev-card span { color: var(--ink-soft); font-size: .92rem; line-height: 1.5; }
.dev-body .dev-card { text-decoration: none; }

/* The reference: one row per operation. */
.op { border-top: 1px solid var(--line); padding: var(--s-5) 0; scroll-margin-top: var(--s-5); }
.op-head { display: flex; gap: var(--s-3); align-items: baseline; flex-wrap: wrap; }
.op-head h3 { margin: 0; font-size: 1.02rem; }
.op-meta { display: flex; gap: var(--s-2); flex-wrap: wrap; margin: var(--s-2) 0 var(--s-3); }
.op-meta .tag { font-family: var(--f-num); font-size: .66rem; letter-spacing: .08em; }
.fields { font-size: .9rem; }
.fields td:first-child { width: 34%; }
.req { color: var(--accent); font-family: var(--f-num); font-size: .7rem; letter-spacing: .08em;
       text-transform: uppercase; }

.dev-steps { counter-reset: step; list-style: none; padding: 0; }
.dev-steps > li { counter-increment: step; position: relative; padding-left: 2.6rem; margin-bottom: var(--s-6); }
.dev-steps > li::before {
  content: counter(step); position: absolute; left: 0; top: .1rem;
  width: 1.8rem; height: 1.8rem; border-radius: 50%; border: 1px solid var(--line-strong);
  display: grid; place-items: center; font: 600 .78rem/1 var(--f-num); color: var(--ink-2);
}
.dev-steps > li > h3 { margin-top: 0; }

.dev-foot-nav { display: flex; justify-content: space-between; gap: var(--s-4); margin-top: var(--s-8);
                padding-top: var(--s-5); border-top: 1px solid var(--line); }
.dev-foot-nav a { color: var(--accent); text-decoration: none; font-weight: 600; }
