/* AI Press Run v1.13.23 — stable, uncropped Jetpack related-post cards. */

#jp-relatedposts .jp-relatedposts-items {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  width: 100%;
}

#jp-relatedposts .jp-relatedposts-post {
  float: none !important;
  width: auto !important;
  margin: 0 !important;
  min-width: 0;
}

#jp-relatedposts .jp-relatedposts-post > a.jp-relatedposts-post-a {
  display: flex !important;
  align-items: center;
  justify-content: center;
  width: 100% !important;
  height: auto !important;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 8px;
  background: #f2f5f3;
}

/* Jetpack gives the image link and title link the same class. Keep the fixed
   ratio on the direct-child image link only; otherwise every title becomes an
   extra 16:9 box and the cards stretch far down the page. */
#jp-relatedposts .jp-relatedposts-post-title a.jp-relatedposts-post-a {
  display: -webkit-box !important;
  width: auto !important;
  height: auto !important;
  min-height: 2.9em;
  aspect-ratio: auto !important;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

#jp-relatedposts .jp-relatedposts-post-img {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
  object-fit: contain !important;
  object-position: center center !important;
}

#jp-relatedposts .jp-relatedposts-post-title {
  margin-top: 9px !important;
  line-height: 1.45;
}

@media (max-width: 680px) {
  #jp-relatedposts .jp-relatedposts-items {
    grid-template-columns: 1fr !important;
    gap: 18px;
  }

  #jp-relatedposts .jp-relatedposts-post {
    width: 100% !important;
  }
}
