.hs-gallery {
  box-sizing: border-box;
  /* The imported page grid disables pointer events on its content wrapper. */
  pointer-events: auto;
  width: 100%;
  min-width: 0;
  padding: var(--cs-gallery-padding);
  color: var(--cs-gallery-ink);
  background: var(--cs-gallery-bg);
}

.hs-gallery__track {
  position: relative;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: clamp(240px, 30vw, 400px);
  gap: var(--cs-gallery-gap);
  width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
  scrollbar-color: var(--cs-gallery-ink) transparent;
  padding-block-end: 12px;
  -webkit-overflow-scrolling: touch;
}

.hs-gallery__controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--cs-gallery-gap);
  padding-top: var(--cs-gallery-gap);
}

.hs-gallery [hidden] {
  display: none !important;
}

.hs-gallery__navigation {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.hs-gallery__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  gap: 10px;
  min-height: 48px;
  border: 1px solid currentColor;
  border-radius: 999px;
  padding: 0 18px;
  color: inherit;
  background: transparent;
  font: inherit;
  font-size: 14px;
  line-height: 1.2;
  cursor: pointer;
  transition: color 180ms ease, background-color 180ms ease, transform 180ms ease;
}

.hs-gallery__button:hover {
  color: var(--cs-gallery-bg);
  background: var(--cs-gallery-ink);
}

.hs-gallery__button:active {
  transform: scale(.96);
}

.hs-gallery__button:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 4px;
}

.hs-gallery__button svg {
  display: block;
  flex-shrink: 0;
}

.hs-gallery__arrow {
  width: 48px;
  padding: 0;
}

.hs-gallery__position {
  min-width: 48px;
  margin-right: 4px;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.hs-gallery .hs-gallery__play-icon,
.hs-gallery[data-playing="false"] .hs-gallery__pause-icon {
  display: none;
}

.hs-gallery[data-playing="false"] .hs-gallery__play-icon {
  display: block;
}

.hs-gallery__track:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 4px;
}

.hs-gallery__item {
  box-sizing: border-box;
  min-width: 0;
  height: var(--cs-gallery-height);
  margin: 0;
  overflow: hidden;
  scroll-snap-align: start;
}

.hs-gallery__item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (max-width: 680px) {
  .hs-gallery__track {
    grid-auto-columns: min(78vw, 340px);
  }

  .hs-gallery__item {
    height: min(var(--cs-gallery-height), 440px);
  }

  .hs-gallery__navigation {
    gap: 8px;
  }

  .hs-gallery__position {
    min-width: 36px;
    margin-right: 0;
  }

  .hs-gallery__playback {
    padding-inline: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hs-gallery__button {
    transition: none;
  }
}
