/*
 * I add this to html files generated with pandoc.
 */

:root {
  --bgt: #fbf1c7;
  --bge: #fbf8e4;
  --bg0: #f9f5d7;
  --bg: #fbf1c7;
  --bg1: #ebdbb2;
  --bg2: #d5c4a1;
  --bg3: #bdae93;
  --bg4: #a89984;
  --fg4: #7c6f64;
  --fg3: #665c54;
  --fg2: #504945;
  --fg1: #3c3836;
  --fg0: #282828;
  --fg: #282828;
  --fg0_h: #1d2021;
  --fg1: #3c3836;
  --ntred: #cc241d;
  --ntgreen: #98971a;
  --ntyellow: #d79921;
  --ntblue: #458588;
  --ntpurple: #b16286;
  --ntaqua: #689da6;
  --ntorange: #d65d0e;
  --ntgrey: #7c6f64;
  --dkred: #9d0006;
  --dkgreen: #79740e;
  --dkyellow: #b57614;
  --dkblue: #076678;
  --dkblue0: #054c5a;
  --dkblue1: #03333b;
  --dkpurple: #8f3f71;
  --dkaqua: #427b58;
  --dkgrey: #3c3836;
  --ltred: #fb4934;
  --ltgreen: #b8bb26;
  --ltyellow: #fabd2f;
  --ltblue: #83a598;
  --ltpurple: #d3869b;
  --ltaqua: #8ec07c;
}

@media (prefers-color-scheme: dark) {
  body {
    background-color: var(--dkblue0);
    color: var(--bg1);
  }

  .subtitle {
    color: var(--bg3);
  }

  main {
    background-color: var(--fg0);
  }

  nav {
    color: red;
    background-color: var(--dkblue1);

    a {
      color: var(--ntblue);
    }
    a:visited {
      color: var(--ntblue);
    }
    a.active {
      background-color: var(--dkblue0);
      color: #faf8e4 !important;
    }
    a:hover {
      background-color: var(--dkblue);
      color: var(--bg);
    }
  }

  blockquote {
    border-left: 0.5em var(--fg2) solid;
    color: var(--bg3);
  }

  div.sourceCode {
    color: var(--bg1) !important;
    background-color: var(--fg0_h) !important;
    a::before {
      color: var(--bg2) !important;
      background-color: var(--fg0_h) !important;
    }
  }

  code {
    background-color: var(--fg0_h);
  }
  pre,
  code,
  kbd,
  samp {
    color: var(--bg1) !important;
  }

  hr {
    border-top: 1px solid var(--bg4) !important;
    border-bottom: 1px solid var(--bg4) !important;
  }

  #header {
    color: var(--bg);
    background-color: var(--dkblue0);
  }

  footer {
    border-top: 0.5rem solid var(--dkblue1);
    background-color: var(--dkblue0);
  }

  .anchor::before {
    content: url("/pandoc/link-dark.svg");
    opacity: 0.35;
  }

  code {
    span { color: var(--bg2) !important; } /* Normal */
    span.al { color: var(--dkred) !important; font-weight: bold; } /* Alert */
    span.an { color: var(--ltpurple) !important; } /* Annotation */
    span.at { color: var(--ltblue) !important; } /* Attribute */
    span.bn { color: var(--ltyellow) !important; } /* BaseN */
    span.bu { color: var(--ltpurple) !important; font-weight: bold; } /* BuiltIn */
    span.cf { color: var(--ltred) !important; font-weight: bold; } /* ControlFlow */
    span.ch { color: var(--ltgreen) !important; } /* Char */
    span.cn { color: var(--ltred) !important; } /* Constant */
    span.co { color: var(--ltgrey) !important; } /* Comment */
    span.cv { color: var(--ltgrey) !important; } /* CommentVar */
    span.do { color: var(--ltgreen) !important; } /* Documentation */
    span.dt { color: var(--ltyellow) !important; } /* DataType */
    span.dv { color: var(--ltpurple) !important; } /* DecVal */
    span.er { color: var(--ltred) !important; text-decoration: underline; } /* Error */
    span.ex { color: var(--ltblue) !important; font-weight: bold; } /* Extension */
    span.fl { color: var(--ltyellow) !important; } /* Float */
    span.fu { color: var(--ltpurple) !important; } /* Function */
    span.im { color: var(--ltorange) !important; } /* Import */
    span.in { color: var(--ltorange) !important; } /* Information */
    span.kw { color: var(--ltred) !important; font-weight: bold; } /* Keyword */
    span.op { color: var(--ltpurple) !important; } /* Operator */
    span.ot { color: var(--ltgreen) !important; } /* Other */
    span.pp { color: var(--ltblue) !important; } /* Preprocessor */
    span.re { color: var(--ltblue) !important; } /* RegionMarker */
    span.sc { color: var(--ltgreen) !important; } /* SpecialChar */
    span.ss { color: var(--ltgreen) !important; } /* SpecialString */
    span.st { color: var(--ltgreen) !important; } /* String */
    span.va { color: var(--ltblue) !important; } /* Variable */
    span.vs { color: var(--ltred) !important; } /* VerbatimString */
    span.wa { color: var(--dkyellow) !important; } /* Warning */
  }
}

