/* CSS RESET */

textarea,
input {
  outline: none;
}

* {
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
  -moz-tap-highlight-color: rgba(0, 0, 0, 0);
  -webkit-touch-callout: none;
  /*-webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;*/
  box-sizing: border-box;
}

:focus {
  outline-color: transparent;
  outline-style: none;
}

/* END CSS RESET */

body {
  background: #fff;
}

body:not(.ui-admin) .ui-admin-only {
  display: none !important;
}

.loading {
  display: block;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 30;
  width: 100%;
  height: 100%;
  overflow: hidden;
  opacity: 0;
  background-image: url(/assets/image/loading.gif);
  background-size: 32px;
  background-position: center;
  background-repeat: no-repeat;
  background-color: rgba(255, 255, 255, 0.8);
  pointer-events: none;
}

.loading.visible {
  opacity: 0.99;
  pointer-events: all;
}

.connection {
  display: block;
  position: relative;
  top: 0;
  left: 0;
}

.connection.visible:not(.not-yet-established) {
  margin: 0 0 40px 0;
}

.connection .banner {
  display: block;
  position: fixed;
  top: -40px;
  left: 0;
  z-index: 10;
  width: 100%;
  height: 40px;
  margin: 0 auto;
  padding: 12px;
  border: none;
  background: #e64444;
  font-size: 16px;
  line-height: 16px;
  color: white;
  text-align: center;
}

.connection.visible:not(.not-yet-established) .banner {
  top: 0;
}

.post-child {
  display: block;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 4%;
  background: rgba(255, 255, 255, 0.8);
  overflow-y: auto;
}

.post-child .post-content {
  display: block;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  -webkit-transform: translate(-50%, -50%);
  width: 100%;
  height: auto;
  max-width: 640px;
  max-height: calc(100% - 64px);
  padding: 16px;
}

.post-child .post-content .post {
  margin-top: 0;
  margin-bottom: 96px;
}

.post-child .post-content .post h1 + p > img {
  margin-top: -8px;
}

.post-child .post-content .post:first-child {
  margin-top: 0;
}

.post-child .post-content .post > *:first-child {
  margin-top: 0 !important;
}

@media (max-width: 720px) {
  .post-child .post-content {
    padding: 0 4%;
  }
  .post-child .post-content .post {
    padding-top: 48px;
    margin-bottom: 96px;
  }
}

@media (min-width: 721px) {
  .post.is-chapter h1 {
    position: relative;
    left: -64px;
    width: calc(100% + 64px);
    padding: 8px 8px 8px 64px;
    border-radius: 6px;
    background-image: url(/assets/image/menu.png);
    background-size: 22px;
    background-position: 16px 49%;
    background-repeat: no-repeat;
    background-color: rgba(0, 0, 0, 0);
    font-size: 2.5em;
    cursor: pointer;
  }
  .post.is-chapter h1:hover {
    background-color: rgba(0, 0, 0, 0.08);
  }
}

.meta {
  position: fixed;
  bottom: 0;
  left: 0;
  z-index: 10;
  width: 100%;
  height: auto;
  padding: 24px;
  line-height: 16px;
  background: -moz-linear-gradient(
    top,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.96) 50%,
    rgba(255, 255, 255, 0.96) 100%
  );
  background: -webkit-linear-gradient(
    top,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.96) 50%,
    rgba(255, 255, 255, 0.96) 100%
  );
  background: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.96) 50%,
    rgba(255, 255, 255, 0.96) 100%
  );
  filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#00ffffff', endColorstr='#e6ffffff',GradientType=0 );
  user-select: none;
}

@media (max-width: 720px) {
  .meta {
    padding: 56px 12px 12px 12px;
  }
}

.meta.hidden {
  bottom: -80px;
  opacity: 0;
  pointer-events: none;
}

.meta .date {
  display: inline-block;
  position: relative;
  vertical-align: middle;
  margin: 0 16px 0 0;
  color: rgba(0, 0, 0, 0.4);
}

@media (max-width: 720px) {
  .meta .date {
    display: block;
    position: fixed;
    top: auto;
    right: auto;
    bottom: 24px;
    left: 8px;
    margin: 0 16px 0 8px;
    color: rgba(0, 0, 0, 0.5);
  }
}

.meta .author {
  display: inline-block;
  vertical-align: middle;
  margin: 0 16px 0 0;
  float: left;
}

