@font-face {
  font-family: 'Graublau-Web';
  src: url('../fonts/graublau-web.ttf');
}

@font-face {
  font-family: 'Linux Libertine O Regular';
  src: url('../fonts/LinLibertine_R.woff');
}

@media print {
  header,
  main,
  footer {
    padding: 0 2rem;
  }

  .sidebar {
    display: none;
  }
}

:root {
  --primary-color: #851418;
  --primary-color-dark: #430a0c;
  --text-color: #444;
  --white-text-color: #fff;
  --bg-color: #eee;
  --bg-section-color: #f5f5f5;
  --border-color: #ddd;

  --code-red: #d7263d;
  --code-green: #228b22;
  --code-blue: #0074d9;
  --code-yellow: #b58900;
  --code-purple: #6c71c4;
  --code-grey: #999;
}

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

html,
body {
  max-width: 100%;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-color);
  text-align: justify;
  padding: 1rem;
  display: grid;
  grid-template-columns: 1fr;
}

body > * {
  min-width: 0;
  word-wrap: break-word;
}

@media (min-width: 62rem) {
  body {
    padding: 8rem;
    grid-template-columns: 2fr 1fr;
  }
}

header,
main,
footer {
  grid-column: 1;
}

header {
  grid-row: 1;
  min-height: 1px;
  padding-left: 0;
  padding-right: 0;
}

@media (min-width: 62rem) {
  header {
    padding-left: 15px;
    padding-right: 15px;
  }
}

.title-container {
  display: flex;
  align-items: center;
  column-gap: 2rem;
  margin-bottom: 23px;
}

.title-img {
  width: 125px;
  padding: 4px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
}

.citation {
  font-family: Helvetica, Arial, sans-serif;
  padding-bottom: 20px;
  line-height: 1.25em;
}

main {
  grid-row: 2;
}

.content {
  border-right: unset;
  text-align: justify;
  min-height: 1px;
  padding-left: 0;
  padding-right: 0;
}

@media (min-width: 62rem) {
  .content {
    border-right: solid 1px var(--bg-color);
    padding-left: 15px;
    padding-right: 15px;
  }
}

h1,
h2,
h3,
h4 {
  font-family: 'Graublau-Web', sans-serif;
  font-weight: 500;
  text-align: left;
  line-height: 1.2;
  color: inherit;
  margin-top: 23px;
  margin-bottom: 11.5px;
}

h1 {
  font-size: 1.8em;
}

h2 {
  font-size: 1.6em;
}

h3 {
  font-size: 1.4em;
}

h4 {
  font-size: 1.2em;
  margin-top: 11.5px;
}

@media (min-width: 62rem) {
  h1 {
    font-size: 2.2em;
  }

  h2 {
    font-size: 1.8em;
  }

  h3 {
    font-size: 1.5em;
  }

  h4 {
    font-size: 1.3em;
  }
}

p {
  font-family: 'Linux Libertine O Regular', serif;
  margin: 0 0 11.5px;
  font-size: 130%;
  line-height: 150%;
}

a {
  color: var(--primary-color);
}

a:hover {
  color: var(--primary-color-dark);
}

ul,
ol {
  margin-bottom: 23px;
  list-style: none;
}

li {
  line-height: 1.5;
}

dl {
  margin-bottom: 23px;
}

dt {
  font-family: 'Graublau-Web', sans-serif;
  font-weight: bold;
  margin-top: 1rem;
}

dd {
  padding-left: 1rem;
}

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

blockquote {
  margin: 23px 0 23px 11.5px;
  padding-left: 1rem;
  font-style: italic;
  text-align: left;
  border-left: 2px solid var(--border-color);
}

blockquote p {
  padding-bottom: 0;
}

figure img {
  width: 50%;
  max-width: 100%;
}

@media (min-width: 62rem) {
  figure img {
    width: 60%;
    max-width: 100%;
    height: auto;
  }
}

.aside,
.note {
  margin: 1rem 0 2rem;
  padding: 1rem;
}

.aside {
  border-left: 2px solid var(--primary-color);
  background-color: var(--bg-color);
}

.note {
  border: 2px solid var(--primary-color);
  background-color: var(--bg-color);
}

.aside p,
.note p {
  font-family: 'Graublau-Web', sans-serif;
  font-size: 14px;
  margin: 0;
}

section.category {
  margin-bottom: 1.5rem;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
}

section.category :not(h2) {
  padding: 0 15px;
}

section.category h2 {
  border-bottom: 1px solid var(--border-color);
  background-color: var(--bg-section-color);
  font-size: 1.3em;
  padding: 10px 15px;
  margin-top: 0;
}

section.category a {
  padding: 0;
}

