/* Apple-style fullscreen gallery lightbox */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--color--background--100, #fff);
  transition: opacity 0.35s ease, background-color 0.6s ease;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

.lightbox.is--open {
  opacity: 1;
  pointer-events: auto;
}

.lightbox__track {
  display: flex;
  height: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  gap: 16px;
  padding: 24px 0;
  box-sizing: border-box;
  scrollbar-width: none;
}

.lightbox__track::-webkit-scrollbar {
  display: none;
}

.lightbox__slide {
  flex: 0 0 86%;
  scroll-snap-align: center;
  background: var(--color--foreground--5, #f5f5f7);
  transition: background-color 0.6s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.lightbox__slide:first-child {
  margin-left: 7%;
}

.lightbox__slide:last-child {
  margin-right: 7%;
}

.lightbox__slide img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

.lightbox__close,
.lightbox__prev,
.lightbox__next {
  position: absolute;
  z-index: 2;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: var(--color--foreground--10, #e8e8ed);
  color: var(--color--foreground--100, #1d1d1f);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, opacity 0.2s ease, color 0.6s ease;
  padding: 0;
}

.lightbox__close:hover,
.lightbox__prev:hover,
.lightbox__next:hover {
  background: var(--color--foreground--15, #dcdce1);
}

.lightbox__close {
  top: 24px;
  left: 24px;
}

.lightbox__prev,
.lightbox__next {
  top: 50%;
  transform: translateY(-50%);
}

.lightbox__prev { left: 16px; }
.lightbox__next { right: 16px; }

.lightbox__prev[disabled],
.lightbox__next[disabled] {
  opacity: 0;
  pointer-events: none;
}

.lightbox__close svg,
.lightbox__prev svg,
.lightbox__next svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 2.5;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

body.lightbox--is--open {
  overflow: hidden;
}

/* clickable gallery images */
.keen-slider__slide img {
  cursor: zoom-in;
}

@media (max-width: 734px) {
  .lightbox__slide { flex-basis: 92%; }
  .lightbox__slide:first-child { margin-left: 4%; }
  .lightbox__slide:last-child { margin-right: 4%; }
  .lightbox__prev, .lightbox__next { display: none; }
}