.meta .author .image {
  display: inline-block;
  vertical-align: middle;
  width: 40px;
  height: 40px;
  margin: -4px 8px -4px 0;
  border-radius: 48px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.2), 0 2px 4px rgba(0, 0, 0, 0.1);
}

.meta .author .name {
  display: none;
  vertical-align: middle;
}

.meta .social {
  display: inline-block;
  position: relative;
  top: 0;
  left: 0;
  float: right;
  vertical-align: middle;
}

.meta .social .button {
  margin: 0 0 0 4px;
}

.meta .progress-bar {
  display: block;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: auto;
  background: rgba(0, 0, 0, 0.1);
}

.meta .progress-bar-inner {
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  width: 0%;
  height: 4px;
  background: rgba(85, 255, 199, 0.8);

  transition: 0.1s all ease-in;
}

.dialogue {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, 30%);
  -webkit-transform: translate(-50%, 30%);
  z-index: 20;
  width: calc(100% - 16px);
  height: auto;
  max-width: 560px;
  max-height: calc(100% - 16px);
  margin: 0 auto;
  padding: 20px;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2), 0 0 0 2000px rgba(0, 0, 0, 0.72);
  opacity: 0;
  pointer-events: none;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  overflow-x: hidden;
  overflow-y: auto;

  transition: 0.15s all ease-in-out;
}

.dialogue.visible {
  top: 50%;
  transform: translate(-50%, -50%, 0);
  -webkit-transform: translate(-50%, -50%);
  opacity: 1;
  pointer-events: all;
}

.dialogue h1:first-of-type,
.dialogue h2:first-of-type {
  margin-top: 8px;
  padding-top: 0;
}

.dialogue.at-end,
.dialogue.at-end.visible {
  transform: translate(-50%, -56%);
  -webkit-transform: translate(-50%, -56%);
  background-color: rgba(255, 255, 255, 0.98);
  box-shadow: 0 0 32px 32px rgba(255, 255, 255, 0.94),
    0 0 0 2000px rgba(255, 255, 255, 0.94);
}

[contenteditable],
[contenteditable="true"] {
  cursor: text;
  margin: 0 0 12px 0;
  padding: 8px 12px;
  border: solid 2px rgba(0, 0, 0, 0.08);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0);
  transition: 0.15s all ease-in-out;
}

[contenteditable]:hover,
[contenteditable="true"]:hover,
[contenteditable]:focus,
[contenteditable="true"]:focus {
  background: rgba(0, 0, 0, 0);
  border: solid 2px rgba(0, 0, 0, 0.12);
}

[contenteditable]:empty:before,
[contenteditable="true"]:empty:before {
  content: attr(data-placeholder);
  display: block;
  position: absolute;
  opacity: 0.3;
}

.post-new .post-new-title {
  min-height: 52px;
  font-size: 24px;
  line-height: 1.4em;
  font-weight: 700;
}

.post-new .post-new-content {
  min-height: 44px;
}

.post-new .post-new-content,
.post-new .post-new-content * {
  font-family: "Roboto Mono", monospace;
  font-size: 16px;
  line-height: 1.5em;
  font-weight: 400;
  letter-spacing: -0.02em;
}

.post-new .post-new-file-container {
  display: inline-block;
  position: relative;
  width: calc(50% - 4px);
  margin: 0 8px 12px 0;
  padding: 14px 12px 14px 52px;
  border-radius: 6px;
  background-color: rgba(0, 0, 0, 0.05);
  opacity: 0.72;
  cursor: pointer;
  transition: 0.15s all ease-in-out;
}

.post-new .post-new-file-container:after {
  content: "";
  display: block;
  position: absolute;
  top: 11px;
  left: 14px;
  z-index: 1;
  width: 24px;
  height: 24px;
  background-image: url(/assets/image/upload.png);
  background-size: 22px;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0.8;
}

.post-new .post-new-file-container:hover {
  background-color: rgba(0, 0, 0, 0.1);
}

