@import url(https://fonts.googleapis.com/css?family=PT+Sans:400,700,400italic,700italic);
@import url(https://fonts.googleapis.com/css?family=Source+Code+Pro);
@import "colors.css";

@font-face {
    font-family: "MapleMono";
    src: url('./fonts/MapleMono-Regular.ttf') format("truetype");
}

@font-face {
    font-family: "IosevkaFixed";
    src: url('./fonts/IosevkaFixed-Regular.ttf') format("truetype");
}

#layout {
  display: grid;
  grid-template-columns: 3fr 1fr;
  gap: 40px;
  max-width: 1100px;
  margin: 5rem auto auto auto;
}

#sidebar {
  color: var(--on_surface);
  border-radius: 16px;
}

#sidebar h1 {
  font-size: 2em;
  font-weight: bold;
  margin-top: 0em;
  color: var(--primary);
  border-radius: 32px;
  text-align: center;
  padding: 0.1rem 0;
}

#sidebar h3 {
  text-align: center;
  margin: 0 0 0.5rem 0;
}

.buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}

.buttons img {
    display: inline-block;
    margin: 0 0;
    max-width: none;
}

#index {
  display: grid;
  grid-template-columns: 40% 60%;
}

.highlight {
  overflow: scroll;
  background: var(--on_primary);
  border-radius: 8px;
}

.highlight pre {
    background-color: transparent;
    font-size: 1rem;
}

.MathJax_Display {
  overflow-x: scroll;
}

.MJX-TEX {
  background: var(--primary);
  color: var(--background);
  border-radius: 8px;
  padding: 0.2rem 1rem !important;
}

.mermaid {
  overflow: scroll;
  text-align: center;
}

header {
  color: var(--primary);
  text-align: right;
}

header span {
    background: var(--primary);
    color: var(--background);
    border-radius: 16px;
    padding: 0.2rem 1rem;
}

#prev {
  text-align: center;
}

.prev-link::before {
  content: "↜";
  font-size: 1.3rem;
  color: var(--background);
  background: var(--primary);
  border-radius: 8px;
  padding: 0.05rem 0.3rem;
}

#next {
  text-align: center;
  margin-left: auto;
}

.next-link::after {
  content: "↝";
  font-size: 1.3rem;
  color: var(--background);
  background: var(--primary);
  border-radius: 8px;
  padding: 0.05rem 0.3rem;
}

@media only screen and (min-width: 800px) {
  nav {
    display: flex;
    flex-direction: row;
  }

  #prev {
    padding-right: 5px;
    text-align: left;
    width: 50%;
  }

  #next {
    padding-left: 5px;
    text-align: right;
    width: 50%;
  }
}

footer {
  color: var(--primary);
  margin-top: 20px;
  text-align: center;
}

footer span {
    background: var(--primary);
    color: var(--background);
    border-radius: 16px;
    padding: 0.2rem 1rem;
}

footer span a {
    color: var(--background);
}

a {
  font-weight: bold;
  text-decoration: none;
  color: var(--primary);
}

blockquote {
  border-left: 10px solid var(--primary);
  border-radius: 8px;
  color: var(--secondary_fixed_dim);
  background: color-mix(in srgb, var(--primary) 5%, transparent);
  margin-left: 0;
  margin-right: 30px;
  padding-left: 20px;
}

body {
  background-color: var(--background);
  color: var(--on_surface);
  font-family: 'MapleMono', sans-serif;
  font-size: 1em;
  line-height: 1.4em;
  margin: auto;
  max-width: 800px;
  padding: 20px;
  text-align: justify;
  word-wrap: break-word;
}

h1 {
  color: var(--primary);
  line-height: 1.2em;
  text-align: left;
}

h2 {
  color: var(--secondary);
}

h3 {
  color: var(--tertiary);
}

@media only screen and (min-width: 800px) {
  body {
      font-size: 1.1em;
  }
}

code {
  border-radius: 8px;
  padding: 2px 4px;
}

p code {
  background: var(--tertiary);
  font-size: 0.9rem;
  color: var(--background);
}

pre {
  color: var(--primary_fixed);
  padding: 5px 20px;
  background-color: var(--on_primary);
  border-radius: 8px;
}

code, pre {
  font-family: 'IosevkaFixed', monospace;
  font-size: 0.8rem;
}

ul {
  list-style: disc;
  padding-left: 20px;
}

ol {
  padding-left: 20px;
}

li::marker {
  color: var(--primary);
}

img {
  display: block;
  margin-left: auto;
  margin-right: auto;
  overflow: scroll;
  max-width: 100%;
}

hr {
  border-color: #5c5b52;
  border-style: solid;
  border-width: 1px 0 0 0;
}

table {
  border: 2px var(--primary) solid;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  border-radius: 8px;
  margin-left: auto;
  margin-right: auto;
}

th {
  padding: 5px 10px;
  border: 0px var(--background) solid;
  background-color: var(--primary);
  color: var(--background);
  text-align: center;
}

td {
  padding: 5px 10px;
  border: 0px var(--secondary) solid;
}

tr:nth-child(even) {
  background-color: var(--secondary_container);
}

tr:nth-child(odd) {
  background-color: var(--background);
}

/* Math - override pygments.css */
.mrow .mi, .mrow .mo {
  color: var(--on_surface);
}

#index .year {
  font-size: 2em;
  font-weight: bold;
  margin-bottom: 2em;
  margin-top: 0em;
}

#index .year span {
  display: inline-block;
  background: var(--primary);
  color: var(--background);
  border-radius: 32px;
  padding: 0.7rem 1rem;
}

#index .date {
  font-size: 1.5em;
  margin-bottom: .5em;
}

#index .post {
  font-size: 1.5em;
  font-weight: bold;
  text-align: left;
  margin-bottom: 2em;
}

@media only screen and (min-width: 800px) {
  #index {
    display: grid;
    grid-template-columns: 40% 60%;
  }

  #index .year {
    grid-column: 1 / span 2;
  }

  #index .date {
    margin-bottom: 2em;
    text-align: center;
  }

  #index .post {
    grid-column: 2;
  }
}
