/* Reusable Handy Foods slideshow */

.hf-slideshow {
  position: relative;
  overflow: hidden;
  background: #1a1a1a;
}

.hf-slideshow-viewport {
  position: relative;
  width: 100%;
  height: 100%;
}

.hf-slideshow-slide {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.9s ease, visibility 0.9s ease;
  pointer-events: none;
}

.hf-slideshow-slide.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  z-index: 1;
}

.hf-slideshow-batch {
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  width: 100%;
  height: 100%;
  gap: 0;
  box-sizing: border-box;
}

.hf-slideshow-item {
  margin: 0;
  flex: 1 1 0;
  min-width: 0;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hf-slideshow-item img,
.hf-slideshow-slide > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.hf-slideshow-controls {
  position: absolute;
  right: 16px;
  bottom: 16px;
  z-index: 3;
  display: flex;
  gap: 6px;
  align-items: center;
}

.hf-slideshow-btn {
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  border-radius: 2px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-size: 18px;
  line-height: 1;
  transition: background 0.2s, border-color 0.2s;
}

.hf-slideshow-btn:hover,
.hf-slideshow-btn:focus-visible {
  background: rgba(217, 45, 39, 0.9);
  border-color: rgba(217, 45, 39, 0.9);
  outline: none;
}

.hf-slideshow-icon-pause,
.hf-slideshow-icon-play {
  display: block;
  width: 10px;
  height: 12px;
  position: relative;
}

.hf-slideshow-icon-pause::before,
.hf-slideshow-icon-pause::after {
  content: '';
  position: absolute;
  top: 0;
  width: 3px;
  height: 12px;
  background: currentColor;
}

.hf-slideshow-icon-pause::before { left: 1px; }
.hf-slideshow-icon-pause::after { right: 1px; }

.hf-slideshow-icon-play::before {
  content: '';
  position: absolute;
  left: 1px;
  top: 0;
  border-style: solid;
  border-width: 6px 0 6px 10px;
  border-color: transparent transparent transparent currentColor;
}

.hf-slideshow-dots {
  position: absolute;
  left: 16px;
  bottom: 18px;
  z-index: 3;
  display: flex;
  gap: 6px;
}

.hf-slideshow-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: 0;
  padding: 0;
  background: rgba(255, 255, 255, 0.4);
  cursor: pointer;
}

.hf-slideshow-dot.is-active {
  background: #fff;
}

/* Quality page — fills editorial hero media column (single full-bleed image) */
.hf-slideshow--quality {
  width: 100%;
  height: 100%;
  min-height: 100%;
}

.hf-slideshow--quality .hf-slideshow-controls {
  display: none;
}

.hf-slideshow--quality .hf-slideshow-dots {
  left: 50%;
  transform: translateX(-50%);
  bottom: 14px;
}

.hf-slideshow--quality .hf-slideshow-batch {
  display: block;
  height: 100%;
}

.hf-slideshow--quality .hf-slideshow-item {
  width: 100%;
  height: 100%;
}

.hf-slideshow--quality .hf-slideshow-item img {
  object-fit: cover;
}

/* Homepage footer band — 5 full (uncropped) images per batch, evenly spaced */
.hf-slideshow--footer {
  width: 100%;
  height: clamp(170px, 24vw, 300px);
  background: #111;
}

.hf-slideshow--footer .hf-slideshow-viewport {
  height: 100%;
}

.hf-slideshow--footer .hf-slideshow-batch {
  display: flex;
  align-items: center;
  justify-content: space-evenly; /* equal space left, right, and between */
  gap: 0;
  padding: 16px 0;
  box-sizing: border-box;
  height: 100%;
  width: 100%;
}

.hf-slideshow--footer .hf-slideshow-item {
  flex: 0 1 auto;
  width: auto;
  height: 100%;
  max-width: calc((100% - 0px) / 5);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hf-slideshow--footer .hf-slideshow-item img {
  display: block;
  height: 100%;
  width: auto;
  max-width: 100%;
  object-fit: contain; /* full image, never cropped */
  object-position: center;
}

.hf-slideshow--footer .hf-slideshow-controls {
  right: 16px;
  bottom: 10px;
}

.hf-slideshow--footer .hf-slideshow-dots {
  left: 50%;
  transform: translateX(-50%);
  bottom: 12px;
}

@media (max-width: 768px) {
  .hf-slideshow--footer {
    height: clamp(120px, 34vw, 170px);
  }

  .hf-slideshow--footer .hf-slideshow-batch {
    padding: 10px 0;
  }

  .hf-slideshow-controls {
    right: 10px;
    bottom: 8px;
  }

  .hf-slideshow-btn {
    width: 30px;
    height: 30px;
    font-size: 16px;
  }
}

@media (max-width: 480px) {
  .hf-slideshow--footer {
    height: 110px;
  }

  .hf-slideshow--footer .hf-slideshow-batch {
    padding: 8px 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hf-slideshow-slide {
    transition: none;
  }
}
