/* Improve code block look inside Typecho default theme */

/* Typecho default theme sets background on pre,code globally.
   Force Prism blocks to look consistent even if <pre> lacks language-*.
*/

/* Any <pre> that directly contains a code block with language-... */
pre:has(> code[class*="language-"]) {
  background: #2d2d2d;
  border-radius: 10px;
  padding: 14px 14px;
  font-size: 13px;
  line-height: 1.55;
  overflow: auto;
}

/* Fallback for browsers without :has() (Safari 15-/old). JS will add language-* to <pre>. */
pre[class*="language-"] {
  background: #2d2d2d;
  border-radius: 10px;
  padding: 14px 14px;
  font-size: 13px;
  line-height: 1.55;
  overflow: auto;
}

/* Keep inner code transparent so <pre> controls the background */
pre:has(> code[class*="language-"]) > code,
pre[class*="language-"] > code {
  background: transparent;
  color: inherit;
}

/* Make toolbar readable */
div.code-toolbar > .toolbar {
  opacity: 1;
}

div.code-toolbar > .toolbar .toolbar-item > button {
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12px;
}

/* Our edit textarea */
.typecho-code-editor {
  width: 100%;
  min-height: 160px;
  box-sizing: border-box;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 13px;
  line-height: 1.55;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.08);
  background: #1e1e1e;
  color: #e6e6e6;
}