.post-new .post-new-file-container input {
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.post-new .post-new-file-label {
  position: relative;
  top: 0;
  left: 0;
  z-index: 1;
}

.post-new .post-new-file-container .file-upload-progress {
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 0;
  width: 0%;
  height: 100%;
  border-radius: 6px;
  background-color: rgba(85, 255, 199, 1);
  transition: 0.25s all ease-in-out;
}

.post-new .post-new-chapter-container {
  display: inline-block;
  position: relative;
  width: calc(50% - 8px);
  margin: 0 0 24px 0;
  padding: 12px;
  border-radius: 6px;
  background-color: rgba(0, 0, 0, 0.044);
}

@media (max-width: 720px) {
  .post-new .post-new-file-container,
  .post-new .post-new-chapter-container {
    display: block;
    width: 100%;
  }
}

.button {
  display: inline-block;
  position: relative;
  top: 0;
  left: 0;
  width: auto;
  height: auto;
  padding: 12px 20px;
  border: solid 2px rgba(0, 0, 0, 0.08);
  border-radius: 6px;
  font-size: 16px;
  font-weight: 500;
  line-height: 16px;
  color: rgba(0, 0, 0, 0.9);
  background-color: rgba(85, 255, 199, 1);
  overflow: hidden;
  cursor: pointer;
  user-select: none;
  text-decoration: none;

  transition: 0.1s all ease-in;
}

@media (max-width: 720px) {
  .button:not(.large) {
    padding: 8px 12px;
    font-size: 14px;
  }
}

.button:after {
  content: "";
  display: block;
  position: absolute;
  top: -10%;
  left: -10%;
  width: 120%;
  height: 120%;
  background: rgba(0, 0, 0, 0);

  transition: 0.1s all ease-in;
}

.button:hover {
  border: solid 2px rgba(0, 0, 0, 0.16);
}

.button:hover:after {
  content: "";
  background: rgba(0, 0, 0, 0.06);
}

.button.disabled {
  opacity: 0.4;
  pointer-events: none;
}

.button.left {
  float: left;
}

.button.right {
  float: right;
}

.button.light {
  background-color: rgba(255, 255, 255, 1);
}

.background-facebook {
  color: #fff !important;
  background: #1877f2 !important;
}

.background-twitter {
  color: #fff !important;
  background: #1da1f2 !important;
}

.button.post-new-show {
  display: inline-block;
  position: fixed;
  top: 16px;
  left: auto;
  z-index: 15;
  bottom: auto;
  right: 12px;
  width: auto;
}

.button.post-new-load {
  display: inline-block;
  position: fixed;
  top: 16px;
  left: auto;
  z-index: 15;
  bottom: auto;
  right: 76px;
  width: auto;
}

.dialogue.chapters {
  top: 0;
  left: 0;
  transform: translate(-50%, 0);
  -webkit-transform: translate(-50%, 0);
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  padding: 56px 16px 16px 16px;
  border-radius: 0;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 0 32px 32px rgba(255, 255, 255, 0.72),
    0 0 0 2000px rgba(255, 255, 255, 0.72);
  user-select: none;

  transition: 0.3s all ease-in-out;
}

.dialogue.chapters.visible {
  transform: translate(0, 0);
  -webkit-transform: translate(0, 0);
}

.chapters-container .chapters-list {
  max-width: 400px;
  margin-top: 12px;
}

.chapters-container .button.chapters-button {
  display: block;
  position: fixed;
  top: 16px;
  left: 12px;
  z-index: 15;
  width: auto;
  height: inherit;
  margin: 0;
  padding: 9px 12px 7px 40px;
  border-radius: 6px;
  background-image: url(/assets/image/menu.png);
  background-size: 22px;
  background-position: 8px 50%;
  background-repeat: no-repeat;
  font-size: 16px;
  line-height: 16px;
  font-weight: 500;
  cursor: pointer;
  user-select: none;

  transition: 0.15s all ease-in;
}

.chapters-container .chapters-button:hover {
  background-color: rgba(0, 0, 0, 0.08);
  opacity: 0.9;
}

.chapters-button.chapters-show,
.chapters-button.chapters-show:hover {
  opacity: 0.99;
  background-color: rgba(255, 255, 255, 1);
}

.chapters-container .chapter {
  display: block;
  position: relative;
  top: 0;
  left: 0;
  width: auto;
  max-width: 100%;
  height: auto;
  margin: 8px -6px 8px -6px;
  padding: 8px 12px 6px 12px;
  border-radius: 6px;
  background-color: rgba(0, 0, 0, 0);
  font-size: 18px;
  line-height: 1.35em;
  cursor: pointer;
}

.chapters-container .chapter:hover {
  background-color: rgba(0, 0, 0, 0.08);
}

.chapters-container .chapter .chapter-title {
  width: 100%;
  height: auto;
  margin: 0;
}

.chapters-container .chapter .chapter-meta {
  width: 100%;
  height: auto;
  font-size: 0.75em;
  color: rgba(0, 0, 0, 0.72);
}

.navigation-highlight-container {
  display: block;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
}

.navigation-highlight {
  display: block;
  position: absolute;
  top: -20%;
  left: 0;
  width: 160%;
  height: 140%;
  box-shadow: inset 48px 0 80px 80px rgba(85, 255, 199, 0.12);
  transition: all 0.25s ease-out;
  opacity: 0;
}

.navigation-highlight.visible {
  opacity: 0.99;
}

.navigation-highlight.right {
  left: auto;
  right: 0;
  box-shadow: inset -48px 0 80px 80px rgba(85, 255, 199, 0.12);
}

.controls {
  display: block;
  position: fixed;
  bottom: 8px;
  right: 4px;
  width: auto;
  height: auto;
  padding: 8px;
  white-space: nowrap;
  opacity: 0.99;
  user-select: none;
  cursor: default;
  text-align: right;
}

.control-section {
  display: block;
  margin: 8px 0 0 0;
  text-align: right;
}

.control-button {
  display: inline-block;
  position: relative;
  top: 0;
  left: 0;
  margin: 0 2px 0 2px;
  padding: 4px 7px 9px 7px;
  border: solid 1px rgba(0, 0, 0, 0.3);
  border-radius: 4px;
  line-height: 1em;
  color: rgba(0, 0, 0, 0.72);
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.1);
  font-size: 14px;
  font-weight: 300;
}