aside {
  grid-row: 3;
  grid-column: 1;
  position: relative;
}

@media (min-width: 62rem) {
  aside {
    grid-row: 1 / span 3;
    grid-column: 2;
  }
}

.author {
  padding-top: 1rem;
  padding-bottom: unset;
  padding-left: 0;
  padding-right: 0;
}

@media (min-width: 62rem) {
  .author {
    padding-top: calc(8rem + 10px);
    padding-bottom: 10px;
    padding-left: 15px;
    padding-right: 15px;
  }
}

.img-container {
  position: relative;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  overflow: hidden;
}

.layover {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--primary-color);
  transform: translateY(100%);
  transition: transform 0.3s ease;
}

.img-container:hover .layover {
  transform: translateY(0);
}

.layover .author-info {
  padding: 5px 10px;
  font-size: 12px;
  font-style: italic;
  color: var(--white-text-color);
}

.author-img {
  padding: 10px;
  margin: 0 auto;
  display: block;
}

.sidebar-nav {
  display: none;
}

@media (min-width: 62rem) {
  .sidebar-nav {
    width: 100%;
    overflow-y: scroll;
    padding-left: 15px;
    padding-right: 15px;
    text-align: left;
    display: block;
  }
}

.sidebar-nav.sticky {
  width: calc((100% - 16rem) / 3);
  position: fixed;
  top: 0;
}

.sidebar-nav .toc ul {
  margin-bottom: 0;
  list-style: none;
}

.sidebar-nav .toc ul li a {
  padding: 5px 10px;
  display: block;
  font-size: 1.3em;
  color: var(--primary-color);
  text-decoration: none;
  transition: color 0.2s;
}

.sidebar-nav .toc ul li ul li a {
  font-size: inherit;
}

.sidebar-nav .toc a:hover {
  color: var(--primary-color-dark);
}

.sidebar-nav .toc a.active {
  background-color: var(--bg-color);
  padding: 5px 10px;
}

code {
  font-family: monospace;
  font-size: 14px;
  color: var(--text-color);
  background-color: var(--bg-color);
  padding: 2px 4px;
}

.sourceCode:first-child {
  background-color: var(--bg-color);
  overflow-x: auto;
  margin: 23px 0;
}

pre.sourceCode {
  padding: 1rem;
  overflow-x: auto;
  font-size: 14px;
  white-space: pre;
}

@media (min-width: 62rem) {
  pre.sourceCode {
    padding: 1rem 2rem;
  }
}

.sourceCode .co {
  color: var(--code-grey);
  font-style: italic;
}

.sourceCode .bu {
  color: var(--code-blue);
  font-weight: bold;
}

.sourceCode .st {
  color: var(--code-red);
}

.sourceCode .kw {
  color: var(--primary-color);
  font-weight: bold;
}

.sourceCode .dt {
  color: var(--code-green);
}

.sourceCode .op {
  color: var(--code-red);
}

.sourceCode .fu {
  color: var(--code-green);
}

.sourceCode .va {
  color: var(--code-yellow);
}

.sourceCode .pp {
  color: var(--code-purple);
}

.table-container {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  margin: 23px 0;
  font-size: 14px;
  border-collapse: collapse;
}

table caption {
  caption-side: bottom;
  padding-top: 0.5rem;
  text-align: left;
}

table thead tr th,
table tbody tr td {
  padding: 0.5rem;
  text-align: left;
  border-bottom: 1px solid var(--primary-color);
}

table thead tr th {
  vertical-align: bottom;
  color: var(--primary-color);
}

footer {
  grid-row: 4;
}

@media (min-width: 62rem) {
  footer {
    grid-row: 3;
  }
}

.footer-text p.link-list,
.footer-text p.license {
  font-family: Helvetica, Arial, sans-serif;
  font-size: 14px;
}

.footnotes hr {
  display: none;
}

.footnote-ref {
  text-decoration: none;
  vertical-align: baseline;
}

.footnote-ref::before {
  content: '[';
}

.footnote-ref::after {
  content: ']';
}

.footnote-ref sup {
  vertical-align: baseline;
  font-size: inherit;
}

.footnotes ol {
  list-style: none;
  padding-left: 0;
  counter-reset: footnote;
}

.footnotes li {
  counter-increment: footnote;
  margin-bottom: 1em;
  position: relative;
  padding-left: 2em;
}

.footnotes li::before {
  content: '[' counter(footnote) '] ';
  position: absolute;
  left: 0;
  color: var(--primary-color);
}

.footnotes li p {
  font-family: Helvetica, Arial, sans-serif;
  font-size: 14px;
}

.footnote-back {
  opacity: 0;
  position: absolute;
  width: 2em;
  height: 1.5em;
  left: 0;
  top: 0;
}
