/*
 * Veriko Docs — code-tabs (multi-language code sample).
 *
 * Tab switching is pure CSS: radio inputs + `:has()` scoped to the
 * `.code-tabs` instance (static classes `.r-<lang>`; the radio `name` is
 * per-instance so multiple blocks don't clash). No inline JS/styles → works
 * under the strict docs CSP. Syntax colors come from /styles/shiki.css.
 */

/* The figure is now a plain container — the bordered card lives in the
 * inner `.code-tabs__card` so the `.example-caption` title can sit above
 * it (outside the border), mirroring the response-table caption. The
 * `.example` border/overflow from markdoc.css is cancelled here. */
.code-tabs.example {
  margin: var(--space-6) 0;
  border: 0;
  border-radius: 0;
  overflow: visible;
}

.code-tabs__card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

/* "Petición" / "Request" title above the code card — same treatment as
 * the response-table caption (left, semibold, display font, with space).
 * Specificity (0,2,0) beats `.example figcaption` (0,1,1). */
.code-tabs > .example-caption {
  display: block;
  background: none;
  border: 0;
  padding: var(--space-2) 0;
  text-transform: none;
  letter-spacing: 0;
  font-family: var(--font-display);
  font-weight: var(--weight-semibold);
  font-size: var(--text-sm);
  color: var(--color-text);
}

.code-tabs__radio {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.code-tabs__bar {
  display: flex;
  gap: 0;
  background: var(--color-bg-subtle);
  border-bottom: 1px solid var(--color-border);
  overflow-x: auto;
}

.code-tabs__tab {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-2) var(--space-4);
  font-family: var(--font-display);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  color: var(--color-text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
  user-select: none;
  transition: color var(--transition-fast), border-color var(--transition-fast);
}

.code-tabs__tab:hover {
  color: var(--color-text);
}

.code-tabs__soon-dot {
  color: var(--color-text-subtle);
  font-size: 1.3em;
  line-height: 0;
}

.code-tabs__panel {
  display: none;
}

.code-tabs__panel pre {
  margin: 0;
  border: 0;
  border-radius: 0;
}

.code-tabs__placeholder {
  margin: 0;
  padding: var(--space-8) var(--space-4);
  text-align: center;
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  background: var(--color-bg-subtle);
}

/* Active panel + tab (scoped to the instance via :has). */
.code-tabs:has(.r-curl:checked) .code-tabs__panel--curl,
.code-tabs:has(.r-python:checked) .code-tabs__panel--python,
.code-tabs:has(.r-javascript:checked) .code-tabs__panel--javascript,
.code-tabs:has(.r-php:checked) .code-tabs__panel--php {
  display: block;
}

.code-tabs:has(.r-curl:checked) .code-tabs__tab--curl,
.code-tabs:has(.r-python:checked) .code-tabs__tab--python,
.code-tabs:has(.r-javascript:checked) .code-tabs__tab--javascript,
.code-tabs:has(.r-php:checked) .code-tabs__tab--php {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}

/* Keyboard focus surfaced on the label via the hidden radio. */
.code-tabs__radio:focus-visible + .code-tabs__bar .code-tabs__tab {
  outline: none;
}
