/* lightbox.css — "The Viewing Room" (Lu Canelas Studio)
 *
 * A private gallery at night. Warm espresso room, one bright thing: the photo.
 * Markup is generated by assets/js/lightbox.js (see the DOM contract there).
 * Motion on the track / frame / zoom / dismiss is driven by JS (springs); this
 * file owns the room, the chrome, the "develop" of each frame and the chrome's
 * own transitions. Everything animates transform / opacity only (filter only
 * on the small preview image).
 *
 * Read by JS: --lb-gap, --lb-inset-top / -bottom / -x (per breakpoint).
 * Written by JS on the root: --lb-progress (0..1), --lb-dismiss (0..1).
 */

.ed-lightbox {
  /* constants */
  --lb-room: 18 14 12;            /* warm espresso, never pure black */
  --lb-cream: 244 241 233;        /* = --on-accent #F4F1E9 */
  --lb-gold: #C8A97E;
  --lb-hair: rgb(var(--lb-cream) / 0.22);
  --lb-text: rgb(var(--lb-cream) / 0.86);   /* >= 12:1 on the room */
  --lb-text-dim: rgb(var(--lb-cream) / 0.62); /* >= 6:1 on the room */
  --lb-chrome-in: 520ms;
  --lb-chrome-out: 280ms;
  --lb-chrome-lead: 120ms;        /* opening: the photo is most of the way there by then */

  /* layout, mobile first (A reads gap + insets) */
  --lb-gap: 24px;
  --lb-bar: 56px;
  --lb-edge: 16px;
  --lb-inset-top: calc(var(--lb-bar) + env(safe-area-inset-top, 0px));
  /* caption 21 + 12 + film 66 + 12 + row 44 + 16 = 171, plus air */
  --lb-inset-bottom: calc(184px + env(safe-area-inset-bottom, 0px));
  --lb-inset-x: 0px;
  --lb-thumb-w: 44px;
  --lb-thumb-h: 56px;

  position: fixed;
  inset: 0;
  height: 100vh;
  height: 100dvh;
  z-index: 9000;
  isolation: isolate;
  overflow: hidden;
  overscroll-behavior: contain;
  color: var(--lb-text);
  font-family: var(--font-body);
  -webkit-tap-highlight-color: transparent;
  /* Closed: out of the tab order and the a11y tree, but still measurable. */
  visibility: hidden;
  pointer-events: none;
}

.ed-lightbox:where(.is-open, .is-opening, .is-closing) {
  visibility: visible;
  pointer-events: auto;
}

/* The room: a backdrop layer, so the frame morph is never faded with it. */
.ed-lightbox::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background: rgb(var(--lb-room));
  opacity: 0;
  transition: opacity 240ms var(--mo-ease);
}
.ed-lightbox:where(.is-open, .is-opening)::before {
  opacity: calc(0.96 * (1 - var(--lb-dismiss, 0) * 0.85));
  transition-duration: 480ms;
}
.ed-lightbox.is-closing::before { opacity: 0; transition-duration: 280ms; }
.ed-lightbox.is-dismissing::before { transition: none; }

/* ── Ambient light: the room takes on the photo's colour ─────────────────── */
.ed-lb-ambient {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
  opacity: calc(1 - var(--lb-dismiss, 0));
}
.ed-lb-ambient-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(48px) saturate(1.15);
  transform: scale(1.4);
  opacity: 0;
  transition: opacity 700ms var(--mo-ease);
  user-select: none;
  -webkit-user-drag: none;
}
.ed-lb-ambient-img.is-current { opacity: 0.36; }
.ed-lb-ambient::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 75% 70% at 50% 46%, transparent 30%, rgb(10 7 6 / 0.7) 100%);
}
@media (min-width: 1024px) {
  .ed-lb-ambient-img { filter: blur(80px) saturate(1.15); }
}

/* ── Gesture surface, track, slides ──────────────────────────────────────── */
.ed-lb-viewport {
  position: absolute;
  inset: 0;
  z-index: 2;
  overflow: hidden;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
.ed-lb-track {
  position: absolute;
  inset: 0;
}
.ed-lb-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  padding: var(--lb-inset-top) var(--lb-inset-x) var(--lb-inset-bottom);
  box-sizing: border-box;
  /* Each slide is a window: the parallax-shifted photo never spills into a neighbour. */
  overflow: hidden;
  pointer-events: none;
}
.ed-lb-frame {
  position: relative;
  width: 100%;
  height: 100%;
  transform-origin: 50% 50%;
}

