/* Course-specific presentation layered over LaTeXML's structural styles. */
:root {
  --page: #f5f2eb;
  --paper: #fffefb;
  --ink: #282722;
  --muted: #6d6a60;
  --rule: #d8d3c7;
  --link: #1e5d88;
  --link-hover: #123f61;
  --theorem-bg: #f2f7fc;
  --theorem-border: #8db4d2;
  --definition-bg: #fff9e9;
  --definition-border: #d9bc65;
  --algorithm-bg: #f2f8f1;
  --algorithm-border: #8caf88;
  --soft-shadow: 0 1px 2px rgb(45 38 26 / 8%), 0 8px 30px rgb(45 38 26 / 5%);
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 2rem;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: Georgia, "Times New Roman", Times, serif;
  font-size: 17px;
  line-height: 1.68;
  text-rendering: optimizeLegibility;
}

.ltx_page_main {
  box-sizing: border-box;
  width: min(100% - 2rem, 52rem);
  margin: 1.5rem auto;
  padding: clamp(1.5rem, 4vw, 4rem) clamp(1.25rem, 6vw, 5rem);
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 3px;
  box-shadow: var(--soft-shadow);
}

.ltx_page_content {
  min-width: 0;
}

a,
a:visited {
  color: var(--link);
  text-decoration-color: rgb(30 93 136 / 38%);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.14em;
}

a:hover,
a:focus-visible {
  color: var(--link-hover);
  text-decoration-color: currentColor;
}

.ltx_page_header,
.ltx_page_footer {
  border-color: var(--rule);
  color: var(--muted);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.78rem;
  line-height: 1.4;
}

.ltx_page_header {
  margin-bottom: 2.5rem;
  padding-bottom: 0.75rem;
}

.ltx_page_footer {
  margin-top: 3.5rem;
  padding-top: 0.75rem;
}

.ltx_page_logo {
  color: var(--muted);
  opacity: 0.7;
}

.ltx_title_document,
.ltx_title_chapter,
.ltx_title_appendix,
.ltx_title_bibliography,
.ltx_title_section,
.ltx_title_subsection,
.ltx_title_subsubsection {
  color: #1f3040;
  line-height: 1.2;
  text-wrap: balance;
}

.ltx_title_chapter,
.ltx_title_appendix,
.ltx_title_bibliography {
  margin: 0 0 2.5rem;
  font-size: clamp(2rem, 6vw, 3rem);
  font-weight: 600;
  letter-spacing: -0.025em;
}

.ltx_title_chapter .ltx_tag,
.ltx_title_appendix .ltx_tag {
  margin-bottom: 0.55rem;
  color: var(--muted);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.38em;
  font-weight: 650;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.ltx_title_section {
  margin: 2.6rem 0 0.9rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--rule);
  font-size: 1.45rem;
  font-weight: 650;
}

.ltx_title_subsection {
  margin: 2rem 0 0.7rem;
  font-size: 1.16rem;
  font-weight: 650;
}

.ltx_title_subsubsection {
  margin-top: 1.7rem;
  font-size: 1rem;
  font-weight: 700;
}

.ltx_p {
  margin-block: 0.85em;
}

.ltx_toclist {
  padding-left: 1.2rem;
}

.ltx_tocentry {
  margin-block: 0.28rem;
}

/* Match the PDF's tcolorbox palette: blue results, yellow definitions. */
.ltx_theorem_theorem,
.ltx_theorem_proposition,
.ltx_theorem_lemma,
.ltx_theorem_corollary,
.ltx_theorem_conjecture,
.ltx_theorem_claim {
  --box-bg: var(--theorem-bg);
  --box-border: var(--theorem-border);
}

.ltx_theorem_definition {
  --box-bg: var(--definition-bg);
  --box-border: var(--definition-border);
}

.ltx_theorem_alg {
  --box-bg: var(--algorithm-bg);
  --box-border: var(--algorithm-border);
}

