.media-gallery__more {
  display: flex;
  justify-content: center;
  margin: 1.5rem 0 0;
}

.media-gallery__more-button {
  background: #d4131d;
  border: 1px solid #d4131d;
  border-radius: 4px;
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  min-height: 2.75rem;
  padding: 0.65rem 1.25rem;
}

.media-gallery__more-button:hover,
.media-gallery__more-button:focus-visible {
  background: #a70e16;
  border-color: #a70e16;
  color: #fff;
}

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

.gallery-lightbox {
  align-items: center;
  background: rgba(0, 0, 0, 0.94);
  display: grid;
  inset: 0;
  justify-items: center;
  padding: 3.5rem 5.5rem 2rem;
  position: fixed;
  z-index: 10000;
}

.gallery-lightbox__figure {
  align-items: center;
  display: flex;
  flex-direction: column;
  height: 100%;
  justify-content: center;
  margin: 0;
  min-height: 0;
  width: 100%;
}

.gallery-lightbox__image {
  cursor: zoom-in;
  display: block;
  max-height: calc(100vh - 8rem);
  max-width: min(100%, 87.5rem);
  object-fit: contain;
  user-select: none;
}

.gallery-lightbox__figure.is-zoomed {
  display: block;
  overflow: auto;
  overscroll-behavior: contain;
}

.gallery-lightbox__figure.is-zoomed .gallery-lightbox__image {
  cursor: zoom-out;
  margin: 0 auto;
  max-height: none;
  max-width: none;
}

.gallery-lightbox__caption {
  color: #fff;
  display: flex;
  font-size: 0.95rem;
  gap: 1rem;
  justify-content: center;
  margin-top: 0.75rem;
  max-width: 60rem;
  text-align: center;
}

.gallery-lightbox__counter {
  color: #d8d8d8;
  white-space: nowrap;
}

.gallery-lightbox__button {
  align-items: center;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 4px;
  color: #fff;
  cursor: pointer;
  display: flex;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 2.25rem;
  height: 3.25rem;
  justify-content: center;
  line-height: 1;
  padding: 0;
  position: absolute;
  width: 3.25rem;
}

.gallery-lightbox__button:hover,
.gallery-lightbox__button:focus-visible {
  background: #d4131d;
  border-color: #d4131d;
  color: #fff;
}

.gallery-lightbox__button:disabled {
  cursor: default;
  opacity: 0.28;
}

.gallery-lightbox__close {
  right: 1.25rem;
  top: 1.25rem;
}

.gallery-lightbox__original {
  right: 5.25rem;
  text-decoration: none;
  top: 1.25rem;
}

.gallery-lightbox__zoom {
  right: 9.25rem;
  top: 1.25rem;
}

.gallery-lightbox__previous {
  left: 1.25rem;
  top: calc(50% - 1.625rem);
}

.gallery-lightbox__next {
  right: 1.25rem;
  top: calc(50% - 1.625rem);
}

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

@media (max-width: 47.99rem) {
  .gallery-lightbox {
    padding: 4rem 0.75rem 5.25rem;
  }

  .gallery-lightbox__image {
    max-height: calc(100vh - 10rem);
  }

  .gallery-lightbox__close {
    right: 0.75rem;
    top: 0.75rem;
  }

  .gallery-lightbox__original {
    right: 4.5rem;
    top: 0.75rem;
  }

  .gallery-lightbox__zoom {
    right: 8.25rem;
    top: 0.75rem;
  }

  .gallery-lightbox__previous,
  .gallery-lightbox__next {
    bottom: 0.75rem;
    top: auto;
  }

  .gallery-lightbox__previous {
    left: calc(50% - 4rem);
  }

  .gallery-lightbox__next {
    right: calc(50% - 4rem);
  }

  .gallery-lightbox__caption {
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .media-gallery__more-button,
  .gallery-lightbox__button {
    transition: none;
  }
}