/* Active-motion states only: a permanent will-change would pin 5 layers. */
.ed-lightbox:where(.is-dragging, .is-animating, .is-opening, .is-closing, .is-dismissing)
  :where(.ed-lb-track, .ed-lb-frame) {
  will-change: transform;
}

/* ── Images and the "develop" ────────────────────────────────────────────── */
.ed-lb-img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}
/* Preview: soft and slightly enlarged while the HD frame is on its way.
   Not when the preview is the grid photo the visitor just tapped (.is-sharp):
   that one is already decoded, so it opens crisp and HD only refines it. */
.ed-lb-img--lo {
  transition: filter 520ms var(--mo-ease), transform 520ms var(--mo-ease);
}
.ed-lb-slide.is-loading:not(.is-sharp) .ed-lb-img--lo {
  filter: blur(14px);
  transform: scale(1.02);
}
/* HD: cross-fades in sharp the moment it decodes. */
.ed-lb-img--hi {
  opacity: 0;
  transition: opacity 520ms var(--mo-ease);
}
.ed-lb-slide.is-ready .ed-lb-img--hi { opacity: 1; }
/* Once HD is fully in, the preview steps out of the way (after the fade). */
.ed-lb-slide.is-ready .ed-lb-img--lo {
  opacity: 0;
  transition: filter 520ms var(--mo-ease), transform 520ms var(--mo-ease), opacity 0s linear 560ms;
}
/* Slow link (> 700 ms): a single hairline runs under the frame. No spinner. */
.ed-lb-slide.is-slow:not(.is-ready) .ed-lb-frame::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -2px;
  width: 96px;
  height: 1px;
  margin-left: -48px;
  background: linear-gradient(90deg, transparent, rgb(var(--lb-cream) / 0.75), transparent);
  animation: lb-shimmer 1400ms var(--mo-ease) infinite;
}
@keyframes lb-shimmer {
  from { transform: translateX(-72px); opacity: 0; }
  30%, 70% { opacity: 1; }
  to { transform: translateX(72px); opacity: 0; }
}

/* ── Chrome: shared entrance / idle-hide ─────────────────────────────────── */
.ed-lb-top,
.ed-lb-nav,
.ed-lb-bottom {
  opacity: 0;
  translate: 0 var(--mo-rise);
  transition:
    opacity 160ms var(--mo-ease),
    translate 160ms var(--mo-ease);
}
/* Arrives top -> nav -> bottom, 40 ms apart. While opening, the photo leads by
   --lb-chrome-lead and the chrome lands with it instead of after the spring's
   sub-pixel tail (that wait read as lag on phones). */
.ed-lightbox:where(.is-open:not(.is-closing)) :where(.ed-lb-top, .ed-lb-nav, .ed-lb-bottom) {
  opacity: 1;
  translate: 0 0;
  transition:
    opacity var(--lb-chrome-in) var(--mo-ease),
    translate var(--lb-chrome-in) var(--mo-ease);
}
.ed-lightbox:where(.is-open:not(.is-closing)) .ed-lb-nav { transition-delay: var(--mo-stagger); }
.ed-lightbox:where(.is-open:not(.is-closing)) .ed-lb-bottom { transition-delay: calc(var(--mo-stagger) * 2); }
.ed-lightbox.is-opening .ed-lb-top { transition-delay: var(--lb-chrome-lead); }
.ed-lightbox.is-opening .ed-lb-nav { transition-delay: calc(var(--lb-chrome-lead) + var(--mo-stagger)); }
.ed-lightbox.is-opening .ed-lb-bottom { transition-delay: calc(var(--lb-chrome-lead) + var(--mo-stagger) * 2); }

/* Idle / tap-toggled: the room goes quiet. */
.ed-lightbox.is-chrome-hidden :where(.ed-lb-top, .ed-lb-nav, .ed-lb-bottom) {
  opacity: 0;
  translate: 0 0;
  pointer-events: none;
  transition: opacity var(--lb-chrome-out) var(--mo-ease), translate var(--lb-chrome-out) var(--mo-ease);
  transition-delay: 0s;
}
.ed-lightbox.is-chrome-hidden .ed-lb-progress { opacity: 0.5; }

