html {
  box-sizing: border-box;
  padding: 0;
  margin: 0;
}

*,
*::before,
*::after {
  box-sizing: inherit;
}

body {
  padding: 0;
  margin: 0;
}

body {
  display: flex;
  line-height: 1.3;
  max-height: 99.5vh;
}

body {
  font-size: 14px;
  font-family: monospace;
  font-weight: normal;
}

h1,
input,
button,
textarea {
  /* have these styles inherit from the body */
  font-size: inherit;
  font-family: inherit;
  font-weight: normal;
  color: inherit;
}

#sidebar,
#aside {
  width: 25em;
  overflow: auto;
  transition: opacity 3s;
}

#main {
  flex-grow: 1;
}

button {
  appearance: none;
  font-family: inherit;
  border: 0;
  background: white;
  font-size: 1em;
  padding: 0;
}

#editor {
  border: 0;
  height: 99vh;
  line-height: 1.3;
  width: 100%;
  padding: 1.3em;
  box-sizing: border-box;
}

#editor:focus {
  outline: none;
}

#aside {
  padding: 0 1em;
}

#searchbox {
  appearance: none;
  border: 1px solid #ddd;
  border-radius: 1em;
  padding: .15em .25em;
  margin: .5em 0 .5em 1em;
}

#notes-title,
#aside-title,
#close-aside-button {
  display: none;
}

#notes-title,
#aside-title {
  margin: .83em 0;
}

#sidebar-header {
  position: sticky;
  top: 0;
  background: #fff;
}

#notes-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

#notes-list li {
  border-bottom: 1px solid #ddd;
  height: 5.75em;
  overflow: hidden;
  padding: .5em 1em;
  white-space: pre-line;
}

#notes-list li.hide {
  display: none;
}

#notes-list li a {
  display: block;
  min-height: 100%;
}

#notes-list li strong {
  text-overflow: ellipsis;
  display: block;
  overflow: hidden;
  white-space: nowrap;
}

#aside-title,
#close-aside-button {
  text-align: right;
}

#metadata label {
  display: block;
  display: flex;
  align-items: center;
}

#metadata label input {
  flex-grow: 1;
  margin-left: .5em;
  border-width: 0px;
}

#calendar {
  display: none;
}

#calendar span {
  border-bottom: 1px solid transparent;
  padding: 0 .25em;
}

#calendar .active {
  font-weight: bold;
  border-bottom: 1px solid #333;
}

.focus-mode #aside,
.focus-mode #sidebar {
  opacity: .025;
}

#note-actions {
  display: flex;
  justify-content: space-between;
}

@media (max-width: 1400px) {
  body {
    font-size: 16px;
  }

  #aside {
    position: absolute;
    top: 0;
    right: 0;
    overflow: hidden;
    height: 3em;
    padding-right: 1em;
  }

  #aside.activated {
    width: 25em;
    height: 100%;
    box-shadow: 0 0 3px #aaa;
    background: white;
    padding-left: 1em;
    padding-right: 1em;
    z-index: 1;
  }

  #aside-title,
  #close-aside-button {
    display: block;
  }


  #close-aside-button,
  #aside.activated #aside-title,
  #sidebar.activated #notes-title {
    display: none;
  }

  #aside.activated #close-aside-button {
    display: block;
  }
}

@media (max-width: 800px) {
  #main {
    margin-top: 2em;
  }

  #aside,
  #sidebar {
    left: 0;
    position: absolute;
    top: 0;
    right: 0;
    height: 3em;
    overflow: hidden;
    width: 100%;
  }

  /* I don't like the interactions or features for the info box on mobile so I'm hiding it for now */
  #aside {
    display: none; 
  }

  #sidebar.activated {
    height: calc(100% - 2em);
    width: 100%;
    background: white;
    overflow: auto;
  }

  #notes-title {
    display: block;
    padding-left: 1.25em;
    background: 0 1px url(../images/icons/arrow-left.svg) no-repeat;
  }

  #aside {
    left: auto;
    right: 0;
    padding: 0 1em;
  }

  #editor {
    height: calc(99vh - 4em);
  }
}