/* The site's own CSS, on top of kerf.css. Checked by Kerf like any .css file. */

/* Copy buttons on code blocks (added by _partials/code.html). */
.code {
  position: relative;
}
.code > button {
  position: absolute;
  top: var(--k-space-8);
  right: var(--k-space-8);
  padding: var(--k-space-4) var(--k-space-8);
  font-size: var(--k-text-sm);
  min-height: 0;
}
.code > pre {
  margin: 0;
}
/* Scrolling blocks and tables take focus, so the keyboard can scroll them. */
.code > pre:focus-visible,
.k-scroll:focus-visible {
  outline: 2px solid var(--k-accent);
  outline-offset: 2px;
}

/* "On this page" (added by postbuild.mjs) and the footer links: links in a
   nav are 44px tall, so wrapped rows need no gap of their own. */
nav[aria-label="On this page"] {
  margin-top: var(--k-space-16);
}
nav[aria-label="On this page"] ul,
nav[aria-label="More"] ul {
  row-gap: 0;
}

/* Prompts on Work with AI are prose: wrap them instead of scrolling, and
   start below the Copy button, which would cover a wrapped first line. */
pre.prompt {
  white-space: pre-wrap;
  padding-top: var(--k-space-48);
}

/* The playground: the preview frame and the markup box are as tall as each
   other side by side, and the preview is a full-width box on a phone. */
#preview {
  width: 100%;
  height: 26rem;
  background: var(--k-bg);
}
#code {
  min-height: 26rem;
  resize: vertical;
}
