.wp-block-image,
.opkey-zoom:not(img),
.opkey-zoom-host {
  position: relative;
}

.wp-block-image,
.wp-block-image img,
.opkey-zoom:not(img),
.opkey-zoom img,
img.opkey-zoom {
  cursor: zoom-in;
}

.wp-block-image figcaption,
.opkey-zoom figcaption,
.opkey-zoom-host figcaption {
  cursor: auto;
}

.opkey-zoom__badge {
  position: absolute;
  z-index: 2;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  pointer-events: none;
  background-color: rgba(15, 23, 42, 0.78);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='6'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 1.15rem 1.15rem;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
}

.wp-block-image img:focus-visible,
.wp-block-image a:focus-visible,
.opkey-zoom img:focus-visible,
img.opkey-zoom:focus-visible,
.opkey-zoom a:focus-visible {
  outline: 2px solid #93c5fd;
  outline-offset: 3px;
}

html.opkey-zoom-open,
html.opkey-zoom-open body {
  overflow: hidden;
}

.opkey-zoom-lightbox,
.opkey-zoom-lightbox * {
  box-sizing: border-box;
}

.opkey-zoom-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000000;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.opkey-zoom-lightbox.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.opkey-zoom-lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: #070b12;
}

.opkey-zoom-lightbox__dialog {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  min-height: 0;
  color: #fff;
  font-family: inherit;
}

.opkey-zoom-lightbox__close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-family: inherit;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
}

.opkey-zoom-lightbox__close:hover,
.opkey-zoom-lightbox__close:focus-visible {
  background: rgba(255, 255, 255, 0.28);
}

.opkey-zoom-lightbox__close:focus-visible,
.opkey-zoom-lightbox__btn:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.opkey-zoom-lightbox__stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  touch-action: none;
}

.opkey-zoom-lightbox__img {
  display: block;
  max-width: calc(100% - 48px);
  max-height: calc(100% - 24px);
  width: auto;
  height: auto;
  transform-origin: center center;
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
  cursor: zoom-in;
  user-select: none;
  -webkit-user-drag: none;
}

.opkey-zoom-lightbox.is-zoomed .opkey-zoom-lightbox__img {
  cursor: grab;
}

.opkey-zoom-lightbox.is-dragging .opkey-zoom-lightbox__img {
  cursor: grabbing;
}

.opkey-zoom-lightbox__dock {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 8px 16px 20px;
}

.opkey-zoom-lightbox__hint,
.opkey-zoom-lightbox__caption {
  margin: 0;
  max-width: 42rem;
  font-size: 13px;
  line-height: 1.4;
  text-align: center;
  color: rgba(255, 255, 255, 0.78);
}

.opkey-zoom-lightbox__caption[hidden] {
  display: none;
}

.opkey-zoom-lightbox__controls {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
}

.opkey-zoom-lightbox__btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #fff;
  font-family: inherit;
  font-size: 24px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
}

.opkey-zoom-lightbox__btn:hover,
.opkey-zoom-lightbox__btn:focus-visible {
  background: rgba(255, 255, 255, 0.16);
}

.opkey-zoom-lightbox__btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.opkey-zoom-lightbox__btn--fit {
  width: auto;
  padding: 0 16px;
  font-size: 14px;
  font-weight: 600;
}

.opkey-zoom-lightbox__scale {
  min-width: 3.4rem;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  text-align: center;
  color: rgba(255, 255, 255, 0.9);
}

.opkey-zoom-lightbox__title {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 640px) {
  .opkey-zoom-lightbox__hint {
    display: none;
  }

  .opkey-zoom-lightbox__close {
    top: 10px;
    right: 10px;
  }

  .opkey-zoom-lightbox__img {
    max-width: calc(100% - 20px);
    border-radius: 4px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .opkey-zoom-lightbox {
    transition: none;
  }
}

@media print {
  .opkey-zoom__badge,
  .opkey-zoom-lightbox {
    display: none !important;
  }
}
