/* Optional reader/editor theme inspired by Lean blueprint pages.
 *
 * Hosts import this file explicitly and apply `.cf-theme-blueprint-book` to a
 * `.cf-theme-scope` root. Coflat does not auto-load or globally apply it.
 */

.cf-theme-blueprint-book {
  --cf-ui-font: "Lucida Grande", Arial, Helvetica, sans-serif;
  --cf-content-font: KaTeX_Main, "Times New Roman", Times, serif;
  --cf-code-font: Monaco, "DejaVu Sans Mono", Consolas, monospace;
  --cf-bg: #e8e8e8;
  --cf-bg-secondary: #e8e8e8;
  --cf-fg: #0a0a14;
  --cf-muted: #536878;
  --cf-border: #c2c2c2;
  --cf-subtle: #dbdbdb;
  --cf-hover: #497da5;
  --cf-active: #89aecb;
  --cf-accent: #396282;
  --cf-accent-fg: #ffffff;
  --cf-color-link: #396282;
  --cf-color-code-bg: #dbdbdb;
  --cf-base-font-size: 16px;
  --cf-line-height: 1.4;
  --cf-content-max-width: 75ch;
  --cf-doc-content-padding-block-start: 8px;
  --cf-doc-content-padding-block-end: 40px;
  --cf-doc-content-padding-inline: 16px;
  --cf-doc-paragraph-margin: 0.5rem 0;
  --cf-doc-heading-margin: 0.9rem 0 0.5rem;
  --cf-doc-list-margin: 0.6rem 0;
  --cf-doc-list-item-margin: 0.15rem 0;
  --cf-doc-code-block-margin: 0.9rem 0;
  --cf-doc-blockquote-margin: 0.9rem 0;
  --cf-h1-size: 2rem;
  --cf-h1-weight: 400;
  --cf-h1-style: normal;
  --cf-h2-size: 1.5rem;
  --cf-h2-weight: 400;
  --cf-h2-style: normal;
  --cf-h3-size: 1rem;
  --cf-h3-weight: 700;
  --cf-h3-style: normal;
  --cf-h4-size: 1rem;
  --cf-h4-weight: 700;
  --cf-h4-style: normal;
  --cf-h5-size: 0.95rem;
  --cf-h5-weight: 700;
  --cf-h5-style: normal;
  --cf-h6-size: 0.9rem;
  --cf-h6-weight: 700;
  --cf-h6-style: normal;
  --cf-block-header-accent: #0a0a14;
  --cf-block-header-border-width: 0px;
  --cf-block-title-weight: 700;
  --cf-block-title-separator: ".\00a0";
  --cf-block-margin: 1rem 0;
  --cf-block-theorem-style: italic;
  --cf-block-lemma-style: italic;
  --cf-block-corollary-style: italic;
  --cf-block-proposition-style: italic;
  --cf-block-conjecture-style: italic;
  --cf-block-definition-style: normal;
  --cf-block-proof-style: normal;
  --cf-proof-marker: "\220E";
  --cf-border-radius: 0;
  --cf-border-radius-lg: 0;
}

.cf-theme-blueprint-book.cf-reader-shell,
.cf-theme-blueprint-book .cf-reader-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  background: #e8e8e8;
}

