#bs-totem-gallery-root.bs-totem-gallery {
  --bs-totem-gallery-ink: #f1eee7;
  --bs-totem-gallery-muted: #a9a59d;
  --bs-totem-gallery-accent: #c99663;
  --bs-totem-gallery-line: rgba(241, 238, 231, 0.18);
  max-width: 1180px;
  margin: clamp(40px, 6vw, 76px) auto;
  padding: 0 clamp(16px, 3vw, 34px);
  color: var(--bs-totem-gallery-ink);
}

.bs-totem-gallery__heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.bs-totem-gallery__eyebrow {
  color: var(--bs-totem-gallery-muted);
}

.bs-totem-gallery__counter {
  color: var(--bs-totem-gallery-accent);
  font-variant-numeric: tabular-nums;
}

.bs-totem-gallery__stage {
  position: relative;
  display: grid;
  place-items: center;
  height: clamp(320px, 58vw, 680px);
  overflow: hidden;
  border: 1px solid var(--bs-totem-gallery-line);
  background: #11110f;
}

.bs-totem-gallery__image {
  display: block;
  width: auto;
  height: auto;
  min-width: 0;
  min-height: 0;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center;
}

.bs-totem-gallery__stage--landscape .bs-totem-gallery__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: cover;
}

.bs-totem-gallery__arrow {
  position: absolute;
  top: 50%;
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  padding: 0;
  transform: translateY(-50%);
  border: 1px solid rgba(255, 255, 255, 0.36);
  border-radius: 50%;
  background: rgba(14, 14, 13, 0.72);
  color: #fff;
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease;
}

.bs-totem-gallery__arrow:hover {
  border-color: var(--bs-totem-gallery-accent);
  background: rgba(14, 14, 13, 0.94);
}

.bs-totem-gallery__arrow:focus-visible,
.bs-totem-gallery__thumb:focus-visible,
#bs-totem-gallery-root:focus-visible {
  outline: 2px solid var(--bs-totem-gallery-accent);
  outline-offset: 3px;
}

.bs-totem-gallery__arrow svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.bs-totem-gallery__arrow--previous { left: 16px; }
.bs-totem-gallery__arrow--next { right: 16px; }

.bs-totem-gallery__thumbnails {
  display: flex;
  gap: 9px;
  overflow-x: auto;
  padding: 14px 1px 6px;
  scrollbar-color: rgba(201, 150, 99, 0.65) transparent;
  scrollbar-width: thin;
  scroll-snap-type: x proximity;
}

.bs-totem-gallery__thumb {
  flex: 0 0 88px;
  height: 68px;
  overflow: hidden;
  padding: 0;
  border: 1px solid var(--bs-totem-gallery-line);
  background: #161614;
  cursor: pointer;
  opacity: 0.62;
  scroll-snap-align: start;
  transition: border-color 160ms ease, opacity 160ms ease;
}

.bs-totem-gallery__thumb:hover { opacity: 0.9; }
.bs-totem-gallery__thumb.is-active {
  border-color: var(--bs-totem-gallery-accent);
  opacity: 1;
}

.bs-totem-gallery__thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (max-width: 640px) {
  #bs-totem-gallery-root.bs-totem-gallery {
    margin-block: 36px 52px;
    padding-inline: 14px;
  }
  .bs-totem-gallery__stage { height: clamp(300px, 92vw, 520px); }
  .bs-totem-gallery__stage--landscape .bs-totem-gallery__image {
    position: static;
    inset: auto;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
  }
  .bs-totem-gallery__arrow { width: 40px; height: 40px; }
  .bs-totem-gallery__arrow--previous { left: 10px; }
  .bs-totem-gallery__arrow--next { right: 10px; }
  .bs-totem-gallery__thumb { flex-basis: 68px; height: 54px; }
  .bs-totem-gallery__thumbnails { gap: 7px; padding-top: 11px; }
}

@media (prefers-reduced-motion: reduce) {
  .bs-totem-gallery__arrow,
  .bs-totem-gallery__thumb { transition: none; }
  .bs-totem-gallery__thumbnails { scroll-behavior: auto; }
}
