@font-face {
  font-family: "SignikaRegular";
  src: url("Signika-Regular.ttf") format("truetype");
  font-weight: normal;
}

@font-face {
  /*
    To get multiple Signika fonts to work with wkhtmltopdf, I needed to edit the font
    using FontForge. You need to change the "Preferred Family" attribute to be unique,
    otherwise wkhtmltopdf will only use one of the fonts. See https://stackoverflow.com/a/45524377
  */

  font-family: "SignikaLight";
  src: url("Signika-Light-modified.ttf") format("truetype");
  font-weight: 300;
}

@font-face {
  font-family: "Source Code Pro";
  src: url("SourceCodePro-Regular.ttf") format("truetype");
  font-style: normal;
}

html {
  font-size: 14px;
  font-weight: 300;
  font-family: SignikaLight;
}

body::before {
  content: " "; /* this is needed to fix some font rendering quirk */
  font-family: SignikaLight;
}

b,
strong {
  font-weight: 700;
}

h1,
h2,
h3,
h4,
h5,
h6,
th {
  font-family: SignikaRegular;
  font-weight: normal;
}

h2 {
  margin: 4rem 0;
}

h3 {
  margin-top: 5rem;
  margin-bottom: 3rem;
}

h4,
h5,
h6 {
  margin-top: 4rem;
  margin-bottom: 2.5rem;
}

p,
ul {
  margin-bottom: 2rem;
}

a {
  text-decoration: none;
}

hr {
  margin-top: 7rem;
  border-top: 1px solid #ebeff2;
}

blockquote {
  border-left: 5px solid #ebeff2;
  padding-left: 1rem;
  margin-left: 0;
}

img {
  max-width: 100%;
}

/* Code */
pre,
code {
  font-family: Source Code Pro;
  font-weight: normal;
  line-height: 1.5;
  padding: 0.3rem;
  border-radius: 0.2rem;
}

code {
  color: #457a00;
  background-color: #f0f4f7;
  white-space: pre-wrap !important; /* SourceCode pandoc will override otherwise */
  word-break:break-word;
}

pre {
  background-color: #f8f8f8; /* match SourceCode pandoc highlighting colors */
  margin-bottom: 2rem;
}

pre code {
  padding: 0;
  border-radius: unset;
  color: black;
  background-color: #f8f8f8; /* match SourceCode pandoc highlighting colors */
}

/* fix wkhtml2pdf incompatibility with v3+ versions of pandoc */
pre > code.sourceCode > span { display: inline-block; }

div.sourceCode { margin-bottom: 2rem; }

@media screen {
  div.sourceCode { overflow: visible; }
}

pre.output {
  margin-top: -2rem;
  border-top: 1px dotted black;
}

pre.output, pre.output code  {
  background-color: black;
  color: white;
}

pre.output::before {
  content: "output";
  display: block;
  margin: -0.2rem -0.1rem 0.3rem;
  border-radius: 0.2rem;
  background-color: #f8f8f8;
  color: black;
  text-align: center;
}


/* Tables */
table {
  margin: 3rem 0;
  text-align: left;
  border-collapse: collapse;
  max-width: 100% !important;
}

thead {
  font-weight: bold;
}

table tbody tr td:last-child, table th:nth-of-type(n+3)
{
  word-break:break-word;
}


tbody tr {
  border-top: 1px solid #ebeff2;
}

th,
td {
  padding: 0.3rem 0;
  padding-right: 1.5rem;
}

/*
 * details / summary
 */

details hr {
  display: none;
}

summary {
  display: block;
}

summary::-webkit-details-marker { display: none }

/* 
 * page break hints
 * wkhtmltopdf doesn't support page-break-after: avoid, so using this hack: https://stackoverflow.com/questions/9238868/how-do-i-avoid-a-page-break-immediately-after-a-heading/53742871#53742871
 */

h1,
h2,
h3,
h4,
h5,
h6,
.next-pre-has-output {
  page-break-inside: avoid;
}

h1::after, h2::after, h3::after, h4::after, h5::after, h6::after, .next-pre-has-output {
  content: "";
  display: block;
  height: 9em;
  margin-bottom: -10em;
  line-height: 0;
}

h2 {
  page-break-before: always;
}

p, tr, li, blockquote, pre {
  page-break-inside: avoid;
}
