/* Shared */
.vhi-carousel{
  position: relative;
}

/* =========================================================
   Card
   ========================================================= */

.vhi-card{
  background: #fff;
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 6px;
  overflow: hidden;
}

/* =========================================================
   Image (NORMALIZED)
   ========================================================= */

.vhi-card__image{
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;   /* normalize all featured images */
  overflow: hidden;
}

.vhi-card__image img{
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;      /* crop to fill */
  object-position: center;
}

/* Fallback for older browsers */
@supports not (aspect-ratio: 1 / 1){
  .vhi-card__image{
    position: relative;
    height: 0;
    padding-top: 56.25%; /* 16:9 */
  }
  .vhi-card__image img{
    position: absolute;
    inset: 0;
  }
}

/* =========================================================
   Body
   ========================================================= */

.vhi-card__body{
  padding: 18px 18px 16px 18px;
  text-align: center;
}

.vhi-card__title{
  margin: 0 0 10px 0;
  font-size: 26px;
  line-height: 1.15;
}

.vhi-card__title a{
  color: inherit;
  text-decoration: none;
}

.vhi-card__text{
  font-size: 15px;
  line-height: 1.6;
  color: rgba(0,0,0,.70);
  margin: 0 auto 16px auto;
  max-width: 36ch;
}

.vhi-card__actions{
  margin-top: 10px;
}

.vhi-card__button{
  display: inline-block;
  padding: 10px 18px;
  border-radius: 4px;
  background: #b23b2f;
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: .02em;
  text-transform: uppercase;
}

.vhi-card__button:hover{
  opacity: .92;
}

.vhi-carousel-empty{
  padding: 12px 0;
  color: rgba(0,0,0,.65);
}

/* =========================================================
   Grid mode
   ========================================================= */

.vhi-card-grid{
  display: grid;
  gap: 22px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* =========================================================
   Carousel mode
   ========================================================= */

/*
  IMPORTANT:
  We create a "gutter" on the carousel wrapper so the arrows do NOT
  overlap the cards. This prevents the exact issue you showed.
*/
.vhi-carousel--carousel{
  padding-left: 44px;
  padding-right: 44px;
}

.vhi-carousel--carousel .vhi-card-track{
  --vhi-gap: 22px;
  --vhi-slides: 3;

  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - (var(--vhi-gap) * (var(--vhi-slides) - 1))) / var(--vhi-slides));
  gap: var(--vhi-gap);

  overflow-x: auto;
  overflow-y: hidden;

  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;

  /* Keep some vertical breathing room; NO left/right padding here */
  padding: 6px 0 10px 0;
}

.vhi-carousel--carousel .vhi-card-track::-webkit-scrollbar{
  height: 10px;
}

.vhi-carousel--carousel .vhi-card{
  scroll-snap-align: start;
}

/* =========================================================
   Arrows (unchanged look; fixed placement)
   ========================================================= */

.vhi-carousel__arrow{
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,.15);
  background: #fff;
  color: rgba(0,0,0,.75);
  cursor: pointer;
  z-index: 5;
  line-height: 1;
  font-size: 22px;
}

.vhi-carousel__arrow--prev{ left: 6px; }
.vhi-carousel__arrow--next{ right: 6px; }

.vhi-carousel__arrow:hover{
  opacity: .92;
}

/* =========================================================
   Dots
   ========================================================= */

.vhi-carousel__dots{
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
}

.vhi-carousel__dot{
  width: 10px;
  height: 10px;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,.25);
  background: transparent;
  cursor: pointer;
}

.vhi-carousel__dot.is-active{
  background: rgba(0,0,0,.65);
}