/* Swipe-down dismiss: chrome leaves ahead of the photo. */
.ed-lightbox.is-dismissing :where(.ed-lb-top, .ed-lb-nav, .ed-lb-bottom, .ed-lb-progress) {
  opacity: calc(1 - var(--lb-dismiss, 0) * 3);
  transition: none;
}

/* Zoomed: arrows, filmstrip and caption step away entirely. */
.ed-lightbox.is-zoomed :where(.ed-lb-nav, .ed-lb-film, .ed-lb-caption) {
  opacity: 0;
  pointer-events: none;
}

/* ── Progress hairline (very top) ────────────────────────────────────────── */
.ed-lb-progress {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 5;
  height: 1px;
  pointer-events: none;
  background: rgb(var(--lb-cream) / 0.08);
  transition: opacity var(--lb-chrome-out) var(--mo-ease);
}
.ed-lb-progress-fill {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--lb-gold);
  transform-origin: 0 50%;
  transform: scaleX(var(--lb-progress, 0));
  transition: transform 420ms var(--mo-ease);
}
.ed-lightbox.is-single .ed-lb-progress { display: none; }

/* ── Top bar: counter (centre) + close ───────────────────────────────────── */
.ed-lb-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 4;
  height: var(--lb-inset-top);
  box-sizing: border-box;
  padding: env(safe-area-inset-top, 0px) max(var(--lb-edge), env(safe-area-inset-right, 0px)) 0
    max(var(--lb-edge), env(safe-area-inset-left, 0px));
  display: flex;
  align-items: center;
  justify-content: flex-end;
  pointer-events: none;
}
.ed-lb-top > * { pointer-events: auto; }

.ed-lb-counter {
  position: absolute;
  left: 50%;
  top: calc(env(safe-area-inset-top, 0px) + var(--lb-bar) / 2);
  translate: -50% -50%;
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0.32em;
  font-variant-numeric: tabular-nums;
  color: var(--lb-text);
  white-space: nowrap;
  pointer-events: none;
}
.ed-lb-count-sep { margin: 0 0.9em 0 0.6em; color: rgb(var(--lb-cream) / 0.45); }
.ed-lb-count-total { color: var(--lb-text-dim); margin-right: -0.32em; }

