/* Source code presentation: inline `code` spans, the collapsible
 * org-src-container block toolbar (toggle/copy button), and syntax
 * highlighting (the GitHub Light token palette used by @wooorm/starry-night,
 * plus a same-palette fallback shown while it loads or if JS is
 * unavailable). */

:not(pre) > code {
  padding: 0.15em 0.35em;
  margin: 0 0.05em;
  border: 1px solid rgba(175, 184, 193, 0.2);
  border-radius: 0.375rem;
  background-clip: padding-box;
  color: #1f2328;
  background-color: rgba(175, 184, 193, 0.2);
  font-size: 85%;
  white-space: nowrap;
}

.org-src-container {
  position: relative;
  box-sizing: border-box;
  margin: 1.5rem auto;

  color: #1f2328;
  background: #f6f8fa;
  border: 1px solid #d0d7de;
  border-radius: 0.5rem;
  box-shadow: 0 1px 0 rgba(27, 31, 36, 0.04);

  font-family: "Jetbrains Mono", "LXGW Wenkai Mono", monospace;
  font-size: 0.875em;
  line-height: 1.55;
  overflow: hidden;
}
.org-code-toolbar {
  position: relative;
  z-index: 2;

  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 2.5rem;
  box-sizing: border-box;
  padding: 0.4rem 0.62rem;

  border-bottom: 1px solid #d8dee4;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.org-code-toggle,
.org-code-copy {
  min-height: 1.65rem;
  box-sizing: border-box;
  padding: 0.28rem 0.55rem;

  color: #57606a;
  background: transparent;
  border: 0;
  border-radius: 0.4rem;
  box-shadow: none;

  font: inherit;
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition:
    color 120ms ease,
    background-color 120ms ease;
}

.org-code-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
}

.org-code-toggle-indicator {
  width: 0;
  height: 0;
  border-top: 0.3rem solid transparent;
  border-bottom: 0.3rem solid transparent;
  border-left: 0.42rem solid currentColor;
  transform: rotate(90deg);
  transition: transform 180ms ease;
}

.org-code-toggle[aria-expanded="false"] .org-code-toggle-indicator {
  transform: rotate(0deg);
}

.org-code-content {
  display: grid;
  grid-template-rows: 1fr;
  opacity: 1;
  visibility: visible;
  transition:
    grid-template-rows 220ms ease,
    opacity 150ms ease,
    visibility 0s linear;
}

.org-code-content-inner {
  min-height: 0;
  overflow: hidden;
}

.org-src-container.is-collapsed .org-code-toolbar {
  border-bottom-color: transparent;
}

.org-src-container.is-collapsed .org-code-content {
  grid-template-rows: 0fr;
  opacity: 0;
  visibility: hidden;
  transition:
    grid-template-rows 220ms ease,
    opacity 150ms ease,
    visibility 0s linear 220ms;
}

.org-src-container > pre,
.org-code-content pre {
  box-sizing: border-box;
  min-width: 0;
  margin: 0;
  padding: 1rem;
  overflow: auto;

  color: inherit;
  background: transparent;
  border: 0;
  border-radius: inherit;
  font: inherit;
  line-height: inherit;
  tab-size: 2;
}
.org-src-container > pre:before,
.org-code-content pre:before {
  display: none !important;
}

.org-code-copy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 3.5rem;
  background: rgba(246, 248, 250, 0.92);
}

.org-code-toggle:hover,
.org-code-copy:hover {
  color: #1f2328;
  background: #eaeef2;
}

.org-code-toggle:active,
.org-code-copy:active {
  background: #d8dee4;
}

.org-code-toggle:focus-visible,
.org-code-copy:focus-visible {
  outline: 2px solid #0969da;
  outline-offset: 2px;
}

.org-code-copy-status {
  display: none;
}

.org-code-copy[data-copy-state="success"] .org-code-copy-label,
.org-code-copy[data-copy-state="error"] .org-code-copy-label {
  display: none;
}

.org-code-copy[data-copy-state="success"] .org-code-copy-status,
.org-code-copy[data-copy-state="error"] .org-code-copy-status {
  display: inline;
}

