/* PORT-28: float the existing carousel buttons beside the rendered image row. */
.gallery:not([data-gallery-controls-ready='true']) .gallery-controls {
  visibility: hidden;
}
.gallery[data-gallery-controls-ready='true'] .gallery-controls {
  position: absolute;
  z-index: 2;
  inset-inline: 0;
  top: var(--gallery-control-center-y);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0;
  margin: 0;
  padding-inline: 8px;
  transform: translateY(-50%);
  pointer-events: none;
}

.gallery[data-gallery-controls-ready='true'] .gallery-controls[hidden] {
  display: none;
}

.gallery[data-gallery-controls-ready='true'] .gallery-controls button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  position: relative;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #5eead4;
  font-size: 1rem;
  line-height: 1;
  pointer-events: auto;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
}

.gallery[data-gallery-controls-ready='true'] .gallery-controls button::before {
  content: '';
  position: absolute;
  width: 32px;
  height: 32px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border: 1px solid rgb(148 163 184 / .28);
  border-radius: 50%;
  background: rgb(15 23 42 / .64);
  backdrop-filter: blur(3px);
  transition: background-color 150ms ease, border-color 150ms ease;
}
.gallery .gallery-controls button > svg {
  position: relative;
  z-index: 1;
  display: block;
  width: 14px;
  height: 14px;
  pointer-events: none;
}

.gallery[data-gallery-controls-ready='true'] .gallery-controls button:hover:not(:disabled),
.gallery[data-gallery-controls-ready='true'] .gallery-controls button:focus-visible {
  border-color: var(--accent);
  background: transparent;
  color: #5eead4;
}
.gallery[data-gallery-controls-ready='true'] .gallery-controls button:hover:not(:disabled)::before,
.gallery[data-gallery-controls-ready='true'] .gallery-controls button:focus-visible::before {
  border-color: var(--accent);
  background: rgb(15 23 42 / .82);
}

.gallery[data-gallery-controls-ready='true'] .gallery-controls button:disabled {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .gallery[data-gallery-controls-ready='true'] .gallery-controls button,
  .gallery[data-gallery-controls-ready='true'] .gallery-controls button::before {
    transition: none;
  }
}