.ltx_theorem_theorem,
.ltx_theorem_proposition,
.ltx_theorem_lemma,
.ltx_theorem_corollary,
.ltx_theorem_conjecture,
.ltx_theorem_claim,
.ltx_theorem_definition,
.ltx_theorem_alg {
  position: relative;
  margin: 1.5rem 0;
  padding: 1rem 1.15rem 1.05rem 1.3rem;
  overflow: hidden;
  background: var(--box-bg);
  border: 1px solid color-mix(in srgb, var(--box-border) 64%, white);
  border-left: 4px solid var(--box-border);
  border-radius: 4px;
  break-inside: avoid;
}

.ltx_theorem > .ltx_title {
  margin: 0 0 0.35rem;
  color: #233748;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.9rem;
  font-weight: 650;
  font-style: normal;
  letter-spacing: 0.015em;
}

.ltx_theorem > .ltx_title + .ltx_para,
.ltx_theorem > .ltx_title + .ltx_para > .ltx_p,
.ltx_theorem > .ltx_title + .ltx_p {
  margin-top: 0;
}

.ltx_theorem > :last-child,
.ltx_theorem > :last-child > .ltx_p:last-child {
  margin-bottom: 0;
}

/* Remarks and examples stay lighter than formal results. */
.ltx_theorem_example,
.ltx_theorem_exercise,
.ltx_theorem_remark,
.ltx_theorem_fact,
.ltx_theorem_problem,
.ltx_theorem_notation {
  margin: 1.35rem 0;
  padding: 0.2rem 0 0.2rem 1rem;
  border-left: 2px solid var(--rule);
}

.ltx_proof {
  margin: 1.25rem 0 1.7rem;
  padding-left: 1rem;
  border-left: 2px solid #e2ded4;
}

.ltx_proof .ltx_title {
  color: var(--muted);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.88rem;
  font-weight: 650;
}

.ltx_note_content > .ltx_note_mark,
.ltx_note_content > .ltx_tag_note {
  display: none;
}

/* Equation cells are nowrap; footnote popups should still wrap normally. */
.ltx_note_content {
  box-sizing: border-box;
  left: 50%;
  width: max-content;
  max-width: min(42rem, calc(100vw - 2rem));
  transform: translateX(-50%);
  white-space: normal;
  overflow-wrap: break-word;
}

.ltx_equation,
.ltx_equationgroup,
mjx-container[display="true"] {
  max-width: 100%;
}

.ltx_equation,
.ltx_equationgroup {
  display: block;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
}

.ltx_tabular {
  max-width: 100%;
}

.ltx_table {
  margin-block: 1.5rem;
  overflow-x: auto;
}

.ltx_tabular th,
.ltx_tabular td {
  padding: 0.3rem 0.55rem;
}

.ltx_figure {
  margin: 1.5rem auto;
}

.ltx_graphics {
  height: auto;
  max-width: 100%;
}

.ltx_caption {
  max-width: 42rem;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

blockquote,
.ltx_quote {
  margin-inline: 1rem;
  padding-left: 1rem;
  border-left: 3px solid var(--rule);
  color: #4f4c44;
}

@media (max-width: 40rem) {
  body {
    font-size: 16px;
  }

  .ltx_page_main {
    width: 100%;
    margin: 0;
    padding: 1.15rem 1rem 2rem;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .ltx_page_header {
    margin-bottom: 2rem;
  }

  .ltx_page_header a[rel~="up"],
  .ltx_page_footer a[rel~="up"] {
    display: none;
  }

  .ltx_theorem_theorem,
  .ltx_theorem_proposition,
  .ltx_theorem_lemma,
  .ltx_theorem_corollary,
  .ltx_theorem_conjecture,
  .ltx_theorem_claim,
  .ltx_theorem_definition,
  .ltx_theorem_alg {
    margin-inline: -0.15rem;
    padding: 0.9rem 0.85rem 0.95rem 1rem;
  }
}

@media print {
  body {
    background: white;
    font-size: 11pt;
  }

  .ltx_page_main {
    width: auto;
    margin: 0;
    padding: 0;
    border: 0;
    box-shadow: none;
  }

  .ltx_page_header,
  .ltx_page_footer,
  .ltx_page_logo {
    display: none;
  }
}
