@import "../variables/_all";
@import "../mixins/_all";
@import './list';
@import './button';
@import './blocker';

.post-list-container {

}

.post-list {
  padding: 16px 0;
  margin: 0;
  display: flex;
  box-sizing: border-box;
  flex-wrap: nowrap;
  overflow: auto;
  .post-list-header {
  }
  .post-list-item {
    flex-shrink: 0;
    width: 40%;
  }
  &.post-list-wrap {
    flex-wrap: wrap;
    padding: 0;
    margin: 0;
    width: 100%;
    box-sizing: border-box;
    .post-list-item {
      flex-shrink: 1;
      width: 50%;
    }
  }
}

.post-image-back {
  background-color: white;
  background-image: linear-gradient(45deg, $post-checkerboard-dark-color 25%, transparent 25%), -moz-linear-gradient(-45deg, $post-checkerboard-dark-color 25%, transparent 25%), -moz-linear-gradient(45deg, transparent 75%, $post-checkerboard-dark-color 75%), -moz-linear-gradient(-45deg, transparent 75%, $post-checkerboard-dark-color 75%);
  background-image: -moz-linear-gradient(45deg, $post-checkerboard-dark-color 25%, transparent 25%), -moz-linear-gradient(-45deg, $post-checkerboard-dark-color 25%, transparent 25%), -moz-linear-gradient(45deg, transparent 75%, $post-checkerboard-dark-color 75%), -moz-linear-gradient(-45deg, transparent 75%, $post-checkerboard-dark-color 75%);
  background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, $post-checkerboard-dark-color), color-stop(0.25, transparent)), -webkit-gradient(linear, 0 0, 100% 100%, color-stop(0.25, $post-checkerboard-dark-color), color-stop(0.25, transparent)), -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.75, transparent), color-stop(0.75, $post-checkerboard-dark-color)), -webkit-gradient(linear, 0 0, 100% 100%, color-stop(0.75, transparent), color-stop(0.75, $post-checkerboard-dark-color));
  background-size: $post-checkerboard-size $post-checkerboard-size;
  background-position: 0 0, $post-checkerboard-size / 2 0, $post-checkerboard-size / 2 (-$post-checkerboard-size / 2), 0px $post-checkerboard-size / 2;
}

.post-list-alt {
  @extend .list-alt;
  width: 100%;
}

.post-list-item {
  list-style: none;
  display: block;
  margin: 0;
  box-sizing: border-box;
  padding: 8px;
  position: relative;
  .ap-image-notfound {
    font-size: 24px;
  }
  .thread-tip {
    position: absolute;
    z-index: 9;
  }
}

.post-banned-blocker {
  @extend .blocker;
  background: $ban-overlay-color;
  z-index: 4;
  .post-banned-blocker-icon {
    font-size: 72px;
  }
}

.post-deleted-blocker {
  @extend .blocker;
  z-index: 5;
  background: $deleted-overlay-color;
  .post-deleted-blocker-icon {
    font-size: 72px;
  }
}

.post-list-item-inner {
  display: block;
  box-sizing: border-box;
  background: white;
  padding: 0;
  box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
  border: 1px solid #CCC;
}

.post-list-item-body {
  display: block;
  width: 100%;
}

.post-list-item-footer {
  display: block;
  width: 100%;
}

.post-list-item-row {
  display: block;
  width: 100%;
}

.post-list-item-desc {
  display: block;
  padding: 4px 8px;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.post-list-item-image-row {
  @extend .post-image-back;
  .ap-image {
    max-width: 100%;
    box-sizing: border-box;
    margin: 0 auto;
    background: transparent;
  }
}

.post-list-item-image {
  &.ap-image {
    img {
      transition: transform 300ms;
      transform-origin: 50% 50%;
      transform: scale(1);
      &:hover {
      }
      &:active {
      }
    }
  }
}

.post-list-item-button-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  .post-list-item-button-col {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    flex-wrap: nowrap;
    padding: 0 2px;
    &:last-child {
      justify-content: flex-end;
    }
  }
}

.post-list-item-disclosure-icon {
  color: $slight-text-color;
}

.post-panel {
  position: relative;
  min-height: 180px;
  .ap-image-notfound {
    font-size: 32px;
  }
}

.post-panel-row {
  padding: 0 8px;
  margin: 0 0;
  &.post-panel-meta-row {
    font-size: $post-small-font-size;
    margin: 8px 0;
    max-width: 100%;
    line-height: $thread-link-height;
  }
  &.post-panel-image-row {
    @extend .post-image-back;
    padding: 0;
    text-align: center;
    max-width: 100%;
    .ap-image {
      display: flex;
      max-width: 100%;
      box-sizing: border-box;
      margin: 0 auto;
      background: transparent;
    }
  }
  &.post-panel-tag-row {
    font-size: $post-small-font-size;
    margin: 4px 0 8px;
  }
  &.post-panel-action-row {
    margin: 16px 0;
    .post-report-button {
      float: right;
    }
  }
}

.post-panel-date {
  float: right;
  color: $light-text-color;
  font-size: 9px;
  display: inline-block;
  line-height: inherit;
}

.post-panel-by {
  &:before {
    content: '-';
    display: inline-block;
    margin: 0 8px;
  }
}

.post-report-button {
  @extend .row-button;
  font-size: smaller;
  .post-report-button-icon {
    display: inline-block;
    margin-right: 2px;
  }
}

.post-ban-button {
  @extend .row-button;
}

.post-destroy-button {
  @extend .row-button;
}

.post-detail {
  .comment-list {
    margin-left: 0;
  }
  .comment-form {
    margin-left: 0;
  }
}

.post-detail-footer {
  text-align: center;
}

.post-destroy {
  text-align: center;
}

.post-thread-button {
  &.ap-button {
    border: none;
    margin: 0 4px 0 0;
    padding: 4px;
    font-size: 14px;
    border-radius: 50%;
  }
  &.post-thread-button-active {
    .post-thread-button-icon {
      opacity: 0.5;
    }
  }
}

.post-unban {
  text-align: center;
  margin: 8px auto;
  max-width: $content-width;
  display: block;
}

.post-panel-image-link {
  &, &:link, &:visited {
    text-decoration: none;
    color: inherit;
  }
}

.post-list-more-button {
  @extend .list-more-button;
}

@media (min-width: $tablet-width) {
  .post-list-container {
    overflow: hidden;
  }
  .post-list {
    .post-list-item {
      flex-shrink: 0;
      width: 23%;
    }
    &.post-list-wrap {
      margin: 0 -8px;
      width: auto;
      .post-list-item {
        width: 25%;
      }
    }
  }
}
