.post-list {
  user-select: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px 16px;
  max-width: 980px;
  margin: auto;
  margin-bottom: 32px;

  @media (max-width: 600px) {
    grid-template-columns: 1fr;
    max-width: 366px;
  }
}

.post-list-item {
  overflow: hidden;
  border-radius: var(--radius-large);
  background-color: var(--color-background-secondary);

  .cover-img {
    overflow: hidden;
    height: 266px;

    img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      filter: brightness(1);
      transition:
        transform 400ms cubic-bezier(0.4, 0, 0.25, 1),
        filter 400ms cubic-bezier(0.4, 0, 0.25, 1);
    }
  }

  &:hover .cover-img img,
  & > a:focus-visible .cover-img img {
    transform: scale(1.03);
    filter: brightness(0.85);
  }

  .title {
    font-size: 24px;
    line-height: 1.16667;
    font-weight: 700;
    max-height: 7em;
    overflow: hidden;
  }

  .content {
    padding: 32px;
  }

  a {
    font-weight: bold;
    font-size: 24px;
    color: var(--color-text-primary);
    text-decoration: none;
  }

  .categories {
    color: var(--color-text-accent);
    margin-bottom: 6px;
    font-weight: 600;

    span {
      font-size: 11px;
      margin-right: 6px;
      text-decoration: none;
    }
  }

  .excerpt {
    margin-top: 12px;
    font-weight: normal;
    font-size: 15px;
    color: var(--color-text-tertiary);

    & > * {
      margin-top: 8px;
      margin-bottom: 8px;
      padding-left: 0;
      padding-right: 0;
    }
  }

  @media (max-width: 800px) {
    .content {
      font-size: 12px;
    }
  }

  .time {
    font-size: 14px;
    line-height: 1.28577;
    font-weight: 600;
    display: block;
    margin-top: 12px;
    color: var(--color-text-secondary);
  }
}

/* in archive page, use a more compact list view */

.post-list.archives {
  display: block;
  max-width: 980px;

  .post-list-item {
    border-radius: 0;
    background-color: initial;
    padding: 21px 0;
    margin: 0;
    border-bottom: 1px solid var(--color-border-primary);

    &:nth-child(n) {
      margin-left: 0;
      margin-right: 0;
    }

    &:last-child {
      border-bottom: none;
    }

    a {
      display: flex;
    }

    .cover-img {
      height: initial;
      min-width: 180px;
      width: 20vw;
      border-radius: var(--radius-medium);
      flex-shrink: 0;
    }
  }
}
