/* Pyfun-specific styling on top of the mdBook themes. */

/* The escape hatches (`mut`, `<-`, `extern`) are tinted amber, matching the
   convention the editor extensions use: visible, deliberate, slightly warm. */
:root {
  --pyfun-escape: #b45309; /* readable amber on the light themes */
  --pyfun-hole: #8250df;   /* typed holes: violet on light themes */
}
.navy,
.coal,
.ayu {
  --pyfun-escape: #e0af68;
  --pyfun-hole: #c792ea;
}

code .hljs-pyfun-escape {
  color: var(--pyfun-escape);
  font-weight: 600;
}

code .hljs-pyfun-hole {
  color: var(--pyfun-hole);
  font-weight: 600;
}

/* Runnable code blocks (docs-run.js progressive enhancement). */
.pyfun-run-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: -8px 0 12px;
}
.pyfun-run-btn {
  font: inherit;
  font-size: 0.85em;
  font-weight: 600;
  padding: 2px 12px;
  border: 1px solid var(--theme-popup-border, #ccc);
  border-radius: 6px;
  background: var(--theme-hover, #f2f2f2);
  color: inherit;
  cursor: pointer;
}
.pyfun-run-btn:hover:not(:disabled) {
  filter: brightness(0.95);
}
.pyfun-run-btn:disabled {
  opacity: 0.6;
  cursor: default;
}
.pyfun-run-hint {
  font-size: 0.75em;
  opacity: 0.6;
}
.pyfun-run-out {
  border-left: 3px solid #7ee787;
  padding: 8px 12px;
  font-size: 0.875em;
  white-space: pre-wrap;
  margin: 0 0 16px;
}
.pyfun-run-out.pyfun-run-err {
  border-left-color: #ff7b72;
}
code[contenteditable]:focus {
  outline: 1px solid var(--pyfun-hole);
  outline-offset: 2px;
}
