/* viewer/index.css */
* {
  font-family:
    Inter,
    Arial,
    sans-serif;
  font-size: 12px;
}
:root {
  --background-90: #ffffff;
  --background-80: #efefef;
  --background-70: #e7e7e7;
  --background-60: #e0e0e0;
  --background-50: #cecece;
  --foreground-90: #000000;
  --foreground-80: #3f3f3f;
  --foreground-70: #5c5c5c;
  --foreground-60: #7f7f7f;
}
body {
  margin: 0;
  width: 100dvw;
  height: 100dvh;
  overscroll-behavior: none;
  overflow: hidden;
  background-color: var(--background-90);
  display: flex;
  flex-direction: row;
  > #sidebar,
  #infobar {
    background-color: var(--background-80);
  }
  > #sidebar {
    width: 250px;
    border-right: 1px solid var(--background-50);
  }
  > #infobar {
    width: 400px;
    border-left: 1px solid var(--background-50);
  }
  > #view {
    flex-grow: 1;
  }
}
input {
  -webkit-appearance: none;
  appearance: none;
  height: 24px;
  border: 1px solid var(--background-50);
  padding: 2px 12px;
  box-sizing: border-box;
  &:hover {
    border: 1px solid var(--foreground-60);
  }
}
header {
  border-bottom: 1px solid var(--background-50);
}
footer {
  border-top: 1px solid var(--background-50);
}
header,
footer {
  display: flex;
  flex-direction: column;
  padding: 12px;
  gap: 8px;
}
h1,
h2,
h3 {
  font-weight: bold;
  margin: 0;
}
h1 {
  font-size: 24px;
}
h2 {
  font-size: 18px;
}
h3 {
  font-size: 14px;
}
ul,
ol {
  margin: 0;
}
p {
  font-size: 12px;
  margin: 0;
}
code {
  font-family:
    Inconsolata,
    Consolas,
    monospace;
  background-color: var(--background-90);
  border: 1px solid var(--background-50);
  padding: 0 1ch;
  user-select: all;
}
#sidebar {
  display: flex;
  flex-direction: column;
  > #list {
    flex-grow: 1;
    overflow-y: auto;
    > .item {
      width: 100%;
      height: 24px;
      user-select: none;
      cursor: pointer;
      padding: 2px 12px;
      box-sizing: border-box;
      align-content: center;
      &:hover {
        background-color: var(--background-70);
      }
      &:active {
        background-color: var(--background-60);
      }
    }
  }
}
#infobar {
  display: flex;
  flex-direction: column;
  #readme {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    padding: 12px;
    overflow-y: scroll;
    gap: 8px;
  }
}
.placeholder {
  background-color: var(--background-60);
  position: relative;
  overflow: hidden;
  &::before {
    content: "";
    position: absolute;
    left: -200px;
    top: 0;
    height: 100%;
    translate: -50% 0;
    width: 0;
    box-shadow: 0 0 100px 50px var(--background-90);
    animation: placeholder-sweep 2s infinite linear;
    width: 0;
  }
  &:nth-child(1) {
    opacity: 1.0;
    &::before {
      animation-delay: 0.0s;
    }
  }
  &:nth-child(2) {
    opacity: 0.8;
    &::before {
      animation-delay: 0.2s;
    }
  }
  &:nth-child(3) {
    opacity: 0.6;
    &::before {
      animation-delay: 0.4s;
    }
  }
  &:nth-child(4) {
    opacity: 0.2;
    &::before {
      animation-delay: 0.6s;
    }
  }
}
@keyframes placeholder-sweep {
  0% {
    left: -100px;
  }
  100% {
    left: calc(100% + 100px);
  }
}
