/* The colours of the light theme. The dark theme gives other values to the same names. */
:root {
  color-scheme: light;
  --text: #111111;
  --bg: #fdfdfd;
  --muted: #828282;
  --title: #424242;
  --link: #2a7ae2;
  --link-visited: #1756a9;
  --border: #e8e8e8;
  --border-hover: #dbdbdb;
  --icon: #000000;
  --code-bg: #eeeeff;
  --code-text: currentColor;
  --table-text: #3f3f3f;
  --table-zebra: #f7f7f7;
  --table-head: #f0f0f0;
  --table-head-border: #e0e0e0;
  --tok-weight: bold;
  --tok-comment-style: italic;
  --tok-comment: #999988;
  --tok-directive: #999999;
  --tok-keyword: currentColor;
  --tok-operator: currentColor;
  --tok-type: #445588;
  --tok-function: #990000;
  --tok-string: #dd1144;
  --tok-number: #009999;
  --tok-builtin: #0086b3;
  --tok-attribute: #008080;
  --tok-module: #555555;
  --tok-constant: #008080;
  --tok-variable: #008080;
  --tok-self: #999999;
  --mono: "Menlo", "Inconsolata", "Consolas", "Roboto Mono", "Ubuntu Mono", "Liberation Mono", "Courier New", monospace;
}

html {
  font-size: 17px;
}

body, h1, h2, h3, h4, h5, h6,
p, blockquote, pre, hr,
dl, dd, ol, ul, figure {
  margin: 0;
  padding: 0;
}

/* The page is a column: the footer stays at the bottom of a short page. */
body {
  font: 350 17px/1.5 -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", "Segoe UI Emoji", "Segoe UI Symbol", "Apple Color Emoji", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background-color: var(--bg);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  font-feature-settings: "kern" 1;
  font-kerning: normal;
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  overflow-wrap: break-word;
}

h1, h2, h3, h4, h5, h6,
p, blockquote, pre,
ul, ol, dl, figure,
.code {
  margin-bottom: 15px;
}

/* The colour of a rule is the one that a browser gives it, until the dark theme sets it. */
hr {
  margin-top: 30px;
  margin-bottom: 30px;
  color: var(--rule, gray);
}

img {
  max-width: 100%;
  vertical-align: middle;
}

figure > img {
  display: block;
}

figcaption {
  font-size: 14.875px;
}

ul, ol {
  margin-left: 30px;
}

li > ul,
li > ol {
  margin-bottom: 0;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 350;
  color: var(--heading, inherit);
}

a {
  color: var(--link);
  text-decoration: none;
}
a:visited {
  color: var(--link-visited);
}
a:hover {
  color: var(--text);
  text-decoration: underline;
}

blockquote {
  color: var(--muted);
  border-left: 4px solid var(--border);
  padding-left: 15px;
  font-size: 1.125rem;
  font-style: italic;
}
blockquote > :last-child {
  margin-bottom: 0;
}
blockquote i, blockquote em {
  font-style: normal;
}

/* Code in a line and in a block. */
pre,
code {
  font-family: var(--mono);
  font-size: 0.9375em;
  border: 1px solid var(--border);
  border-radius: 3px;
  background-color: var(--code-bg);
}

code {
  padding: 1px 5px;
}

pre {
  padding: 8px 12px;
  overflow-x: auto;
  color: var(--code-text);
}
pre > code {
  border: 0;
  padding-right: 0;
  padding-left: 0;
}

/* A block of code. The name of its language shows in the corner while the pointer is on it. */
.code {
  position: relative;
  border-radius: 3px;
  background: var(--code-bg);
}
.code[data-language]::before {
  content: attr(data-language);
  display: none;
  position: absolute;
  top: 0;
  right: 0;
  padding: 2px 6px;
  font-family: var(--mono);
  font-size: 14.875px;
  font-weight: bold;
  color: var(--muted);
  border-bottom-left-radius: 3px;
  line-height: 1;
}
.code[data-language]:hover::before {
  display: block;
}

/* The parts of the code. */
.code .comment,
.code .comment_block {
  color: var(--tok-comment);
  font-style: var(--tok-comment-style);
}
.code .directive {
  color: var(--tok-directive);
  font-weight: var(--tok-weight);
}
.code .keyword,
.code .keyword_value,
.code .keyword_declaration {
  color: var(--tok-keyword);
  font-weight: var(--tok-weight);
}
.code .operator,
.code .operator_word {
  color: var(--tok-operator);
  font-weight: var(--tok-weight);
}
.code .type {
  color: var(--tok-type);
  font-weight: var(--tok-weight);
}
.code .function {
  color: var(--tok-function);
  font-weight: var(--tok-weight);
}
.code .string,
.code .escape,
.code .char {
  color: var(--tok-string);
}
.code .integer,
.code .float,
.code .hex {
  color: var(--tok-number);
}
.code .builtin {
  color: var(--tok-builtin);
}
.code .attribute {
  color: var(--tok-attribute);
}
.code .module {
  color: var(--tok-module);
}
.code .constant {
  color: var(--tok-constant);
}
.code .variable {
  color: var(--tok-variable);
}
.code .self {
  color: var(--tok-self);
}

/* The column that holds the text of the header and of the page. */
.column {
  max-width: 870px;
  margin-right: auto;
  margin-left: auto;
  padding-right: 15px;
  padding-left: 15px;
}
@media screen and (min-width: 800px) {
  .column {
    max-width: 840px;
    padding-right: 30px;
    padding-left: 30px;
  }
}
.column::after {
  content: "";
  display: table;
  clear: both;
}

