/* Syntax highlighting for code blocks */
code[data-theme*=" "],
code[data-theme*=" "] span {
  color: var(--shiki-light);
  background-color: var(--shiki-light-bg);
}

@media (prefers-color-scheme: dark) {
  code[data-theme*=" "],
  code[data-theme*=" "] span {
    color: var(--shiki-dark);
    background-color: var(--shiki-dark-bg);
  }
}

/* Code block styling - keep these as they enhance Tailwind Typography */
[data-rehype-pretty-code-figure] {
  position: relative;
  margin-top: 1.5rem;
  margin-bottom: 1rem;
}

[data-rehype-pretty-code-figure] code {
  display: grid;
  min-width: 100%;
  overflow-wrap: break-word;
  border-radius: 0px;
  border-width: 0px;
  background-color: transparent;
  padding: 0px;
  counter-reset: line;
  -webkit-box-decoration-break: clone;
          box-decoration-break: clone;
}

[data-line] {
  display: inline-block;
  min-height: 1rem;
  width: 100%;
  padding-left: 1rem;
  padding-right: 1rem;
  padding-top: 0.125rem;
  padding-bottom: 0.125rem;
}

[data-line-numbers] > [data-line]::before {
  font-size: 0.75rem;
  line-height: 1rem;
  color: hsl(var(--muted-foreground));
  counter-increment: line;
  content: counter(line);
  display: inline-block;
  width: 1rem;
  margin-right: 1.5rem;
  text-align: right;
}

[data-highlighted-line] {
  background-color: rgb(82 82 91 / 0.5);
}

[data-highlighted-chars] span {
  position: relative;
}

[data-highlighted-chars] {
  border-radius: calc(var(--radius) - 4px);
  background-color: rgb(82 82 91 / 0.5);
  padding: 0.25rem;
  color: hsl(var(--foreground));
}

[data-rehype-pretty-code-title] {
  margin-top: 0.75rem;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
  padding-left: 1rem;
  padding-right: 1rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 500;
}

/* Steps component - work with prose instead of overriding it */
.mdx .steps {
  margin-left: 1rem;
  border-left-width: 1px;
  border-color: hsl(var(--muted-foreground) / 0.3);
  padding-left: 2rem;
  counter-reset: step;
}

.mdx .steps > h3 {
  position: relative;
  counter-increment: step;
}

.mdx .steps > h3::before {
  position: absolute;
  left: -2.5rem;
  top: 0px;
  display: flex;
  height: 2rem;
  width: 2rem;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  background-color: hsl(var(--primary));
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 700;
  color: hsl(var(--primary-foreground));
  content: counter(step);
}

