/* Product lightbox: click a product shot and it opens large on a 90% black screen that fades in over .3s; with
   several shots in a group you get arrows, a thumbnail strip, keyboard arrows and swipe, and the next shot slides
   in 80px while it fades. Measured from the Webflow lightbox on the Lord Burger product pages (webflow.js
   lightbox module + its CSS); rewritten, no jQuery.

   Knobs: set them on :root or any ancestor of <body> (the viewer is appended to <body>). */
.plb {
  position: fixed; inset: 0; z-index: var(--plb-z, 2000);
  background: var(--plb-scrim, rgba(0, 0, 0, .9));
  color: #fff;
  font: 300 17px/1.2 var(--plb-font, "Helvetica Neue", Helvetica, Ubuntu, "Segoe UI", Verdana, sans-serif);
  text-align: center;
  opacity: 0;
  transition: opacity var(--plb-fade, .3s) var(--plb-ease, ease);
  user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent;
  outline: 0;
}
.plb[hidden] { display: none; }
.plb.is-shown { opacity: 1; }
html.plb-open { overflow: hidden; }                      /* page scroll locked while open (Webflow: html.w-lightbox-noscroll) */

/* the stage: full screen on phones; 96vh with a 2vh top margin from 768px; 86 / 84vh when a strip sits under it */
.plb__content { position: relative; height: 100vh; height: 100dvh; overflow: hidden; touch-action: pan-y pinch-zoom; }
.plb--group .plb__content { height: 86vh; height: 86dvh; }
.plb__view { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.plb__figure { position: relative; margin: 0; cursor: var(--plb-img-cursor, zoom-out); }
.plb--group .plb__figure { cursor: pointer; }            /* in a group a click on the shot goes to the next one */
.plb__img { display: block; max-width: 100vw; max-height: 100vh; max-height: 100dvh; width: auto; height: auto; -webkit-user-drag: none; }
.plb--group .plb__img { max-height: 86vh; max-height: 86dvh; }
.plb__caption {
  position: absolute; left: 0; right: 0; bottom: 0; padding: .5em 1em;
  background: rgba(0, 0, 0, .4); text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.plb__caption:empty { display: none; }

/* controls: close top right (4em x 2.6em), arrows the full stage height (4em wide), all fading on .3s */
.plb__ctrl {
  position: absolute; top: 0; width: 4em; padding: 0; border: 0; background: none; color: #fff; font: inherit;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  transition: opacity .3s;
}
.plb__ctrl svg { display: block; overflow: visible; filter: drop-shadow(0 0 1.5px rgba(0, 0, 0, .55)); }
.plb__ctrl:focus-visible { outline: 2px solid #fff; outline-offset: -6px; }
.plb__close { right: 0; height: 2.6em; }
.plb__close svg { width: 18px; height: 18px; }
.plb__prev, .plb__next { bottom: 0; display: none; opacity: var(--plb-arrow-opacity, .5); }   /* arrows from 768px only; phones swipe */
.plb__prev { left: 0; } .plb__next { right: 0; }
.plb__prev svg, .plb__next svg { width: 24px; height: 40px; }
.plb__close { top: 0; }
.plb__ctrl:hover { opacity: 1; }
.plb__ctrl.is-inactive, .plb__ctrl.is-inactive:hover { opacity: 0; pointer-events: none; }

/* thumbnail strip (groups only): 10vh squares, 2vh above and below, the current one dimmed to .3 */
.plb__strip {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 0 1vh;
  white-space: nowrap; line-height: 0; overflow-x: auto; overflow-y: hidden; scrollbar-width: none;
}
.plb__strip::-webkit-scrollbar { display: none; }
.plb:not(.plb--group) .plb__strip { display: none; }
.plb__item {
  display: inline-block; box-sizing: content-box; width: var(--plb-thumb, 10vh); padding: 2vh 1vh;
  border: 0; margin: 0; background: none; cursor: pointer; vertical-align: top;
}
.plb__item:focus-visible { outline: 2px solid #fff; outline-offset: -2px; }
.plb__item.is-active { opacity: var(--plb-thumb-active, .3); }
.plb__thumb { display: block; width: 100%; height: var(--plb-thumb, 10vh); object-fit: cover; background: #222; }

/* the spinner only shows when a shot takes longer than 200ms to load */
.plb__spinner {
  position: absolute; top: 50%; left: 50%; width: 40px; height: 40px; margin: -20px 0 0 -20px; box-sizing: border-box;
  border: 5px solid rgba(0, 0, 0, .4); border-radius: 50%; animation: plb-spin .8s linear infinite;
}
.plb__spinner::after {
  content: ""; position: absolute; inset: -4px; border: 3px solid transparent; border-bottom-color: #fff; border-radius: 50%;
}
.plb__spinner[hidden] { display: none; }
@keyframes plb-spin { to { transform: rotate(360deg); } }

@media (min-width: 768px) {
  .plb__content { height: 96vh; margin-top: 2vh; }
  .plb--group .plb__content { height: 84vh; }
  .plb__img { max-width: 96vw; max-height: 96vh; }
  .plb--group .plb__img { max-width: 82.3vw; max-height: 84vh; }
  .plb__close { opacity: var(--plb-close-opacity, .8); }
  .plb--group .plb__prev, .plb--group .plb__next { display: flex; }
}

/* the trigger: any element with data-plb (a link to the big image, or anything wrapping an <img>) */
[data-plb] { cursor: var(--plb-trigger-cursor, zoom-in); }

@media (prefers-reduced-motion: reduce) {
  .plb, .plb__ctrl { transition: none; }
  .plb__spinner { animation-duration: 2.4s; }
}

/* ---------- listing mode (data-plb-mode="listing"): the viewer every Crush listing page carries ----------
   A bar across the top with the photo count ("3 / 54") and a worded Close button; the photo centred with its caption
   UNDER it, never over it; round 52px arrows at the sides (at the bottom corners on phones); no thumbnail strip.
   Measured from our listing pages (peter-martin-3409-hwy3 .lb, boehm-team, t-williams, cliff-meredith): scrim at 96%,
   photo max-height 100dvh - 140px (100dvh - 190px on phones), 80px side room for the arrows (12px on phones).
   Knobs: --plb-scrim (here rgb(14 17 16 / .96)), --plb-bar-x (16px phones / 28px from 900px), --plb-radius (4px),
          --plb-chrome (140px: the room the bar, caption and arrows take from the photo's height), --plb-arrow (52px) */
.plb__count, .plb__close-txt { display: none; }
.plb--listing { background: var(--plb-scrim, rgb(14 17 16 / .96)); font: 400 16px/1.3 var(--plb-font, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif); }
.plb--listing .plb__content, .plb--listing.plb--group .plb__content { height: 100vh; height: 100dvh; margin-top: 0; }
.plb--listing .plb__strip { display: none; }
.plb--listing .plb__count {
  display: flex; align-items: center; position: absolute; z-index: 2; top: 16px; left: var(--plb-bar-x, 16px); height: 38px; margin: 0;
  font: 400 12.5px/1 var(--plb-mono, ui-monospace, "SF Mono", Menlo, monospace); letter-spacing: .14em; font-variant-numeric: tabular-nums;
}
.plb--listing .plb__close {
  top: 16px; right: var(--plb-bar-x, 16px); width: auto; height: 38px; padding: 0 16px; z-index: 2; opacity: 1;
  border: 1px solid rgb(255 255 255 / .4); border-radius: var(--plb-radius, 4px); font-weight: 600; font-size: 14px; line-height: 1;
}
.plb--listing .plb__close svg { display: none; }
.plb--listing .plb__close-txt { display: inline; }
.plb--listing .plb__close:hover { background: rgb(255 255 255 / .08); }
.plb--listing .plb__close:focus-visible { outline-offset: 3px; }
.plb--listing .plb__view { padding: 70px 0 24px; }
.plb--listing .plb__figure { display: flex; flex-direction: column; align-items: center; cursor: default; }
.plb--listing .plb__img, .plb--listing.plb--group .plb__img {
  max-width: calc(100vw - 160px); max-height: calc(100vh - var(--plb-chrome, 140px)); max-height: calc(100dvh - var(--plb-chrome, 140px));
  border-radius: 3px;
}
.plb--listing .plb__caption {
  position: static; margin-top: 12px; padding: 0 16px; max-width: 60ch; background: none; white-space: normal; text-align: center;
  font-size: 14px; line-height: 1.4; color: rgb(255 255 255 / .75); text-wrap: balance;
}
.plb--listing.plb--group .plb__prev, .plb--listing.plb--group .plb__next {
  display: flex; top: 50%; bottom: auto; width: var(--plb-arrow, 52px); height: var(--plb-arrow, 52px); margin-top: calc(var(--plb-arrow, 52px) / -2);
  border: 1px solid rgb(255 255 255 / .35); border-radius: 50%; background: rgb(255 255 255 / .06); opacity: 1; z-index: 2;
}
.plb--listing .plb__prev { left: 16px; } .plb--listing .plb__next { right: 16px; }
.plb--listing .plb__prev svg, .plb--listing .plb__next svg { width: 11px; height: 18px; }
.plb--listing .plb__prev:hover, .plb--listing .plb__next:hover { background: rgb(255 255 255 / .16); }
.plb--listing .plb__ctrl:focus-visible { outline-offset: 3px; }
@media (min-width: 900px) {
  .plb--listing { --plb-bar-x: 28px; }
}
@media (max-width: 899px) {
  .plb--listing .plb__view { padding: 66px 0 84px; }
  .plb--listing .plb__img, .plb--listing.plb--group .plb__img {
    max-width: calc(100vw - 24px); max-height: calc(100vh - var(--plb-chrome-m, 190px)); max-height: calc(100dvh - var(--plb-chrome-m, 190px));
  }
  .plb--listing.plb--group .plb__prev, .plb--listing.plb--group .plb__next { top: auto; bottom: 18px; margin-top: 0; }
  .plb--listing .plb__prev:active, .plb--listing .plb__next:active { transform: translateY(2px); }
}

/* ---------- fit-pan zoom (data-plb-zoom="fit-pan"): Era Residence's apartment lightbox ----------
   Click the photo (desktop) and it fills the window's width while the chrome steps aside: the count / pager drops
   (translateY 100%), Close slides off (translateX 250%), arrows and caption fade, all .8 s cubic-bezier(.25,1,.5,1);
   the pan + the touch gestures are a transform the script writes on the img. Knob: --plb-zoom-dur (.8s) */
.plb--fitpan .plb__img { touch-action: none; }                     /* phones: our pinch / drag / double-tap, not the page's */
@media (hover: hover) and (min-width: 992px) {
  .plb--fitpan .plb__img { cursor: zoom-in; }
  .plb--fitpan.plb--zoomed .plb__img, .plb--fitpan.plb--zoomed .plb__view { cursor: zoom-out; }
}
.plb--fitpan .plb__img { transform-origin: 50% 50%; will-change: transform; }
.plb--fitpan .plb__count, .plb--fitpan .plb__close, .plb--fitpan .plb__prev, .plb--fitpan .plb__next, .plb--fitpan .plb__caption, .plb--fitpan .plb__strip {
  transition: transform var(--plb-zoom-dur, .8s) cubic-bezier(.25, 1, .5, 1), opacity var(--plb-zoom-dur, .8s) cubic-bezier(.25, 1, .5, 1);
}
.plb--fitpan.plb--zoomed .plb__count { transform: translateY(100%); opacity: 0; pointer-events: none; }
.plb--fitpan.plb--zoomed .plb__close { transform: translateX(250%); pointer-events: none; }
.plb--fitpan.plb--zoomed .plb__prev, .plb--fitpan.plb--zoomed .plb__next, .plb--fitpan.plb--zoomed .plb__caption, .plb--fitpan.plb--zoomed .plb__strip { opacity: 0; pointer-events: none; }
.plb--zoomed .plb__content { overflow: visible; }
.plb--zoomed .plb__view { z-index: 3; }

/* ---------- line pager (data-plb-pager="line"): "01 ---- 05", the line grows to n / total in .4 s Out ---------- */
.plb__pg { display: none; }
.plb--pgline .plb__count { display: flex; align-items: center; position: absolute; z-index: 2; top: 16px; left: var(--plb-bar-x, 16px); height: 38px; margin: 0;
  font: 700 11px/1 var(--plb-pg-font, var(--plb-font, ui-sans-serif, system-ui, sans-serif)); letter-spacing: .048em; font-variant-numeric: tabular-nums; }
.plb--pgline .plb__count-txt { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.plb--pgline .plb__pg { display: flex; align-items: center; gap: 16px; }
.plb__pg-track { position: relative; width: var(--plb-pg-w, 160px); height: 1px; background: rgb(255 255 255 / .25); }
.plb__pg-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: currentColor; transition: width .4s cubic-bezier(.25, 1, .5, 1); }
@media (max-width: 899px) { .plb--pgline { --plb-pg-w: 96px; } }
@media (prefers-reduced-motion: reduce) {
  .plb--fitpan .plb__count, .plb--fitpan .plb__close, .plb--fitpan .plb__prev, .plb--fitpan .plb__next, .plb--fitpan .plb__caption, .plb--fitpan .plb__strip, .plb__pg-fill { transition: none; }
}
