/**
 * <CodeBlock> — vanilla component kit primitive.
 *
 * Monospace block on --bg-secondary fill with optional copy button.
 *
 * Markup:
 *   <div class="c-code">
 *     <pre class="c-code__pre"><code>{ "mcpServers": { ... } }</code></pre>
 *     <button type="button" class="c-code__copy" data-copy-source="self">Copy</button>
 *   </div>
 *
 * `data-copy-source="self"` (default) copies the <pre>'s textContent.
 * `data-copy-source="#some-id"` copies the textContent of that element instead.
 */

.c-code {
  position: relative;
  display: block;
  background: var(--bg-secondary);
  border: 0.5px solid var(--border-tertiary);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
}

.c-code__pre {
  margin: 0;
  padding: 0;
  font-family: var(--font-mono);
  font-size: var(--font-size-mono);
  line-height: 1.5;
  color: var(--text-primary);
  white-space: pre;
  overflow-x: auto;
}

.c-code__copy {
  position: absolute;
  top: var(--space-2);
  right: var(--space-2);
  height: 24px;
  padding: 0 var(--space-2);
  font-family: inherit;
  font-size: var(--font-size-micro);
  font-weight: 500;
  color: var(--text-primary);
  background: var(--bg-primary);
  border: 0.5px solid var(--border-secondary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.c-code__copy:hover {
  background: var(--bg-tertiary);
}

.c-code__copy:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.c-code__copy[data-copied="true"] {
  background: var(--success-bg);
  color: var(--success-text);
  border-color: var(--success-text);
}
