:host {
  display: contents;
}

.hb-image-preview {
  position: fixed;
  inset: 0;
  z-index: var(--hb-z-index-modal-mask, 2000);
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--hb-color-bg-mask, rgba(0, 0, 0, 0.5));
}

.hb-image-preview__wrapper {
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hb-image-preview__img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  user-select: none;
  transition: transform 0.2s ease;
  pointer-events: none;
}

.hb-image-preview__btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background-color: rgba(0, 0, 0, 0.4);
  color: var(--hb-color-text-inverse, #ffffff);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  transition: background-color var(--hb-transition-duration, 0.2s) ease;
}

.hb-image-preview__btn:hover {
  background-color: rgba(0, 0, 0, 0.6);
}

.hb-image-preview__btn--prev {
  left: 24px;
}

.hb-image-preview__btn--next {
  right: 24px;
}

.hb-image-preview__toolbar {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
  border-radius: var(--hb-border-radius-base, 4px);
  background-color: rgba(0, 0, 0, 0.5);
  color: var(--hb-color-text-inverse, #ffffff);
}

.hb-image-preview__tool {
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border: none;
  border-radius: var(--hb-border-radius-sm, 2px);
  background: transparent;
  color: var(--hb-color-text-inverse, #ffffff);
  font-size: 16px;
  cursor: pointer;
  transition: background-color var(--hb-transition-duration, 0.2s) ease;
}

.hb-image-preview__tool:hover {
  background-color: rgba(255, 255, 255, 0.15);
}

.hb-image-preview__tool-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  padding: 0 4px;
  font-size: 13px;
  color: var(--hb-color-text-inverse, #ffffff);
}

.hb-image-preview__close {
  position: absolute;
  top: 24px;
  right: 24px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background-color: rgba(0, 0, 0, 0.4);
  color: var(--hb-color-text-inverse, #ffffff);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  transition: background-color var(--hb-transition-duration, 0.2s) ease;
}

.hb-image-preview__close:hover {
  background-color: rgba(0, 0, 0, 0.6);
}