@media (prefers-color-scheme: light) {
  body {
    color: var(--fg0);
    background-color: var(--dkblue);
  }

  main {
    background-color: var(--bge);
  }

  .subtitle {
    color: var(--fg2);
  }

  nav {
    color: #faf8e4;
    background-color: #054c5a;

    a {
      color: #458587;
    }
    a:visited {
      color: #458587;
    }
    a.active {
      background-color: #458587;
      color: #faf8e4 !important;
    }
    a:hover {
      background-color: var(--dkblue);
      color: var(--bg);
    }
  }

  blockquote {
    border-left: 0.5em var(--fg0) solid;
    color: var(--ntgrey);
  }

  h1,
  h2,
  h3,
  h4,
  h5,
  h6 {
    color: var(--fg0)
  }

  code {
    background-color: var(--bg);
    color: var(--fg0);
  }

  a code {
    color: var(--fg0);
  }

  #header {
    color: #faf8e4;
    background-color: #066678;
  }

  hr {
    border-top: 1px solid var(--fg4) !important;
    border-bottom: 1px solid var(--fg4) !important;
  }

  footer {
    border-top: 0.5rem solid var(--dkblue0);
    background-color: var(--dkblue);
    color: #faf8e4;
  }

  .anchor::before {
    content: url("/pandoc/link-light.svg");
    opacity: 0.20;
  }
}

html {
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
}

body {
  font-family: century_supra_a, Georgia, serif;
  font-size: 16px;
  line-height: 1.7;
  margin: 0;
}

main {
  min-height: 100vh;
  position: relative;
}

#header {
  padding: 0.3rem 0;
  border-bottom: 1px solid #458587;
  font-size: 2rem;
}

nav .content {
  display: flex;
  padding: 0;

  a {
    text-decoration: none;
    font-size: 1em;
    padding: 0.15em 1em;
  }
}

footer {
  height: 2rem;
  position: absolute;
  bottom: 0;
  width: 100%;
  display: flex;
  font-size: 0.8rem;
}

footer .content {
  display: flex;
  align-items: center;
  gap: 1em;
  height: 100%;
}

.content {
  margin: auto;
  padding: 0 0.5rem;
  max-width: 50rem;
}

.content-wrap {
  padding-bottom: 4rem;
  overflow-wrap: break-word;
}

code {
  border-radius: 5em / 10em;
  padding-left: 0.3em;
  padding-right: 0.3em;
}

a {
  color: var(--ntblue);
  text-decoration: none;
}

a:visited {
  color: var(--dkblue);
}

a:hover {
  color: var(--ntblue);
}

a:active {
  color: var(--ntblue);
}

a:focus {
  outline: thin dotted;
}

a code {
  text-decoration-line: underline;
}

strong a {
  text-decoration-line: underline;
}

strong a:hover {
  text-decoration-line: underline;
}

strong a:visited {
  text-decoration-line: underline;
}

*::-moz-selection {
  /* background: var(--ntred); */
  background: rgba(255, 255, 0, 0.3);
  color: var(--fg0);
}

*::selection {
  background: rgba(255, 255, 0, 0.3);
  color: var(--fg0);
}

a::-moz-selection {
  background: rgba(255, 255, 0, 0.3);
  color: var(--ntblue);
}

a::selection {
  background: rgba(255, 255, 0, 0.3);
  color: var(--ntblue);
}

p {
  margin: 1em 0;
}

img {
  max-width: 100%;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  line-height: 125%;
  /* margin-top: 1em; */
  font-weight: normal;
}

