/* Article and FAQ images open in a full-screen lightbox. */
.article-image-zoom {
  display: block;
  width: fit-content;
  max-width: 100%;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  cursor: zoom-in;
}

.article-image-zoom:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 4px;
}

body.lightbox-open {
  overflow: hidden;
}

.image-lightbox {
  width: 100vw;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--white);
  overflow: hidden;
}

.image-lightbox::backdrop {
  background: #141a2ef2;
}

.image-lightbox-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 64px 72px 48px;
}

.image-lightbox-image {
  width: auto;
  max-width: 100%;
  min-height: 0;
  max-height: 100%;
  flex: 0 1 auto;
  object-fit: contain;
  border-radius: 6px;
  background: var(--white);
  cursor: default;
}

/* Small screenshots scale up to the viewport so their text is legible. */
@media (min-width: 768px) {
  .image-lightbox-image {
    width: 100%;
    height: 100%;
    background: none;
  }
}

.image-lightbox-caption {
  max-width: 60rem;
  color: #ffffffd9;
  font-size: 0.875rem;
  text-align: center;
}

.image-lightbox-count {
  position: absolute;
  top: 22px;
  left: 24px;
  margin: 0;
  color: #ffffffbf;
  font-size: 0.8125rem;
  letter-spacing: 0.04em;
}

.image-lightbox button {
  position: absolute;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 1px solid #ffffff40;
  border-radius: 50%;
  background: #ffffff14;
  color: var(--white);
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.2s var(--ease);
}

.image-lightbox button[hidden] {
  display: none;
}

.image-lightbox button:hover {
  background: #ffffff2e;
}

.image-lightbox button:focus-visible {
  outline: 2px solid var(--white);
  outline-offset: 3px;
}

.image-lightbox-close {
  top: 8px;
  right: 12px;
}

.image-lightbox-prev,
.image-lightbox-next {
  top: 50%;
  transform: translateY(-50%);
}

.image-lightbox-prev {
  left: 12px;
}

.image-lightbox-next {
  right: 12px;
}

@media (prefers-reduced-motion: no-preference) {
  .image-lightbox[open] {
    animation: image-lightbox-in 0.2s var(--ease);
  }
}

@keyframes image-lightbox-in {
  from {
    opacity: 0;
  }
}

/* Phones: arrows move under the image so it can use the full width. */
@media (max-width: 767px) {
  .image-lightbox-stage {
    padding: 64px 8px 88px;
  }

  .image-lightbox-prev,
  .image-lightbox-next {
    top: auto;
    bottom: 20px;
    transform: none;
  }

  .image-lightbox-prev {
    left: calc(50% - 60px);
  }

  .image-lightbox-next {
    right: calc(50% - 60px);
  }
}
