.category-group {
  margin: 3rem 2rem 4rem;
}

.category-group__header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.category-title {
  margin: 0;
  font-size: 1.75rem;
  line-height: 1.3;
}

.category-description {
  color: #666;
  margin: 0.5rem auto 0;
  max-width: 600px;
}

.category-group--uncategorized .category-title {
  color: #444;
}

/* ✅ CENTER GRID HORIZONTALLY */
.posts-grid {
  display: grid;
  gap: 2rem;

  /* centers the grid tracks when there’s extra space */
  justify-content: center;

  /* keep a nice content width so it doesn't stretch too wide */
  max-width: 1400px;
  margin: 0 auto 2rem;

  /* FIXED: sets max item size to 300px and prevents stretching */
  grid-template-columns: repeat(auto-fit, minmax(220px, 300px));
}

.grid-item {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.grid-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.post-thumbnail {
  width: 100%;
  overflow: hidden;
}

.post-thumbnail img {
  width: 100%;
  height: 200px;
  object-fit: contain;
  display: block;
}

.post-content {
  padding: 1.5rem;
}

.post-title {
  margin: 0 0 1rem;
  font-size: 1.25rem;
  line-height: 1.4;
  text-align: center;
}

.post-title a {
  color: #333;
  text-decoration: none;
}

.post-title a:hover {
  color: #0073aa;
}

.post-excerpt {
  color: #666;
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 1rem;
}

/* Optional: tweak max width for very large screens */
@media (min-width: 1600px) {
  .posts-grid {
    max-width: 1600px;
  }
}

.pagination {
  margin: 3rem 0;
  text-align: center;
}

.pagination .nav-links {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.pagination a,
.pagination span {
  padding: 0.5rem 1rem;
  background: #fff;
  border: 1px solid #e0e0e0;
  text-decoration: none;
  color: #333;
}

.pagination a:hover {
  background: #0073aa;
  color: #fff;
  border-color: #0073aa;
}

.pagination .current {
  background: #0073aa;
  color: #fff;
  border-color: #0073aa;
}