h4,
h5,
h6 {
  font-weight: bold;
}

h1 {
  font-size: 2.25em;
}

h2 {
  font-size: 2em;
}

h3 {
  font-size: 1.5em;
}

h4 {
  font-size: 1.2em;
}

h5 {
  font-size: 1em;
}

h6 {
  font-size: 0.9em;
}

blockquote {
  margin: 0;
  padding-left: 3em;
}

hr {
  display: block;
  height: 2px;
  border: 0;
  margin: 1em 0;
  padding: 0;
}

pre,
code,
kbd,
samp {
  font-family: monospace, monospace;
  _font-family: 'courier new', monospace;
  font-size: 0.98em;
}

pre {
  white-space: pre;
  white-space: pre-wrap;
  word-wrap: break-word;
}

b,
strong {
  font-weight: bold;
}

dfn {
  font-style: italic;
}

ins {
  background: #ff9;
  color: #000;
  text-decoration: none;
}

mark {
  background: #ff0;
  color: #000;
  font-style: italic;
  font-weight: bold;
}

sub,
sup {
  font-size: 75%;
  line-height: 0;
  position: relative;
  vertical-align: baseline;
}

sup {
  top: -0.5em;
}

sub {
  bottom: -0.25em;
}

ul,
ol {
  margin: 1em 0;
  padding: 0 0 0 2em;
}

li p:last-child {
  margin-bottom: 0;
}

ul ul,
ol ol {
  margin: .3em 0;
}

dl {
  margin-bottom: 1em;
}

dt {
  font-weight: bold;
  margin-bottom: .8em;
}

dd {
  margin: 0 0 .8em 2em;
}

dd:last-child {
  margin-bottom: 0;
}

img {
  border: 0;
  -ms-interpolation-mode: bicubic;
  vertical-align: middle;
}

figure {
  display: block;
  text-align: center;
  margin: 1em 0;
}

figure img {
  border: none;
  margin: 0 auto;
}

figcaption {
  font-size: 0.8em;
  font-style: italic;
  margin: 0 0 .8em;
}

table {
  margin-bottom: 2em;
  border-bottom: 1px solid #ddd;
  border-right: 1px solid #ddd;
  border-spacing: 0;
  border-collapse: collapse;
}

table th {
  padding: .2em 1em;
  background-color: #eee;
  border-top: 1px solid #ddd;
  border-left: 1px solid #ddd;
}

table td {
  padding: .2em 1em;
  border-top: 1px solid #ddd;
  border-left: 1px solid #ddd;
  vertical-align: top;
}

.author {
  font-size: 1.2em;
  text-align: left;
}

.date {
  font-size: 1.2em;
  text-align: left;
}

@media print {
  * {
    background: transparent !important;
    color: black !important;
    filter: none !important;
    -ms-filter: none !important;
  }

  body {
    font-size: 12pt;
  }

  .content {
    max-width: 100%;
  }


  a,
  a:visited {
    text-decoration: underline;
  }

  hr {
    height: 1px;
    border: 0;
    border-bottom: 1px solid black;
  }

  a[href]:after {
    content: " (" attr(href) ")";
  }

  abbr[title]:after {
    content: " (" attr(title) ")";
  }

  .ir a:after,
  a[href^="javascript:"]:after,
  a[href^="#"]:after {
    content: "";
  }

  pre,
  blockquote {
    border: 1px solid #999;
    padding-right: 1em;
    page-break-inside: avoid;
  }

  tr,
  img {
    page-break-inside: avoid;
  }

  img {
    max-width: 100% !important;
  }

  @page :left {
    margin: 15mm 20mm 15mm 10mm;
  }

  @page :right {
    margin: 15mm 10mm 15mm 20mm;
  }

  p,
  h2,
  h3 {
    orphans: 3;
    widows: 3;
  }

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

/* show the anchor links in headings if one hovers over the heading. */
.anchor::before {
  display: inline-block;
  font-size: 1em;
  left: -1.5em;
  line-height: 1.5;
  position: relative;
  width: 0em;
}

.anchor:hover {
  text-decoration: none;
}

h1:hover>.anchor::before,
h2:hover>.anchor::before,
h3:hover>.anchor::before,
h4:hover>.anchor::before,
h5:hover>.anchor::before,
h6:hover>.anchor::before {
  opacity: 1;
}

/* end: heading anchor links */
