@import "../_variables";
@import "../_mixins";

.postlist-wrapper {
  margin: 0 auto;
  text-align: center;
  max-width: var(--homepage-width);
}


.post-item {
  position: relative;
  margin: 40px 40px 40px;
  padding: 0 10px;
  @include transition(all 0.3s);
  &__img {
    display: inline-block;
    width: 220px;
    height: 147px;
    overflow: hidden;
    position: relative;
    z-index: 1;
    cursor: pointer;
    border-radius: 5px;  

    img {
      width: 100%;
      height: 100%;
      object-fit: cover;
    }

    &::after {
      content: "";
      width: 100%;
      height: 100%;
      background: var(--image-mask-color);
    }

  }

  &:hover {
    
    @include transform(scale(1.02));
  }

  .else {
    display: inline-block;
    text-align: left;
    top: 80px;
    height: 143px;
    width: 600px;
    border: 2px solid #757575;
    border-radius: 5px;
    overflow-y: auto;
    &::-webkit-scrollbar {
      width: 2px;
      background: transparent;
    };
    &::-webkit-scrollbar-thumb {
      background: rgb(163, 163, 163); 
    }
  }

  &__date {
    color: var(--c-text-sub);
    font-size: 16px;
    margin: 10px 0 0 50px;
  }

  &__title {
    color: var(--c-text);
    

    &:hover,
    &:focus {
      text-decoration: underline;
      color: var(--c-text-accent);
    }

    h2 {
      font-size: 23px;
      font-weight: bold;
      line-height: 1.1;
      margin: 20px 10px 0 50px;
    }

    h3 {
      font-size: 16px;
      font-weight: normal;
      margin: 10px 10px 0 50px;
      line-height: 1.8;
    }
  }

  &__content p {
    line-height: 1.8;
    font-size: 14px;
    margin: 10px 100px 0 50px;
  }
}

@media (max-width: $MQLarge) {
  .post-item {
    margin-left: 120px;
    &__img {
      width: 240px;
      height: 154px;
    }

    .else {
      top: 10px;
      width: 500px;
      height: 150px;
    }

    &__date {
      font-size: 16px;
      margin: 10px 0 0 60px;
    }

    &__title {
      h2 {
        font-size: 24px;
        margin: 20px 60px 0 60px;
      }

      h3 {
        margin: 10px 60px 0 60px;
      }
    }

    &__content p {
      margin: 10px 60px 0 60px;
    }
  }
}

@media (max-width: $MQIpad) {
  .postlist-wrapper {
    padding: 0 13px 20px;
  }

  .post-item {
    margin: 50px auto 70px;
    padding: 0 0 30px;
    border-bottom: 1px solid var(--c-border);
    max-width: 570px;
    &__img {
      display: block;
      margin: 0 auto;
      width: 570px;
      height: 320px;
      border-radius: 10px;
    }

    .else {
      position: static;
      height: auto;
      width: 100%;
      margin: 0 auto;
      background: transparent;
      border: none;
    }

    &__date {
      margin: 10px 0 0 20px;
    }

    &__title h2 {
      font-size: 24px;
      margin: 10px 20px 0 20px;
    }

    &__title h3,
    &__content p {
      margin: 10px 20px 0 20px;
    }
  }
}

@media (max-width: $MQMobile) {
  .post-item {
    margin: 40px auto 0;
    max-width: 400px;

    &__img {
      width: 100%;
      height: 210px;
    }

    &__date,
    &__title h2,
    &__title h3,
    &__content p {
      margin-left: 5px;
    }
  }
}
