/* style.css - the stylesheet. The values are the ones the site has always
   had; this file only drops what was duplicated or unused. */

:root {
  --blue: #007bff;
  --bg-color: #000000;
  --bg-color-highlight: #1a1a1a;
  --fg-color: #ffffff;
  --hover-color: var(--blue);
  --sidebar-width: 100px;
  --topbar-height: 60px;
  --invert: invert(1.0);
}

:root[data-theme="light"] {
  --bg-color: #fef9e4;
  --bg-color-highlight: #ffe;
  --fg-color: #000000;
  --invert: invert(0);
}

@font-face {
    font-family: 'Spleen';
    src: url(../fonts/spleen.woff2) format('woff2');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Gohu';
    src: url(../fonts/gohu.woff) format('woff');
    font-weight: normal;
    font-style: normal;
}

/* ==========================================================================
   Base
   ========================================================================== */

body {
    max-width: 100ch;
    min-height: 100vh;
    margin: 2vh auto 60px auto;
    font-family: 'Gohu', sans-serif;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.3rem;
    color: var(--fg-color);
    background: var(--bg-color);
    box-sizing: border-box;
    padding: 0 1rem;
}

/* the page content, to the right of the sidebar */
main {
    display: block;
    margin-left: var(--sidebar-width);
    margin-right: auto;
    padding: 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* ==========================================================================
   Typography
   ========================================================================== */

h1, h2, h3, h4, h5, h6 {
    line-height: normal;
}

.light-heading {
  font-weight: normal;
}

ul, ol {
    margin-top: 0;
    padding-left: 0.5em;
}

a:link, a:visited {
  color: var(--blue);
  text-decoration: none;
}

.text-style-link:link, .text-style-link:visited {
    color: inherit;
}

a:hover {
  text-decoration: underline;
}

code, pre, tt {
    font-family: 'Spleen', monospace;
    overflow-wrap: inherit;
    text-align: left;
    font-size: 1em;
    font-weight: 500;
    overflow: hidden;
}

pre {
    width: 96%;
    background-color: var(--bg-color-highlight);
    overflow: auto;
    max-height: 1000px;
    font-size: 10pt;
    border: 1px solid var(--fg-color);
    border-radius: 4px;
    padding: 0.5em 0.8em;
}

pre > code {
    background-color: var(--bg-color-highlight);
    border: none;
    display: inline-block;
}

code {
    background-color: var(--bg-color-highlight);
    border: 1px solid var(--fg-color);
    border-radius: 4px;
    padding: 1px;
}

table {
  text-align: justify;
  width: 100%;
  border-collapse: collapse; }

td, th {
  padding: 0.5em;
  border-bottom: 1px solid var(--fg-color); }

blockquote{ padding:0 0 0 1rem;
            margin:.8rem 0;
            background-color:var(--bg-color-highlight);
            color:var(--fg-color);
            border-left:.25rem solid var(--fg-color);
          }

blockquote p {
  margin-bottom: 0; }

img, video {
  height: auto;
  max-width: 100%;
  margin-top: 0rem;
  margin-bottom: 0rem; }

iframe {
    border: 1px solid var(--fg-color);
    width: 99%;
    height: 400px;
}

figure {
    display: flex;
    flex-direction: column;
    align-content: center;
    margin-top: 1em;
    margin-bottom: 1em;
}

figure img {
    vertical-align: top;
    margin: 0 auto;
}

figure figcaption {
    margin: .4em auto;
    font-style: italic;
    font-family: Didot, serif;
    text-align: center;
}

/* black line art, flipped in the dark theme */
.svg {
	filter: var(--invert);
}

.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  grid-gap: 10px;
}

.image-border {
    height: auto;
}

textarea, input[type="text"], input[type="email"], input[type="password"], input[type="number"],input[type="date"] {
  background-color: var(--bg-color-highlight);
  color: var(--fg-color);
    border: none;
}

textarea:focus, input[type="text"]:focus, input[type="email"]:focus, input[type="password"]:focus, input[type="number"]:focus, input[type="date"]:focus {
  outline: none;
  border-color: var(--fg-color);
}

/* ==========================================================================
   Sidebar
   ========================================================================== */

.sidebar-footer {
    margin-top: auto;
    margin-bottom: 75px;
    font-size: 0.8em;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.sidebar-theme-text {
  position: fixed;
  color: var(--fg-color);
  text-align: center;
  bottom: 0.5rem;
  font-size: 8px;
  left: 0.8rem;
}

#toggleThemeBtn
{
  position: fixed;
  bottom: 0.5rem;
  left: 0.5rem;
  background-color: var(--bg-color);
  color: var(--fg-color);
  border: 1px solid var(--fg-color);
  border-radius: 5px;
  cursor: pointer;
  font-size: 13px;
  width: 80px;
  padding-top: 5px;
}

.sidebar a:hover {
  color: var(--hover-color);
}

.sidebar {
  height: 100%;
  width: var(--sidebar-width);
  position: fixed;
  top: 0;
  left: 0;
  background-color: var(--bg-color);
  overflow-x: hidden;
  overflow-y: hidden;
  padding-top: 5px;
  border-right: 3px dotted var(--fg-color);
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease-in-out;
}

.sidebar-nav {
    flex-grow: 1;
    line-height: 14px;
}

.icon-button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    margin: 5px 0;
    transition: transform 0.2s;
}

.icon-button:hover {
    transform: scale(1.3);
}

.icon-button img {
    width: 100%;
    height: auto;
    max-width: 30px;
    will-change: transform;
}

#openbsd.icon-button img,
#webring.icon-button img,
#df.icon-button img
{
    max-width: 40px;
}

#sdf.icon-button img
{
    max-width: 60px;
}