/* GitHub Light token palette used by @wooorm/starry-night. */
.pl-c {
  color: #59636e;
}
.pl-c1,
.pl-s .pl-v {
  color: #0550ae;
}
.pl-e,
.pl-en {
  color: #6639ba;
}
.pl-smi,
.pl-s .pl-s1 {
  color: #1f2328;
}
.pl-ent {
  color: #0550ae;
}
.pl-k {
  color: #cf222e;
}
.pl-s,
.pl-pds,
.pl-s .pl-pse .pl-s1,
.pl-sr,
.pl-sr .pl-cce,
.pl-sr .pl-sre,
.pl-sr .pl-sra {
  color: #0a3069;
}
.pl-v,
.pl-smw {
  color: #953800;
}
.pl-bu {
  color: #82071e;
}
.pl-ii {
  color: #f6f8fa;
  background-color: #82071e;
}
.pl-c2 {
  color: #f6f8fa;
  background-color: #cf222e;
}
.pl-sr .pl-cce {
  color: #116329;
  font-weight: 700;
}
.pl-ml {
  color: #3b2300;
}
.pl-mh,
.pl-mh .pl-en,
.pl-ms {
  color: #0550ae;
  font-weight: 700;
}
.pl-mi {
  color: #1f2328;
  font-style: italic;
}
.pl-mb {
  color: #1f2328;
  font-weight: 700;
}
.pl-md {
  color: #82071e;
  background-color: #ffebe9;
}
.pl-mi1 {
  color: #116329;
  background-color: #dafbe1;
}
.pl-mc {
  color: #953800;
  background-color: #ffd8b5;
}
.pl-mi2 {
  color: #d1d9e0;
  background-color: #0550ae;
}
.pl-mdr {
  color: #8250df;
  font-weight: 700;
}
.pl-ba {
  color: #59636e;
}
.pl-sg {
  color: #818b98;
}
.pl-corl {
  color: #0a3069;
  text-decoration: underline;
}

/* GitHub-like fallback while the highlighter loads or when it is unavailable. */
.org-src-container .org-comment,
.org-src-container .org-comment-delimiter {
  color: #59636e;
}
.org-src-container .org-keyword {
  color: #cf222e;
}
.org-src-container .org-string {
  color: #0a3069;
}
.org-src-container .org-constant,
.org-src-container .org-builtin {
  color: #0550ae;
}
.org-src-container .org-function-name {
  color: #6639ba;
}
.org-src-container .org-type {
  color: #0550ae;
}
.org-src-container .org-variable-name {
  color: #953800;
}

/*
 * Some major modes export language-specific Htmlize faces (for example,
 * org-haskell-keyword) instead of the generic faces above. Keep those blocks
 * highlighted while Starry Night downloads or whenever JavaScript is blocked.
 */
.org-src-container [class$="-comment"],
.org-src-container [class$="-comment-delimiter"] {
  color: #59636e;
}
.org-src-container [class$="-keyword"],
.org-src-container [class$="-operator"] {
  color: #cf222e;
}
.org-src-container [class$="-string"],
.org-src-container [class$="-literal"],
.org-src-container [class$="-constant"],
.org-src-container [class$="-builtin"] {
  color: #0550ae;
}
.org-src-container [class$="-function-name"],
.org-src-container [class$="-definition"],
.org-src-container [class$="-constructor"] {
  color: #6639ba;
}
.org-src-container [class$="-type"] {
  color: #0550ae;
}
.org-src-container [class$="-variable-name"] {
  color: #953800;
}

@media (hover: none) {
  .org-code-copy {
    min-width: 3.5rem;
  }
}

@media (max-width: 480px) {
  .org-src-container {
    margin-inline: -0.35rem;
    border-radius: 0.375rem;
  }

  .org-code-toolbar {
    padding-inline: 0.45rem;
  }

  .org-src-container > pre,
  .org-code-content pre {
    padding: 0.8rem;
  }
}

@media print {
  .org-src-container {
    box-shadow: none;
    break-inside: avoid;
  }

  .org-code-toolbar {
    display: none;
  }

  .org-code-content,
  .org-src-container.is-collapsed .org-code-content {
    display: block;
    opacity: 1;
    visibility: visible;
  }

  .org-src-container > pre,
  .org-code-content pre {
    padding-top: 1rem;
    white-space: pre-wrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  .org-code-toggle-indicator,
  .org-code-content {
    transition: none;
  }
}
