/* Blog post extras on top of Tailwind's prose styles: code blocks and highlighted text. */

/* Code blocks: a light card with line numbers, Slack-style channel and mention pills,
   long lines wrapped with a hanging indent, and a copy button added by blog.js. */
.prose pre.bn-code {
  position: relative;
  margin: 1.75em 0;
  padding: 1.1em 3.25em 1.1em 0;
  background: #f6f5f1;
  color: #2f2d2a;
  border: 1px solid #ebe8e1;
  border-radius: 14px;
  font-size: 0.875rem;
  line-height: 1.75;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  counter-reset: bn-line;
}
.prose pre.bn-code code {
  display: block;
  padding: 0;
  background: none;
  color: inherit;
  font-size: inherit;
  font-weight: 400;
  white-space: inherit;
}
.prose pre.bn-code code::before,
.prose pre.bn-code code::after { content: none; }
.bn-code .bn-line {
  display: block;
  position: relative;
  min-height: 1.75em;
  padding-left: 3.4em;
  counter-increment: bn-line;
}
.bn-code .bn-line::before {
  content: counter(bn-line);
  position: absolute;
  left: 0;
  width: 2.4em;
  text-align: right;
  color: #bdb8ad;
  user-select: none;
}

/* Tokens (Pygments short class names). */
.bn-code .nf { color: #c2410c; font-weight: 600; }            /* /slash-command */
.bn-code .nt,
.bn-code .ni {                                                  /* #channel, @mention */
  color: #1264a3;
  background: rgba(29, 155, 209, 0.12);
  border-radius: 4px;
  padding: 0.05em 0.2em;
}
.bn-code .ni { color: #8a5a00; background: rgba(250, 204, 21, 0.28); }
.bn-code .nv {                                                  /* {workflow variable} */
  color: #6d28d9;
  background: rgba(139, 92, 246, 0.12);
  border-radius: 999px;
  padding: 0.05em 0.45em;
}
.bn-code .k { color: #4338ca; font-weight: 600; }               /* Trigger:, Step 1:, If */
.bn-code .s, .bn-code .s1, .bn-code .s2 { color: #047857; }     /* "quoted labels" */
.bn-code .c, .bn-code .c1, .bn-code .cm { color: #9b968c; font-style: italic; }
.bn-code .gu { color: #9b968c; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.8em; }
.bn-code .kd, .bn-code .kn { color: #be123c; }                  /* other languages */
.bn-code .mi, .bn-code .mf { color: #1d4ed8; }

.bn-copy {
  position: absolute;
  top: 0.7em;
  right: 0.7em;
  display: grid;
  place-items: center;
  width: 2em;
  height: 2em;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #a8a296;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.bn-copy:hover { background: #ebe8e1; color: #2f2d2a; }
.bn-copy[data-copied] { color: #047857; }
.bn-copy svg { width: 1.05em; height: 1.05em; }

/* ==Highlighted text==: a highlighter-pen stroke, slightly uneven at the ends. */
.prose mark {
  color: inherit;
  padding: 0.08em 0.3em;
  margin: 0 -0.1em;
  border-radius: 0.6em 0.25em 0.7em 0.3em;
  background: linear-gradient(100deg, rgba(253, 216, 53, 0) 0.5%, rgba(253, 216, 53, 0.9) 2.5%,
                              rgba(252, 211, 45, 0.75) 50%, rgba(253, 216, 53, 0.9) 96%, rgba(253, 216, 53, 0) 99.5%);
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

/* Citation markers: small numbers in the accent color, with a little room between neighbours. */
.prose sup.footnote-ref { font-size: 0.68em; line-height: 0; margin-left: 0.1em; }
.prose sup.footnote-ref + sup.footnote-ref { margin-left: 0.25em; }
.prose sup.footnote-ref a { text-decoration: none; font-weight: 600; color: #6366f1; }
.prose sup.footnote-ref a:hover { text-decoration: underline; }
