/* Lightbox (assets/lightbox.js), ported from theme-ph-2026. */

/* ============================================================
   LIGHTBOX (single content images)
   ============================================================ */
.azul-lb {
  position: fixed;
  inset: 0;
  background: rgba(6, 22, 34, 0.94);
  z-index: var(--z-lightbox);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}
.azul-lb.is-open { display: flex; }

/* Logged-in users: shift modal below WP admin bar */
body.admin-bar .azul-lb { top: 32px; }
@media (max-width: 782px) {
  body.admin-bar .azul-lb { top: 0; }
}

.azul-lb__stage {
  width: 100%;
  height: 100%;
  display: flex;
  /* `safe` keeps centering until the image overflows, then falls back to start
     so the pan can reach the top/left edges (default `center` traps overflow). */
  align-items: safe center;
  justify-content: safe center;
  overflow: auto;
  /* Prevent scroll/pan from chaining to the body underneath when the user
     pans past an edge of the image. */
  overscroll-behavior: contain;
}
/* The <picture> holds the <source> elements copied from the page; the image
   stays the flex item of the stage. */
.azul-lb__pic { display: contents; }
.azul-lb__img {
  max-width: 100%;
  max-height: 100%;
  display: block;
  border-radius: var(--azul-radius-s);
  user-select: none;
  -webkit-user-drag: none;
  /* `cursor` is driven by JS based on the current zoom level (default / zoom-in
     / zoom-out depending on whether more zoom levels are available). */
}
.azul-lb__img.is-zoomed {
  max-width: none;
  max-height: none;
}

.azul-lb__close,
.azul-lb__nav {
  position: absolute;
  width: 48px;
  height: 48px;
  background: rgba(255, 255, 255, 0.08);
  border: 0;
  border-radius: var(--azul-radius);
  color: #ffffff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background .2s cubic-bezier(.22, .61, .36, 1);
  z-index: 2;
}
.azul-lb__close:hover,
.azul-lb__nav:hover { background: rgba(255, 255, 255, 0.22); }

.azul-lb__close { top: 1rem; right: 1rem; }
.azul-lb__nav--prev { left: 1rem; top: 50%; transform: translateY(-50%); }
.azul-lb__nav--next { right: 1rem; top: 50%; transform: translateY(-50%); }
.azul-lb__nav[hidden] { display: none; }

.azul-lb__counter {
  color: rgba(255, 255, 255, 0.85);
  font-size: .85rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: .04em;
  white-space: nowrap;
  padding: .2rem .7rem;
  background: rgba(0, 0, 0, 0.45);
  border-radius: var(--azul-radius);
  align-self: center;
}

/* Caption: above the counter and thumbs, or at the bottom alone. */
.azul-lb__caption {
  position: absolute;
  left: 50%;
  bottom: 1rem;
  z-index: 2;
  transform: translateX(-50%);
  max-width: min(42rem, 90vw);
  margin: 0;
  padding: .45rem .9rem;
  border-radius: var(--azul-radius-s);
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: .95rem;
  line-height: 1.4;
  text-align: center;
}
.azul-lb__caption[hidden] { display: none; }
.azul-lb.has-caption:not(.is-immersive) .azul-lb__caption { bottom: 7.5rem; }
.azul-lb.is-immersive .azul-lb__caption { bottom: 1rem; }

/* Bottom: counter pill above + thumbs strip */
.azul-lb__bottom {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5rem;
  max-width: 90vw;
}
.azul-lb__bottom[hidden] { display: none; }

/* Thumbs strip */
.azul-lb__thumbs {
  display: flex;
  gap: .35rem;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, .3) transparent;
  padding: .35rem;
  background: rgba(0, 0, 0, 0.45);
  border-radius: var(--azul-radius-s);
  max-width: 100%;
}
.azul-lb__thumb {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 0;
  background: transparent;
  cursor: pointer;
  border-radius: 3px;
  overflow: hidden;
  opacity: .55;
  transition: opacity .2s cubic-bezier(.22, .61, .36, 1), border-color .2s cubic-bezier(.22, .61, .36, 1);
}
.azul-lb__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.azul-lb__thumb:hover {
  opacity: .9;
  border-color: rgba(255, 255, 255, 0.45);
}
.azul-lb__thumb.is-active {
  opacity: 1;
  border-color: var(--azul-coral);
}

/* Immersive view button: top-right, below the close button */
.azul-lb__immersive {
  position: absolute;
  top: 4.5rem;
  right: 1rem;
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.08);
  border: 0;
  border-radius: var(--azul-radius);
  color: #ffffff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background .2s cubic-bezier(.22, .61, .36, 1);
  z-index: 2;
}
.azul-lb__immersive:hover,
.azul-lb__immersive[aria-pressed="true"] { background: rgba(255, 255, 255, 0.22); }

/* Zoom indicator pill: [−] [percent] [+], only shown when zoom is available */
.azul-lb__zoom {
  position: absolute;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: .15rem;
  padding: .2rem .3rem;
  background: rgba(0, 0, 0, 0.45);
  border-radius: var(--azul-radius);
  z-index: 2;
}
.azul-lb__zoom[hidden] { display: none; }
.azul-lb__zoom-btn {
  background: transparent;
  border: 0;
  color: rgba(255, 255, 255, 0.85);
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: var(--azul-radius);
  padding: 0;
  transition: background .2s cubic-bezier(.22, .61, .36, 1), opacity .2s cubic-bezier(.22, .61, .36, 1);
}
.azul-lb__zoom-btn:hover:not([disabled]) { background: rgba(255, 255, 255, 0.08); }
.azul-lb__zoom-btn[disabled] { opacity: 0.35; cursor: default; }
.azul-lb__zoom-value {
  color: rgba(255, 255, 255, 0.85);
  font-size: .85rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: .04em;
  min-width: 3rem;
  text-align: center;
  user-select: none;
}

/* Immersive mode: hide nav arrows + bottom (counter + thumbs) + zoom indicator */
.azul-lb.is-immersive .azul-lb__nav,
.azul-lb.is-immersive .azul-lb__bottom,
.azul-lb.is-immersive .azul-lb__zoom { display: none; }

/* Notice: centered overlay, fades out after a few seconds */
.azul-lb__notice {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.75);
  color: #ffffff;
  padding: 1rem 1.5rem;
  border-radius: var(--azul-radius);
  font-size: .95rem;
  text-align: center;
  max-width: 80vw;
  opacity: 0;
  transition: opacity .3s cubic-bezier(.22, .61, .36, 1);
  pointer-events: none;
  z-index: 3;
}
.azul-lb__notice.is-visible { opacity: 1; }
.azul-lb__notice[hidden] { display: none; }
