/* ═══════════════════════════════════════════════════════════════════
   VS Code-Style Code Blocks  (MIT — hand-written, no framework)
   Designed for inkeybit glassmorphic dark theme
   ═══════════════════════════════════════════════════════════════════ */

/* ── Editor wrapper ────────────────────────────────────────────── */
.vscode-editor {
  position: relative;
  margin: 1.8rem 0;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(255, 255, 255, 0.04) inset;
  font-family: 'Cascadia Code', 'Fira Code', 'JetBrains Mono', 'Consolas', 'Monaco', 'Courier New', monospace;
  font-size: 0.875rem;
  line-height: 1.65;
  background: #1e1e1e;
  transition: box-shadow 0.3s ease;
}
.vscode-editor:hover {
  box-shadow:
    0 12px 48px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(0, 210, 255, 0.12) inset;
}

/* ── Title bar ─────────────────────────────────────────────────── */
.vscode-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  height: 36px;
  background: #252526;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  user-select: none;
  -webkit-user-select: none;
}

/* Traffic-light dots */
.vscode-dots {
  display: flex;
  gap: 7px;
  align-items: center;
}
.vscode-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
}
.vscode-dot.red    { background: #ff5f56; }
.vscode-dot.yellow { background: #ffbd2e; }
.vscode-dot.green  { background: #27c93f; }

/* Language label */
.vscode-lang {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: rgba(255, 255, 255, 0.45);
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

/* Copy button */
.vscode-copy-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  font-size: 0.72rem;
  font-weight: 500;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: rgba(255, 255, 255, 0.55);
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  line-height: 1;
}
.vscode-copy-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}
.vscode-copy-btn.copied {
  color: #4ec9b0;
  border-color: rgba(78, 201, 176, 0.3);
  background: rgba(78, 201, 176, 0.08);
}
.vscode-copy-btn svg {
  width: 13px;
  height: 13px;
  fill: currentColor;
  flex-shrink: 0;
}

/* ── Code body (pre + code) ────────────────────────────────────── */
.vscode-editor .vscode-body {
  display: flex;
  overflow-x: auto;
  overflow-y: auto;
  max-height: 600px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.15) transparent;
}
.vscode-editor .vscode-body::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
.vscode-editor .vscode-body::-webkit-scrollbar-track {
  background: transparent;
}
.vscode-editor .vscode-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}
.vscode-editor .vscode-body::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* Line numbers gutter */
.vscode-line-numbers {
  display: flex;
  flex-direction: column;
  padding: 16px 0;
  padding-right: 12px;
  padding-left: 16px;
  text-align: right;
  color: rgba(255, 255, 255, 0.2);
  font-size: 0.8rem;
  line-height: 1.65;
  user-select: none;
  -webkit-user-select: none;
  flex-shrink: 0;
  background: #1e1e1e;
  border-right: 1px solid rgba(255, 255, 255, 0.04);
}
.vscode-line-numbers span {
  min-width: 2ch;
}

/* Override rouge/prism defaults inside wrapper */
.vscode-editor pre,
.vscode-editor pre.highlight {
  margin: 0 !important;
  padding: 16px 20px !important;
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  overflow: visible !important;
  flex: 1;
  min-width: 0;
}
.vscode-editor code,
.vscode-editor pre code {
  background: transparent !important;
  padding: 0 !important;
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  color: #d4d4d4;
  white-space: pre;
  word-break: normal;
  word-wrap: normal;
  tab-size: 4;
}

/* ── Inline code (outside code blocks) ─────────────────────────── */
.post-content code:not(pre code) {
  background: rgba(110, 118, 129, 0.25);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  font-size: 0.88em;
  font-family: 'Cascadia Code', 'Fira Code', 'Consolas', monospace;
  color: #e06c75;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

/* ═══════════════════════════════════════════════════════════════════
   Prism.js VS Code Dark+ Token Colors (MIT License)
   ═══════════════════════════════════════════════════════════════════ */

/* Base text */
code[class*="language-"],
pre[class*="language-"] {
  color: #d4d4d4;
  text-shadow: none;
}

/* Comments */
.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
  color: #6a9955;
  font-style: italic;
}

/* Punctuation */
.token.punctuation {
  color: #d4d4d4;
}

/* Namespace opacity */
.token.namespace {
  opacity: 0.7;
}

/* Strings */
.token.string,
.token.attr-value {
  color: #ce9178;
}

/* Property, tag, boolean, number, constant */
.token.property,
.token.tag,
.token.boolean,
.token.number,
.token.constant,
.token.symbol {
  color: #b5cea8;
}

/* Selector, attr-name, char, builtin */
.token.selector,
.token.attr-name,
.token.char,
.token.builtin {
  color: #d7ba7d;
}

/* Operators */
.token.operator {
  color: #d4d4d4;
}

/* Keywords */
.token.keyword {
  color: #569cd6;
}

/* Functions */
.token.function {
  color: #dcdcaa;
}

/* Regex, important, variable */
.token.regex,
.token.important,
.token.variable {
  color: #d16969;
}

/* Class name, type hints */
.token.class-name {
  color: #4ec9b0;
}

/* Important, bold */
.token.important,
.token.bold {
  font-weight: bold;
}

/* Italic */
.token.italic {
  font-style: italic;
}

/* Entity */
.token.entity {
  cursor: help;
}

/* Deleted */
.token.deleted {
  color: #ce9178;
}

/* Inserted */
.token.inserted {
  color: #b5cea8;
}

/* ── Special language tokens ───────────────────────────────────── */

/* Python */
.language-python .token.builtin { color: #4ec9b0; }
.language-python .token.decorator { color: #dcdcaa; }

/* JSON */
.language-json .token.property { color: #9cdcfe; }

/* CSS */
.language-css .token.property { color: #9cdcfe; }
.language-css .token.selector { color: #d7ba7d; }

/* HTML/markup */
.language-html .token.tag { color: #569cd6; }
.language-html .token.attr-name { color: #9cdcfe; }
.language-html .token.attr-value { color: #ce9178; }

/* Bash / Shell */
.language-bash .token.function { color: #dcdcaa; }
.language-bash .token.parameter { color: #9cdcfe; }

/* YAML */
.language-yaml .token.key { color: #9cdcfe; }
.language-yaml .token.value { color: #ce9178; }

/* ── Responsive adjustments ────────────────────────────────────── */
@media (max-width: 600px) {
  .vscode-editor {
    font-size: 0.78rem;
    margin: 1.2rem -0.5rem;
    border-radius: 8px;
  }
  .vscode-titlebar {
    height: 32px;
    padding: 0 10px;
  }
  .vscode-dot {
    width: 10px;
    height: 10px;
  }
  .vscode-lang {
    font-size: 0.65rem;
  }
  .vscode-copy-btn {
    font-size: 0.65rem;
    padding: 2px 7px;
  }
  .vscode-line-numbers {
    padding-left: 10px;
    padding-right: 8px;
    font-size: 0.72rem;
  }
  .vscode-editor pre,
  .vscode-editor pre.highlight {
    padding: 12px 14px !important;
  }
}

/* ── Remove default Rouge/Jekyll code block styles inside editor ── */
.vscode-editor .highlighter-rouge,
.vscode-editor div.highlight {
  background: transparent !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
}

/* ── Monospace font preload hint ───────────────────────────────── */
/* We use system monospace stack. For premium feel, load JetBrains Mono
   or Fira Code via Google Fonts. The stack fallback works great too. */
