/* ===== Base grid (desktop) ===== */
.hcb-grid{
  display: grid;
  grid-template-columns: repeat(auto-fill, 120px);
  gap: 1.5rem;
  justify-content: center;
}

/* Tile */
.hcb-tile{
  color: inherit;
  text-decoration: none;
}

/* Image block */
.hcb-img-wrap{
  position: relative;
  width: 120px;
  height: 120px;
  border-radius: 12px;
  overflow: hidden;
  background: #f5f5f5;
  box-shadow: 0 6px 18px rgba(0,0,0,.08);
  margin: 0 auto;
  transition: transform .15s ease, box-shadow .15s ease;
}
.hcb-img-wrap::after{
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 102, 204, 0.48); /* bleu transparent */
  transition: opacity .2s ease;
  pointer-events: none;
}
@media (min-width: 992px){
  .hcb-tile:hover .hcb-img-wrap::after{
    opacity: 0;
  }
}

/* Image itself = rounded 3px */
.hcb-img-wrap img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 3px;
}

/* Title */
.hcb-title{
  font-size: 0.95rem;
  text-align: center;
  margin-top: .75rem;
  font-weight: 600;
}

/* ===== Tablet: 3 per row ===== */
@media (min-width: 768px) and (max-width: 991px){
  .hcb-grid{
    grid-template-columns: repeat(3, 1fr);
    justify-content: stretch;
  }
  .hcb-img-wrap{
    margin: 0 auto;
  }
}

/* ===== Mobile: horizontal scroll ===== */
@media (max-width: 767px){
  .hcb-grid{
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 140px;           /* largeur de “carte” dans le scroll */
    grid-template-columns: unset;
    gap: 1rem;

    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    padding: .25rem .25rem 1rem;        /* petit padding pour respirer */
    justify-content: start;
  }

  .hcb-grid > .hcb-tile{
    scroll-snap-align: start;
  }

  /* option: cacher la scrollbar (webkit) */
  .hcb-grid::-webkit-scrollbar{
    height: 6px;
  }
  .hcb-grid::-webkit-scrollbar-thumb{
    background: rgba(0,0,0,.15);
    border-radius: 999px;
  }
}

/* ===== Hover only desktop ===== */
@media (min-width: 992px){
  .hcb-tile:hover .hcb-img-wrap{
    transform: translateY(-2px);
    box-shadow: 0 10px 26px rgba(0,0,0,.12);
  }
}
