/* =============================================================
   Lean 4 code blocks — containers + token colours.
   Companion stylesheet for static/js/lean-highlighter.js.

   This file owns:
     .case-code, .lean-code            scrollable code area + scrollbars
     .case-code-short                   auto-height variant for short snippets
     .case-code pre, .lean-code pre     font, padding, white-space
     .lh-*                              token colour palette
   ============================================================= */

/* ---------------------------------------------- code-block container */

.case-code,
.lean-code {
  font-family: var(--mono, "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace);
  font-size: 13px;
  font-feature-settings: "calt" off, "liga" off;
  line-height: 1.75;
  background: var(--light, #faf7ee);
  color: var(--ink, #16140f);
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--rule, #cec6b1) transparent;
}
.case-code { height: 580px; }
.case-code.case-code-short {
  height: auto;
  min-height: 0;
  max-height: 560px;
  overflow: auto;
}
.case-code::-webkit-scrollbar,
.lean-code::-webkit-scrollbar { width: 10px; height: 10px; }
.case-code::-webkit-scrollbar-thumb,
.lean-code::-webkit-scrollbar-thumb {
  background: var(--rule, #cec6b1);
  border-radius: 999px;
}
.case-code::-webkit-scrollbar-track,
.lean-code::-webkit-scrollbar-track { background: transparent; }

/* The <pre class="lh"> emitted by the highlighter (or the plain fallback). */
.case-code pre,
.lean-code pre {
  margin: 0;
  padding: 32px 36px 36px;
  background: transparent !important;
  background-color: transparent !important;
  color: var(--ink, #16140f);
  font-family: inherit !important;
  font-size: 13px !important;
  font-feature-settings: "calt" off, "liga" off;
  line-height: 1.75;
  white-space: pre;
  min-width: max-content;
  tab-size: 2;
}
.case-code code,
.lean-code code {
  background: transparent !important;
  padding: 0 !important;
  border-radius: 0 !important;
  font-weight: 400 !important;
  font-family: inherit !important;
  font-size: inherit !important;
  color: inherit !important;
}

/* ---------------------------------------------- token palette
   GitHub-Light-derived palette.

   The user has two reference pages side-by-side:
     - Academic-project-page-template/showcase.html — old Shiki highlighter
       using the `github-light` theme. Visually preferred for token colour.
     - / showcase.html — current vscode-textmate highlighter. Visually
       preferred for the surrounding cream-paper chrome.

   So this palette mirrors GitHub Light's token colours (the ones Shiki
   emits as inline styles in the Academic page) and applies them to our
   .lh-* classes. The page background stays cream — GitHub Light's hues
   are muted enough that they sit happily on #faf7ee, and the two pages
   now read with the same character.

   GitHub Light source colours (github/primer/primitives/light-default):
     comment           → #6e7781
     keyword           → #cf222e   (def/theorem, by/let/fun/match, modifiers)
     entity.name.type  → #953800   (Type/Prop/Sort, namespaces)
     support.function  → #8250df   (tactics, qualified lemma tails)
     variable          → #24292f
     string            → #0a3069
     constant.numeric  → #0550ae
     constant.language → #0550ae
     invalid           → #82071e
*/

.case-code .lh-comment,   .lean-code .lh-comment   { color: #6e7781; font-style: italic; }
.case-code .lh-doc,       .lean-code .lh-doc       { color: #6e7781; font-style: italic; }
.case-code .lh-comment-code,
.lean-code .lh-comment-code {
  color: #0969da;
  font-style: normal;
  font-weight: 600;
}

.case-code .lh-kw-decl,   .lean-code .lh-kw-decl   { color: #d1242f; font-weight: 700; }
.case-code .lh-kw,        .lean-code .lh-kw        { color: #d1242f; font-weight: 700; }
.case-code .lh-tactic,    .lean-code .lh-tactic    { color: #d1242f; font-weight: 700; }

.case-code .lh-type,      .lean-code .lh-type      { color: #953800; }
.case-code .lh-name-ctor, .lean-code .lh-name-ctor { color: #953800; }

.case-code .lh-lemma,     .lean-code .lh-lemma     { color: #8250df; }
.case-code .lh-name,      .lean-code .lh-name      { color: #24292f; }

.case-code .lh-str,       .lean-code .lh-str       { color: #0a3069; }
.case-code .lh-num,       .lean-code .lh-num       { color: #0550ae; }

.case-code .lh-op,        .lean-code .lh-op        { color: #24292f; }
.case-code .lh-paren,     .lean-code .lh-paren     { color: #24292f; }
.case-code .lh-punct,     .lean-code .lh-punct     { color: #24292f; }
.case-code .lh-attr,      .lean-code .lh-attr      { color: #cf222e; }
.case-code .lh-meta,      .lean-code .lh-meta      { color: #82071e; }

/* Rainbow brackets — depth-cycled with VS Code-style bright bracket colours. */
.case-code .lh-br-0, .lean-code .lh-br-0 { color: #c69026; font-weight: 800; }  /* warm amber */
.case-code .lh-br-1, .lean-code .lh-br-1 { color: #c45ac8; font-weight: 800; }  /* orchid */
.case-code .lh-br-2, .lean-code .lh-br-2 { color: #1f7fd8; font-weight: 800; }  /* clear blue */
.case-code .lh-br-3, .lean-code .lh-br-3 { color: #2f9b5f; font-weight: 800; }  /* soft green */
