:root {
  --text: black;
  --bg: white;
  --text-blend: #666;
  --border: rgb(220, 220, 220);
  --bg-blend: rgb(200, 200, 200);
  --bg-code-blend: rgb(250, 250, 250);
  --text-blend-2:rgb(182, 182, 182);
  --syntax-data-type: #6161c1;
  --syntax-comment: var(--text-blend-2);
  --syntax-comment: var(--text-blend-2);
  --syntax-value: #b85c00;
  --syntax-keyword: currentColor;
}

* {
  line-height: inherit;
}

@media (prefers-color-scheme: dark) {
  :root {
    --text: rgb(232, 232, 232);
    --border: rgb(66, 66, 66);
    --bg: #18191B;
    --bg-blend: #2b2d31;
    --bg-code-blend: #2b2d31;
    --text-blend: rgb(200, 200, 200);
    --text-blend-2: rgb(150, 150, 150);
    --syntax-value: orange;
    --syntax-data-type: #9191dd;
  }
}

blockquote {
  margin: 0;
  background-color: var(--bg-blend);
  padding: .5rem;
  border-radius: 5px;

  p, ul {
    margin-block: .4em;
  }

  > :first-child {
    margin-top: 0;
  }

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

#TOC {
  align-items: center;
  border-block: 1px solid currentColor;
  margin-bottom: 2rem;

  display: grid;
  gap: 15px;

  > ul {
    display: grid;
    padding-left: 0px;

    ul {
      padding-left: 20px;
    }
  }

  @media (min-width: 800px) {
    grid-template-columns: auto 1fr;

    > ul {
      grid-template-columns: repeat(auto-fit, minmax(85px, 1fr));
    }
  }


  &:hover {
    color: var(--text);
  }
  color: var(--text-blend-2);

  > span {
    font-size: 1.2rem;
  }
  ul {
    list-style: none;
  }
  a {
    display: block;
    padding: .2rem .4rem;
    color: currentColor;
    text-decoration: none;
    &:hover {
      background-color: var(--bg-blend);
    }
  }
}

body {
  box-sizing: border-box;
  font-family: "Libre Baskerville", serif;
  padding: 0 5vw;
  margin-left: auto;
  margin-right: auto;
  max-width: 1400px;

  color: var(--text);
  background-color: var(--bg);
}

header {
  font-family: "Source Code Pro", monospace;
  display: grid;
  align-items: center;
  justify-items: center;
  text-align: center;
  padding-block: 2.5rem;

  .header-title {
    font-size: 2rem;
    font-weight: 600;
  }

  .header-subtitle {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
  }

  .header-meta {
    font-size: 0.95rem;
    color: var(--text-blend);
    line-height: 1.6;
  }

  .header-author {
    font-weight: 500;
  }

  .header-date {
    font-style: italic;
    opacity: 0.8;
  }
}

.sitenav {
  display: flex;
  justify-content: space-between;
}

p {
  text-align: justify;
}

pre, code {
  font-family: "Fira Code", "Source Code Pro", monospace;
}

pre.sourceCode {
  -ms-overflow-style: none; /* Internet Explorer 10+ */
  scrollbar-width: 0px;
  scrollbar-width: none; /* Firefox */
  &::-webkit-scrollbar  {
    display: initial;
  }
}

code {
  white-space: nowrap;
}

/* semantic highlighting */
code.haskell {
  /* DataTypes */
  .dt {
    color: var(--syntax-data-type);
  }
  /* Comment */
  .co {
    color: var(--syntax-comment);
  }
  /* Value */
  .dv {
    color: var(--syntax-value);
  }
  /* Char Literal */
  .ch {
    color: var(--syntax-value);
  }
  /* String Literal */
  .st {
    color: var(--syntax-value);
  }
  /* keyword */
  .kw {
    color: var(--syntax-keyword);
    font-weight: bold;
  }
}

.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: stretch;
  margin-left: auto;
  margin-right: auto;
  column-gap: 2rem;

  .lhs {
    overflow: hidden;
  }
}

pre {
  overflow: auto;
}

.code {
  padding-bottom: 1rem;
  max-width: 100%;
  overflow: auto;
}

@media (max-width: 768px) {
  body {
    max-width: 100%;
  }

  .row {
    grid-template-columns: 1fr;
    gap: 0.0rem;
    margin-bottom: 1rem;
  }

  .code {
    background-color: var(--bg-code-blend);
    padding: 10px !important;
    border: 1px solid var(--border);
    border-radius: 10px;
  }

  .row > p {
    margin-bottom: 0;
  }

  .code {
    padding: 0;
  }
}

figure {
  display: grid;
  align-items: center;
  justify-content: center;

  img {
    max-width: min(400px, 80vw);
    margin-bottom: .4rem;
  }

  figcaption {
    color: var(--text-blend-2);
    font-size: .8rem;
    text-align: center;
  }
}

h1 {
  font-size: 1.8rem;
  margin-bottom: 1.6rem;
  margin-top: 4rem;
}

h2 {
  font-size: 1.5rem;
  margin-block: 1.6rem;
}

h3 {
  font-size: 1.1rem;
  margin-bottom: 1rem;
}

p {
  margin-top: 0px;
}

div.sourceCode {
  margin-top: 0px;
  line-height: 1.3;
}

a {
  color: var(--syntax-data-type);
  text-decoration: none;

  &:hover {
    text-decoration: underline;
  }

  &:visited {
    color: var(--syntax-value);
  }
}

