/* developers.css — /Developers, the Dealer API reference (261201/004).
 * Three columns on a wide screen: the section list, the explanation, and a dark panel with the request and
 * the answer. The code panels use the site's dark "chrome" colours in both themes. Loaded on that page only. */

.dev-layout { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 44px; align-items: start; margin-bottom: 60px; }

.dev-nav { position: sticky; top: 18px; max-height: calc(100vh - 36px); overflow-y: auto; font-size: 13.5px; }
.dev-nav h2 { margin: 18px 0 6px; font: 700 12px var(--font-body); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.dev-nav h2:first-child { margin-top: 0; }
.dev-nav ul { margin: 0; padding: 0; list-style: none; }
.dev-nav a { display: block; padding: 5px 10px; border-left: 2px solid var(--line); color: var(--ink); text-decoration: none; }
.dev-nav a:hover { border-left-color: var(--muted); }
.dev-nav a[aria-current="true"] { border-left-color: var(--red); color: var(--red); font-weight: 600; }

.dev-section { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 44px; align-items: start; padding: 38px 0; border-top: 1px solid var(--line); scroll-margin-top: 12px; }
.dev-section:first-child { padding-top: 0; border-top: 0; }

.dev-text { font-size: 15px; line-height: 1.6; }
.dev-text h1 { margin: 4px 0 14px; }
.dev-text h2 { margin: 0 0 14px; font: 700 28px/1.1 var(--font-display); text-transform: uppercase; letter-spacing: .01em; }
.dev-text h3 { margin: 26px 0 4px; padding-bottom: 8px; border-bottom: 1px solid var(--line); font: 700 12px var(--font-body); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.dev-text p { margin: 0 0 12px; }
.dev-text code { padding: 1px 5px; border-radius: 3px; background: var(--soft); border: 1px solid var(--line); font: 12.5px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; overflow-wrap: anywhere; }
.dev-note { padding: 10px 14px; border-left: 3px solid var(--red); background: var(--soft); font-size: 13.5px; }
.dev-endpoint { font: 600 14px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; overflow-wrap: anywhere; }
.dev-endpoint span { margin-right: 8px; padding: 2px 7px; border-radius: 3px; background: var(--green); color: var(--surface); font-size: 11.5px; letter-spacing: .04em; }

.dev-try { margin: -4px 0 12px; font-size: 13px; }

.dev-fields { margin: 0; }
.dev-field { padding: 12px 0; border-bottom: 1px solid var(--line); }
.dev-field:last-child { border-bottom: 0; }
.dev-field dt { margin-bottom: 3px; }
.dev-field dt code { padding: 0; border: 0; background: none; font-weight: 700; font-size: 13px; }
.dev-field dt span { margin-left: 6px; font-size: 12.5px; color: var(--muted); }
.dev-field dd { margin: 0; font-size: 14px; color: var(--ink); }

/* Sticky beside its text; a column taller than the window scrolls inside itself so its end stays reachable. */
.dev-code { position: sticky; top: 18px; display: grid; gap: 16px; min-width: 0; max-height: calc(100vh - 36px); overflow-y: auto; scrollbar-width: thin; }
/* color-scheme: the panels are dark in both themes, so their own scrollbars are too (seen 261201/014: white bars). */
.dev-panel { border: 1px solid var(--chrome-line); border-radius: var(--radius); background: var(--chrome-bg); color: var(--chrome-ink); overflow: hidden; color-scheme: dark; }
.dev-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 8px 12px; background: var(--chrome-panel); border-bottom: 1px solid var(--chrome-line); font-size: 12.5px; font-weight: 600; color: var(--chrome-muted); }
.dev-tabs { display: flex; gap: 2px; flex-wrap: wrap; }
.dev-tabs button { padding: 3px 9px; border: 0; border-radius: 3px; background: none; color: var(--chrome-muted); font: 600 12px var(--font-body); cursor: pointer; }
.dev-tabs button:hover { color: var(--chrome-ink); }
.dev-tabs button[aria-selected="true"] { background: var(--chrome-line); color: var(--chrome-ink); }
.dev-sample { position: relative; }
.dev-sample + .dev-sample { border-top: 1px solid var(--chrome-line); }
.dev-sample-label { display: block; padding: 8px 14px 0; font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--chrome-accent); }
/* No height limit on a block: the column already scrolls (one scrollbar, not one inside another). Code keeps
   its lines and scrolls sideways; an answer wraps, so a long value (a description, a picture link) is readable. */
.dev-sample pre { margin: 0; padding: 14px; overflow-x: auto; font: 12.5px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre; tab-size: 4; scrollbar-width: thin; }
.dev-panel-answer .dev-sample pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.dev-sample code { font: inherit; color: inherit; background: none; border: 0; padding: 0; }
.dev-copy { position: absolute; top: 8px; right: 8px; padding: 3px 9px; border: 1px solid var(--chrome-line); border-radius: 3px; background: var(--chrome-panel); color: var(--chrome-muted); font: 600 11.5px var(--font-body); cursor: pointer; opacity: 0; transition: opacity .12s; }
.dev-sample:hover .dev-copy, .dev-copy:focus-visible { opacity: 1; }
.dev-copy:hover { color: var(--chrome-ink); }

/* With script (developers.js marks <html>): one language at a time, chosen by the tabs. */
.dev-js [data-dev-samples] .dev-sample:not(.is-on) { display: none; }
.dev-js [data-dev-samples] .dev-sample-label { display: none; }

.dev-foot { margin-top: 30px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }

@media (max-width: 1100px) {
  .dev-section { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .dev-code { position: static; max-height: none; overflow-y: visible; }
}
@media (max-width: 760px) {
  .dev-layout { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .dev-nav { position: static; max-height: none; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
  .dev-nav ul { display: flex; flex-wrap: wrap; gap: 2px 4px; }
  .dev-nav a { border-left: 0; border-bottom: 2px solid transparent; padding: 4px 8px; }
  .dev-nav a[aria-current="true"] { border-bottom-color: var(--red); }
  .dev-copy { opacity: 1; }
}
@media (prefers-reduced-motion: no-preference) {
  html:has(.dev-layout) { scroll-behavior: smooth; }
}
