/* =============================================================================
   POSTS
   Classes: .post-list, .post-card, .post-card-image, .post-card-body, .post-card-meta
   Figma: post-card (Property 1 = Default)
   Verify the Divi 5 markup these sit on (see docs/CLASSES.md).
============================================================================= */

/* ─── .post-card ───
   Vertical card: image, then a body with title and meta line.
   Type it on the container (Column / Group, or the Loop item). */
.post-card {
  display: flex;
  flex-direction: column;
  gap: var(--card-gap);
  padding-top: var(--card-padding-top);
  padding-bottom: var(--card-padding-bottom);
  padding-left: var(--card-padding-left);
  padding-right: var(--card-padding-right);
  border-radius: var(--card-radius);
}

/* Image — vertical ratio, cropped to fit */
.post-card-image {
  aspect-ratio: var(--card-image-ratio-vertical);
  overflow: hidden;
  border-radius: var(--card-radius);
}

.post-card-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Body — title + meta, inset from the card edge */
.post-card-body {
  display: flex;
  flex-direction: column;
  padding-left: var(--space-1);
  padding-right: var(--space-1);
}

/* Meta line — date | category on the left, arrow icon on the right */
.post-card-meta {
  display: flex;
  align-items: center;
  gap: var(--space-0-5);
}

.post-card-meta > * {
  margin: 0;
}

.post-card-meta a {
  color: inherit;
  text-decoration: none;
}

/* Arrow icon (Figma: illustrated arrow, 32px) */
.post-card-meta::after {
  content: "";
  flex: 0 0 auto;
  width: var(--icon-medium);
  height: var(--icon-medium);
  margin-left: auto;
  background-color: var(--icon-on-light);
  -webkit-mask: url("../assets/arrow.svg") center / contain no-repeat;
  mask: url("../assets/arrow.svg") center / contain no-repeat;
}

/* ─── .post-list ───
   The repeating container of the posts loop: a row of cards. */
.post-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (max-width: 980px) {
  .post-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .post-list {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-3);
  }
}
