/*
 * YADIM Zoom Image. The picture is the module's own size (set by the width / alignment settings through custom properties on a scoped
 * class printed by PHP). The zoom layers (lens, panel, inset, canvas) are added by the script and sit inside the stage, which clips them
 * and takes the module's rounded corners. Selectors are kept to one or two classes so Divi's design settings and a theme can override them.
 */
.yadim-zi { position: relative; box-sizing: border-box; width: var(--zi-w, 100%); max-width: var(--zi-max, 100%); margin-left: var(--zi-ml, auto); margin-right: var(--zi-mr, auto); border-radius: inherit; --zi-ms: 250ms; }
@media (max-width: 980px) { .yadim-zi { width: var(--zi-w-t, var(--zi-w, 100%)); max-width: var(--zi-max-t, var(--zi-max, 100%)); } }
@media (max-width: 767px) { .yadim-zi { width: var(--zi-w-m, var(--zi-w-t, var(--zi-w, 100%))); max-width: var(--zi-max-m, var(--zi-max-t, var(--zi-max, 100%))); } }
.zi-stage { position: relative; overflow: hidden; line-height: 0; border-radius: inherit; }
.zi-img { display: block; width: 100%; height: auto; max-width: 100%; border-radius: inherit; -webkit-user-drag: none; user-select: none; }
.yadim-zi[data-zi-ready] .zi-stage { -webkit-tap-highlight-color: transparent; }
.zi-stage:focus-visible { outline: 3px solid #2a7de1; outline-offset: 2px; }

/* the magnifier lens and the focus area */
.zi-lens { position: absolute; left: 0; top: 0; z-index: 3; box-sizing: border-box; pointer-events: none; visibility: hidden; will-change: transform, opacity; }
.zi-lens-ring { width: 100%; height: 100%; box-sizing: border-box; }
.zi-lens-in { position: relative; width: 100%; height: 100%; overflow: hidden; }
.zi-lens-img { position: absolute; left: 0; top: 0; max-width: none; display: block; will-change: transform; }
.zi-lens.is-ring .zi-lens-in { background: transparent; }
.zi-edge-glow .zi-lens-ring { box-shadow: 0 0 22px 6px var(--zi-glow, #fff); }
.zi-edge-glass .zi-lens-ring { -webkit-backdrop-filter: blur(8px) saturate(1.5); backdrop-filter: blur(8px) saturate(1.5); }
.zi-edge-liquid .zi-lens-ring, .zi-edge-liquid .zi-lens-in { animation: var(--zi-liquid, none); }
@keyframes zi-liquid { 0%, 100% { border-radius: 50% 50% 50% 50% / 50% 50% 50% 50%; } 33% { border-radius: 58% 42% 52% 48% / 46% 56% 44% 54%; } 66% { border-radius: 44% 56% 46% 54% / 55% 45% 55% 45%; } }

/* the floating zoom: a panel outside the picture, and the marker on the picture */
.yadim-zi.zi-side-right, .yadim-zi.zi-side-left, .yadim-zi.zi-side-above, .yadim-zi.zi-side-below { display: flex; align-items: flex-start; gap: var(--zi-gap, 16px); }
.zi-side-right { flex-direction: row; }
.zi-side-left { flex-direction: row-reverse; }
.zi-side-above { flex-direction: column-reverse; align-items: stretch; }
.zi-side-below { flex-direction: column; align-items: stretch; }
.zi-side-right .zi-stage, .zi-side-left .zi-stage { flex: 1 1 0; min-width: 0; }
.zi-side-above .zi-panel, .zi-side-below .zi-panel { align-self: center; }
.yadim-zi.zi-stacked { flex-direction: column; align-items: stretch; }
.zi-stacked .zi-panel { width: 100% !important; }
.zi-panel { position: relative; flex: 0 0 auto; box-sizing: border-box; overflow: hidden; line-height: 0; opacity: .55; transition: opacity var(--zi-ms, 250ms) ease; }
.zi-panel.is-floating { position: absolute; left: 0; top: 0; z-index: 5; pointer-events: none; opacity: 0; }
.zi-panel-img { position: absolute; left: 0; top: 0; max-width: none; display: block; will-change: transform; }
.zi-ind { position: absolute; left: 0; top: 0; z-index: 2; box-sizing: border-box; overflow: hidden; pointer-events: none; visibility: hidden; will-change: transform; }
.zi-ind::after { content: ""; position: absolute; inset: 0; background: var(--zi-ind-bg, #2a7de1); opacity: var(--zi-ind-op, .18); }
.zi-ind-img { position: absolute; left: 0; top: 0; max-width: none; display: block; will-change: transform; }

/* the fluid zoom */
.zi-gl { position: absolute; left: 0; top: 0; z-index: 2; width: 100%; height: 100%; pointer-events: none; visibility: hidden; }

/* zoom and pan, and the inset map */
.zi-view { position: relative; transform-origin: 0 0; will-change: transform; }
.zi-hires { position: absolute; left: 0; top: 0; width: 100%; height: 100%; opacity: 0; transition: opacity .3s ease; -webkit-user-drag: none; }
.zi-hires.is-loaded { opacity: 1; }
.zi-stage.is-zoomed { cursor: grab; }
.zi-stage.is-dragging { cursor: grabbing; }
.zi-controls { position: absolute; right: 10px; top: 10px; z-index: 6; display: flex; gap: 6px; line-height: 1; }
.zi-controls.is-left { right: auto; left: 10px; }
.zi-btn { width: 34px; height: 34px; margin: 0; padding: 0; border: 0; border-radius: 8px; background: rgba(20, 24, 40, .82); color: #fff; font: 600 18px/34px system-ui, sans-serif; text-align: center; cursor: pointer; }
.zi-btn:hover:not(:disabled) { background: rgba(20, 24, 40, .95); }
.zi-btn:focus-visible { outline: 2px solid #fab90a; outline-offset: 2px; }
.zi-btn:disabled { opacity: .35; cursor: default; }
.zi-status { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.zi-inset { position: absolute; z-index: 5; box-sizing: border-box; overflow: hidden; line-height: 0; cursor: pointer; background: #1d2433; }
.zi-inset-tl { left: 10px; top: 10px; }
.zi-inset-tr { right: 10px; top: 10px; }
.zi-inset-bl { left: 10px; bottom: 10px; }
.zi-inset-br { right: 10px; bottom: 10px; }
.zi-inset-img { display: block; width: 100%; height: auto; max-width: none; pointer-events: none; -webkit-user-drag: none; }
.zi-vp { position: absolute; left: 0; top: 0; box-sizing: border-box; pointer-events: none; }
.zi-vp::before { content: ""; position: absolute; inset: 0; background: var(--zi-vp-bg, #2a7de1); opacity: var(--zi-vp-op, .22); }
.zi-viewer { max-height: 82vh; }
.zi-viewer .zi-img { max-height: 82vh; object-fit: contain; }

@media (prefers-reduced-motion: reduce) {
  .zi-panel, .zi-hires, .zi-img { transition: none !important; }
  .zi-edge-liquid .zi-lens-ring, .zi-edge-liquid .zi-lens-in { animation: none !important; }
}
