/* CreativeClick Image Popup v3 */

.simple-image-popup-plugin {
      position: fixed;
      inset: 0;
      z-index: 999999; /* above Divi fixed header (99999) and WP admin bar */
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 28px;
      box-sizing: border-box;
      background: rgba(0, 0, 0, 0.75);
      opacity: 0;
      visibility: hidden;
      transition: opacity 0.3s ease, visibility 0s linear 0.3s;
}

.simple-image-popup-plugin.is-open {
      opacity: 1;
      visibility: visible;
      transition: opacity 0.3s ease, visibility 0s linear 0s;
}

/* Safety net: a closed popup can never be seen or clicked, whatever its
   children say (a visible child of a hidden parent is still clickable). */
.simple-image-popup-plugin[hidden] {
      display: none !important;
}

.simple-image-popup-plugin:not(.is-open),
.simple-image-popup-plugin:not(.is-open) * {
      pointer-events: none !important;
}

.simple-image-popup-plugin:not(.is-open) .sip-slide,
.simple-image-popup-plugin:not(.is-open) .sip-slide.is-active {
      visibility: hidden !important;
}

html.sip-lock,
html.sip-lock body {
      overflow: hidden !important;
}

.simple-image-popup-plugin__inner {
      position: relative;
      box-sizing: border-box;
      max-width: 100%;
      max-height: 100%;
      padding: 3px;
      margin: 0;
      background: #fff;
      box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
      transform: translateY(12px) scale(0.97);
      transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
      outline: none;
}

.simple-image-popup-plugin.is-open .simple-image-popup-plugin__inner {
      transform: none;
}

/* Close button: always on top of every slide */
.simple-image-popup-plugin__close,
#simple-image-popup-plugin__close {
      position: absolute;
      top: -14px;
      right: -14px;
      z-index: 20;
      width: 36px;
      height: 36px;
      padding: 0;
      margin: 0;
      display: flex;
      align-items: center;
      justify-content: center;
      border: 2px solid #fff;
      border-radius: 50%;
      background: #111;
      color: #fff;
      cursor: pointer;
      box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
      transition: background 0.2s ease, transform 0.2s ease;
      line-height: 1;
}

.simple-image-popup-plugin__close:hover,
.simple-image-popup-plugin__close:focus-visible {
      background: #444;
      transform: scale(1.08);
}

.simple-image-popup-plugin__close:focus-visible {
      outline: 2px solid #fff;
      outline-offset: 2px;
}

.simple-image-popup-plugin__icon {
      width: 16px;
      height: 16px;
      fill: none;
      stroke: currentColor;
      stroke-width: 2.5;
      stroke-linecap: round;
}

/* Slides are stacked in one grid cell, so the box sizes to the tallest
   image and nothing needs absolute positioning. */
.sip-image-rotator {
      position: relative;
      display: grid;
}

.sip-slide {
      grid-area: 1 / 1;
      display: flex;
      align-items: center;
      justify-content: center;
      opacity: 0;
      visibility: hidden;
      transition: opacity 0.6s ease, visibility 0s linear 0.6s;
}

.sip-slide.is-active {
      z-index: 1;
      opacity: 1;
      visibility: visible;
      transition: opacity 0.6s ease, visibility 0s linear 0s;
}

.sip-slide__link {
      display: block;
      width: 100%;
}

.simple-image-popup-plugin__image {
      display: block;
      width: 100%;
      height: auto;
      max-height: calc(100vh - 62px);
      max-height: calc(100dvh - 62px);
      object-fit: contain;
      margin: 0 auto;
}

.simple-image-popup-plugin.sip-click-close .sip-slide > .simple-image-popup-plugin__image {
      cursor: pointer;
}

/* Dots */
.sip-dots {
      position: absolute;
      left: 0;
      right: 0;
      bottom: 10px;
      z-index: 5;
      display: flex;
      justify-content: center;
      gap: 8px;
      pointer-events: none;
}

.sip-dot {
      pointer-events: auto;
      width: 10px;
      height: 10px;
      padding: 0;
      border: 2px solid #fff;
      border-radius: 50%;
      background: rgba(0, 0, 0, 0.35);
      box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
      cursor: pointer;
      transition: background 0.2s ease, transform 0.2s ease;
}

.sip-dot.is-active {
      background: #111;
      transform: scale(1.15);
}

@media (max-width: 600px) {
      .simple-image-popup-plugin {
            padding: 22px 16px;
      }

      .simple-image-popup-plugin__close,
      #simple-image-popup-plugin__close {
            top: -12px;
            right: -10px;
            width: 34px;
            height: 34px;
      }
}

@media (prefers-reduced-motion: reduce) {
      .simple-image-popup-plugin,
      .simple-image-popup-plugin__inner,
      .sip-slide {
            transition: none !important;
            transform: none !important;
      }
}
