/* Training doc stylesheet — pandoc --standalone -c style.css --highlight-style=pygments */

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

/* Page — max-width on body directly avoids per-element margin:auto weirdness */
body {
  font-family: -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  color: #24292f;
  background: #ffffff;
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 2rem 5rem;
}

/* Headings — body prefix raises specificity to (0,0,2) to beat any injected h1 rule */
body h1, body h2, body h3, body h4, body h5, body h6 {
  font-weight: 600;
  line-height: 1.25;
  margin-top: 1.5em;
  margin-bottom: 0.4em;
  text-align: left;
}

body h1 { font-size: 1.875rem; border-bottom: 1px solid #d0d7de; padding-bottom: 0.3em; margin-top: 1em; }
body h2 { font-size: 1.5rem;   border-bottom: 1px solid #d0d7de; padding-bottom: 0.2em; }
body h3 { font-size: 1.25rem; }
body h4 { font-size: 1rem; color: #57606a; }

p  { margin: 0.8em 0; }
a  { color: #0969da; text-decoration: none; }
a:hover { text-decoration: underline; }
strong { font-weight: 600; }

/* Inline code */
code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.875em;
  background: #f0f0f0;
  padding: 0.2em 0.4em;
  border-radius: 3px;
}

/* Code blocks
   div.sourceCode  — pandoc wrapper for language-tagged fenced blocks
   pre             — unlabeled fenced blocks (no div wrapper)
   pre.sourceCode  — the <pre> inside div.sourceCode; reset so the outer div's
                     border/background shows and there's no double-border */
pre, div.sourceCode {
  background: #f6f8fa;
  border: 1px solid #d0d7de;
  border-radius: 6px;
  overflow-x: auto;
  margin: 1em 0;
}

pre {
  padding: 1em 1.25em;
  line-height: 1.5;
}

div.sourceCode {
  padding: 1em 1.25em;
}

pre.sourceCode {
  background: transparent;
  border: none;
  margin: 0;
  padding: 0;
  overflow: visible;
  line-height: 1.5;
}

pre code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.875rem;
  background: none;
  color: inherit;
  padding: 0;
  border: none;
  white-space: pre;
}

/* Blockquote */
blockquote {
  margin: 1em 0;
  padding: 0.5em 1em;
  border-left: 4px solid #d0d7de;
  color: #57606a;
  background: #f6f8fa;
}
blockquote p { margin: 0.3em 0; }

/* Tables */
table {
  border-collapse: collapse;
  width: 100%;
  margin: 1em 0;
  font-size: 0.9rem;
}

th, td {
  border: 1px solid #d0d7de;
  padding: 0.5em 0.75em;
  text-align: left;
  vertical-align: top;
}

thead tr  { background: #f6f8fa; font-weight: 600; }
tbody tr:nth-child(even) { background: #f9f9f9; }

/* Lists */
ul, ol { padding-left: 2em; margin: 0.5em 0; }
li { margin: 0.3em 0; }
li > ul, li > ol { margin-top: 0.2em; }

/* HR */
hr { border: none; border-top: 1px solid #d0d7de; margin: 2em 0; }

/* Images */
img { max-width: 100%; border-radius: 4px; display: block; margin: 1em 0; }

/* Table of Contents (pandoc --toc) */
nav#TOC {
  background: #f6f8fa;
  border: 1px solid #d0d7de;
  border-radius: 6px;
  padding: 1em 1.25em;
  margin-bottom: 2em;
  font-size: 0.9rem;
}

nav#TOC ul { list-style: none; padding-left: 1em; margin: 0.2em 0; }
nav#TOC > ul { padding-left: 0; }
nav#TOC li  { margin: 0.2em 0; }
nav#TOC a   { color: #24292f; text-decoration: none; }
nav#TOC a:hover { color: #0969da; text-decoration: underline; }

/* Definition lists */
dl { margin: 1em 0; }
dt { font-weight: 600; margin-top: 0.75em; }
dd { margin-left: 1.5em; color: #57606a; }

/* Callout divs: ::: note / ::: tip / ::: warning / ::: caution
   Requires pandoc -f markdown+fenced_divs */
div.note, div.tip, div.warning, div.caution {
  padding: 0.75em 1em;
  border-radius: 6px;
  border-left: 4px solid;
  margin: 1em 0;
  font-size: 0.9rem;
}

div.note    { background: #ddf4ff; border-color: #0969da; }
div.tip     { background: #dafbe1; border-color: #1a7f37; }
div.warning { background: #fff8c5; border-color: #d4a72c; }
div.caution { background: #ffebe9; border-color: #cf222e; }
