html {
  width: 100%;
  height: 100%;
  overflow: hidden;
  position: fixed;
}

#overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #000;
  filter:alpha(opacity=0);
  -moz-opacity:0;
  -khtml-opacity: 0;
  opacity: 0;
  z-index: 9999;
}

.tooltip .arrow {
  display: none;
}


.navbar {
  position: absolute;
  top: 0;
  width: 100%;
}

#sidebar a:hover {
  text-decoration: none;
}

.wrapper {
  height: calc(100% - 56px);
  overflow: auto;
  position: fixed;
  top: 56px;
  width: 100%;
  align-items: stretch;
}

.cell {
  color: black;
}

.cell-button {
  color: gray;
}

.cell-button:hover {
  color: darkgray;
}

.toolbar-button {
  padding-left: 2rem;
  padding-top: .375rem;
  line-height: 1.5;
  color: white;
  -webkit-user-select: none;  
  -moz-user-select: none;    
  -ms-user-select: none;      
  user-select: none;
}

.toolbar-button:hover {
  color: #ddd;
  text-decoration: none;
}

.back-chevron {
  line-height: 1.5 !important;
  vertical-align: middle !important;
  margin-bottom: 4px !important;
}

#sidebar {
  padding-left: 20px;
  background-color: #ecedee;
  height: 100vh;
  padding-top: 20px;
  border-right: 1px solid darkgray;
  position: fixed;
  width: 250px;
}

#sidebar ul > li {
  padding-bottom: 10px;
}

#sidebar ul > li > a {
  color: rgba(0,0,0,.5);
}

#sidebar ul > li.active > a {
  color: black;
}

#sidebar div > a {
  color: rgba(0,0,0,.5);
}

#sidebar div.active > a {
  color: black;
}

#content {
  width: 100%;
  padding: 20px;
}

#article pre {
  background-color: #fdf6e3;
  color: #657b83;
  border-radius: 5px;
  padding: 5px;
}

#type-menu {
  display:none;
  position: fixed;
  z-index: 10000;
  min-width: 300px;
  width: 100%;
  max-width: 400px;
  height: 250px;
  background-color: black;
  border: 1px solid gray;
  border-radius: 10px;
  padding: 10px;
}

@media (prefers-color-scheme: dark) {
  #article pre {
    background-color: #002b36;
    color: #839496;
    border-radius: 5px;
    padding: 5px;
  }

  .cell {
    color: white;
  }

  #sidebar {
    padding-left: 20px;
    background-color: #1a1d20;
    height: 100vh;
    padding-top: 20px;
    border-right: 1px solid black;
  }

  #sidebar ul > li {
    padding-bottom: 10px;
  }

  #sidebar ul > li > a {
    color: rgba(255,255,255,.5);
  }

  #sidebar ul > li.active > a {
    color: white;
  }

  #sidebar div > a {
    color: rgba(255,255,255,.5);
  }

  #sidebar div.active > a {
    color: white;
  }
  
  body {
    background-color: #111 !important;
    color: #eee;
  }

  .jumbotron {
    background-color: #333 !important;
  }

  .modal-content {
    background-color: #111 !important;
    color: #eee;
  }

  .modal-header {
    border-bottom: 1px solid #555 !important;
  }

  .modal-header .close {
    color: #eee !important;
    text-shadow: 0 1px 0 #555 !important;
  }

  .modal-footer {
    border-top: 1px solid #555 !important;
  }

  .bg-light {
    background-color: #333 !important;
  }

  .bg-white {
    background-color: #000 !important;
  }

  .bg-black {
    background-color: #eee !important;
  }

  .form-control {
    display: block;
    width: 100%;
    height: calc(1.5em + 0.75rem + 2px);
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    color: #dee2e6;
    background-color: #000;
    background-clip: padding-box;
    border: 1px solid #6c757d;
    border-radius: 0.25rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
  }

  @media (prefers-reduced-motion: reduce) {
    .form-control {
      transition: none;
    }
  }

  .form-control::-ms-expand {
    background-color: transparent;
    border: 0;
  }

  .form-control:-moz-focusring {
    color: transparent;
    text-shadow: 0 0 0 #dee2e6;
  }

  .form-control:focus {
    color: #dee2e6;
    background-color: #191d21;
    border-color: #b3d7ff;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
  }

  .form-control::-webkit-input-placeholder {
    color: #6c757d;
    opacity: 1;
  }

  .form-control::-moz-placeholder {
    color: #6c757d;
    opacity: 1;
  }

  .form-control::-ms-input-placeholder {
    color: #6c757d;
    opacity: 1;
  }

  .form-control::placeholder {
    color: #6c757d;
    opacity: 1;
  }

  .form-control:disabled,
  .form-control[readonly] {
    background-color: #343a40;
    opacity: 1;
  }

  .card {
    background-color: #000;
    border: 1px solid #6c757d;
  }
}

@media all and (display-mode: standalone) {
  .navbar {
    position: absolute;
    top: 0;
    width: 100%;
    padding-top: 44px !important;
  }

  #refreshButton {
    display: block !important;
  }

  .wrapper {
    height: calc(100% - 92px);
    overflow: auto;
    position: fixed;
    top: 92px;
    width: 100%;
    align-items: stretch;
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
    padding-bottom: env(safe-area-insert-bottom);
  }

  @media (min-width: 577px) {
    .navbar {
      position: absolute;
      top: 0;
      width: 100%;
      padding-top: 24px !important;
    }

    #navbarNavDropdown {
      padding-left: env(safe-area-inset-left);
      padding-right: env(safe-area-inset-right);
    }
  
    .wrapper {
      height: calc(100% - 72px);
      overflow: auto;
      position: fixed;
      top: 72px;
      width: 100%;
      align-items: stretch;
      padding-left: env(safe-area-inset-left);
      padding-right: env(safe-area-inset-right);
      padding-bottom: env(safe-area-insert-bottom);
    }
  }
}

@media (max-width: 991.98px) {
  #sidebar {
    display: none !important;
  }
}

@media (min-width: 991.98px) {
  .navbar-nav {
    display: none !important;
  }

  #sidebar {
    min-width: 250px;
    max-width: 250px;
    display: block !important;
  }

  #content {
    left: 250px;
    width: calc(100% - 250px) !important;
    position: relative;
  }

  #sidebar.active {
    margin-left: -250px;
  }
}

/* Fonts */
#type-menu > div.font-choice {
  font-size: 24px;
  width: 100%;
  border-bottom: 1px solid darkgray;
}

#type-menu > div.font-size-choice {
  display: table;
  width: 100%;
  table-layout: fixed;    /* For cells of equal size */
}

#type-menu > div.font-size-choice  span {
  display: table-cell;
  text-align: center;
}

@font-face {
  font-family: Georgia;
  src: url('Georgia.ttf');
}

@font-face {
  font-family: Montserrat;
  src: url('Montserrat-Regular.otf');
}

@font-face {
  font-family: Roboto;
  src: url('Roboto-Regular.ttf');
}

@font-face {
  font-family: 'Source Serif Pro';
  src: url('SourceSerifPro-Regular.ttf');
}