@import "variables.css";

article.home-prose {
  box-sizing: border-box;
}

#post-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5em;
  padding: 0;
  margin: 1.5em auto;
  max-width: 80em;
  box-sizing: border-box;
  align-items: stretch;
}

/* Each post card: full-width of its grid cell; keep content in a column so headings, image and excerpt flow */
#post-list>li {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: start;
  width: 100%;
}

#post-list img {
  max-width: 100%;
  border-radius: 8px;
  margin-bottom: 0.5em;
}

#post-list .post-title {
  top: 0;
}

/* Responsive: at <=900px switch to 2 columns */
@media (max-width: 900px) {
  #post-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Responsive: at <=500px switch to 1 column */
@media (max-width: 500px) {
  #post-list {
    grid-template-columns: 1fr;
  }

  #post-list,
  #home-prose {
    padding-left: 0.75em;
    padding-right: 0.75em;
  }
}
