/* The look of the Grant page: the TeXmacs generic style, carried to the web. */

@font-face { font-family: "CMU Serif"; font-weight: 400; font-style: normal; font-display: swap;
  src: url("fonts/cmu-serif-500-roman.woff2") format("woff2"); }
@font-face { font-family: "CMU Serif"; font-weight: 400; font-style: italic; font-display: swap;
  src: url("fonts/cmu-serif-500-italic.woff2") format("woff2"); }
@font-face { font-family: "CMU Serif"; font-weight: 700; font-style: normal; font-display: swap;
  src: url("fonts/cmu-serif-700-roman.woff2") format("woff2"); }
@font-face { font-family: "CMU Typewriter Text"; font-weight: 400; font-style: normal; font-display: swap;
  src: url("fonts/cmu-typewriter-text-500-roman.woff2") format("woff2"); }

html { background: #fff; color: #000; -webkit-text-size-adjust: 100%; }

body {
  font-family: "CMU Serif", "Latin Modern Roman", "Computer Modern", Georgia, serif;
  font-size: 16px;
  line-height: 1.5;
  max-width: 38em;
  margin: 0 auto;
  padding: 3.75em 1.5em 5em;
  text-align: left;
  hyphens: auto;
  -webkit-hyphens: auto;
}

/* Headings: the weight of the text, set apart by size and space. */
h1, h2, h3, h4, strong { font-weight: 400; }
h2 { font-size: 1.42em; margin: 2.4em 0 0.7em; text-align: left; }
h3 { font-size: 1.17em; margin: 1.9em 0 0.6em; text-align: left; }
strong { font-variant: small-caps; letter-spacing: 0.02em; }
p { margin: 0.75em 0; }
a { color: inherit; text-decoration-color: #000; text-underline-offset: 0.15em; }

/* Title: centred. */
table.title-block { width: 100% !important; text-align: center; hyphens: none; -webkit-hyphens: none; }
table.title-block td { text-align: center !important; padding: 0; }
body > .title-block { margin-bottom: 2.5em !important; }
.title-block .title-block:first-child font { font-size: 1.5em !important; letter-spacing: 0.055em; }
.title-block p, .title-block center { margin: 0; }

/* Code keeps its spaces. */
tt, pre, .verbatim { font-family: "CMU Typewriter Text", "Latin Modern Mono", Menlo, monospace; }
tt, .verbatim { font-size: 0.95em; hyphens: none; -webkit-hyphens: none; }
pre.verbatim {
  font-size: 0.84em;
  line-height: 1.42;
  text-align: left;
  margin: 1.1em 0 1.1em 1.6em;
  overflow-x: auto;
  white-space: pre;
}

/* Tables: three rules, as in print. */
table { border-collapse: collapse; }
td { padding: 0.28em 0.9em 0.28em 0; vertical-align: baseline; text-align: left; hyphens: none; -webkit-hyphens: none; }
td p { margin: 0; }
td tt, td .verbatim { font-size: 0.88em; }
td pre.verbatim { display: inline; margin: 0; white-space: pre-wrap; }

/* Figures. */
img { max-width: 100%; object-fit: contain; }
.caption, .caption p { font-size: 0.92em; text-align: center; hyphens: none; -webkit-hyphens: none; }

mjx-container { font-size: 1em !important; }
mjx-container[display="true"] { margin: 0.9em 0 !important; overflow-x: auto; overflow-y: hidden; }

@media (max-width: 640px) {
  body { font-size: 15px; padding: 2.5em 1.1em 4em; text-align: left; }
  pre.verbatim { margin-left: 0; font-size: 0.74em; }
  td { padding-right: 0.6em; }
}

@media print {
  body { font-size: 11pt; max-width: none; padding: 0; }
}

/* One reading column; tables retain their rows and columns within it. */
html, body { background: #fff; color: #000; color-scheme: light; }
body { columns: auto; }
body > div { margin-left: 0 !important; margin-right: 0 !important; }
table { width: 100% !important; }
td pre.verbatim { white-space: pre-wrap !important; }
table.title-block, table.title-block td { text-align: center !important; }
.title-block table { margin-top: 0 !important; }
pre.verbatim { margin-left: 0; }
.caption, .caption p { text-align: left; }
img { display: block; width: 82%; max-width: 30em; height: auto !important; margin: 0 auto !important; vertical-align: baseline !important; }

/* Match the exported abstract paragraph to the body text. */
body > .title-block + div + div > p > font { font-size: inherit !important; }

/* Soft grid tables, retaining the document's serif and typewriter fonts.
   The headings sit above the rounded grid, as labels for each column. */
table:has(> tbody > tr > td:nth-child(2)) {
  --table-rule: #e5e5e5;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.94em;
  line-height: 1.5;
  margin: 1.6em 0;
}
table:has(> tbody > tr > td:nth-child(2)) > tbody > tr > td {
  border: 0 !important;
  vertical-align: top;
  padding: 0.65em 0.8em;
  overflow-wrap: anywhere;
}
table:has(> tbody > tr > td:nth-child(2)) > tbody > tr:first-child > td {
  font-family: inherit;
  font-weight: 700;
  padding-top: 0;
  padding-bottom: 0.65em;
}
table:has(> tbody > tr > td:nth-child(2)) > tbody > tr:not(:first-child) > td {
  background: #fafafa;
  border-right: 1px solid var(--table-rule) !important;
  border-bottom: 1px solid var(--table-rule) !important;
}
table:has(> tbody > tr > td:nth-child(2)) > tbody > tr:not(:first-child) > td:first-child {
  border-left: 1px solid var(--table-rule) !important;
}
table:has(> tbody > tr > td:nth-child(2)) > tbody > tr:nth-child(2) > td {
  border-top: 1px solid var(--table-rule) !important;
}
table:has(> tbody > tr > td:nth-child(2)) > tbody > tr:nth-child(2) > td:first-child { border-top-left-radius: 10px; }
table:has(> tbody > tr > td:nth-child(2)) > tbody > tr:nth-child(2) > td:last-child { border-top-right-radius: 10px; }
table:has(> tbody > tr > td:nth-child(2)) > tbody > tr:last-child > td:first-child { border-bottom-left-radius: 10px; }
table:has(> tbody > tr > td:nth-child(2)) > tbody > tr:last-child > td:last-child { border-bottom-right-radius: 10px; }
table:has(> tbody > tr > td:nth-child(3)) > tbody > tr > td:first-child { width: 22%; }
table:has(> tbody > tr > td:nth-child(3)) > tbody > tr > td:nth-child(2) { width: 24%; }
table:has(> tbody > tr > td:nth-child(2)) :is(tt, pre.verbatim) {
  border: 1px solid var(--table-rule);
  border-radius: 0.55em;
  padding: 0.04em 0.28em;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
  font-size: 0.92em;
  line-height: inherit;
}
@media (max-width: 480px) {
  table:has(> tbody > tr > td:nth-child(2)) { font-size: 0.9em; }
  table:has(> tbody > tr > td:nth-child(2)) > tbody > tr > td { padding: 0.6em 0.45em; }
}

/* The mark, above the title. */
img[src="grant-mark.svg"] { display: block; width: 5.2em !important; height: auto !important; margin: 0 auto 1.4em !important; vertical-align: baseline !important; }
