h1 {
  margin-bottom: -5px;
}

h1[contenteditable] {
  background-image: url(/icon/edit.svg);
  background-size: contain;
  background-position: right;
  background-repeat: no-repeat;
}

main {
  width: 50%;
  min-width: 500px;
  margin: 50px auto;
}

main img {
  width: 100%;
  height: auto;
  border-radius: 20px;
  margin: 15px 0;
}

main:not(.edit) date:nth-of-type(2) {
  display: none;
}

main.edit date:nth-of-type(1) {
  display: none;
}

main:not(.edit) .rawcont {
  display: none;
}

main.edit .htmlcont {
  display: none;
}

nav {
  margin-top: 50px;
  border-top: 1px solid var(--light);
  display: flex;
  clear: both;
}

nav > div {
  width: 50%;
  padding: 0;
  margin: 15px;
  display: flex;
  cursor: pointer;
}

nav .next {
  border-left: 1px solid var(--light);
  text-align: right;
  justify-content: end;
}

nav i {
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  background-image: url(/icon/caret.svg);
  aspect-ratio: 1 / 1;
}

nav div:hover i {
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  background-image: url(/icon/caret-fill.svg);
}

nav .next i {
  transform: rotate(180deg);
}

nav p {
  margin: 0;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  max-width: 180px;
}

nav p:nth-child(1) {
  font-weight: 700;
}

nav p:nth-child(2) {
  color: var(--dark-grey);
  margin-top: -5px;
  font-size: 70%;
}

#comments {
  padding-top: 20px;
  border-top: 1px solid var(--light)
}

#comments form > * {
  width: 100%;
  box-sizing: border-box;
  background: none;
  padding: 10px;
  border: 1px solid var(--light);
  font-family: Catamaran;
}

#comments form textarea {
  resize: none;
}

#comments form [type=submit] {
  transition: all .2s;
}

#comments form [type=submit]:hover {
  background-color: var(--main-col);
  color: white;
}

#comments > div p {
  margin: 0;
}

#comments > div .name {
  font-weight: 700;
  margin-top: 10px
}

#comments > div {
  background-image: url(/icon/quote.svg);
  background-size: 50px;
  background-position: 100% 0;
  background-repeat: no-repeat;
}

#comments > em {
  text-align: center;
  margin: 30px auto 0;
  display: block;
}

.sidebar {
  position: fixed;
  top: 200px;
  right: 100px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px;
  border-radius: 10px;
  background: white;
  box-shadow: 0 0 15px var(--lighter);
}

.sidebar i {
  background-position: center;
  background-size: contain;
  background-repeat: no-repeat;
  width: 30px;
  height: 30px;
  cursor: pointer;
}

.sidebar .edit {
  background-image: url(/icon/edit.svg);
}

.sidebar .del {
  background-image: url(/icon/delete.svg);
}

.sidebar .save {
  background-image: url(/icon/save.svg);
}

.sidebar .load {
  background-image: url(/icon/loading.svg);
}

.rawcont {
  padding: 10px;
  border: 1px solid var(--light);
  border-radius: 5px;
  width: 100%;
  height: 100vw;
  box-sizing: border-box;
  resize: none;
}

iframe {
  height: calc(100vh - 150px);
  position: fixed;
  left: -270px;
  width: 270px;
}

iframe.open {
  left: 0;
}

body.scrolled iframe {
  height: calc(100vh - 100px);
}

section.archive-note {
  padding: .5em 1em;
  background-color: #f3c55a33;
  border: 2px solid #f3c55a;
  border-left-width: .5em;
  border-radius: 1em;
}

@media screen and (max-width: 550px) {
  main {
    width: calc(100vw - 50px);
    min-width: unset;
  }

  nav {
    flex-direction: column;
  }

  nav > div {
    width: 100%;
    border-left: none !important;
  }

  nav .desc {
    width: calc(100% - 67px)
  }

  nav p {
    max-width: unset;
  }
}