:root {
  --color-page-background: #fafafa;
  --color-code-background: #f4f4f4;
  --color-base: #333333;
  --color-base-lighter: #666666;
  --color-border: #cccccc;
  --color-dimmed: #888888;
  --color-highlight: #117ccc;

  --figure-margin-vertical: 0.5em;
  --figure-margin-horizontal: 0.75em;

  --content-padding-horizontal: 20px;
  --content-width: 640px;

  --layout-border-width: 1px;

  --logo-height: 90px;
  --logo-width: 90px;

  --gutter-vertical: 20px;

  --nav-border-height: 4px;
  --nav-height: calc(var(--logo-height) + calc(var(--gutter-vertical) * 2));

  --main-width: 960px;
  --main-width-narrow: 640px;

  --container-border: var(--color-border) solid var(--layout-border-width);
  --container-spacing-horizontal: 40px;
  --container-spacing-vertical: 20px;
}


/* reset */

html,
body {
  margin: 0;
  padding: 0;
}

ol {
  list-style: none;
  margin: 0;
  padding: 0;
}


/* fonts */

@font-face {
  font-family: "LiberationMono";
  src: url("fonts/LiberationMono-Regular-webfont.woff") format("woff");
  font-style: normal;
  font-weight: normal;
}

@font-face {
  font-family: "Roboto";
  src: url("fonts/Roboto-Light-webfont.woff") format("woff");
  font-style: normal;
  font-weight: normal;
}

@font-face {
  font-family: "Roboto";
  src: url("fonts/Roboto-LightItalic-webfont.woff") format("woff");
  font-style: italic;
  font-weight: normal;
}

@font-face {
  font-family: "Roboto";
  src: url("fonts/Roboto-Bold-webfont.woff") format("woff");
  font-style: normal;
  font-weight: bold;
}

@font-face {
  font-family: "Roboto";
  src: url("fonts/Roboto-BoldCondensed-webfont.woff") format("woff");
  font-stretch: condensed;
  font-style: normal;
  font-weight: bold;
}


/* layout/general */

html {
  font-size: 100%;
}

body {
  background-color: var(--color-page-background);
  color: var(--color-base);
  font-family: Roboto, sans-serif;
  margin: 0 var(--content-padding-horizontal);
}

#header,
main,
#footer {
  margin: 0 auto;
  max-width: var(--main-width);
}

@media only screen and (max-device-width: 1020px), only screen and (max-width: 1020px) {
  #header,
  main,
  #footer {
    min-width: var(--main-width-narrow);
    max-width: var(--main-width-narrow);
  }
}

main,
#footer {
  clear: both;
}

main a,
#footer a {
  color: var(--color-highlight);
  cursor: pointer;
  text-decoration: none;
}

main a:hover,
#footer a:hover {
  color: var(--color-base);
  text-decoration: underline;
  -moz-text-decoration-color: var(--color-highlight);
  -moz-text-decoration-style: solid;
}

.clear {
  clear: both;
}


/* header (incl. navigation) */

.topbar {
  border-bottom: var(--container-border);
  display: flex;
}

.topbar h1 {
  margin: 0;
  padding: 0;
}

.logo {
  background-image: url(logo.png);
  display: block;
  height: var(--logo-height);
  overflow: hidden;
  text-indent: 100%;
  white-space: nowrap;
  width: var(--logo-width);
}

.nav-main ol {
  --nav-transition: all 0.5s linear;
  display: flex;
  justify-content: space-between;
}

.nav-main-item {
  border-color: transparent;
  border-style: solid;
  border-width: var(--nav-border-height) 0 0 0;
  color: #aaaaaa;
  display: block;
  font-size: 1.1rem;
  font-weight: bold;
  text-decoration: none;
  text-shadow: 1px 0 2px rgba(0, 0, 0, 0.1);
  text-transform: uppercase;
  transition: var(--nav-transition);
}

.nav-main-item.current,
.nav-main-item:hover {
  border-top-color: var(--color-highlight);
  color: var(--color-base);
  transition: var(--nav-transition);
}

@media (max-width: 1020px) {

  .topbar {
    flex-direction: column;
    margin-top: var(--gutter-vertical);
  }

  .logo {
    margin: 0 auto;
  }

  .nav-main {
    border-top: var(--container-border);
    margin-top: var(--gutter-vertical);
    padding: 0 var(--container-spacing-horizontal);
  }

  .nav-main-item {
    line-height: 2;
  }
}