/* Odometer: the old digits roll out, the new ones roll in. */
.ed-lb-count-cur {
  display: inline-grid;
  overflow: hidden;
  height: 1.4em;
  line-height: 1.4em;
  vertical-align: middle;
}
.ed-lb-digit-out,
.ed-lb-digit-in {
  grid-area: 1 / 1;
  text-align: right;
}
.ed-lb-digit-out { opacity: 0; }
.ed-lightbox .ed-lb-digit-out { animation: lb-roll-out-up 240ms var(--mo-ease) both; }
.ed-lightbox .ed-lb-digit-in  { animation: lb-roll-in-up 240ms var(--mo-ease) both; }
.ed-lightbox[data-dir="prev"] .ed-lb-digit-out { animation-name: lb-roll-out-down; }
.ed-lightbox[data-dir="prev"] .ed-lb-digit-in  { animation-name: lb-roll-in-down; }
@keyframes lb-roll-out-up   { from { transform: none; opacity: 1; } to { transform: translateY(-100%); opacity: 0; } }
@keyframes lb-roll-out-down { from { transform: none; opacity: 1; } to { transform: translateY(100%);  opacity: 0; } }
@keyframes lb-roll-in-up    { from { transform: translateY(100%);  opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes lb-roll-in-down  { from { transform: translateY(-100%); opacity: 0; } to { transform: none; opacity: 1; } }

/* ── Round hairline buttons (close, arrows) ──────────────────────────────── */
.ed-lb-close,
.ed-lb-nav {
  position: relative;
  display: grid;
  place-items: center;
  padding: 0;
  margin: 0;
  color: var(--lb-text);
  background: rgb(var(--lb-room) / 0.35);
  border: 1px solid var(--lb-hair);
  border-radius: 50%;
  cursor: pointer;
  font-size: 0;           /* glyphs are drawn below, whatever the markup holds */
  line-height: 0;
  -webkit-appearance: none;
  appearance: none;
  transition:
    background-color 220ms var(--mo-ease),
    border-color 220ms var(--mo-ease),
    scale 150ms var(--mo-ease);
}
.ed-lb-close > *,
.ed-lb-nav > * { display: none; }
.ed-lb-close { width: 44px; height: 44px; min-width: 44px; min-height: 44px; }
.ed-lb-close::before,
.ed-lb-close::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 16px;
  height: 1px;
  margin: -0.5px 0 0 -8px;
  background: currentColor;
  transform: rotate(45deg);
  transition: transform 320ms var(--mo-ease);
}
.ed-lb-close::after { transform: rotate(-45deg); }
.ed-lb-close:active,
.ed-lb-nav:active { scale: 0.96; }

/* ── Arrows (desktop with a real pointer only) ───────────────────────────── */
.ed-lb-nav {
  position: absolute;
  top: 50%;
  z-index: 4;
  width: 52px;
  height: 52px;
  margin-top: -26px;
  display: none;
}
.ed-lb-nav::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 9px;
  height: 9px;
  border-top: 1px solid currentColor;
  border-left: 1px solid currentColor;
  transition: transform 280ms var(--mo-ease);
}
.ed-lb-nav--prev { left: max(22px, env(safe-area-inset-left, 0px)); }
.ed-lb-nav--next { right: max(22px, env(safe-area-inset-right, 0px)); }
.ed-lb-nav--prev::before { transform: translate(-30%, -50%) rotate(-45deg); }
.ed-lb-nav--next::before { transform: translate(-70%, -50%) rotate(135deg); }
.ed-lb-nav:where(:disabled, [aria-disabled="true"]) {
  opacity: 0.28;
  pointer-events: none;
}
@media (hover: hover) and (min-width: 1024px) {
  .ed-lb-nav { display: grid; }
  .ed-lightbox.is-single .ed-lb-nav { display: none; }
  .ed-lightbox.is-touch .ed-lb-nav { display: none; }
}

@media (hover: hover) {
  .ed-lb-close:hover,
  .ed-lb-nav:hover {
    background: rgb(var(--lb-cream) / 0.1);
    border-color: rgb(var(--lb-cream) / 0.5);
  }
  .ed-lb-close:hover::before { transform: rotate(135deg); }
  .ed-lb-close:hover::after  { transform: rotate(45deg); }
  .ed-lb-nav--prev:hover::before { transform: translate(-45%, -50%) rotate(-45deg); }
  .ed-lb-nav--next:hover::before { transform: translate(-55%, -50%) rotate(135deg); }
}

/* ── Bottom: caption, filmstrip, actions ─────────────────────────────────── */
.ed-lb-bottom {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 4;
  box-sizing: border-box;
  padding: 0 max(var(--lb-edge), env(safe-area-inset-right, 0px))
    calc(env(safe-area-inset-bottom, 0px) + 16px) max(var(--lb-edge), env(safe-area-inset-left, 0px));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  pointer-events: none;   /* the dark around the controls still closes the room */
}
.ed-lb-bottom > * { pointer-events: auto; }

.ed-lb-caption {
  margin: 0;
  max-width: min(80vw, 640px);
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(17px, 1.6vw, 22px);
  line-height: 1.2;
  letter-spacing: 0.01em;
  text-align: center;
  color: rgb(var(--lb-cream) / 0.82);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: opacity 280ms var(--mo-ease);
}
.ed-lb-caption:empty { display: none; }

