/* 4-up responsive grid */
.suitecrm-kb-cats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
@media (max-width: 1100px) {
  .suitecrm-kb-cats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 800px) {
  .suitecrm-kb-cats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  .suitecrm-kb-cats { grid-template-columns: 1fr; }
}

/* Card */
.kb-cat-card {
  display: block;
  text-decoration: none;
  color: inherit;
}
.kb-cat-card__inner {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 8px 24px rgba(0,0,0,.06);
  border: 1px solid rgba(0,0,0,.06);
  min-height: 140px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: box-shadow .2s ease, transform .2s ease;
}
.kb-cat-card__inner:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(0,0,0,.09);
}
.kb-cat-card__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.25;
}
.kb-cat-card__desc {
  margin: 0;
  color: #555;
  line-height: 1.4;
  display: -webkit-box;  
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.suitecrm-kb-cats {
    margin-top:35px;
}
/* badge for counts  */
.kb-cat-card__count {
  margin-top: auto;
  align-self: flex-start;
  font-size: .85rem;
  background: #f3f4f6;
  border-radius: 999px;
  padding: 4px 10px;
  color: #374151;
}
/* Ensure grid items stretch uniformly */
.suitecrm-kb-cats {
  align-items: stretch; /* explicit */
}

/* Make the grid item (anchor) and its inner box fill the track height */
.kb-cat-card {
  display: block;
  height: 100%;
}
.kb-cat-card__inner {
  height: 100%;                 /* fill row height */
  display: flex;                /* vertical layout */
  flex-direction: column;
  min-height: 140px;            /* keep your baseline */
}

/* Clamp the title too (prevents 2–3 line titles from growing the card) */
.kb-cat-card__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;        /* <-- clamp to 2 lines */
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* You already have a clamp on the description; keep or set to your liking */
.kb-cat-card__desc {
  -webkit-line-clamp: 4;  /* or greater if you prefer */
  margin-bottom: 12px;
}

/* The count pill stays anchored at the bottom without adding extra height gaps */
.kb-cat-card__count {
  margin-top: auto;             /* pushes badge to bottom consistently */
}
