/* Numbering for sections */
body {
  counter-reset: h2-counter;
}

main > section > h2 {
  counter-increment: h2-counter;
  position: relative;
}

main > section > h2::before {
  content: counter(h2-counter) ". ";
  font-weight: bold;
  margin-right: 0.5rem;
  color: inherit;
}

aside nav a::before {
  display: none;
}

/* ✅ Fix flex child overflow */
main.flex-1 {
  min-width: 0; /* allows wrapping inside flex container */
}

/* ✅ Prevent code blocks from overflowing */
pre,
pre[class*="language-"] {
  white-space: pre-wrap;     /* wrap long lines but keep line breaks */
  overflow-x: auto;          /* horizontal scroll if still too wide */
  max-width: 100%;
  box-sizing: border-box;
}

/* ✅ Override Prism defaults */
pre code,
code[class*="language-"] {
  white-space: pre-wrap !important; /* force wrapping over Prism’s pre */
  overflow-wrap: anywhere;          /* break long URLs/tokens */
  word-break: break-word;           /* fallback */
}
