/* Reduce excessive vertical spacing in article content. */
article .typography h2 {
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

article .typography h3 {
  margin-top: 1.1rem;
  margin-bottom: 0.4rem;
}

article .typography p,
article .typography ul,
article .typography ol,
article .typography pre,
article .typography table,
article .typography blockquote {
  margin-top: 0.6rem;
}

article .typography li + li {
  margin-top: 0.2rem;
}

/* Compact code blocks with shadcn-like styling. */
article .typography pre {
  position: relative;
  margin-top: 0.6rem;
  padding: 0.75rem 3.5rem 0.75rem 0.9rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background-color: var(--color-code);
  color: var(--color-code-foreground);
  font-size: 0.6em;
  line-height: 1.45;
  overflow: auto;
}

article .typography pre code {
  background: transparent;
  padding: 0;
}

article .typography .code-copy-button {
  position: absolute;
  top: 0.45rem;
  right: 0.45rem;
  height: 1.55rem;
  min-width: 3rem;
  padding: 0 0.55rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background-color: var(--color-secondary);
  color: var(--color-secondary-foreground);
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
}

article .typography .code-copy-button:hover {
  background-color: var(--color-accent);
  color: var(--color-accent-foreground);
}

article .typography .code-copy-button:focus-visible {
  outline: 2px solid var(--color-ring);
  outline-offset: 2px;
}

article .typography pre.is-copied .code-copy-button {
  background-color: var(--color-primary);
  color: var(--color-primary-foreground);
}

/* Hide default mkdocs-shadcn footer attribution. */
footer .text-muted-foreground.w-full.text-center.text-xs.leading-loose.sm\:text-sm {
  display: none;
}

/* Header badge showing the total script count from docs navigation links. */
.script-total-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 1.75rem;
  padding: 0 0.65rem;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background-color: var(--color-secondary);
  color: var(--color-secondary-foreground);
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}

@media (max-width: 767px) {
  .script-total-badge {
    display: none;
  }
}
