/* Shiki Syntax Highlighting - Modern Theme Integration */

/* Base code block styles - integrates with modern theme variables */
.shiki {
  padding: 1.5rem;
  border-radius: 0.75rem;
  overflow-x: auto;
  margin: 2rem 0;
  font-family: 'JetBrains Mono', 'Cascadia Code', 'Fira Code', Consolas, Monaco, 'Courier New', monospace;
  font-size: 0.875rem;
  line-height: 1.7;
  tab-size: 2;
  position: relative;
  border: 1px solid var(--border-color);
  transition: border-color 0.3s ease;
}

/* Apply theme colors based on data-theme attribute */
/* Light mode - use the inline CSS variables that Shiki generates */
[data-theme="light"] .shiki {
  background-color: #f6f8fa;
}

[data-theme="light"] .shiki span {
  color: var(--shiki-light) !important;
}

/* Dark mode - use the inline CSS variables that Shiki generates */
[data-theme="dark"] .shiki {
  background-color: #161b22;
}

[data-theme="dark"] .shiki span {
  color: var(--shiki-dark) !important;
}

/* Hover effect */
.shiki:hover {
  border-color: var(--primary);
}

/* Pre and code reset for Shiki */
.shiki pre {
  margin: 0;
  padding: 0;
  background: none;
  overflow-x: auto;
}

.shiki code {
  background: none;
  padding: 0;
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  color: inherit;
}

/* Line highlighting support */
.shiki .highlighted {
  background-color: var(--code-highlight-bg, rgba(255, 255, 255, 0.1));
  display: block;
  margin: 0 -1.5rem;
  padding: 0 1.5rem;
  width: calc(100% + 3rem);
  border-left: 3px solid var(--primary);
}

/* Line numbers (if enabled) */
.shiki[data-line-numbers] {
  position: relative;
  padding-left: 3.5rem;
}

.shiki .line-number {
  position: absolute;
  left: 0;
  width: 3rem;
  padding-right: 1rem;
  text-align: right;
  color: var(--muted);
  user-select: none;
  opacity: 0.5;
}

/* Inline code (not in code blocks) */
:not(pre) > code {
  background: var(--inline-code-bg, rgba(139, 191, 255, 0.1));
  color: var(--inline-code-text, #e96900);
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
  font-size: 0.875em;
  font-family: 'JetBrains Mono', 'Cascadia Code', 'Fira Code', Consolas, Monaco, 'Courier New', monospace;
}

/* Remove old Prism styles */
pre[class*="language-"],
code[class*="language-"] {
  /* Reset any Prism-specific styles */
  background: none;
  text-shadow: none;
}