.posts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.5rem;
  margin: 1.25rem 0;
  padding: 0 0.25rem;
}

@media (min-width: 1100px) {
  .posts {
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 1.75rem;
  }
}

@media (min-width: 1600px) {
  .posts {
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 2rem;
  }
}

.post-card {
  display: flex;
  flex-direction: column;
  background: #111;
  border: 1px solid #222;
  border-radius: 12px;
  overflow: hidden;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.post-card:hover {
  border-color: #444;
  transform: translateY(-2px);
}

.post-card__image {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #0a0a0a;
}

.post-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.post-card__content {
  padding: 1.15rem 1.3rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  flex: 1;
}

.post-card__meta {
  display: flex;
  gap: 0.8rem;
  font-size: 0.82rem;
  color: #777;
}

.post-card__title {
  margin: 0;
  font-size: 1.2rem;
  line-height: 1.3;
  font-weight: 600;
}

.post-card__title a {
  color: #eee;
  text-decoration: none;
}

.post-card__title a:hover {
  color: #fff;
}

.post-card__excerpt {
  margin: 0;
  color: #aaa;
  font-size: 0.98rem;
  line-height: 1.45;
  flex: 1;
}

.post-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  list-style: none;
  margin: 0.45rem 0 0;
  padding: 0;
  font-size: 0.78rem;
}

.post-card__tags a {
  display: inline-block;
  background: #1a1a1a;
  color: #999;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.post-card__tags a:hover {
  background: #2a2a2a;
  color: #ddd;
}

.post-card:not(:has(.post-card__image)) .post-card__content {
  padding-top: 1.3rem;
}
/* Fade-in on load */
.post-card__media-badge {
  position: absolute;
  bottom: 0.85rem;
  right: 0.85rem;
  background: var(--color-accent, #3b82f6);
  color: #fff !important;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  line-height: 1;
  letter-spacing: 0.01em;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
  max-width: calc(100% - 1.7rem);
  text-decoration: none;
  opacity: 0;
  animation: badgeFadeIn 0.6s ease-out 0.15s forwards;
  overflow: hidden;
  isolation: isolate;
}

.post-card__media-badge::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    color-mix(in srgb, var(--color-accent, #3b82f6) 40%, white) 50%,
    transparent 100%
  );
  transform: translateX(-100%);
  z-index: -1;
  transition: transform 0.55s ease;
}

.post-card:hover .post-card__media-badge::before {
  transform: translateX(100%);
}

.post-card__media-badge:visited,
.post-card__media-badge:hover,
.post-card__media-badge:focus {
  color: #fff !important;
  text-decoration: none;
}

.post-card__media-icon {
  font-size: 1em;
  line-height: 1;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

.post-card:hover .post-card__media-badge {
  transform: scale(1.04);
  filter: brightness(1.05);
}

.post-card__media-badge--inline {
  position: static;
  align-self: flex-start;
  margin: 0.35rem 0 0.5rem;
  box-shadow: none;
  max-width: 100%;
}

.post-card__media-badge--inline:hover {
  transform: none;
  filter: brightness(1.08);
}

@keyframes badgeFadeIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.post-card {
  position: relative;
}

.post-card__stretched-link {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.post-card__image {
  position: relative;
  z-index: 2;          /* sit above the stretched link */
}

.post-card__media-badge {
  z-index: 3;          /* above both the stretched link and the image */
  /* keep all the existing badge styles (position, background, animation, etc.) */
}

.post-card__tags,
.post-card__tags a {
  position: relative;
  z-index: 3;
}