/* ============================================================
   rl-lightbox — accessible tap/click-to-enlarge overlay
   Ruby Zu-Pin Li — rubylicious.com
   Pairs with style/js/lightbox.js
   Added 2026-09-17
   ------------------------------------------------------------
   Scope: images inside Slick carousels (.slick .item img) plus
   any element opted in with data-rl-zoom.
   ============================================================ */

/* ---------- Affordance on the source image ---------- */

.rl-zoomable {
  cursor: zoom-in;
}

.rl-zoomable:focus {
  outline: 3px solid #e01f69;
  outline-offset: 3px;
}

/* Hide the ring for mouse users in browsers that support it,
   keep it for keyboard users. */
.rl-zoomable:focus:not(:focus-visible) {
  outline: none;
}

.rl-zoomable:focus-visible {
  outline: 3px solid #e01f69;
  outline-offset: 3px;
}

/* ---------- Scroll lock while the overlay is open ---------- */

html.rl-lb-open,
html.rl-lb-open body {
  overflow: hidden;
}

/* ---------- Overlay shell ---------- */

.rl-lb {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 10500;
  display: none;
  background: #0e0e10;
  font-family: 'Rubik', Helvetica, Arial, sans-serif;
  opacity: 0;
  transition: opacity 0.18s ease-out;
}

.rl-lb.is-open {
  display: block;
}

.rl-lb.is-visible {
  opacity: 1;
}

/* ---------- Image stage (pannable + pinch-zoomable) ---------- */

.rl-lb__stage {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  /* Allow the browser's own pinch-zoom on top of scroll panning. */
  touch-action: pan-x pan-y pinch-zoom;
  padding: 60px 14px 72px;
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
}

/* margin:auto (rather than align-items:center) keeps an oversized
   image fully reachable when the stage scrolls. */
.rl-lb__img {
  margin: auto;
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  cursor: zoom-in;
  background: #fff;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

/* Actual-pixel state: width is set inline by the script. */
.rl-lb.is-zoomed .rl-lb__img {
  max-width: none;
  max-height: none;
  cursor: zoom-out;
}

/* ---------- Controls ---------- */

.rl-lb__btn {
  position: absolute;
  z-index: 2;
  margin: 0;
  padding: 0;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  transition: background 0.15s ease-out, border-color 0.15s ease-out;
}

.rl-lb__btn:hover,
.rl-lb__btn:focus {
  background: #e01f69;
  border-color: #e01f69;
  color: #fff;
  outline: none;
}

.rl-lb__btn:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 2px;
}

.rl-lb__btn[hidden] {
  display: none;
}

.rl-lb__close {
  top: 10px;
  right: 12px;
  font-size: 26px;
}

.rl-lb__zoom {
  top: 10px;
  right: 68px;
  font-size: 17px;
  font-weight: 500;
}

.rl-lb__prev,
.rl-lb__next {
  top: 50%;
  margin-top: -23px;
  width: 50px;
  height: 50px;
  font-size: 24px;
}

.rl-lb__prev { left: 12px; }
.rl-lb__next { right: 12px; }

/* ---------- Caption / counter ---------- */

.rl-lb__bar {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 2;
  padding: 14px 18px 18px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.75), rgba(0, 0, 0, 0));
  color: #fff;
  text-align: center;
  font-size: 13px;
  line-height: 1.5;
  pointer-events: none;
}

.rl-lb__caption {
  display: block;
  color: #fff;
}

.rl-lb__count {
  display: block;
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.65);
  font-size: 12px;
  letter-spacing: 0.04em;
}

.rl-lb__hint {
  display: block;
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.55);
  font-size: 11px;
}

/* ---------- Screen-reader-only live region ---------- */

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

/* ---------- Small screens ---------- */

@media (max-width: 767px) {
  .rl-lb__stage {
    padding: 56px 0 64px;
  }
  .rl-lb__prev,
  .rl-lb__next {
    width: 44px;
    height: 44px;
    font-size: 21px;
  }
  .rl-lb__prev { left: 6px; }
  .rl-lb__next { right: 6px; }
  .rl-lb__hint { display: none; }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  .rl-lb,
  .rl-lb__btn {
    transition: none;
  }
}