.control-button.wide {
  padding: 6px 10px 8px 10px;
}

.control-description {
  display: inline-block;
  vertical-align: middle;
  padding: 8px 8px 6px 8px;
  font-size: 12px;
  color: rgba(0, 0, 0, 0.64);
}

.controls hr {
  max-width: 36px;
  margin: 12px 0 12px auto;
  text-align: right;
}

/* START CHECKBOX */

[type="checkbox"]:not(:checked),
[type="checkbox"]:checked {
  position: absolute;
  left: -9999px;
  box-sizing: border-box;
}

[type="checkbox"]:not(:checked) + label,
[type="checkbox"]:checked + label {
  display: inline-block;
  position: relative;
  margin: -8px 0 0 0;
  padding: 8px 0 0 40px;
  color: rgba(0, 0, 0, 0.64);
  font-size: 16px;
  line-height: 24px;
  cursor: pointer;
  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

[type="checkbox"]:not(:checked) + label:before,
[type="checkbox"]:checked + label:before {
  content: "";
  position: absolute;
  top: 8px;
  left: 0;
  width: 24px;
  height: 24px;
  background-color: rgba(0, 0, 0, 0.08);
  border: solid 2px rgba(0, 0, 0, 0.12);
  border-radius: 4px;
  box-sizing: border-box;
  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

[type="checkbox"]:not(:checked) + label:before:hover {
  background-color: rgba(0, 0, 0, 0.1);
}

[type="checkbox"]:checked + label:before {
  content: "";
  background-color: rgba(85, 255, 199, 1);
}

[type="checkbox"]:not(:checked) + label:after,
[type="checkbox"]:checked + label:after {
  content: "";
  position: absolute;
  top: 8px;
  left: 0;
  width: 24px;
  height: 22px;
  background-image: url(/assets/image/check.png);
  background-size: 18px;
  background-position: 48% 68%;
  background-repeat: no-repeat;
  opacity: 0.64;
  -webkit-transition: all 0.2s ease-in-out;
  -moz-transition: all 0.2s ease-in-out;
  -ms-transition: all 0.2s ease-in-out;
  -o-transition: all 0.2s ease-in-out;
  transition: all 0.2s ease-in-out;
  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

[type="checkbox"]:not(:checked) + label:after {
  opacity: 0;
}

[type="checkbox"]:checked + label:after {
  opacity: 0.64;
}

/* END CHECKBOX */

@media (min-width: 641px) {
  .moon {
    display: none !important;
  }
  .nomo {
    display: inherit !important;
  }
}

@media (max-width: 720px) {
  .moon {
    display: inherit !important;
  }
  .nomo {
    display: none !important;
  }
}
