@import "libs/datepicker.min.css";
@import "modules/header.css";
@import "modules/dateFilter.css";

body {
  background-image: url('../assets/bg-top.svg'), url('../assets/bg-bottom.svg');
  background-position: left top, right bottom;
  background-repeat: no-repeat, no-repeat;
  background-size: 44vw, 14vw;
}

.content {
  width: 100%;
  max-width: calc(836px + 21px + 21px);
  display: grid;
  justify-self: center;
  padding: 18px 21px;
}

.stat-list {
  display: flex;
  flex-wrap: wrap;
  margin-top: 10px;
  margin-left: 4px;
}

.stat-item {
  display: flex;
  gap: 4px;
  font-size: 14px;
  font-weight: 500;
  margin-right: 16px;

  &:first-of-type {
    margin-right: 28px;
  }

  dt {
    font-weight: 700;
  }
}

.post-list {
  display: grid;
  gap: 8px;
  justify-items: center;
  margin-top: 2px;
}

.post {
  width: 100%;
  background-color: white;

  .post-card {
    font-size: 14px;
    font-weight: 500;
  }

  .post-stats {
    display: flex;
    gap: 20px;
  }

  .post-stats-item {
    display: grid;
    grid-auto-flow: column;
    align-items: center;
    gap: 8px;
    grid-auto-columns: max-content;
  }
}

.post-list[data-view='list'] {
  .post {
    display: grid;
    grid-template-columns: 86px 1fr;
    gap: 30px;
    width: 100%;

    @media (max-width: 619px) {
      gap: 16px;
    }
  }

  .post-body {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    align-items: center;

    @media (max-width: 619px) {
      grid-template-columns: initial;
    }
  }

  .post-card {
    @media (max-width: 619px) {
      display: flex;
      align-items: center;
      gap: 16px;
    }
  }

  .post-title {
    padding-bottom: 3px;

    @media (max-width: 619px) {
      min-width: 100px;
    }

    @media (max-width: 369px) {
      min-width: 80px;
      font-size: 13px;
    }
  }

  .post-img {
    width: 86px;
    height: 86px;
  }

  .post-stats {
    @media (max-width: 369px) {
      font-size: 13px;
      gap: 10px;
    }
  }

  .post-stats-item {
    @media (max-width: 369px) {
      gap: 4px;
    }
  }
}

.post-list[data-view='grid'] {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(203px, 1fr));
  gap: 8px;

  .post-body {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    padding: 9px 12px 16px;
  }

  .post-card:nth-of-type(2) {
    margin-left: 14px;
  }

  .post-card:last-of-type {
    grid-column: 1 / -1;
    font-size: 12px;
    margin-top: 18px;
    display: flex;
    justify-content: space-between;
    align-items: baseline;

    .post-title {
      font-size: 14px;
    }
  }

  .post-stats {
    display: grid;
    gap: 4px;
    margin-top: 4px;
  }

  .post-img {
    width: 100%;
  }
}

.view-toggle {
  display: flex;
  justify-content: flex-end;
  gap: 21px;
  margin-right: 4px;
  margin-bottom: 21px;
}

.view-toggle__btn--active {
  rect {
    fill: #3D8EDA;
  }
}

.btn {
  text-transform: uppercase;
  border-radius: 14px;
  border-width: 1px;
  border-style: solid;
  min-height: 28px;
  padding-left: 24px;
  padding-right: 24px;
  font-size: 11px;
  font-weight: 500;

  &.btn--secondary {
    color: #929292;
    border-color: #929292;
    transition: color 0.2s ease-out;
  }

  &:hover {
    cursor: pointer;
    color: #5F5F5F;
  }
}

.btn-load {
  justify-self: center;
  margin-top: 16px;
}
