.hb-home-categories {
  margin: 2.5rem 0;
}

.hb-home-categories__header {
  margin-bottom: 1.25rem;
}

.hb-home-categories__title {
  margin: 0;
  color: #1f2933;
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.2;
}

.hb-home-categories__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.hb-home-categories__card {
  min-width: 0;
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity 420ms ease,
    transform 420ms ease;
}

.hb-home-categories__card.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.hb-home-categories__link {
  display: flex;
  height: 100%;
  min-height: 18rem;
  flex-direction: column;
  overflow: hidden;
  color: #1f2933;
  text-decoration: none;
  background: #fff;
  border: 1px solid rgba(31, 41, 51, 0.12);
  border-radius: 8px;
  box-shadow: 0 8px 22px rgba(31, 41, 51, 0.06);
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease;
}

.hb-home-categories__link:hover,
.hb-home-categories__link:focus {
  color: #1f2933;
  text-decoration: none;
  border-color: rgba(0, 128, 96, 0.4);
  box-shadow: 0 14px 32px rgba(31, 41, 51, 0.13);
  transform: translateY(-4px);
}

.hb-home-categories__link:focus-visible {
  outline: 3px solid rgba(0, 128, 96, 0.35);
  outline-offset: 3px;
}

.hb-home-categories__media {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #eef4f1;
}

.hb-home-categories__image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 220ms ease;
}

.hb-home-categories__link:hover .hb-home-categories__image,
.hb-home-categories__link:focus .hb-home-categories__image {
  transform: scale(1.045);
}

.hb-home-categories__placeholder {
  display: flex;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
  color: #0f766e;
  font-size: 2.5rem;
  font-weight: 700;
  text-transform: uppercase;
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.14), rgba(245, 158, 11, 0.16)),
    #eef4f1;
}

.hb-home-categories__body {
  display: flex;
  min-height: 9rem;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 0.55rem;
  padding: 1rem;
}

.hb-home-categories__name {
  display: block;
  color: #172033;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.25;
}

.hb-home-categories__description {
  display: -webkit-box;
  overflow: hidden;
  color: #56616f;
  font-size: 0.92rem;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}

@media (max-width: 1199.98px) {
  .hb-home-categories__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 767.98px) {
  .hb-home-categories {
    margin: 2rem 0;
  }

  .hb-home-categories__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
  }

  .hb-home-categories__title {
    font-size: 1.45rem;
  }

  .hb-home-categories__link {
    min-height: 15rem;
  }

  .hb-home-categories__body {
    min-height: 7.75rem;
    padding: 0.85rem;
  }
}

@media (max-width: 479.98px) {
  .hb-home-categories__grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hb-home-categories__card,
  .hb-home-categories__link,
  .hb-home-categories__image {
    transition: none;
  }

  .hb-home-categories__card {
    opacity: 1;
    transform: none;
  }
}