@media (min-width: 1021px) {

  .topbar {
    align-items: center;
    justify-content: space-between;
  }

  .nav-main-item {
    line-height: var(--nav-height);
    margin-left: 2rem;
  }
}


/* footer */

.footer-columns {
  display: flex;
  justify-content: space-between;
  margin-left: calc(var(--container-spacing-horizontal) * -1);
}

.footer-columns section {
  flex: 1;
  margin-bottom: 10px !important;
  margin-left: var(--container-spacing-horizontal);
}

@media only screen and (max-device-width: 1020px), only screen and (max-width: 1020px) {
  .footer-columns .latest-stuff {
    display: none;
  }
}


#footer {
  line-height: 1.5;
  margin-top: var(--gutter-vertical);
}

#footer #footer-box {
  padding: var(--container-spacing-vertical) 0;
}

#footer .latest-stuff li {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#footer p {
  clear: both;
  margin: 0.2em 0;
  padding: 0;
}

#footer .bottom {
  clear: both;
  color: var(--color-dimmed);
  font-size: 0.75rem;
  line-height: 1.5;
  text-align: left;
}


/* asides */

main article footer.meta section,
main aside.sidebar section,
#footer-box section {
  border-top: var(--container-border);
  font-size: 0.9rem;
  margin-bottom: var(--container-spacing-vertical);
  padding-top: var(--container-spacing-vertical);
  text-align: left;
}

main article footer.meta section h2,
main aside.sidebar section h2,
#footer-box section h2 {
  clear: none !important;
  font-size: 1rem;
  font-stretch: condensed;
  margin: 0 0 calc(var(--container-spacing-vertical) - 4px) 0;
  padding: 0;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

main article footer.meta section h2 .additional,
main aside.sidebar section h2 .additional,
#footer-box section h2 .additional {
  text-transform: none;
}

main article footer.meta section li,
main aside.sidebar section li,
#footer-box section li {
  margin-bottom: 0.5em;
}

.sidebar-label,
.sidebar-value {
  margin-left: 0.5rem;
  margin-right: 0.5rem;
}

.sidebar-label {
  color: var(--color-dimmed);
  font-size: 0.8125rem;
  text-transform: uppercase;
}

.sidebar-value + .sidebar-label {
  margin-top: 1.25rem;
}

.sidebar-value {
  color: var(--color-base);
  display: flex;
  margin-bottom: 0.5rem;
  margin-top: 0.5rem;
}

.sidebar-value-icon {
  color: var(--color-base-lighter);
  flex-shrink: 0;
  margin-right: 0.4rem;
}

.sidebar-value-text {
  flex-grow: 1;
  flex-wrap: wrap;
}

.sidebar-value-additional {
  color: var(--color-dimmed);
  font-size: 0.8125rem;
}


/* main content */

main {
  min-height: 400px;
  text-align: justify;
}

main h1,
main h2,
main h3,
main h4 {
  clear: both;
  line-height: 1.3;
  margin: 1.5em 0 0.5em 0;
  padding: 0;
  text-align: left;
  width: var(--content-width);
}

main h1 {
  font-size: 2rem;
  margin-top: 1em;
}

main h2 {
  font-size: 1.4rem;
}

main h3 {
  font-size: 1.2rem;
}

main h4 {
  font-size: 1rem;
}

.additional {
  color: var(--color-dimmed);
  font-size: 0.8em;
  font-weight: normal;
}


.history {
  display: table;
}

.history li {
  display: table-row;
}

.history li time,
.history li a {
  display: table-cell;
  padding: 8px 0 0 0;
}

.history li time {
  color: var(--color-dimmed);
  font-size: 0.8rem;
  padding-right: 16px;
  text-align: right;
  white-space: nowrap;
}

.history li a {
  border-left: var(--color-dimmed) solid 1px;
  font-size: 0.9rem;
  font-weight: bold;
  padding-left: 16px;
}

/* necessary wrapper element to avoid absolute
   positioning bug in Firefox. */
.history li a span {
  position: relative;
}

.history li a span:before {
  background-color: var(--color-page-background);
  border: var(--color-dimmed) solid 1px;
  border-radius: 50%;
  content: "";
  display: block;
  height: 7px;
  left: -21px;
  position: absolute;
  top: 3px;
  width: 7px;
}

.article-body ol.history-detailed {
  list-style: none;
  margin: 0;
}

.history-detailed li {
  margin: 0 0 1em 0;
}

.history-detailed li a {
  display: block;
  font-weight: bold;
}

.history-detailed li .meta {
  color: var(--color-dimmed);
  display: block;
  font-size: 0.9rem;
}

