@import "variables.scss";

div.loading-overlay {
  z-index: 20;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url(../images/loading.gif) center no-repeat #f8f8f8;
}

div.posts {
  div.coto {
    position: relative;
    border-radius: 8px;
    border-color: #ddd;
    box-shadow: none;
    margin-bottom: 8px;

    &.coto-focus > div.coto-inner,
    &.selected > div.coto-inner {
      border-radius: 8px;
    }
    
    &.posting {
      opacity: 0.3;
      background: url(../images/loading.gif) center no-repeat #fff;
    }
  }

  div.coto-inner {
    padding-bottom: 3px;

    div.coto-header i.in-pinned-graph {
      display: inline;
    }
  }

  div.repost-header {
    margin-bottom: 8px;
    display: flex;
    flex-direction: row;
    padding-top: 0.5rem;
    position: relative;

    div.repost-icon {
      width: 25px;

      i {
        font-size: 2rem;
        color: #ccc;
        vertical-align: middle;
      }
    }

    div.amishi {
      flex: 1;

      img.avatar {
        width: 18px;
        height: 18px;
      }

      span.name {
        font-size: 1.3rem;
      }
    }

    div.reposted-in {
      flex: 1;
    }
  }

  div.author {
    margin-bottom: 8px;

    img.avatar {
      margin: 0;
      padding: 0;
      width: 24px;
      height: 24px;
      margin-right: 6px;
      border-radius: 4px;
      vertical-align: middle;
    }

    span.name {
      color: #aaa;
      font-weight: bold;
    }
  }

  div.post-footer {
    min-height: 10px;
    text-align: right;

    span.posted-at {
      font-size: 12px;
      font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
      color: #ccc;
    }
  }
}

div.posts-as-stream {
  div.posts-on-day {
    margin-top: 20px;

    div.date-header {
      z-index: 10;
      position: -webkit-sticky;
      position: sticky;
      top: -8px;
      left: 0;
      padding: 10px;
      padding-left: 0;

      span.date {
        color: #999;
        background-color: #f8f8f8;
        padding: 10px;
        font-size: 1.5rem;
      }
    }
  }
  
  div.coto.by-another-amishi {
    margin-left: 8px;

    &::before {
      content: '';
      position: absolute;
      display: block;
      width: 0;
      height: 0;
      left: -20px;
      top: 0;
      bottom: 0;
      margin: auto;
      border-top: 10px solid transparent;
      border-bottom: 10px solid transparent;
      border-right: 10px solid #ddd;
      border-left: 10px solid transparent;
    }
  
    &::after {
      content: '';
      position: absolute;
      display: block;
      width: 0;
      height: 0;
      left: -19px;
      top: 0;
      bottom: 0;
      margin: auto;
      border-top: 10px solid transparent;
      border-bottom: 10px solid transparent;
      border-right: 10px solid #fff;
      border-left: 10px solid transparent;
    }
  }

  img.author-icon-in-tile {
    display: none;
  }
}

div.posts-as-tiles div.posts {
  column-count: 3;
  column-gap: 0;

  @media (#{$narrow-viewport}) {
    column-count: 2;
  }

  div.coto {
    font-size: 1.2rem;
    border-radius: 4px;
    margin-bottom: 4px;
    margin-right: 4px;
    position: relative;

    -webkit-column-break-inside: avoid;
    page-break-inside: avoid;
    break-inside: avoid;

    div.coto-inner {
      height: 100%;
      box-sizing: border-box;
    }
    
    div.coto-header {
      min-height: 10px;
    }

    span.coto-tool-buttons {
      top: 0;
      right: -12px;

      &::before {
        content: none;
      }
      &::after {
        content: none;
      }
    }

    div.parents {
      display: none;
    }

    div.sub-cotos-button {
      display: none;
    }

    div.coto-body {
      max-height: 300px;
      overflow: hidden;
      padding-bottom: 8px;
    }

    div.blank-content i {
      font-size: 1.5rem;
    }

    div.post-footer {
      display: none;
    }

    &.coto-focus > div.coto-inner,
    &.selected > div.coto-inner {
      border-radius: 4px;
    }

    div.repost-icon i {
      font-size: 1.6rem;
    }

    div.author {
      display: none;
    }

    span.cotonoma-label {
      font-size: 1.3rem;

      img.avatar {
        width: 18px;
        height: 18px;
      }
    }

    a.tool-button.edit-coto,
    a.tool-button.add-coto {
      display: none;
    }

    img.author-icon-in-tile {
      position: absolute;
      right: 4px;
      bottom: 4px;
      width: 18px;
      height: 18px;
      border-radius: 4px;
      opacity: 0.8;
    }
  }
}