table {
  margin-bottom: 30px;
  width: 100%;
  text-align: left;
  color: var(--table-text);
  border-collapse: collapse;
  border: 1px solid var(--border);
}
table tr:nth-child(even) {
  background-color: var(--table-zebra);
}
table th, table td {
  padding: 10px 15px;
}
table th {
  background-color: var(--table-head);
  border: 1px solid var(--table-head-border);
}
table td {
  border: 1px solid var(--border);
}
@media screen and (max-width: 800px) {
  table {
    display: block;
    overflow-x: auto;
  }
}

/* The header: the name of the site, and the links to the pages. */
.top {
  border-bottom: 1px solid var(--border);
  min-height: 55.95px;
  line-height: 57.375px;
  position: relative;
}

.site-name {
  font-size: 1.625rem;
  font-weight: 300;
  letter-spacing: -1px;
  margin-bottom: 0;
  float: left;
}
@media screen and (max-width: 600px) {
  .site-name {
    padding-right: 45px;
  }
  .js .site-name {
    padding-right: 89px;
  }
}
.site-name, .site-name:visited {
  color: var(--title);
}

/* The button that changes the theme. It shows only when the script of the page runs: the
   script sets the class "js". On a narrow screen it is in the corner, and the menu is to
   the left of it. */
.theme-button {
  display: none;
  position: absolute;
  top: 10px;
  right: 15px;
  box-sizing: border-box;
  width: 36px;
  height: 36px;
  padding: 9px;
  border: 0;
  border-radius: 5px;
  background: none;
  line-height: 0;
  cursor: pointer;
}
.theme-button svg {
  fill: var(--icon);
}
.js .theme-button {
  display: block;
}
.js .menu {
  right: 59px;
}

/* On a narrow screen the links are a box that the button opens. The check box keeps the
   state, thus the menu needs no script. */
.menu {
  position: absolute;
  top: 9px;
  right: 15px;
  background-color: var(--bg);
  border: 1px solid var(--border);
  border-radius: 5px;
  text-align: right;
}
.menu-check {
  display: none;
}
.menu-button {
  display: block;
  float: right;
  width: 36px;
  height: 26px;
  padding-top: 10px;
  line-height: 0;
  text-align: center;
  cursor: pointer;
}
.menu-button svg {
  fill: var(--icon);
}
.menu-links {
  clear: both;
  display: none;
}
.menu-check:checked ~ .menu-links {
  display: block;
  padding-bottom: 5px;
}
.menu .menu-links a {
  color: var(--text);
  line-height: 1.5;
  display: block;
  padding: 5px 10px;
  margin-left: 20px;
}
@media screen and (min-width: 600px) {
  /* The button is the last thing in the row. Its icon ends where the text column ends. */
  .theme-button {
    position: static;
    float: right;
    margin: 10px -9px 0 5px;
  }
  .menu {
    position: static;
    float: right;
    border: none;
    background-color: inherit;
  }
  .menu-button {
    display: none;
  }
  .menu-links {
    display: block;
  }
  .menu .menu-links a {
    display: inline;
    padding: 0;
    margin-left: auto;
  }
  .menu .menu-links a:not(:last-child) {
    margin-right: 20px;
  }
}

.bottom {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  text-align: center;
}
.bottom small {
  font-size: 0.8rem;
}

.content {
  padding: 30px 0;
  flex: 1 0 auto;
}

/* The list of the posts on the home page. */
.posts {
  margin-left: 0;
  list-style: none;
}
.posts > li {
  margin-bottom: 30px;
  border-bottom: 1px solid var(--border);
  display: block;
  padding: 0.2rem 0;
}
.posts time,
.byline {
  font-size: 14.875px;
  color: var(--muted);
}
.posts h3 a {
  display: block;
  font-size: 1.5rem;
}

/* The links to the newer and to the older posts. */
.pager ul {
  display: table;
  margin: 0 auto 30px;
  list-style: none;
}
.pager li {
  float: left;
  margin: 5px 10px 5px 0;
}
.pager li:last-of-type {
  margin-right: 0;
}
.pager li a,
.pager li span {
  display: block;
  min-width: 41px;
  text-align: center;
  box-sizing: border-box;
}
.pager li a {
  padding: 10px 12px;
  border: 1px solid var(--border);
}
.pager li a:hover {
  border-color: var(--border-hover);
}
.pager li span {
  padding: 7.5px;
  border: 1px solid transparent;
}
.pager li .edge {
  color: var(--border);
  border: 1px dashed;
}

/* A post or a page. */
.article-head {
  margin-bottom: 30px;
}
.article-title,
.article-body h1 {
  font-size: 2.625rem;
  letter-spacing: -1px;
  line-height: 1.15;
}
.article-body {
  margin-bottom: 30px;
}
.article-body h1, .article-body h2, .article-body h3,
.article-body h4, .article-body h5, .article-body h6 {
  margin-top: 30px;
}
.article-body h2 {
  font-size: 1.75rem;
}
.article-body h3 {
  font-size: 1.375rem;
}
.article-body h4 {
  font-size: 1.25rem;
}
.article-body h5 {
  font-size: 1.125rem;
}
.article-body h6 {
  font-size: 1.0625rem;
}
@media screen and (min-width: 800px) {
  .article-body h2 {
    font-size: 2rem;
  }
  .article-body h3 {
    font-size: 1.625rem;
  }
}

/* The page for a path that the site does not have. */
.missing {
  margin: 10px auto;
  max-width: 600px;
  text-align: center;
}
.missing h1 {
  margin: 30px 0;
  font-size: 4em;
  line-height: 1;
  letter-spacing: -1px;
}
