/* VS Code Light+ colors mapped to Verso's existing token classes:
 * https://github.com/microsoft/vscode/blob/main/extensions/theme-defaults/themes/light_plus.json
 */
:root {
  --verso-code-keyword-color: #0000ff;
  --verso-code-const-color: #795e26;
  --verso-code-var-color: #001080;
  --verso-code-var-style: normal;
  --verso-code-keyword-weight: normal;
  --verso-code-color: #000000;
}

/* Verso embeds these mappings inline in full source pages. Theorem excerpts
 * load code.css without that inline stylesheet, so share the mappings here.
 */
.hl.lean .keyword {
  color: var(--verso-code-keyword-color);
}

.hl.lean .const {
  color: var(--verso-code-const-color);
}

.hl.lean .var {
  color: var(--verso-code-var-color);
}

.hl.lean .inter-text {
  color: var(--verso-code-color);
}

.hl.lean .token.typed {
  color: #267f99;
}

.hl.lean .keyword {
  font-weight: var(--verso-code-keyword-weight);
}

.hl.lean .var {
  font-style: var(--verso-code-var-style);
}

.hl.lean .comment,
.hl.lean .doc-comment {
  color: #008000;
}

.hl.lean .literal.string,
.hl.lean .char {
  color: #a31515;
}

.hl.lean .literal.number,
.hl.lean .number {
  color: #098658;
}

.hl.lean .sort,
.hl.lean .level-var,
.hl.lean .level-const {
  color: #267f99;
}

/* Shared highlighting for theorem details and full annotated source pages. */
:where(.verso-code-container, .code-content) code.hl.lean.block {
  display: block;
  font-family: 'SFMono-Regular', Menlo, Consolas, 'Liberation Mono', monospace;
  font-size: 0.875rem;
  line-height: 1.8;
  font-style: normal;
  font-weight: normal;
  color: var(--verso-code-color);
  white-space: pre;
  overflow-x: auto;
  tab-size: 2;
}
/* One continuous source surface, with prose docstrings between declarations. */
.code-content {
  padding: 2rem clamp(1rem, 4vw, 3rem);
  min-width: 0;
  overflow-x: auto;
  background: #fafafa;
}
.code-content code.hl.lean.block {
  margin: 0 0 1.5rem;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  overflow-x: visible;
}
.code-content .hl.lean .comment {
  white-space: pre-wrap;
}
.code-content .hl.lean .tactic-toggle {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.code-content :is(.md-text, .verso-text) {
  font-family: system-ui, sans-serif;
  font-size: 1rem;
  line-height: 1.7;
  color: #334155;
  white-space: normal;
  max-width: 72ch;
  margin: 1.5rem 0 0.5rem;
}
.code-content :is(.md-text, .verso-text) > * {
  font-family: inherit;
}
.code-content :is(.md-text, .verso-text) :is(ul, ol) {
  padding-left: 1.5rem;
}
.code-content :is(.md-text, .verso-text) code {
  font-family: 'SFMono-Regular', Menlo, Consolas, monospace;
  font-size: 0.875em;
}

/* Set documentation apart without turning declarations back into cards. */
.code-content :is(.md-text, .verso-text):not(.mod-doc) {
  border-left: 3px solid #c4cedd !important;
  padding: 0.15rem 0 0.15rem 1rem;
  margin: 1.75rem 0 0.75rem;
  color: #526075;
  line-height: 1.75;
}
.code-content :is(.md-text, .verso-text):not(.mod-doc) p {
  margin: 0 0 0.65rem;
  color: inherit;
  line-height: inherit;
}
.code-content :is(.md-text, .verso-text):not(.mod-doc) > :last-child {
  margin-bottom: 0;
}
.code-content :is(.md-text, .verso-text):not(.mod-doc) code {
  padding: 0;
  border: 0;
  background: transparent;
  color: #364152;
}

/* Module titles should read as section headings within the source document. */
.code-content :is(.md-text, .verso-text).mod-doc {
  margin: 1.5rem 0;
  padding-bottom: 1rem;
}
.code-content :is(.md-text, .verso-text).mod-doc :is(h1, h2) {
  font-family: system-ui, sans-serif;
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: normal;
  color: #334155;
  margin: 0 0 0.35rem;
}
.code-content :is(.md-text, .verso-text).mod-doc p {
  font-size: 0.875rem;
  line-height: 1.6;
  color: #64748b;
  margin: 0;
}
