/*
 * Article image lightbox.
 * Visual proportions follow the production BurgerEditor colorbox while the
 * markup and controls are owned by the theme and require no jQuery.
 */
.bqey-lightbox[hidden] {
  display: none;
}

.bqey-lightbox {
  position: fixed;
  z-index: 100000;
  inset: 0;
  display: grid;
  place-items: center;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  padding: 60px 72px;
  background: rgb(10 10 10 / 85%);
}

.bqey-lightbox *,
.bqey-lightbox *::before,
.bqey-lightbox *::after {
  box-sizing: border-box;
}

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

.bqey-lightbox__panel {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
}

.bqey-lightbox__stage {
  display: grid;
  place-items: center;
  max-width: 95vw;
  max-height: calc(100vh - 120px);
  margin: 0;
}

.bqey-lightbox__image {
  display: block;
  width: auto;
  max-width: min(95vw, calc(100vw - 144px));
  height: auto;
  max-height: calc(100vh - 120px);
  border: 2px solid #fff;
  background: #fff;
  object-fit: contain;
}

.bqey-lightbox__image--loading {
  min-width: 64px;
  min-height: 64px;
  opacity: 0;
}

.bqey-lightbox__image--error {
  display: none;
}

.bqey-lightbox__message {
  padding: 24px;
  border: 2px solid #fff;
  color: #fff;
  font-size: 16px;
}

.bqey-lightbox__button {
  position: absolute;
  z-index: 2;
  appearance: none;
  width: 48px;
  height: 48px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #fff;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.bqey-lightbox__button:hover {
  opacity: 0.7;
}

.bqey-lightbox__button:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 4px;
}

.bqey-lightbox__previous {
  top: 50%;
  left: 0;
  transform: translateY(-50%);
}

.bqey-lightbox__next {
  top: 50%;
  right: 0;
  transform: translateY(-50%);
}

.bqey-lightbox__previous::after,
.bqey-lightbox__next::after {
  position: absolute;
  top: 11px;
  left: 13px;
  width: 25px;
  height: 25px;
  border-top: 2px solid currentcolor;
  border-right: 2px solid currentcolor;
  content: '';
}

.bqey-lightbox__previous::after {
  left: 18px;
  transform: rotate(225deg);
}

.bqey-lightbox__next::after {
  transform: rotate(45deg);
}

.bqey-lightbox__close {
  top: -48px;
  right: 0;
  width: 40px;
  height: 40px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: rgb(0 0 0 / 10%);
}

.bqey-lightbox__close::before,
.bqey-lightbox__close::after {
  position: absolute;
  top: 8px;
  left: 17px;
  width: 2px;
  height: 20px;
  background: currentcolor;
  content: '';
}

.bqey-lightbox__close::before {
  transform: rotate(45deg);
}

.bqey-lightbox__close::after {
  transform: rotate(135deg);
}

.bqey-lightbox__counter {
  position: absolute;
  bottom: -44px;
  left: 50%;
  margin: 0;
  color: #fff;
  font-size: 15px;
  line-height: 1;
  transform: translateX(-50%);
}

.bqey-lightbox-trigger {
  cursor: zoom-in;
}

@media (max-width: 768px) {
  .bqey-lightbox {
    padding: 64px 10px 80px;
  }

  .bqey-lightbox__stage {
    max-height: calc(100vh - 144px);
  }

  .bqey-lightbox__image {
    max-width: calc(100vw - 20px);
    max-height: calc(100vh - 144px);
  }

  .bqey-lightbox__close {
    top: -54px;
    width: 44px;
    height: 44px;
  }

  .bqey-lightbox__close::before,
  .bqey-lightbox__close::after {
    top: 9px;
    left: 19px;
    height: 22px;
  }

  .bqey-lightbox__previous,
  .bqey-lightbox__next {
    top: auto;
    bottom: -66px;
    transform: none;
  }

  .bqey-lightbox__counter {
    bottom: -52px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bqey-lightbox__button {
    transition: none;
  }
}
