.ts-grid-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 80px 24px;
}

.ts-grid-section.ts-no-shadow .ts-cat:hover {
  box-shadow: none !important;
  transform: none !important;
}

.ts-grid-section__head {
  text-align: center;
  margin-bottom: 40px;
}

.ts-grid-section__title {
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  font-weight: 800;
  color: #1A1F2E;
  margin: 0 0 8px;
  letter-spacing: -0.02em;
}

.ts-grid-section__sub {
  font-size: 1.0625rem;
  color: #4A5168;
  margin: 0;
}

/* Filter bar */
.ts-filterbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 32px;
}

.ts-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: #FFFFFF;
  border: 1px solid #E5E7EB;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  color: #4A5168;
  cursor: pointer;
  transition: all 0.15s ease;
}

.ts-chip:hover {
  border-color: #565BD7;
  color: #1A1F2E;
}

.ts-chip--active {
  background: #565BD7;
  border-color: #565BD7;
  color: #FFFFFF;
}

.ts-chip__count {
  font-size: 0.75em;
  background: rgba(0, 0, 0, 0.08);
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 700;
}

.ts-chip--active .ts-chip__count {
  background: rgba(255, 255, 255, 0.25);
}

/* Bento grid */
.ts-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(3, 1fr);
  align-items: start;
}

/* When showing all categories, featured spans 2 cols + 2 rows */
.ts-grid--bento .ts-cat--featured {
  grid-column: span 2;
  grid-row: span 2;
}

/* When a filter is active, switch to flat grid */
.ts-grid[data-active-filter]:not([data-active-filter="all"]) {
  grid-template-columns: repeat(3, 1fr);
}
.ts-grid[data-active-filter]:not([data-active-filter="all"]) .ts-cat--featured {
  grid-column: span 1;
  grid-row: span 1;
}

/* Hide cards that don't match the active filter */
.ts-grid[data-active-filter]:not([data-active-filter="all"]) .ts-cat {
  display: none;
}
.ts-grid[data-active-filter] .ts-cat[data-cat="all"],
.ts-grid[data-active-filter] .ts-cat.is-visible {
  display: flex;
}

@media (max-width: 960px) {
  .ts-grid { grid-template-columns: repeat(2, 1fr); }
  .ts-grid--bento .ts-cat--featured { grid-column: span 2; grid-row: span 1; }
}

@media (max-width: 768px) {
  .ts-grid-section { padding: 60px 20px; }
  .ts-grid, 
  .ts-grid[data-active-filter]:not([data-active-filter="all"]) { 
    grid-template-columns: 1fr; 
  }
  .ts-grid--bento .ts-cat--featured { 
    grid-column: span 1; 
    grid-row: span 1;
  }
}

@media (max-width: 640px) {
  .ts-grid-section { padding: 40px 16px; }
  .ts-cat { padding: 20px !important; }
}

/* Card */
.ts-cat {
  display: flex;
  flex-direction: column;
  background: #FFFFFF;
  border: 1px solid #E5E7EB;
  border-radius: 20px;
  padding: 28px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ts-cat:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px -8px rgba(15, 23, 42, 0.12);
}

.ts-cat--featured {
  background: #F5F6FF;
  border-color: rgba(86, 91, 215, 0.2);
}

.ts-cat__head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}

.ts-cat__icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.ts-cat__icon svg,
.ts-cat__icon i {
  width: 24px;
  height: 24px;
  font-size: 24px;
}

.ts-cat__title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: #1A1F2E;
  letter-spacing: -0.01em;
}

.ts-cat__count {
  font-size: 0.8125rem;
  color: #6B7280;
  margin-top: 2px;
}

.ts-cat__lede {
  font-size: 0.9375rem;
  line-height: 1.55;
  color: #4A5168;
  margin: 0 0 20px;
}

.ts-cat__list {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.ts-cat__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  margin: 0 -12px;
  border-radius: 10px;
  text-decoration: none;
  color: #1A1F2E;
  font-size: 0.9375rem;
  background: rgba(241, 242, 246, 0.4);
  transition: background 0.15s ease, border-color 0.15s ease;
  border: 1px solid transparent;
}

.ts-cat__item:hover {
  background: #F7F8FB;
  border-color: #E5E7EB;
  text-decoration: none;
  color: #1A1F2E;
}

.ts-cat__item-title {
  flex: 1;
  font-weight: 500;
  text-align: left;
}

.ts-cat__item-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #6B7280;
  font-size: 0.8125rem;
  flex-shrink: 0;
}

.ts-cat__item-arrow {
  color: #565BD7;
  font-weight: 700;
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.ts-cat__item:hover .ts-cat__item-arrow {
  opacity: 1;
  transform: translateX(0);
}

.ts-cat__more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.875rem;
  font-weight: 600;
  color: #565BD7;
  text-decoration: none;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid #F1F2F6;
}

.ts-cat__more:hover {
  text-decoration: underline;
  color: #565BD7;
}