/* Void Markdown — Code Blocks */

.void-md div[class*='language-'] {
  position: relative;
  margin: 1em 0;
  border-radius: 8px;
  overflow: hidden;
  background: var(--vmd-bg-soft, #f8fafc);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .void-md div[class*='language-'] {
    background: #1e293b;
  }
}

:root[data-theme='dark'] .void-md div[class*='language-'] {
  background: #1e293b;
}

.void-md div[class*='language-'] pre {
  margin: 0;
  padding: 1.25em 1.5em;
  overflow-x: auto;
  background: transparent;
}

.void-md div[class*='language-'] code {
  font-family: var(--vmd-font-mono, ui-monospace, 'Cascadia Code', Menlo, monospace);
  font-size: 0.875em;
  line-height: 1.7;
  display: block;
  width: fit-content;
  min-width: 100%;
}

/* Language label */
.void-md div[class*='language-'] .lang {
  position: absolute;
  top: 0.5em;
  right: 3em;
  font-size: 0.75em;
  font-weight: 500;
  color: var(--vmd-text-muted, #94a3b8);
  pointer-events: none;
  text-transform: uppercase;
}

/* Copy button */
.void-md div[class*='language-'] .copy {
  position: absolute;
  top: 0.5em;
  right: 0.5em;
  width: 2em;
  height: 2em;
  border: 1px solid var(--vmd-border, #e2e8f0);
  border-radius: 4px;
  background: var(--vmd-bg-soft, #f8fafc);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s;
}

.void-md div[class*='language-']:hover .copy {
  opacity: 1;
}

.void-md div[class*='language-'] .copy::before {
  content: '';
  display: block;
  width: 100%;
  height: 100%;
  background: currentColor;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Crect x='9' y='9' width='13' height='13' rx='2'/%3E%3Cpath d='M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1'/%3E%3C/svg%3E")
    center / 60% no-repeat;
}

/* Shiki dual theme — keep inline light colors, only swap in dark mode */
.void-md pre.shiki.shiki-themes {
  background-color: var(--shiki-light-bg, #fff) !important;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .void-md pre.shiki.shiki-themes {
    background-color: var(--shiki-dark-bg, #1e293b) !important;
    color: var(--shiki-dark, #e1e4e8) !important;
  }

  :root:not([data-theme='light']) .void-md pre.shiki.shiki-themes span[style*='--shiki-dark'] {
    color: var(--shiki-dark) !important;
  }
}

:root[data-theme='dark'] .void-md pre.shiki.shiki-themes {
  background-color: var(--shiki-dark-bg, #1e293b) !important;
  color: var(--shiki-dark, #e1e4e8) !important;
}

:root[data-theme='dark'] .void-md pre.shiki.shiki-themes span[style*='--shiki-dark'] {
  color: var(--shiki-dark) !important;
}

/* Shiki notation transformers */
.void-md pre .diff.add {
  background: rgba(16, 185, 129, 0.14);
}

.void-md pre .diff.add::before {
  content: '+';
  position: absolute;
  left: 0.5em;
  color: #10b981;
}

.void-md pre .diff.remove {
  background: rgba(239, 68, 68, 0.14);
  opacity: 0.7;
}

.void-md pre .diff.remove::before {
  content: '-';
  position: absolute;
  left: 0.5em;
  color: #ef4444;
}

.void-md pre .diff {
  position: relative;
  padding-left: 2em;
  margin: 0 -1.5em;
  padding-right: 1.5em;
}

.void-md pre .highlighted {
  background: rgba(99, 102, 241, 0.1);
  margin: 0 -1.5em;
  padding: 0 1.5em;
  display: inline-block;
  width: calc(100% + 3em);
}

.void-md pre .highlighted.warning {
  background: rgba(234, 179, 8, 0.14);
}

.void-md pre .highlighted.error {
  background: rgba(239, 68, 68, 0.14);
}

.void-md pre .has-focus .line:not(.focused) {
  opacity: 0.4;
  transition: opacity 0.3s;
}

.void-md pre:hover .has-focus .line:not(.focused) {
  opacity: 1;
}

/* Line numbers */
.void-md div[class*='language-'].line-numbers-mode {
  padding-left: 2.5em;
}

.void-md .line-numbers-wrapper {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 2.5em;
  padding: 1.25em 0;
  text-align: center;
  font-family: var(--vmd-font-mono, monospace);
  font-size: 0.875em;
  line-height: 1.7;
  color: var(--vmd-text-muted, #94a3b8);
  border-right: 1px solid var(--vmd-border, #e2e8f0);
  background: var(--vmd-bg-soft, #f8fafc);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .void-md .line-numbers-wrapper {
    background: #1e293b;
  }
}

:root[data-theme='dark'] .void-md .line-numbers-wrapper {
  background: #1e293b;
}