.ed-lb-film {
  display: flex;
  gap: 6px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding: 2px 12px 8px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 20px, #000 calc(100% - 20px), transparent);
  mask-image: linear-gradient(90deg, transparent, #000 20px, #000 calc(100% - 20px), transparent);
  transition: opacity 280ms var(--mo-ease);
}
.ed-lb-film::-webkit-scrollbar { display: none; }
.ed-lightbox.is-single .ed-lb-film { display: none; }

.ed-lb-thumb {
  position: relative;
  flex: 0 0 auto;
  width: var(--lb-thumb-w);
  height: var(--lb-thumb-h);
  min-width: 44px;
  padding: 0;
  border: 0;
  border-radius: 1px;
  background: rgb(var(--lb-cream) / 0.06);
  opacity: 0.45;
  cursor: pointer;
  scroll-snap-align: center;
  -webkit-appearance: none;
  appearance: none;
  transition: opacity 320ms var(--mo-ease);
}
/* Centre a short strip; a long one still scrolls from its first thumb. */
.ed-lb-thumb:first-child { margin-left: auto; }
.ed-lb-thumb:last-child { margin-right: auto; }
.ed-lb-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
  pointer-events: none;
  -webkit-user-drag: none;
}
/* The cream underline eases in under the selected photo. */
.ed-lb-thumb::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -6px;
  height: 1px;
  background: rgb(var(--lb-cream) / 0.9);
  transform: scaleX(0);
  transition: transform 420ms var(--mo-ease);
}
.ed-lb-thumb[aria-selected="true"] { opacity: 1; }
.ed-lb-thumb[aria-selected="true"]::after { transform: scaleX(1); }
@media (hover: hover) {
  .ed-lb-thumb:hover { opacity: 0.8; }
  .ed-lb-thumb[aria-selected="true"]:hover { opacity: 1; }
}

