/* Copyright 2026 Martin Janecke. Licensed under the EUPL-1.2 or later. */

/* General styles */

:root {
  --sans-font: "Noto Sans", "Open Sans", "Droid Sans", sans-serif;
  --mono-font: "Noto Sans Mono", "Noto Mono", "Droid Sans Mono", monospace, monospace;
}
html {
  background-color: #FFF;
  color: #333;
  font-family: var(--sans-font);
}
body {
  box-sizing: border-box;
  font-size: 1.2em;
  line-height: 1.5;
  margin: 0;
  min-height: 100vh;
  padding: 0 0 0 10em;
  width: 100%;
}
blockquote, details, dl, ol, ul, h1, h2, h3, hr, p, pre, table, [role=note] {
  margin: 1.5rem auto;
}

/* Header (Sidebar) */

header {
  background-color: #868A88;
  bottom: 0;
  box-sizing: border-box;
  color: #DDD;
  left: 0;
  overflow-y: scroll;
  padding: 1em 1em 0 1em;
  position: fixed;
  text-align: right;
  top: 0;
  width: 10em;
}
header:hover {
  color: #EEE;
}
header ul {
  list-style-type: none;
  margin: 0 -1em;
  padding: 0;
}
header svg {
  display: inline-block;
  height: auto;
  margin-bottom: 1em;
  width: 5em;
}
header a {
  color: inherit;
  display: block;
  padding: 0 1em;
}
header a:hover {
  background: #444;
}

/* Main */

main {
  margin: 0 auto;
  max-width: 50em;
  padding: 1em 1em 1em 2em;
}

/* Narrow window adaptions */

@media screen and (max-width: 50em) {
  body {
    padding-left: 9em;
  }
  header {
    padding-left: 0.5em;
    width: 9em;
  }
  main {
    padding-left: 1em;
  }
}

@media screen and (max-width: 40em) {
  body {
    padding-left: 0em;
  }
  header {
    bottom: unset;
    font-size: 1rem;
    position: relative;
    width: 100%;
  }
  header ul {
    column-width: 8.5em;
    column-rule: solid thin;
    display: block;
    margin: 0 0 0 4em;
  }
  header svg {
    height: 4em;
    left: .5em;
    position: absolute;
    top: .5em;
    width: 4em;
  }
  header a {
    display: inline-block;
    padding: 1px 5px;
    margin: 1px 0;
    min-width: 7em;
  }
}

/* Headings */

h1 {
  border-bottom: 1px solid #868A88;
  font-size: 1.5em;
  line-height: 1.2;
  padding-bottom: 1rem;
}
h2 {
  font-size: 1.3em;
  line-height: 1.3;
}
h3 {
  font-size: 1.15em;
  line-height: 1.4;
}

/* Expandable-section headings */

details:not([open]) > summary {
  color: #00E;
}
details:not([open]) > summary h2,
details:not([open]) > summary h3 {
  font: inherit;
}
summary > * {
  cursor: pointer;
  display: inline;
}

/* Section breaks */

hr {
  border: none;
  margin-left: auto;
  margin-right: auto;
  width: 50%;
}
hr._h2 {
  border-top: thin solid;
}
hr._h3 {
  border-top: thin dashed;
}

/* Tables */

table {
  border-collapse: collapse;
  display: table;
}
td, th {
  border: solid thin #222222;
  padding: .3em .5em;
  text-align: left;
}
colgroup:first-child {
  border-right: solid medium #222222;
}
thead {
  border-bottom: solid medium #222222;
}

/* Code, plain text */

code, pre {
  font-family: var(--mono-font);
  line-height: 1.4;
}
code {
  background-color: #F8F8F8;
  padding: .2em;
  white-space: pre-wrap;
}
pre > code {
  display: block;
  overflow-y: hidden;
  overflow-x: auto;
  padding: .5em .7em;
  white-space: pre;
}
._plain {
  line-height: 1.1;
}

/* Quotations */

blockquote {
  border-left: 1px solid #868A88;
  background-color: #F8F8F8;
  padding: 1em;
}
blockquote > :first-child {
  margin-top: 0;
}
blockquote > :last-child {
  margin-bottom: 0;
}

/* Notes */

[role=note] {
  font-size: smaller;
}
[role=note] > hr {
  border-top: thin solid;
  margin: 2rem auto 0 0;
  max-width: 6em;
}
[role=note] > hr + * {
  margin-top: .3em;
}

/* Alignment */

._left {
  text-align: left;
}
._center {
  text-align: center;
}
._right {
  text-align: right;
}
._mid {
  display: table;
  margin: 0 auto;
}
._align :not(._align) {
  text-align: inherit;
}

/* Links */

a {
  color: #0000EE;
  cursor: pointer;
  text-decoration: none;
}
main a:visited {
  color: #551A8B;
}
main a:active, main a:hover {
  text-decoration: underline;
}
main a:active {
  color: #FF0000;
}

/* Syntax highlighting */

.q-digits, .q-marker {
  color: #000000; /* black */
}
.q-operator {
  color: #555555; /* dark grey */
}
.q-space {
  color: #AAAAAA; /* light gray */
}
.q-name {
  color: #008000; /* dark green */
}
.q-beyond, .q-unit, .q-boolean {
  color: #008080; /* teal */
}
.q-parameter, .q-unknown {
  color: #AA00AA; /* magenta */
}
.q-type {
  color: #AA0000; /* red */
}
.q-text {
  color: #FF8000; /* orange */
}
.q-delimiter {
  color: #0000FF; /* blue */
}
.q-pair:has(> :is(:first-child, :last-child):hover) > :is(:first-child, :last-child) {
  color: #AAAA00; /* dark yellow */
}
.q-flaw {
  color: #FFFFFF;
  cursor: help;
  background-color: #DD0000; /* white on red */
  margin-left: -1px;
  margin-right: -1px;
  padding-left: 1px;
  padding-right: 1px;
}

/* Footer */

footer {
  font-style: italic;
  opacity: 0.5;
  padding: 0 1em;
  text-align: right;
}
footer p {
  font-size: 1rem;
}

/* End */