main img.float,
main .float-right {
  float: right;
  margin: 0.2em 0 0.4em 1.2em;
}

main .float-left {
  float: left;
  margin: 0.2em 1.2em 0.4em 0;
}


/* articles */

.article {
  clear: both;
  padding: 0 var(--content-padding-horizontal);
}

.article-body {
  float: left;
  line-height: 1.5;
  width: var(--content-width);
}

@media only screen and (max-device-width: 1020px), only screen and (max-width: 1020px) {
  .article-body {
    width: 100%;
  }
}

.article-body p:first-child {
  margin-top: 0;
  padding-top: 0;
}

.article-body ul li > p {
  margin: 0;
  padding: 0;
}

.article-body ol {
  list-style: decimal;
  margin: 0 0 0 1em;
  padding: 0;
}

article footer.meta,
aside.sidebar {
  margin-left: var(--content-width);
  padding-left: calc(var(--content-padding-horizontal) * 2);
  text-align: left;
}

@media only screen and (max-device-width: 1020px), only screen and (max-width: 1020px) {
  article footer.meta,
  aside.sidebar {
    clear: both;
    margin-left: 0;
    padding-left: 0;
    padding-top: var(--container-spacing-vertical);
  }

  article footer.meta section,
  aside.sidebar section {
    border: 0 !important;
  }
}

article footer.meta p,
aside.sidebar p {
  margin: 0;
  padding: 0;
}


/* releases */

article.release {
  border-top: var(--color-border) double 4px;
}

article.release:first-child {
  border: none;
}

article.release h1 {
  padding-left: calc(var(--content-padding-horizontal) * -1);
  position: relative;
}

article.release h1 a.permalink {
  display: inline-block;
  font-size: 0.7em;
  left: calc(var(--content-padding-horizontal) * -1);
  position: absolute;
  text-decoration: none;
  top: 0;
  visibility: hidden;
  width: var(--content-padding-horizontal);
}

article.release h1:hover a.permalink {
  visibility: visible;
}


/* images, figures */

img {
  border: 0;
  box-sizing: content-box;
}

figure img,
img.framed {
  background-color: #ffffff;
  border: var(--color-border) solid 1px;
  box-shadow: 0 0 3px rgba(0, 0, 0, 0.5);
}

img.padded {
  border-radius: 3px;
  padding: 9px;
}

figure.align-center {
  display: table;
  margin: var(--figure-margin-vertical) auto;
}

figure.align-left {
  float: left;
  margin: 0 var(--figure-margin-horizontal) var(--figure-margin-vertical) 0;
}

figure.align-right {
  float: right;
  margin: 0 0 var(--figure-margin-vertical) var(--figure-margin-horizontal);
}

figure p {
  font-size: 0.9rem;
  font-style: italic;
  margin: 0;
  padding: 0;
  text-align: left;
}


/* icons */

.icon {
  display: inline-block;
  fill: currentColor;
  height: 1em;
  stroke: currentColor;
  stroke-width: 0;
  vertical-align: -7%;
  width: 1em;
}


/* quotes, code */

blockquote {
  border-left: var(--color-border) solid 0.3em;
  margin: 0;
  padding-left: 0.7em;
}

.highlight pre,
pre.code {
  border-color: var(--color-border);
  border-style: solid;
  border-width: var(--layout-border-width) 0;
  clear: both;
  display: block;
  line-height: 1.5;
  margin: 0 calc(var(--content-padding-horizontal) * -1);
  overflow: auto;
  padding: 1rem var(--content-padding-horizontal);
}

.highlight pre,
pre.code,
.literal {
  background-color: var(--color-code-background);
}

.highlight pre,
code,
.literal {
  font-family: LiberationMono, "Courier New", monospace;
  font-size: 0.85rem;
}


/* code highlighting */

