/* Blog index, archive and category pages: posts as cards, 3 per row (4 rows = 12 per page) */
.pf-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

@media screen and (max-width: 59.9844em) {
  .pf-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media screen and (max-width: 37.4844em) {
  .pf-cards { grid-template-columns: minmax(0, 1fr); }
}

.pf-card.md-post {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 0.05rem solid var(--md-default-fg-color--lightest);
  border-radius: 0.4rem;
  background: var(--md-default-bg-color);
  transition: box-shadow 125ms, border-color 125ms;
}

.pf-card.md-post:hover {
  border-color: transparent;
  box-shadow: var(--md-shadow-z2);
}

.pf-card__image img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.pf-card .md-post__header,
.pf-card .md-post__content,
.pf-card .md-post__action {
  padding: 0 0.8rem;
}

.pf-card .md-post__header { margin-top: 0.6rem; }

/* title */
.pf-card .md-post__content h2 {
  margin: 0.3rem 0 0.4rem;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
}

/* excerpt: text only, at most 5 lines; images and embeds belong to the post page */
.pf-card .md-post__content {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 9;
  line-clamp: 9;
  font-size: 0.7rem;
}

.pf-card .md-post__content img,
.pf-card .md-post__content figure,
.pf-card .md-post__content iframe,
.pf-card .md-post__content .glightbox,
.pf-card .md-post__content .headerlink {
  display: none;
}

.pf-card .md-post__content > :first-child { margin-top: 0; }

.pf-card .md-post__action {
  margin-top: auto;
  padding-top: 0.4rem;
  padding-bottom: 0.7rem;
  font-size: 0.7rem;
}

/* card pages have no table of contents or section navigation: give the grid the full width */
@media screen and (min-width: 76.25em) {
  .md-main__inner:has(.pf-cards) > .md-sidebar { display: none; }
  .md-main__inner:has(.pf-cards) > .md-content { max-width: none; }
}