/* Actions row */
.ed-lb-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  max-width: 440px;
}
.ed-lb-back,
.ed-lb-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6em;
  flex: 1 1 0;
  min-width: 0;
  min-height: 44px;
  padding: 0 18px;
  box-sizing: border-box;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  transition:
    color 220ms var(--mo-ease),
    background-color 220ms var(--mo-ease),
    border-color 220ms var(--mo-ease),
    scale 150ms var(--mo-ease);
}
.ed-lb-back {
  flex: 0 1 auto;
  color: var(--lb-text);
  background: transparent;
  border: 1px solid var(--lb-hair);
  font-weight: 500;
}
@media (max-width: 400px) {
  .ed-lb-back,
  .ed-lb-cta { padding: 0 14px; letter-spacing: 0.14em; }
  .ed-lb-cta { font-size: 10px; }
}
.ed-lb-back::before {
  content: "←";
  content: "←" / "";
  font-style: normal;
  letter-spacing: 0;
  transition: transform 280ms var(--mo-ease);
}
/* The conversion button stays the filled taupe of the brand. */
.ed-lb-cta {
  color: var(--on-accent);
  background: var(--accent, #A08A80);
  border: 1px solid transparent;
}
.ed-lb-cta::after {
  content: "→";
  content: "→" / "";
  font-style: normal;
  letter-spacing: 0;
  transition: transform 280ms var(--mo-ease);
}
.ed-lb-back:active,
.ed-lb-cta:active { scale: 0.97; }
@media (hover: hover) {
  .ed-lb-back:hover {
    color: rgb(var(--lb-cream));
    background: rgb(var(--lb-cream) / 0.08);
    border-color: rgb(var(--lb-cream) / 0.5);
  }
  .ed-lb-back:hover::before { transform: translateX(-3px); }
  .ed-lb-cta:hover { background: var(--fg, #665852); }
  .ed-lb-cta:hover::after { transform: translateX(3px); }
}

/* Focus: one ring, everywhere in the room. */
.ed-lightbox :where(button, a):focus-visible {
  outline: 2px solid var(--mo-ring-on-dark);
  outline-offset: 3px;
}

/* Visually hidden live region. */
.ed-lb-live {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ── Breakpoints ─────────────────────────────────────────────────────────── */
@media (min-width: 768px) {
  .ed-lightbox {
    --lb-gap: 40px;
    --lb-bar: 64px;
    --lb-edge: 28px;
    /* caption 22 + 12 + film 76 + 12 + row 44 + 16 = 182, plus air */
    --lb-inset-bottom: calc(194px + env(safe-area-inset-bottom, 0px));
    --lb-inset-x: 40px;
    --lb-thumb-w: 52px;
    --lb-thumb-h: 66px;
  }
  .ed-lb-film { max-width: 640px; }
}

@media (min-width: 1024px) {
  .ed-lightbox {
    --lb-gap: 64px;
    --lb-bar: 76px;
    --lb-edge: 96px;
    /* One console line: caption 26 + 12 + film 90 + 16 = 144, plus air */
    --lb-inset-bottom: calc(160px + env(safe-area-inset-bottom, 0px));
    --lb-inset-x: 96px;
    --lb-thumb-w: 64px;
    --lb-thumb-h: 80px;
  }
  .ed-lb-top { padding-right: max(32px, env(safe-area-inset-right, 0px)); }
  /* Desktop console: Gallery | filmstrip | Begin your project, caption above the strip. */
  .ed-lb-bottom {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas: ". cap ." "back film cta";
    align-items: center;
    column-gap: 40px;
    row-gap: 12px;
    padding-left: max(32px, env(safe-area-inset-left, 0px));
    padding-right: max(32px, env(safe-area-inset-right, 0px));
  }
  .ed-lb-row { display: contents; }
  .ed-lb-caption { grid-area: cap; justify-self: center; max-width: 100%; }
  .ed-lb-film { grid-area: film; max-width: none; gap: 8px; }
  .ed-lb-back { grid-area: back; justify-self: start; }
  .ed-lb-cta { grid-area: cta; justify-self: end; }
  .ed-lb-back,
  .ed-lb-cta { flex: 0 0 auto; min-width: 168px; }
}

/* Landscape phones / short windows: the photo needs every pixel. */
@media (max-height: 520px) and (orientation: landscape) {
  .ed-lightbox {
    --lb-bar: 48px;
    --lb-gap: 32px;
    --lb-edge: 16px;
    --lb-inset-bottom: calc(112px + env(safe-area-inset-bottom, 0px));
    --lb-inset-x: max(env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px));
    --lb-thumb-w: 40px;
    --lb-thumb-h: 50px;
  }
  .ed-lb-caption { display: none; }
  .ed-lb-bottom { gap: 8px; padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 8px); }
  .ed-lb-top { padding-right: max(var(--lb-edge), env(safe-area-inset-right, 0px)); }
}
@media (max-height: 400px) and (orientation: landscape) {
  .ed-lightbox { --lb-inset-bottom: calc(60px + env(safe-area-inset-bottom, 0px)); }
  .ed-lb-film { display: none; }
}

/* ── Reduced motion: opacity only, <= 180 ms, no blur, no roll ───────────── */
@media (prefers-reduced-motion: reduce) {
  .ed-lightbox::before { transition: opacity 180ms linear; }
  .ed-lb-ambient-img { transition: opacity 180ms linear; }
  .ed-lb-top,
  .ed-lb-nav,
  .ed-lb-bottom,
  .ed-lightbox:where(.is-open:not(.is-opening):not(.is-closing)) :where(.ed-lb-top, .ed-lb-nav, .ed-lb-bottom),
  .ed-lightbox.is-chrome-hidden :where(.ed-lb-top, .ed-lb-nav, .ed-lb-bottom) {
    translate: 0 0;
    transition: opacity 180ms linear;
    transition-delay: 0s;
  }
  .ed-lb-slide.is-loading .ed-lb-img--lo { filter: none; transform: none; }
  .ed-lb-img--lo,
  .ed-lb-slide.is-ready .ed-lb-img--lo { transition: opacity 0s linear 180ms; }
  .ed-lb-img--hi { transition: opacity 180ms linear; }
  .ed-lb-slide.is-slow:not(.is-ready) .ed-lb-frame::after { animation: none; transform: none; opacity: 0.6; }
  .ed-lb-progress-fill { transition: none; }
  .ed-lightbox .ed-lb-digit-out { animation: none; opacity: 0; }
  .ed-lightbox .ed-lb-digit-in { animation: lb-fade-in 180ms linear both; }
  .ed-lightbox[data-dir] .ed-lb-digit-out { animation: none; }
  .ed-lightbox[data-dir] .ed-lb-digit-in { animation-name: lb-fade-in; }
  .ed-lb-close,
  .ed-lb-nav,
  .ed-lb-back,
  .ed-lb-cta,
  .ed-lb-thumb,
  .ed-lb-thumb::after,
  .ed-lb-close::before,
  .ed-lb-close::after,
  .ed-lb-nav::before,
  .ed-lb-back::before,
  .ed-lb-cta::after { transition-duration: 0.01ms; }
  .ed-lb-close:active,
  .ed-lb-nav:active,
  .ed-lb-back:active,
  .ed-lb-cta:active { scale: 1; }
}
@keyframes lb-fade-in { from { opacity: 0; } to { opacity: 1; } }
