/* Hero da homepage: grelha comercial de categorias (6 ou 8 cartões). */

.cacto-hero__title {
  line-height: 1.05;
  text-wrap: balance;
}

.cacto-hero__lead {
  text-wrap: balance;
}

.cacto-hero-cats {
  list-style: none;
  margin: 2rem auto 0;
  padding: 0.85rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  max-width: 68rem;
  background: #f4f7f2;
  background: color-mix(in srgb, var(--cactus-light, #e8f3e4) 48%, #ffffff);
  border-radius: 1.35rem;
}

.cacto-hero-cats[data-count="1"] {
  grid-template-columns: minmax(0, 16rem);
  justify-content: center;
}

@media (min-width: 640px) {
  .cacto-hero-cats {
    gap: 1rem;
    padding: 1.15rem;
  }
}

@media (min-width: 1024px) {
  .cacto-hero-cats[data-count="3"],
  .cacto-hero-cats[data-count="4"],
  .cacto-hero-cats[data-count="5"],
  .cacto-hero-cats[data-count="6"],
  .cacto-hero-cats[data-count="7"],
  .cacto-hero-cats[data-count="8"] {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .cacto-hero-cats[data-count="2"] {
    grid-template-columns: repeat(2, minmax(0, 18rem));
    justify-content: center;
  }
}

.cacto-hero-cat {
  display: flex;
  flex-direction: column;
  min-width: 0;
  margin: 0;
  padding: 0.4rem 0.4rem 0.65rem;
  background: #ffffff;
  border-radius: 1.05rem;
  box-shadow: 0 10px 28px color-mix(in srgb, #181818 7%, transparent);
  color: var(--text-color, #2b2b2b);
  text-decoration: none;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

a.cacto-hero-cat,
a.cacto-hero-cat:link,
a.cacto-hero-cat:visited,
a.cacto-hero-cat:hover,
a.cacto-hero-cat:focus,
a.cacto-hero-cat:active {
  color: var(--text-color, #2b2b2b);
  text-decoration: none;
}

a.cacto-hero-cat:hover,
a.cacto-hero-cat:focus-visible {
  transform: translateY(-3px);
  box-shadow: 0 16px 32px color-mix(in srgb, var(--cactus-color, #5c9748) 22%, transparent);
}

a.cacto-hero-cat:focus-visible {
  outline: 2px solid var(--cactus-color, #5c9748);
  outline-offset: 3px;
}

.cacto-hero-cat__media {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 0.8rem;
  background: linear-gradient(145deg, var(--cactus-light, #e8f3e4), var(--cactus-color, #5c9748));
}

.cacto-hero-cat__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s ease;
}

a.cacto-hero-cat:hover .cacto-hero-cat__media img,
a.cacto-hero-cat:focus-visible .cacto-hero-cat__media img {
  transform: scale(1.04);
}

.cacto-hero-cat__name {
  margin: 0.55rem 0.35rem 0.1rem;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: 0.01em;
}

@media (prefers-reduced-motion: reduce) {
  .cacto-hero-cat,
  .cacto-hero-cat__media img {
    transition: none;
  }

  a.cacto-hero-cat:hover,
  a.cacto-hero-cat:focus-visible,
  a.cacto-hero-cat:hover .cacto-hero-cat__media img,
  a.cacto-hero-cat:focus-visible .cacto-hero-cat__media img {
    transform: none;
  }
}
