.crp-wrapper {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  padding: 10px;
  justify-items: center;
}

.crp-item {
  width: 100%;
  max-width: 280px;
  background: #fff;
  border-radius: 12px;
  border: 1px solid #ddd;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 440px; /* cố định chiều cao toàn bộ box */
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.crp-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.crp-item img {
  width: 100%;
  height: 260px !important;
  object-fit: cover !important; /* auto crop ảnh để giữ bố cục đều */
  display: block;
  background-color: #f0f0f0;
}

.crp-item a {
  padding: 10px;
  font-size: 15px;
  font-weight: 600;
  color: #000;
  text-decoration: none;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-grow: 1;
}

.crp-custom-title {
  font-size: 20px;
  font-weight: bold;
  text-align: center;
  color: #fff;
  background: linear-gradient(to right, #1e90ff, #00bfff);
  padding: 8px 20px;
  border-radius: 999px;
  margin: 0 auto 16px auto;
  display: inline-block;
}

/* Mobile fix */
@media (max-width: 768px) {
  .crp-wrapper {
    grid-auto-flow: column;
    grid-auto-columns: 240px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    display: grid;
  }

  .crp-item {
    scroll-snap-align: start;
    height: 440px !important;
  }
}