/* ====================================================
   shared components — patterns reused across all
   restapi.wtf sites. Loaded after styles-base.css.
   Each site's own styles.css can still override.
   ==================================================== */

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

.picker-intro {
  color: var(--fg-muted);
  margin: 0 0 24px;
  max-width: 65ch;
}

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

.crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
  font-size: 13px;
  color: var(--fg-muted);
}
.crumbs button {
  appearance: none;
  background: transparent;
  border: 0;
  color: var(--fg-muted);
  font: inherit;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
}
.crumbs button:hover { background: var(--bg-elev); color: var(--fg); }
.crumbs .sep { color: var(--fg-subtle); }

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

.question { margin-bottom: 24px; }
.question h2 {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin: 0 0 10px;
}
.question h3 {
  font-size: 20px;
  font-weight: 600;
  margin: 0 0 16px;
  line-height: 1.35;
}

.choices { display: grid; gap: 8px; }
.choice {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--bg-elev);
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 14px 16px;
  font: inherit;
  cursor: pointer;
  min-height: 52px;
  transition: border-color 80ms, background 80ms;
}
.choice:hover { border-color: var(--border-strong); }
.choice-title { font-weight: 500; }
.choice-hint {
  display: block;
  margin-top: 4px;
  color: var(--fg-muted);
  font-size: 13px;
}

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

.small { font-size: 13px; }
.detail-back { font-size: 14px; margin-bottom: 16px; display: inline-block; }

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

.ref-section { margin-bottom: 28px; }
.ref-section h2 {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin: 0 0 12px;
}
.ref-list { display: grid; gap: 8px; }
.ref-row {
  display: block;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--bg);
  color: var(--fg);
  text-decoration: none;
  transition: border-color 80ms;
}
.ref-row:hover {
  border-color: var(--border-strong);
  background: var(--bg-elev);
  text-decoration: none;
}
.ref-row-title { font-weight: 500; margin-bottom: 4px; }
.ref-row-summary { font-size: 13px; line-height: 1.5; color: var(--fg-muted); }

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

.detail-head { margin-bottom: 16px; }
.detail-head h1 {
  margin: 0 0 12px;
  font-size: 26px;
  font-weight: 600;
  line-height: 1.3;
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}
.category-pill {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg-muted);
  background: var(--bg-elev);
  border: 1px solid var(--border);
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 500;
}

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

.detail-section ul { margin: 0; padding: 0; list-style: none; }
.detail-section li {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.detail-section li:last-child { border-bottom: 0; }
.detail-section li .hint {
  font-size: 13px;
  color: var(--fg-muted);
  margin-top: 4px;
}

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

.good-bad-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 720px) {
  .good-bad-grid { grid-template-columns: 1fr; }
}
.good-bad-cell {
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 12px;
}
.good-bad-cell.good { border-left: 3px solid #2da44e; }
.good-bad-cell.bad  { border-left: 3px solid #cf222e; }
.good-bad-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}
.good-bad-cell.good .good-bad-label { color: #2da44e; }
.good-bad-cell.bad  .good-bad-label { color: #cf222e; }

/* Generic preformatted code block. */
.code-block {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
  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);
  border-radius: var(--r);
  padding: 14px 16px;
  margin-bottom: 12px;
  background: var(--bg);
}
.view-card .who { font-weight: 600; margin-bottom: 6px; }
.view-card .stance { color: var(--fg-muted); }

.topic-head h1 {
  margin: 0 0 8px;
  font-size: 26px;
  font-weight: 600;
  line-height: 1.3;
}
.topic-guidance {
  margin-top: 24px;
  padding: 14px 16px;
  border-left: 3px solid var(--accent);
  background: var(--bg-elev);
  border-radius: 0 var(--r) var(--r) 0;
}
.topic-guidance h2 {
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-muted);
}

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

.status-link-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.status-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--bg-elev);
  font-size: 13px;
  text-decoration: none;
  color: var(--fg);
  font-family: var(--mono);
}
.status-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}

/* ---------- Sibling-sites footer strip ---------- */

.sibling-sites {
  font-family: var(--mono);
  font-size: 13px;
}
.sibling-sites a { color: var(--fg-muted); }
.sibling-sites a[aria-current="page"] {
  color: var(--fg);
  font-weight: 600;
  text-decoration: none;
  cursor: default;
}
.sibling-sites a[aria-current="page"]:hover { text-decoration: none; }
