/* ==========================================================================
   Shared blog post card component
   Used by: the "Related Posts" grid on single.php AND the main post grid
   on archive.php (category/tag/date archives) — one card design, reused,
   so both places stay visually consistent by construction rather than by
   coincidence. Reuses the --tp-* design tokens defined in style.css.
   ========================================================================== */

.tp-post-card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.tp-post-card {
  display: flex;
  flex-direction: column;
  background: var(--tp-white);
  border: 1px solid var(--tp-border-light);
  border-radius: var(--tp-radius-lg);
  overflow: hidden;
  box-shadow: var(--tp-shadow-sm);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.tp-post-card:hover {
  box-shadow: var(--tp-shadow-md);
  transform: translateY(-3px);
}

.tp-post-card-image {
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--tp-bg-light);
}

.tp-post-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.tp-post-card:hover .tp-post-card-img {
  transform: scale(1.04);
}

.tp-post-card-img--placeholder {
  display: block;
  width: 100%;
  height: 100%;
}

.tp-post-card-body {
  padding: 18px 20px 20px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.tp-post-card-category {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--tp-primary);
  text-decoration: none;
  margin-bottom: 8px;
}

.tp-post-card-title {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.4;
  margin: 0 0 8px;
}

.tp-post-card-title a {
  color: var(--tp-text-main);
  text-decoration: none;
}

.tp-post-card-title a:hover {
  color: var(--tp-primary);
}

.tp-post-card-excerpt {
  font-size: 14px;
  line-height: 1.6;
  color: var(--tp-text-muted);
  margin: 0 0 16px;
  flex-grow: 1;
}

.tp-post-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--tp-text-light);
  margin-top: auto;
}

.tp-post-card-readmore {
  font-weight: 700;
  color: var(--tp-primary);
  text-decoration: none;
}

.tp-post-card-readmore:hover {
  text-decoration: underline;
}

@media only screen and (min-width: 769px) and (max-width: 1024px) {
  .tp-post-card-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media only screen and (max-width: 768px) {
  .tp-post-card-grid {
    grid-template-columns: 1fr;
  }
}
