/* ====================================================
   restapi.wtf — shared component patterns.

   Wizards / pickers / reference lists / detail pages.
   All selectors restyled to match the editorial trade-press
   aesthetic in styles-base.css. Token-driven; no hardcoded
   colors except for the good/bad accents.

   Loaded AFTER styles-base.css, BEFORE per-site styles.css.
   ==================================================== */

/* ---------- Picker intro paragraph ---------- */

.picker-intro {
  color: var(--fg-soft);
  margin: 0 0 32px;
  max-width: 60ch;
  font-size: 17px;
  line-height: 1.6;
}

/* ---------- Crumbs (Back / Start over) ---------- */

.crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 24px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-muted);
}
.crumbs button {
  appearance: none;
  background: transparent;
  border: 0;
  color: var(--fg-muted);
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  cursor: pointer;
  padding: 2px 6px;
  border-bottom: 1px solid transparent;
  transition: color 180ms, border-color 180ms;
}
.crumbs button:hover { color: var(--accent); border-bottom-color: var(--accent); }
.crumbs .sep { color: var(--fg-subtle); }

/* ---------- Question / choice (used by every wizard / picker) ---------- */

.question { margin-bottom: 40px; }
.question h2 {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin: 0 0 18px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.question h2::before {
  content: "";
  display: inline-block;
  width: 28px;
  height: 1px;
  background: var(--accent);
}
.question h3 {
  font-family: var(--serif);
  font-size: clamp(28px, 3.4vw, 38px);
  font-weight: 400;
  font-style: italic;
  letter-spacing: -0.014em;
  line-height: 1.1;
  margin: 0 0 28px;
  color: var(--fg);
  max-width: 28ch;
}

.choices {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--border);
}
.choice {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  color: var(--fg);
  border: 0;
  border-bottom: 1px solid var(--border);
  padding: 22px 0;
  font: inherit;
  font-size: 17px;
  cursor: pointer;
  position: relative;
  transition: padding-left 200ms cubic-bezier(.2,.7,.2,1), color 180ms;
}
.choice::before {
  content: "→";
  position: absolute;
  left: 0;
  top: 22px;
  font-family: var(--mono);
  color: var(--accent);
  opacity: 0;
  transform: translateX(-8px);
  transition: opacity 180ms, transform 200ms cubic-bezier(.2,.7,.2,1);
}
.choice:hover {
  padding-left: 32px;
  color: var(--fg);
}
.choice:hover::before {
  opacity: 1;
  transform: translateX(0);
}
.choice-title { font-weight: 500; font-size: 17px; color: var(--fg); }
.choice-hint {
  display: block;
  margin-top: 6px;
  color: var(--fg-muted);
  font-size: 14px;
  line-height: 1.55;
  max-width: 60ch;
}

/* ---------- Small utility classes ---------- */

.small { font-size: 13px; }
.detail-back {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-bottom: 28px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid transparent;
  padding-bottom: 1px;
  transition: color 180ms, border-color 180ms;
}
.detail-back:hover { color: var(--accent); border-bottom-color: var(--accent); text-decoration: none; }
.detail-back::before { content: "←"; }

/* ---------- Reference list (browse mode pattern) ---------- */

.ref-section { margin-bottom: 48px; }
.ref-section h2 {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin: 0 0 16px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.ref-section h2::before {
  content: "";
  display: inline-block;
  width: 28px;
  height: 1px;
  background: var(--accent);
}
.ref-list {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--border);
}
.ref-row {
  display: block;
  padding: 18px 0 18px 4px;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: var(--fg);
  text-decoration: none;
  position: relative;
  transition: padding-left 200ms cubic-bezier(.2,.7,.2,1), color 180ms;
}
.ref-row::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0; bottom: 0;
  width: 2px;
  background: var(--accent);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 220ms cubic-bezier(.2,.7,.2,1);
}
.ref-row:hover {
  padding-left: 18px;
  text-decoration: none;
}
.ref-row:hover::before {
  transform: scaleY(1);
}
.ref-row-title {
  font-weight: 500;
  font-size: 17px;
  margin-bottom: 6px;
  color: var(--fg);
}
.ref-row-summary {
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--fg-soft);
  max-width: 70ch;
}

/* ---------- Detail page header ---------- */

.detail-head { margin-bottom: 32px; }
.detail-head h1 {
  font-family: var(--serif);
  margin: 0 0 16px;
  font-size: clamp(40px, 5.4vw, 64px);
  font-weight: 400;
  line-height: 1.0;
  letter-spacing: -0.022em;
  display: flex;
  align-items: baseline;
  gap: 18px;
  flex-wrap: wrap;
  color: var(--fg);
}
.detail-head h1 em { font-style: italic; color: var(--accent); }

.category-pill {
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--fg-muted);
  background: transparent;
  border: 1px solid var(--border-hi);
  padding: 4px 10px;
  font-weight: 500;
  vertical-align: middle;
}

/* ---------- Section list rows (inside .detail-section) ---------- */

.detail-section ul {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--border);
}
.detail-section li {
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  line-height: 1.55;
  color: var(--fg-soft);
}
.detail-section li strong { color: var(--fg); font-weight: 600; }
.detail-section li .hint {
  font-size: 14px;
  color: var(--fg-muted);
  margin-top: 6px;
}

/* ---------- Good / Bad code examples grid ---------- */

.good-bad-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 720px) {
  .good-bad-grid { grid-template-columns: 1fr; }
}
.good-bad-cell {
  border: 1px solid var(--border);
  background: var(--bg-elev);
  padding: 16px 18px;
  border-left: 3px solid var(--border-hi);
}
.good-bad-cell.good { border-left-color: #3aa063; }
.good-bad-cell.bad  { border-left-color: #cf222e; }
.good-bad-label {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  margin-bottom: 10px;
}
.good-bad-cell.good .good-bad-label { color: #3aa063; }
.good-bad-cell.bad  .good-bad-label { color: #cf222e; }

/* Generic preformatted code block. */
.code-block {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.65;
  white-space: pre;
  overflow-x: auto;
  color: var(--fg);
  font-family: var(--mono);
}

/* ---------- Multi-view card (contested topics) ---------- */

.view-card {
  border: 1px solid var(--border);
  background: var(--bg-elev);
  padding: 18px 20px;
  margin-bottom: 14px;
}
.view-card .who {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}
.view-card .stance {
  color: var(--fg-soft);
  font-size: 15.5px;
  line-height: 1.55;
}

.topic-head h1 {
  font-family: var(--serif);
  margin: 0 0 14px;
  font-size: clamp(40px, 5.4vw, 64px);
  font-weight: 400;
  line-height: 1.0;
  letter-spacing: -0.022em;
}
.topic-guidance {
  margin-top: 32px;
  padding: 18px 20px;
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  color: var(--fg);
}
.topic-guidance h2 {
  font-family: var(--mono);
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
}

/* ---------- Cross-link chips (e.g. linking to status codes) ---------- */

.status-link-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.status-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border: 1px solid var(--border-hi);
  background: transparent;
  font-size: 12.5px;
  text-decoration: none;
  color: var(--fg-soft);
  font-family: var(--mono);
  letter-spacing: 0.06em;
  transition: color 180ms, border-color 180ms;
}
.status-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}
