* {
  box-sizing: border-box;
}

html {
  font-family: Georgia, "DejaVu Serif", serif;
  font-size: 20px;

  background-color: #eee8d5;
  color: #586e75;
}

body {
  font-size: 0.8rem;
  line-height: 1.4rem;
  margin: 0;
  min-height: 100vh;
}

@supports (display: grid) {
  body {
    display: grid;
    grid-template-rows: auto 1fr auto;
    grid-template-columns: 1fr minmax(min-content, 40rem) auto 1fr;
    grid-template-areas:
      ". header header ."
      ". main   list   ."
      ". footer footer .";
    grid-gap: 0.4rem;
  }
}

header {
  grid-area: header;

  padding: 0.4rem;
  padding-bottom: 0;

  max-width: 41rem;
}

header a {
  display: inline-block;
  background-image: url(/theme/images/favicon-32x32.png);
  background-repeat: no-repeat;
  padding-left: 40px;
  line-height: 32px;

  font-size: 1.2rem;
  font-family: sans-serif;
  font-weight: bold;

  color: #586e75;
}

header a:visited {
  color: #586e75;
}

header a:hover {
  text-decoration: none;
}

main {
  grid-area: main;

  margin: auto;
  padding: 1rem;
  height: 100%;
  width: 100%;

  background-color: #fdf6e3;
}

#page-list {
  grid-area: list;

  background-color: #fdf6e3;
  width: 15rem;
  font-family: sans-serif;
  padding: 0.4rem;
}

#page-list h2 {
  font-size: 1rem;
  margin-top: 0;
}

#page-list ul {
  list-style-type: none;
  padding-left: 0;
  margin-top: 0.3rem;
}

#page-list li {
  margin-top: 0.3rem;
  padding-bottom: 0.3rem;
  line-height: 1rem;
}

#page-list li:last-child {
  border-bottom: 0;
}

#page-list li.current a {
  text-decoration: underline;
}

#page-list .summary {
  margin: 0;
  margin-left: 0.5rem;
  font-size: 0.6rem;
  font-style: italic;
  line-height: 0.8rem;
}

#page-list .post-date {
  font-weight: bold;
  font-size: 0.6rem;
}

.article-summary h2 {
  border-bottom: 0;
}

.article-summary h2 a {
  color: #586e75;
}

.article-summary {
  border-top: 1px solid #cbc5b6;
}

.conspicuous {
  font-weight: bold;
  color: #dc322f;
}

.date-info {
  display: inline-block;
  color: #93a1a1;
  font-family: sans-serif;
  font-size: 0.6rem;
  line-height: 1.2rem;
}

a {
  color: #268bd2;
  text-decoration: none;
}

a:visited {
  color: #6c71c4;
}

a:hover {
  text-decoration: underline;
}

a code {
  color: #268bd2;
}

blockquote {
  background-color: #eee8d5;
  border-left: 2px solid #586e75;
  margin-left: 1.4rem;
  margin-right: 0;
  padding: 0.4rem 0.8rem;
  font-style: italic;
}

code, pre {
  background-color: #eee8d5;
  color: #586e75;
  padding: 0.1rem 0.2rem;
  border: 1px solid #cbc5b6;
}

pre {
  padding: 0.3rem;
  margin-left: 1.4rem;
  overflow: auto;
}

footer {
  grid-area: footer;

  width: 100%;
  background-color: #eee8d5;
  font-family: sans-serif;
  font-size: 0.6rem;
  padding: 0.5rem 0;
}

footer a, footer a:visited {
  color: #586e75;
}

ul.site-footer {
  display: flex;
  justify-content: center;

  list-style-type: none;
  margin: 0;
}

li.site-footer-item {
  margin: 0;
}

li.site-footer-item + li.site-footer-item {
  margin-left: 1rem;
}

h1, h2, h3, h4, h5, h6 {
  font-family: sans-serif;
}

h1 {
  margin-top: 0;
  margin-bottom: 0.2rem;
  line-height: 1.8rem;
}

h2, h3, h4 {
  border-bottom: 1px solid #cbc5b6;
  padding-bottom: 0.2rem;
  margin-bottom: 0;
}

h2 {
  line-height: 1.6rem;
}

h3 {
  line-height: 1.4rem;
}

hr {
  border: 0;
  border-top: 1px dotted #cbc5b6;
}

p {
  margin-top: 0.4rem;
}

table {
  border-collapse: collapse;
  margin-left: 1.4rem;
}

th {
  text-align: left;
}

th, td {
  border: 1px solid #cbc5b6;
  padding: 0.2rem 0.4rem;
}

div.toc {
  width: 33%;
  background-color: #eee8d5;
  float: right;
  margin: 1.6rem 0 0.4rem 0.4rem;
  padding: 0.5rem;
  font-family: sans-serif;
  font-size: 0.7rem;
  line-height: 0.9rem;
}

div.toc .toctitle {
  display: block;
  font-size: 0.8rem;
  font-weight: bold;
  border-bottom: 1px solid #cbc5b6;
  padding-bottom: 0.3rem;
}

div.toc ul {
  margin: 0;
  padding: 0;
  list-style-type: none;
}

div.toc li {
  margin-top: 0.5rem;
}

div.toc ul ul {
  margin-left: 0.5rem;
  padding-left: 0.5rem;
  border-left: 1px dashed #cbc5b6;
}

div.toc ul ul li {
  font-size: 0.6rem;
}

/* Elements on Stripe donation page */
label {
  display: block;
}

#error_explanation {
  color: #dc322f;
  font-weight: bold;
}