.cf-theme-blueprint-book .cf-reader-header {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0.5rem;
  color: #ffffff;
  background: linear-gradient(180deg, #6696bb 0, #396282);
}

.cf-theme-blueprint-book .cf-reader-header-title {
  margin: 0 auto;
  color: #ffffff;
  font-family: var(--cf-ui-font);
  font-size: 1.5rem;
  font-weight: 400;
  line-height: 1.2;
}

.cf-theme-blueprint-book .cf-reader-document {
  min-width: 0;
  overflow: auto;
  padding: 0.5rem 0.5rem 2.5rem;
  background: #e8e8e8;
}

.cf-theme-blueprint-book .cf-reader {
  padding-block: 0.5rem 2.5rem;
  background: #e8e8e8;
}

.cf-theme-blueprint-book .cf-reader-toc {
  display: none;
  overflow: auto;
  border-right: none;
  padding: 0 1rem 1rem 0;
  background: #6696bb;
}

.cf-theme-blueprint-book .cf-reader-toc a {
  display: inline-block;
  max-width: 90%;
  padding: 0.5rem 0.5rem 0.5rem 0.8rem;
  color: #ffffff;
  font-size: 1.125rem;
  text-decoration: none;
}

.cf-theme-blueprint-book .cf-reader-toc a:hover {
  background: #497da5;
}

.cf-theme-blueprint-book .cf-reader-toc a[aria-current="page"],
.cf-theme-blueprint-book .cf-reader-toc .current > a,
.cf-theme-blueprint-book .cf-reader-toc a.current {
  background: #89aecb;
}

.cf-theme-blueprint-book .cf-doc-flow a {
  color: #396282;
  text-decoration-line: underline;
  text-decoration-style: dotted;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.cf-theme-blueprint-book .cf-doc-flow .cf-doc-heading {
  color: #0f2f48;
  font-family: var(--cf-ui-font);
}

.cf-theme-blueprint-book .cm-line.cf-doc-heading {
  color: #0f2f48;
  font-family: var(--cf-ui-font);
}

.cf-theme-blueprint-book .cf-doc-flow .cf-doc-heading--h1 {
  font-size: var(--cf-h1-size);
  font-style: var(--cf-h1-style);
  font-weight: var(--cf-h1-weight);
}

.cf-theme-blueprint-book .cf-doc-flow .cf-doc-heading--h2 {
  font-size: var(--cf-h2-size);
  font-style: var(--cf-h2-style);
  font-weight: var(--cf-h2-weight);
}

.cf-theme-blueprint-book .cf-doc-flow :where(.cf-doc-heading--h3, .cf-doc-heading--h4, .cf-doc-heading--h5, .cf-doc-heading--h6) {
  font-size: 1rem;
  font-style: normal;
  font-weight: 700;
}

.cf-theme-blueprint-book .cf-doc-flow .cf-doc-heading--h1 {
  line-height: 1;
  margin-block: 1rem;
  text-align: center;
}

.cf-theme-blueprint-book .cm-line.cf-doc-heading--h1 {
  line-height: 1;
  text-align: center;
}

.cf-theme-blueprint-book .cf-doc-flow .cf-doc-heading--h2 {
  line-height: 1.2;
  margin-block: 0.8rem 0.5rem;
}

.cf-theme-blueprint-book .cm-line.cf-doc-heading--h2 {
  line-height: 1.2;
}

.cf-theme-blueprint-book .cf-doc-flow .cf-doc-heading--h3,
.cf-theme-blueprint-book .cf-doc-flow .cf-doc-heading--h4 {
  margin-block: 0.67rem 0.4rem;
}

.cf-theme-blueprint-book .cf-doc-flow .cf-doc-block,
.cf-theme-blueprint-book .cf-doc-block:not(.cm-line) {
  margin: var(--cf-block-margin);
}

.cf-theme-blueprint-book .cf-doc-flow .cf-doc-block--abstract,
.cf-theme-blueprint-book .cf-doc-block--abstract:not(.cm-line) {
  box-sizing: border-box;
  inline-size: var(--cf-doc-abstract-width, 88%);
  margin-inline: auto;
  max-inline-size: var(--cf-doc-abstract-max-width, 42rem);
}

.cf-theme-blueprint-book .cf-doc-flow .cf-doc-block--abstract .cf-doc-abstract-label,
.cf-theme-blueprint-book .cf-doc-block--abstract:not(.cm-line) .cf-doc-abstract-label {
  text-align: center;
}

.cf-theme-blueprint-book .cf-doc-flow .cf-doc-block-collapsible,
.cf-theme-blueprint-book .cf-doc-flow details.cf-doc-block {
  display: block;
}

.cf-theme-blueprint-book .cf-doc-flow .cf-doc-block-heading {
  color: #0a0a14;
  cursor: default;
  font-family: var(--cf-content-font);
  font-style: normal;
  font-weight: 700;
  line-height: 1.5;
  user-select: text;
}

.cf-theme-blueprint-book .cf-doc-flow .cf-doc-block-collapsible {
  --cf-block-disclosure-indicator-color: #536878;
}

.cf-theme-blueprint-book .cf-doc-flow .cf-block-disclosure-toggle {
  color: #536878;
  line-height: 1.5;
}

.cf-theme-blueprint-book .cf-doc-flow .cf-block-disclosure-toggle:hover,
.cf-theme-blueprint-book .cf-doc-flow .cf-block-disclosure-toggle:focus-visible,
.cf-theme-blueprint-book .cf-doc-flow .cf-block-disclosure-toggle-collapsed {
  color: #0a0a14;
}

.cf-theme-blueprint-book .cf-doc-flow .cf-doc-block--proof > .cf-doc-block-heading {
  line-height: 1.2;
}

.cf-theme-blueprint-book .cf-doc-flow .cf-doc-block-heading::marker {
  color: #0a0a14;
  font-size: 0.8em;
}

.cf-theme-blueprint-book .cf-doc-flow .cf-doc-block--theorem,
.cf-theme-blueprint-book .cf-doc-flow .cf-doc-block--proposition,
.cf-theme-blueprint-book .cm-line.cf-doc-block--theorem,
.cf-theme-blueprint-book .cm-line.cf-doc-block--proposition {
  border-left: 0.15rem solid #0a0a14;
  padding-left: 1rem;
  font-style: italic;
}

.cf-theme-blueprint-book .cf-doc-flow .cf-doc-block--lemma,
.cf-theme-blueprint-book .cf-doc-flow .cf-doc-block--corollary,
.cf-theme-blueprint-book .cf-doc-flow .cf-doc-block--conjecture,
.cf-theme-blueprint-book .cm-line.cf-doc-block--lemma,
.cf-theme-blueprint-book .cm-line.cf-doc-block--corollary,
.cf-theme-blueprint-book .cm-line.cf-doc-block--conjecture {
  border-left: 0.1rem solid #0a0a14;
  padding-left: 1rem;
  font-style: italic;
}

.cf-theme-blueprint-book .cf-doc-flow .cf-doc-block--proof,
.cf-theme-blueprint-book .cf-doc-block--proof:not(.cm-line),
.cf-theme-blueprint-book .cm-line.cf-doc-block--proof {
  border-left: 0.08rem solid #808080;
  padding-left: 1rem;
}

.cf-theme-blueprint-book .cf-doc-flow .cf-doc-block--proof[open]::after {
  float: right;
  color: #0a0a14;
  content: var(--cf-proof-marker);
  font-size: var(--cf-proof-marker-size, 1.2em);
  line-height: 1;
}

.cf-theme-blueprint-book .cf-doc-flow .cf-doc-block--definition,
.cf-theme-blueprint-book .cf-doc-flow .cf-doc-block--example,
.cf-theme-blueprint-book .cf-doc-flow .cf-doc-block--remark,
.cf-theme-blueprint-book .cm-line.cf-doc-block--definition,
.cf-theme-blueprint-book .cm-line.cf-doc-block--example,
.cf-theme-blueprint-book .cm-line.cf-doc-block--remark {
  font-style: normal;
}

.cf-theme-blueprint-book .cf-doc-flow .cf-doc-code-block {
  border-radius: 0;
}

@media (min-width: 1024px) {
  .cf-theme-blueprint-book.cf-reader-shell,
  .cf-theme-blueprint-book .cf-reader-shell {
    grid-template-columns: 25ch minmax(0, 1fr);
  }

  .cf-theme-blueprint-book .cf-reader-toc {
    display: block;
    max-width: 25ch;
  }

  .cf-theme-blueprint-book .cf-reader-document {
    padding: 1rem 0 0;
  }
}
