/*
 * Wisepath Wealth — shared tap-to-enlarge lightbox.
 * Pairs with lightbox.js. Uses the native <dialog> element.
 */

/* ---- Dialog shell ----------------------------------------------- */
.wp-lightbox {
  /* Native <dialog> is already centered by the UA, but pin explicit values
     so it stays fixed + centered across engines. */
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  margin: 0;

  /* Constrain to the viewport while leaving breathing room. */
  max-width: 92vw;
  max-height: 92vh;
  width: max-content;

  /* Let the <dialog> itself (not the <img>) own the tap-close hit area. */
  padding: 16px;
  box-sizing: border-box;

  background: #ffffff;
  border: none;
  border-radius: 8px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);

  overflow: hidden;
}

/* Dark, semi-opaque backdrop (native ::backdrop). */
.wp-lightbox::backdrop {
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(2px);
}

/* ---- Figure / image --------------------------------------------- */
.wp-lightbox__figure {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  max-height: 100%;
}

.wp-lightbox__img {
  display: block;
  max-width: 100%;
  max-height: 92vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 4px;
  background: #f4f4f4;
}

.wp-lightbox__caption {
  font-size: 14px;
  line-height: 1.4;
  color: #444;
  text-align: center;
  max-width: 90vw;
}

/* ---- Close button ----------------------------------------------- */
.wp-lightbox__close {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;

  /* Min 44px tap target. */
  min-width: 44px;
  min-height: 44px;
  width: 44px;
  height: 44px;
  padding: 0;

  display: flex;
  align-items: center;
  justify-content: center;

  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}

.wp-lightbox__close:hover {
  background: rgba(0, 0, 0, 0.8);
  transform: scale(1.05);
}

.wp-lightbox__close:focus-visible {
  outline: 3px solid #2f80ed;
  outline-offset: 2px;
}

/* ---- Small-screen polish ---------------------------------------- */
@media (max-width: 640px) {
  .wp-lightbox {
    max-width: 96vw;
    max-height: 94vh;
    padding: 12px;
  }
  .wp-lightbox__img {
    max-height: 88vh;
  }
  .wp-lightbox__close {
    top: 4px;
    right: 4px;
  }
}
