/* Stylesheet for both HTML outputs (single page and one page per chapter). */

:root {
  --text: #1a1a1a;
  --muted: #666;
  --link: #1f3a8a;
  --rule: #ccc;
}

html { font-size: 112.5%; }

body {
  margin: 0 auto;
  max-width: 44em;
  padding: 1.5em 1.2em 4em;
  color: var(--text);
  background: #fff;
  font-family: "Latin Modern Roman", "CMU Serif", Georgia, "Times New Roman", serif;
  line-height: 1.5;
  hyphens: auto;
  overflow-wrap: break-word;
}

h1, h2, h3, h4, nav, .sitenav, table th, figcaption {
  font-family: "Latin Modern Sans", "CMU Sans Serif", "Helvetica Neue", Arial, sans-serif;
}

h1 { font-size: 1.9em; margin: 2em 0 0.8em; }
h2 { font-size: 1.4em; font-weight: normal; text-align: center; margin: 1.8em 0 0.6em; }
h3 { font-size: 1.15em; font-weight: normal; text-align: center; margin: 1.5em 0 0.5em; }
h1 .header-section-number { margin-right: 0.3em; }

a { color: var(--link); }
a:visited { color: #5b3a8a; }

code {
  font-family: "Latin Modern Mono", "CMU Typewriter Text", Menlo, Consolas, monospace;
  font-size: 0.95em;
  overflow-wrap: anywhere;
}

img { max-width: 100%; height: auto; }
p > img:only-child { display: block; margin: 1.5em auto; }
figure { margin: 1.5em 0; text-align: center; }
figcaption { color: var(--muted); font-size: 0.9em; }

table {
  margin: 1.2em auto;
  border-collapse: collapse;
  font-size: 0.95em;
}
th, td { border: 1px solid var(--rule); padding: 0.25em 0.6em; vertical-align: top; }
th { background: #f4f4f4; }

dt { font-weight: bold; margin-top: 0.6em; }
dd { margin-left: 2em; }

/* title block */
#title-block-header { text-align: center; margin-bottom: 2em; }
#title-block-header .title { font-family: inherit; font-weight: normal; font-size: 2.4em; margin: 0.5em 0; }
#title-block-header .intro { text-align: left; display: inline-block; max-width: 34em; font-size: 1.1em; }
#title-block-header .author, #title-block-header .date { margin: 0.2em 0; color: var(--muted); }

/* table of contents */
#TOC { border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); padding: 0.5em 0 1em; }
#TOC h2 { text-align: left; }
#TOC ul { list-style: none; padding-left: 1.5em; margin: 0; }
#TOC > ul { padding-left: 0; }
#TOC > ul > li { margin-top: 0.4em; font-weight: bold; }
#TOC > ul > li li { font-weight: normal; }
#TOC a { text-decoration: none; }
#TOC a:hover { text-decoration: underline; }

/* footnotes */
.footnote-ref { text-decoration: none; }
section.footnotes { font-size: 0.9em; border-top: 1px solid var(--rule); margin-top: 2em; }
section.footnotes hr { display: none; }
.footnote-back { text-decoration: none; }

/* navigation in the multi-page version */
.sitenav {
  display: flex;
  justify-content: space-between;
  gap: 1em;
  font-size: 0.9em;
  padding: 0.5em 0;
  border-bottom: 1px solid var(--rule);
}
.sitenav.bottom { border-bottom: none; border-top: 1px solid var(--rule); margin-top: 3em; }
.sitenav span { flex: 1; }
.sitenav .nav-top { text-align: center; }
.sitenav .nav-next { text-align: right; }
.sitenav a { text-decoration: none; }

@media print {
  .sitenav { display: none; }
  body { max-width: none; }
}