.code .hll { background-color: #ffffcc }
.code .c { color: #999988; font-style: italic } /* Comment */
.code .err { color: #a61717; background-color: #e3d2d2 } /* Error */
.code .k { font-weight: bold } /* Keyword */
.code .o { font-weight: bold } /* Operator */
.code .ch { color: #999988; font-style: italic } /* Comment.Hashbang */
.code .cm { color: #999988; font-style: italic } /* Comment.Multiline */
.code .cp { color: #999999; font-weight: bold } /* Comment.Preproc */
.code .cpf { color: #999988; font-style: italic } /* Comment.PreprocFile */
.code .c1 { color: #999988; font-style: italic } /* Comment.Single */
.code .cs { color: #999999; font-weight: bold; font-style: italic } /* Comment.Special */
.code .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */
.code .ge { font-style: italic } /* Generic.Emph */
.code .gr { color: #aa0000 } /* Generic.Error */
.code .gh { color: #999999 } /* Generic.Heading */
.code .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */
.code .go { color: #888888 } /* Generic.Output */
.code .gp { color: #555555 } /* Generic.Prompt */
.code .gs { font-weight: bold } /* Generic.Strong */
.code .gu { color: #aaaaaa } /* Generic.Subheading */
.code .gt { color: #aa0000 } /* Generic.Traceback */
.code .kc { font-weight: bold } /* Keyword.Constant */
.code .kd { font-weight: bold } /* Keyword.Declaration */
.code .kn { font-weight: bold } /* Keyword.Namespace */
.code .kp { font-weight: bold } /* Keyword.Pseudo */
.code .kr { font-weight: bold } /* Keyword.Reserved */
.code .kt { color: #445588; font-weight: bold } /* Keyword.Type */
.code .m { color: #009999 } /* Literal.Number */
.code .s { color: #bb8844 } /* Literal.String */
.code .na { color: #008080 } /* Name.Attribute */
.code .nb { color: #999999 } /* Name.Builtin */
.code .nc { color: #445588; font-weight: bold } /* Name.Class */
.code .no { color: #008080 } /* Name.Constant */
.code .ni { color: #800080 } /* Name.Entity */
.code .ne { color: #990000; font-weight: bold } /* Name.Exception */
.code .nf { color: #990000; font-weight: bold } /* Name.Function */
.code .nn { color: #555555 } /* Name.Namespace */
.code .nt { color: #000080 } /* Name.Tag */
.code .nv { color: #008080 } /* Name.Variable */
.code .ow { font-weight: bold } /* Operator.Word */
.code .w { color: #bbbbbb } /* Text.Whitespace */
.code .mb { color: #009999 } /* Literal.Number.Bin */
.code .mf { color: #009999 } /* Literal.Number.Float */
.code .mh { color: #009999 } /* Literal.Number.Hex */
.code .mi { color: #009999 } /* Literal.Number.Integer */
.code .mo { color: #009999 } /* Literal.Number.Oct */
.code .sa { color: #bb8844 } /* Literal.String.Affix */
.code .sb { color: #bb8844 } /* Literal.String.Backtick */
.code .sc { color: #bb8844 } /* Literal.String.Char */
.code .dl { color: #bb8844 } /* Literal.String.Delimiter */
.code .sd { color: #bb8844 } /* Literal.String.Doc */
.code .s2 { color: #bb8844 } /* Literal.String.Double */
.code .se { color: #bb8844 } /* Literal.String.Escape */
.code .sh { color: #bb8844 } /* Literal.String.Heredoc */
.code .si { color: #bb8844 } /* Literal.String.Interpol */
.code .sx { color: #bb8844 } /* Literal.String.Other */
.code .sr { color: #808000 } /* Literal.String.Regex */
.code .s1 { color: #bb8844 } /* Literal.String.Single */
.code .ss { color: #bb8844 } /* Literal.String.Symbol */
.code .bp { color: #999999 } /* Name.Builtin.Pseudo */
.code .fm { color: #990000; font-weight: bold } /* Name.Function.Magic */
.code .vc { color: #008080 } /* Name.Variable.Class */
.code .vg { color: #008080 } /* Name.Variable.Global */
.code .vi { color: #008080 } /* Name.Variable.Instance */
.code .vm { color: #008080 } /* Name.Variable.Magic */
.code .il { color: #009999 } /* Literal.Number.Integer.Long */

.code s {
  /* Work around issue with newer Docutils version replacing Pygments
     `<span class="s">…</span>` with `<s>…</s>`. */
  text-decoration: none;
}


/* tags */

@media only screen and (max-device-width: 1020px), only screen and (max-width: 1020px) {
  aside.sidebar ol.tags {
    column-count: 4;
  }

  aside.sidebar ol.tags li {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: 100%;
  }
}

aside.sidebar ol.tags li a {
  padding: 0 0.2em;
}

aside.sidebar ol.tags li.selected a,
aside.sidebar ol.tags li a:hover {
  background-color: var(--color-border);
  border-radius: 3px;
  color: var(--color-base) !important;
}


@media print {
  * {
    color: #333333 !important;
  }

  #footer,
  .nav-main,
  aside.sidebar {
    display: none;
  }
}
