/*<!--section:docs-->

The `<pre><code>` blocks are Prism-compatible and support captions via `data-caption="..."` attribute:

```treeview {data-caption="Blades CSS ships:"}
/css/
├── blades.css  (Pico CSS successor)
├── blades.ninja.css  (experimental add-ons)
└── pico.css  (underlying fork)
```

Preformatted blocks:

```
stay untouched by Prism themes.
```

<!--section:code-->
```css */
pre {
  @media (width < 768px) {
    border-radius: 0;
  }
  /* Override Prism theme background in dark scheme (!important beats
     Prism's `pre[class*="language-"]` and unlayered CSS when layered) */
  &:has(code) {
    @media (prefers-color-scheme: dark) {
      &:where(:not([data-theme], [data-theme] *)) {
        background: var(--pico-code-background-color) !important;
      }
    }
    &:where([data-theme="dark"], [data-theme="dark"] *) {
      background: var(--pico-code-background-color) !important;
    }
  }
}

code {
  /* Code block caption via data-attr (to display filename, etc.) */
  &[data-caption] {
    &::before {
      content: attr(data-caption);
      display: block;
      margin-bottom: 1rem;
      opacity: 50%;
      font-style: italic;
    }
  }
}
