@keyframes heartbeat {
  0% {
    transform:scale(1);
  }

  50% {
    transform:scale(1.3);
  }

  100% {
    transform:scale(1);
  }
}

@keyframes sharpen {
  from {
    filter: blur(8px);
  }

  to {
    filter: none;
  }
}

#saved-searches-nav {
  margin-top: 1em;
}

#excerpt p.links {
  margin-top: 1em;
}

#edit-dialog {
  /* Hide everything but the rating and tags fields. */
  .post_has_embedded_notes_fieldset, .post_lock_fieldset, .post_parent_id,
  .post_source, #filedropzone, .upload_as_pending, .upload_source_container,
  .upload_parent_id, .upload_artist_commentary_container, .upload_commentary_translation_container {
    display: none;
  }
}

#has-parent-relationship-preview, #has-children-relationship-preview {
  overflow-x: auto;
  white-space: nowrap;

  article.post-preview {
    width: auto;
    border: none;
    margin: 0;
    padding: 5px 5px 10px;
    max-width: 154px;

    img {
      white-space: normal;
    }
  }
}

.post-count {
  color: var(--tag-count-color);
  margin-left: 0.2em;
}

.low-post-count {
  color: var(--low-post-count-color);
}

div#c-posts {
  .fav-buttons {
    font-size: 14pt;
    margin: 0.5em 0;

    i {
      margin-right: 0.1em;
    }

    button.ui-button {
      padding: 0.25em 0.75em;
    }
  }

  form#remove-fav-button button:not([disabled]) i.icon {
    color: var(--remove-favorite-button);
  }

  #remove-fav-button.animate i {
    animation: heartbeat 0.4s ease;
  }

  .fav-buttons-true #add-fav-button {
    display: none;
  }

  .fav-buttons-false #remove-fav-button {
    display: none;
  }

  #ugoira-controls {
    div#seek-slider {
      margin-top: 0.5em;
      float: right;
      overflow: visible;
      background: var(--ugoira-seek-slider-background);

      .ui-progressbar-value {
        background: var(--ugoira-seek-slider-progressbar-background);
      }
    }

    #save-video-link {
      margin: 0.5em 0;
    }

    button {
      margin-top: 0.3em;
    }

    #ugoira-load-progress {
      display: inline;
      margin-left: 17px;
    }
  }

  .outer-recent-searches {
    overflow: hidden;
  }

  .post-notice {
    margin: 0.5em 0;
    padding: 0.5em;
    overflow: hidden;
    border: var(--post-notice-border);

    p {
      margin-bottom: 0;
    }

    &.post-notice-parent { background: var(--post-parent-notice-background); }
    &.post-notice-child { background: var(--post-child-notice-background); }
    &.post-notice-pending { background: var(--post-pending-notice-background); }
    &.post-notice-banned { background: var(--post-banned-notice-background); }
    &.post-notice-deleted { background: var(--post-deleted-notice-background); }
    &.post-notice-resized { background: var(--post-resized-notice-background); }
    &.post-notice-search { background: var(--post-search-notice-background); }
  }

  aside#sidebar > section > ul {
    margin-bottom: 1em;

    a.wiki-link {
      margin-right: 0.3em;
    }
  }

  aside#sidebar > section > ul ul li {
    margin-left: 1em;
  }

  #search-box-form {
    display: flex;

    input {
      min-width: 0;
      flex: 1;
    }

    #search-box-submit {
      padding: 2px 6px;
      border-left: none;
      border-radius: 0;
    }
  }

  div#a-index {
    menu#post-sections {
      margin-bottom: 0.5em;
      font-size: var(--text-lg);

      li {
        padding: 0 1em 0.5em 0;

        &.active {
          font-weight: bold;
        }
      }
    }
  }

  div#a-show {
    #post-info-source {
      word-break: break-all;
    }

    .recommended-posts {
      margin-top: 1em;
    }

    menu#post-sections {
      margin: 0;
      font-size: var(--text-lg);

      li {
        padding: 0 1em 0 0;
      }
    }

    .image-container {
      margin: 1em 0 0.5em;
    }

    textarea {
      margin-bottom: 0.25em;
    }

    #edit textarea {
      width: 100%;
    }

    #favlist {
      margin-left: 1em;
      word-wrap: break-word;
    }

    #recommended.loading-recommended-posts {
      pointer-events: none;
      opacity: 0.5;
    }

    span.close-button {
      position: absolute;
      top: 5px;
      right: 5px;
      cursor: pointer;
    }

    #artist-commentary {
      border: var(--post-artist-commentary-container-border);
      border-radius: 3px;
      background: var(--post-artist-commentary-container-background);
      margin-bottom: 0.5em;
      padding: 0.5em;

      #original-artist-commentary, #translated-artist-commentary {
        max-height: 20em;
        overflow-y: auto;
      }
    }
  }

  div#quick-edit-div {
    textarea {
      width: 70%;
      height: 4em;
      display: block;
    }
  }
}

body[data-post-current-image-size="large"] #post-options .image-view-large-link,
body[data-post-current-image-size="original"] #post-options .image-view-original-link,
body[data-post-current-image-size="original"] #image-resize-notice {
  display: none;
}

/* Always show the "Resized to X% of original" notice on mobile when it exists. */
#image-resize-notice {
  @media screen and (max-width: 660px) {
    display: block !important;
  }
}

body.mode-translation .note-container {
  cursor: crosshair;
}

body:not(.mode-translation) div#c-posts div#a-show #mark-as-translated-section {
  display: none;
}

div#c-post-versions, div#c-artist-versions {
  div#a-index {
    a {
      word-wrap: break-word;
    }
  }
}

div#c-posts, div#c-uploads {
  /* Fetch source data box */
  div#source-info {
    border-radius: 4px;
    margin: 1em 0;
    padding: 1em;
    border: var(--fetch-source-data-border);

    &:not(.loading) #source-info-loading { display: none; }
    &.loading #source-info-content { display: none; }
    &.loading #fetch-data-manual { display: none; }

    ul {
      display: inline-block;
    }

    dt, dd, li {
      display: inline;
    }

    dt, #source-info-tags li {
      margin-right: 1em;
    }
  }
}

/* Container for the tag edit <textarea>, header, and related tags buttons. */
#tags-container {
  div.header {
    line-height: 1.5em;

    label {
      display: inline-block;
    }

    i#open-edit-dialog {
      font-size: var(--text-xs);
    }

    span[data-tag-counter] {
      float: right;
      color: var(--muted-text-color);
      font-size: var(--text-sm);

      img {
        margin-left: 0.5em;
        width: 20px;
        height: 20px;
      }
    }
  }
}

div#c-explore-posts {
  a.desc {
    font-weight: bold;
    margin: 0 0.5em;
  }

  .date-nav-links {
    text-align: center;
  }

  .period {
    margin: 0 5em;

    &:first-child {
      margin-left: 0;
    }
  }
}

div#unapprove-dialog {
  p {
    margin-bottom: 1em;
  }
}

#add-commentary-dialog {
  input {
    width: 70%;
  }

  input[type=checkbox] {
    width: auto;
  }

  textarea {
    font-size: 1em;
    width: 100%;
  }
}
