/**
 * Hummingbird Category Cards
 * Layout, colori e dimensioni arrivano da variabili CSS (--hbcc-*) impostate dal modulo.
 */

.hbcc {
  margin-block: 2rem;
}

.hbcc__title {
  margin-bottom: 1rem;
  font-weight: 700;
  color: var(--bs-body-color);
}

/* Griglia responsive: colonne scelte da back office per smartphone / tablet / desktop */
.hbcc__grid {
  display: grid;
  grid-template-columns: repeat(var(--hbcc-cols-sm, 1), minmax(0, 1fr));
  gap: var(--hbcc-gap, 17px);
}

@media (min-width: 576px) {
  .hbcc__grid {
    grid-template-columns: repeat(var(--hbcc-cols-md, 2), minmax(0, 1fr));
  }
}

@media (min-width: 992px) {
  .hbcc__grid {
    grid-template-columns: repeat(var(--hbcc-cols-lg, 4), minmax(0, 1fr));
  }
}

/* Card */
.hbcc-card {
  position: relative;
  display: flex;
  align-items: center;
  min-height: var(--hbcc-h, 172px);
  overflow: hidden;
  color: var(--hbcc-fg, #fff);
  text-decoration: none;
  background: var(--hbcc-bg, #0b4f6c);
  border-radius: var(--hbcc-radius, 4px);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.hbcc-card:hover,
.hbcc-card:focus-visible {
  color: var(--hbcc-fg, #fff);
  text-decoration: none;
}

.hbcc-card:focus-visible {
  outline: 3px solid var(--bs-primary, #0d6efd);
  outline-offset: 2px;
}

.hbcc-card__body {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  align-items: flex-start;
  padding: 1.5rem 1.625rem;
}

.hbcc-card__name {
  margin: 0 0 0.125rem;
  font-size: var(--hbcc-fs-name, 20px);
  font-weight: var(--hbcc-fw-name, 600);
  line-height: 1.2;
  color: inherit;
}

.hbcc-card__count {
  font-size: 0.9375rem;
  color: inherit;
  opacity: 0.65;
}

.hbcc-card__cta {
  display: inline-flex;
  gap: 0.4rem;
  align-items: center;
  margin-top: 0.5rem;
  font-size: 0.9375rem;
  font-weight: 500;
}

.hbcc-card__icon {
  flex: 0 0 auto;
  color: inherit;
}

.hbcc-card__icon path {
  stroke: var(--hbcc-bg, #0b4f6c);
}

/* Immagine a destra, anche trasparente (PNG/WebP) */
.hbcc-card__media {
  position: absolute;
  inset-block: 0;
  inset-inline-end: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  width: var(--hbcc-media-w, 62%);
  pointer-events: none;
}

.hbcc-card__img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: right center;
  transition: transform 0.35s ease;
}

/* Effetti al passaggio del mouse */
.hbcc--hover-zoom .hbcc-card:hover .hbcc-card__img,
.hbcc--hover-zoom .hbcc-card:focus-visible .hbcc-card__img {
  transform: scale(1.06);
}

.hbcc--hover-lift .hbcc-card:hover,
.hbcc--hover-lift .hbcc-card:focus-visible {
  box-shadow: 0 0.75rem 1.5rem rgb(0 0 0 / 22%);
  transform: translateY(-4px);
}

@media (prefers-reduced-motion: reduce) {
  .hbcc-card,
  .hbcc-card__img {
    transition: none;
  }

  .hbcc--hover-zoom .hbcc-card:hover .hbcc-card__img,
  .hbcc--hover-lift .hbcc-card:hover {
    transform: none;
  }
}

/* Smartphone a 1 colonna: l'immagine cede un po' di spazio al testo */
@media (max-width: 575.98px) {
  .hbcc-card__media {
    width: min(var(--hbcc-media-w, 62%), 55%);
  }
}
