/* ============================================================
   syllabus.css — Pandoc HTML syllabus stylesheet
   Dartmouth green accent theme

   To change the body font, update --font-body below.
   To change the heading font, update --font-heading.
   Dartmouth green: #00693E
   ============================================================ */

:root {
  --font-body:    Georgia, "Times New Roman", serif;
  --font-heading: "Helvetica Neue", Arial, sans-serif;
  --font-mono:    Menlo, Monaco, Consolas, "Lucida Console", monospace;

  --color-dartmouth-green: #00693E;
  --color-green-dark:      #004d2e;
  --color-text:            #1a1a1a;
  --color-muted:           #555555;
  --color-border:          #d4d4d4;
  --color-bg:              #fdfdfd;

  --max-width: 750px;
}

/* ---- Reset / Base ---- */

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  color: var(--color-text);
  background-color: var(--color-bg);
  font-size: 17px;
  line-height: 1.65;
}

body {
  font-family: var(--font-body);
  margin: 0 auto;
  max-width: var(--max-width);
  padding: 3rem 2rem 4rem;
  hyphens: auto;
  overflow-wrap: break-word;
  text-rendering: optimizeLegibility;
  font-kerning: normal;
}

/* ---- Header block (title / author / date from pandoc % lines) ---- */

header#title-block-header {
  text-align: center;
  margin-bottom: 2.5rem;
  padding-bottom: 1.25rem;
  border-top: 5px solid var(--color-dartmouth-green);
  border-bottom: 1px solid var(--color-border);
  padding-top: 1.5rem;
}

header#title-block-header .title {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-dartmouth-green);
  margin: 0 0 0.25rem;
}

header#title-block-header .author {
  font-family: var(--font-heading);
  font-size: 1rem;
  color: var(--color-muted);
  margin: 0;
}

header#title-block-header .date {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  color: var(--color-muted);
  margin: 0.15rem 0 0;
}

/* ---- Headings ---- */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  line-height: 1.25;
  margin-top: 2rem;
  margin-bottom: 0.5rem;
}

h1 {
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--color-dartmouth-green);
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 0.3rem;
}

h2 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--color-text);
}

h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-text);
}

h4, h5, h6 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-muted);
}

h5, h6 {
  font-style: italic;
}

h6 {
  font-weight: normal;
}

/* ---- Paragraphs and inline ---- */

p {
  margin: 0.85em 0;
}

strong {
  font-weight: 700;
}

em {
  font-style: italic;
}

/* ---- Links ---- */

a {
  color: var(--color-dartmouth-green);
  text-decoration: underline;
  text-underline-offset: 2px;
}

a:visited {
  color: var(--color-green-dark);
}

a:hover {
  color: var(--color-green-dark);
  text-decoration-thickness: 2px;
}

/* ---- Lists ---- */

ol, ul {
  padding-left: 1.6em;
  margin: 0.75em 0;
}

li {
  margin-bottom: 0.3em;
}

li > ol,
li > ul {
  margin-top: 0.2em;
}

/* ---- Blockquote ---- */

blockquote {
  margin: 1em 0 1em 0;
  padding: 0.6em 1em;
  border-left: 3px solid var(--color-dartmouth-green);
  color: var(--color-muted);
  background-color: #f5f9f7;
}

blockquote p {
  margin: 0;
}

/* ---- Horizontal rule ---- */

hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 2em 0;
}

/* ---- Code ---- */

code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background-color: #f0f0f0;
  padding: 0.1em 0.3em;
  border-radius: 3px;
  hyphens: manual;
}

pre {
  background-color: #f0f0f0;
  padding: 1em 1.2em;
  border-radius: 4px;
  overflow-x: auto;
  margin: 1em 0;
}

pre code {
  background: none;
  padding: 0;
  font-size: 0.85em;
  overflow-wrap: normal;
}

/* ---- Tables ---- */

table {
  margin: 1.2em 0;
  border-collapse: collapse;
  width: 100%;
  font-size: 0.95em;
  font-variant-numeric: lining-nums tabular-nums;
}

thead {
  background-color: var(--color-dartmouth-green);
  color: #ffffff;
}

thead th {
  padding: 0.5em 0.75em;
  text-align: left;
  font-family: var(--font-heading);
  font-weight: 600;
}

tbody tr:nth-child(even) {
  background-color: #f4f8f6;
}

td, th {
  padding: 0.4em 0.75em;
  border-bottom: 1px solid var(--color-border);
}

tbody {
  border-bottom: 2px solid var(--color-dartmouth-green);
}

/* ---- Images ---- */

img {
  max-width: 100%;
  height: auto;
}

/* ---- Table of contents ---- */

#TOC {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--color-dartmouth-green);
  padding: 0.75em 1.25em;
  margin-bottom: 2em;
  background: #f5f9f7;
}

#TOC li {
  list-style: none;
}

#TOC ul {
  padding-left: 1.2em;
  margin: 0.25em 0;
}

#TOC > ul {
  padding-left: 0;
}

#TOC a {
  text-decoration: none;
  color: var(--color-dartmouth-green);
}

#TOC a:hover {
  text-decoration: underline;
}

/* ---- Math ---- */

.display.math {
  display: block;
  text-align: center;
  margin: 1rem auto;
  overflow-x: auto;
}

/* ---- Pandoc utility classes ---- */

span.smallcaps {
  font-variant: small-caps;
}

div.columns {
  display: flex;
  gap: min(4vw, 1.5em);
}

div.column {
  flex: auto;
  overflow-x: auto;
}

div.hanging-indent {
  margin-left: 1.5em;
  text-indent: -1.5em;
}

ul.task-list[class] {
  list-style: none;
}

ul.task-list li input[type="checkbox"] {
  font-size: inherit;
  width: 0.8em;
  margin: 0 0.8em 0.2em -1.6em;
  vertical-align: middle;
}

/* ---- Responsive ---- */

@media (max-width: 600px) {
  html {
    font-size: 15px;
  }

  body {
    padding: 1.25rem 1rem 2rem;
  }

  header#title-block-header .title {
    font-size: 1.6rem;
  }
}

/* ---- Print ---- */

@media print {
  :root {
    --color-dartmouth-green: #004d2e; /* slightly darker prints better */
  }

  html {
    background-color: white;
    font-size: 11pt;
  }

  body {
    background-color: transparent;
    color: black;
    /*max-width: 750px;
    padding: 0; */
  }

  header#title-block-header {
    border-top-color: var(--color-dartmouth-green);
  }

  a {
    color: black;
    text-decoration: underline;
  }

  a[href]::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    color: #444;
  }

  /* Don't expand internal anchor links */
  a[href^="#"]::after {
    content: "";
  }

  blockquote {
    background: none;
    border-left-color: #444;
    color: #333;
  }

  thead {
    background-color: #e0ede7;
    color: black;
  }

  #TOC {
    background: none;
  }

  h1, h2, h3, h4 {
    page-break-after: avoid;
  }

  p, li {
    orphans: 3;
    widows: 3;
  }

  pre, blockquote, table {
    page-break-inside: avoid;
  }
}