.sidebar a {
    padding: 6px 4px 6px 0;
    font-size: 19px;
    text-decoration: none;
    color: var(--fg-color);
    display: block;
}

img#logo {
    filter: var(--invert);
    width: 60px;
    height: 60px;
    padding-left: 10px;
}

/* ==========================================================================
   Topbar
   ========================================================================== */

#themeToggle
{
  display: none;
}

.topbar {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--topbar-height);
  background-color: var(--bg-color);
  border-bottom: 2px dotted var(--fg-color);
  padding: 0 5px;
  z-index: 1000;
}

.topbar-logo {
  height: 40px;
  width: auto;
  filter: var(--invert);
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 2.1em;
  cursor: pointer;
  filter: var(--invert);
}

/* ==========================================================================
   Mediaplayer
   ========================================================================== */

.custom-audio-player {
    cursor: pointer;
}

.custom-audio-player .play-icon {
    width: 61px;
    height: 61px;
    background-image: url(blaupunkt.png);
    background-size: contain;
    filter: var(--invert);
    background-repeat: no-repeat;
    background-position: center;
    transition: transform 0.2s;
    margin-bottom: 8px;
}

.custom-audio-player .play-icon:hover {
    transform: scale(1.2);
}

.custom-audio-player audio {
    display: none;
}

/* ==========================================================================
   Mobile view
   ========================================================================== */

@media (max-width: 700px) {

  :root {
      --sidebar-width: 0;
      --topbar-height: 60px;
  }

  body {
    font-size: 16px;
    line-height: 1.5em;
  }

  code, pre, tt {
      font-size: 13pt;
  }

  p {
      line-height: 1.5em;
  }

  pre {
      font-size: 15pt;
      padding: 0.5em 0.5em;
  }

  img#logo {
      display: none;
  }

  .sidebar a {
    font-size: 40px;
    line-height: 1.2em;
  }

  .sidebar {
    height: auto;
    width: 100%;
    transform: translateY(-250%);
    padding-top: 60px;
    border-bottom: 3px dotted var(--fg-color);
  }

  .sidebar-footer {
      flex-direction: row;
      margin: -25px 0 -10px 8px;
  }

  .sidebar.active {
      transform: translateY(0);
      z-index: 999;
  }

  .topbar {
    display: flex;
    position: absolute;
    align-items: center;
    justify-content: space-between;
  }

  .menu-toggle {
    display: block;
  }

  .sidebar-theme-text {
      display: none;
  }

  main {
    margin-left: 0;
    max-width: 100%;
    padding-top: var(--topbar-height);
  }

  #toggleThemeBtn
  {
    display: none;
  }

  #themeToggle
  {
    display: inline;
  }

  #sdf
  {
    display: none;
  }

  .icon-button img {
     max-width: 25px;
  }

  /* the logo in the top bar is not one of the small icons */
  .topbar .topbar-logo {
     display: block;
     max-width: none;
     width: auto;
     height: 40px;
  }
}

/* ==========================================================================
   Directory listings made by tree -H
   ========================================================================== */

.tree p {
  font-family: Spleen, monospace, sans-serif;
  color: var(--fg-color);
}

.tree a:hover {
  color: #000000;
  background-color: yellow;
}

.tree .FIFO { color: purple; }
.tree .CHAR { color: yellow; }
.tree .DIR { color: blue; }
.tree .BLOCK { color: yellow; }
.tree .LINK { color: aqua; }
.tree .SOCK { color: fuchsia; }
.tree .EXEC { color: green; }

/* ==========================================================================
   New since the cleanup: post headers, the Notes list, the DOS demos
   and the forest
   ========================================================================== */

ul.posts {
  list-style: none;
  padding-left: 0;
}

ul.posts li {
  margin: 0.3em 0;
}

ul.posts time {
  display: inline-block;
  min-width: 4.5em;
  opacity: 0.7;
}

.dos {
  margin: 1em 0 2em;
}

.dos-screen {
  display: block;
  width: 100%;
  background: #000;
  border: 1px solid var(--fg-color);
  image-rendering: pixelated;
}

.dos-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.4em 0;
  opacity: 0.7;
}

.dos-bar button {
  font: inherit;
  color: var(--fg-color);
  background: var(--bg-color-highlight);
  border: 1px solid var(--fg-color);
  border-radius: 4px;
  padding: 0.1em 0.6em;
  cursor: pointer;
}

.dos-bar button:disabled {
  opacity: 0.4;
  cursor: default;
}

.dos-hint {
  opacity: 0.7;
  margin: 0;
}

a.wiki {
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 0.2em;
}

.post-header .taxon {
  margin: 0;
  opacity: 0.7;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.85em;
}

.post-header .parent {
  margin: 0.2em 0 0;
  opacity: 0.7;
}

.related {
  margin-top: 2.5rem;
  padding-top: 0.5rem;
  border-top: 1px dotted var(--fg-color);
}

.related h2 {
  font-size: 1em;
  opacity: 0.7;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

ul.outline li {
  margin: 0.25em 0;
}

ul.outline small {
  opacity: 0.7;
  margin-left: 0.4em;
}

.katex-display {
  overflow-x: auto;
  overflow-y: hidden;
}

.guestbook .nobots {
  display: none;
}

.guestbook .error {
  color: var(--blue);
}

.guestbook textarea,
.guestbook input[type="text"] {
  box-sizing: border-box;
  width: 100%;
  max-width: 40em;
}

.guestbook .entry {
  margin: 1.5em 0;
  padding-top: 0.5em;
  border-top: 1px dotted var(--fg-color);
}

.guestbook .entry time {
  opacity: 0.7;
  margin-left: 0.5em;
}

.guestbook .entry p {
  margin: 0.3em 0 0;
}

.guestbook .reply {
  margin-left: 2em;
}