/* Solarized (light) syntax highlighting for Pygments
 * From: https://gist.github.com/nicolashery/5765395 */
.highlight { background-color: #fdf6e3; color: #586e75 }
.highlight .c { color: #93a1a1 } /* Comment */
.highlight .err { color: #586e75 } /* Error */
.highlight .g { color: #586e75 } /* Generic */
.highlight .k { color: #859900 } /* Keyword */
.highlight .l { color: #586e75 } /* Literal */
.highlight .n { color: #586e75 } /* Name */
.highlight .o { color: #859900 } /* Operator */
.highlight .x { color: #cb4b16 } /* Other */
.highlight .p { color: #586e75 } /* Punctuation */
.highlight .cm { color: #93a1a1 } /* Comment.Multiline */
.highlight .cp { color: #859900 } /* Comment.Preproc */
.highlight .c1 { color: #93a1a1 } /* Comment.Single */
.highlight .cs { color: #859900 } /* Comment.Special */
.highlight .gd { color: #2aa198 } /* Generic.Deleted */
.highlight .ge { color: #586e75; font-style: italic } /* Generic.Emph */
.highlight .gr { color: #dc322f } /* Generic.Error */
.highlight .gh { color: #cb4b16 } /* Generic.Heading */
.highlight .gi { color: #859900 } /* Generic.Inserted */
.highlight .go { color: #586e75 } /* Generic.Output */
.highlight .gp { color: #586e75 } /* Generic.Prompt */
.highlight .gs { color: #586e75; font-weight: bold } /* Generic.Strong */
.highlight .gu { color: #cb4b16 } /* Generic.Subheading */
.highlight .gt { color: #586e75 } /* Generic.Traceback */
.highlight .kc { color: #cb4b16 } /* Keyword.Constant */
.highlight .kd { color: #268bd2 } /* Keyword.Declaration */
.highlight .kn { color: #859900 } /* Keyword.Namespace */
.highlight .kp { color: #859900 } /* Keyword.Pseudo */
.highlight .kr { color: #268bd2 } /* Keyword.Reserved */
.highlight .kt { color: #dc322f } /* Keyword.Type */
.highlight .ld { color: #586e75 } /* Literal.Date */
.highlight .m { color: #2aa198 } /* Literal.Number */
.highlight .s { color: #2aa198 } /* Literal.String */
.highlight .na { color: #586e75 } /* Name.Attribute */
.highlight .nb { color: #B58900 } /* Name.Builtin */
.highlight .nc { color: #268bd2 } /* Name.Class */
.highlight .no { color: #cb4b16 } /* Name.Constant */
.highlight .nd { color: #268bd2 } /* Name.Decorator */
.highlight .ni { color: #cb4b16 } /* Name.Entity */
.highlight .ne { color: #cb4b16 } /* Name.Exception */
.highlight .nf { color: #268bd2 } /* Name.Function */
.highlight .nl { color: #586e75 } /* Name.Label */
.highlight .nn { color: #586e75 } /* Name.Namespace */
.highlight .nx { color: #586e75 } /* Name.Other */
.highlight .py { color: #586e75 } /* Name.Property */
.highlight .nt { color: #268bd2 } /* Name.Tag */
.highlight .nv { color: #268bd2 } /* Name.Variable */
.highlight .ow { color: #859900 } /* Operator.Word */
.highlight .w { color: #586e75 } /* Text.Whitespace */
.highlight .mf { color: #2aa198 } /* Literal.Number.Float */
.highlight .mh { color: #2aa198 } /* Literal.Number.Hex */
.highlight .mi { color: #2aa198 } /* Literal.Number.Integer */
.highlight .mo { color: #2aa198 } /* Literal.Number.Oct */
.highlight .sb { color: #93a1a1 } /* Literal.String.Backtick */
.highlight .sc { color: #2aa198 } /* Literal.String.Char */
.highlight .sd { color: #586e75 } /* Literal.String.Doc */
.highlight .s2 { color: #2aa198 } /* Literal.String.Double */
.highlight .se { color: #cb4b16 } /* Literal.String.Escape */
.highlight .sh { color: #586e75 } /* Literal.String.Heredoc */
.highlight .si { color: #2aa198 } /* Literal.String.Interpol */
.highlight .sx { color: #2aa198 } /* Literal.String.Other */
.highlight .sr { color: #dc322f } /* Literal.String.Regex */
.highlight .s1 { color: #2aa198 } /* Literal.String.Single */
.highlight .ss { color: #2aa198 } /* Literal.String.Symbol */
.highlight .bp { color: #268bd2 } /* Name.Builtin.Pseudo */
.highlight .vc { color: #268bd2 } /* Name.Variable.Class */
.highlight .vg { color: #268bd2 } /* Name.Variable.Global */
.highlight .vi { color: #268bd2 } /* Name.Variable.Instance */
.highlight .il { color: #2aa198 } /* Literal.Number.Integer.Long */

@media (max-width: 1000px) {
  body {
    display: block;
  }

  header {
    padding-bottom: 0.4rem;
  }

  #page-list {
    width: 100%;
    max-width: 40rem;
    margin: auto;
    margin-top: 1rem;
    padding: 1rem;
  }
}

@media (max-width: 700px) {
  html {
    font-size: 18px;
  }

  main {
    padding: 0.4rem 0.2rem;
  }

  div.toc {
    width: auto;
    float: none;
    margin-left: 0;
    margin-top: 0.4rem;
    padding-left: 0;
    background-color: #fdf6e3;

    border-bottom: 1px solid #cbc5b6;
  }

  #page-list {
    padding: 0.2rem;
  }
}
