.oev-gallery,
body .wp-block-gallery {
  display: grid;
  grid-template-columns: repeat(var(--oev-gallery-cols, 3), minmax(0, 1fr));
  gap: var(--oev-gallery-gap, 12px);
  margin: 1.4rem 0;
  padding: 0;
}

.oev-gallery__item,
body .wp-block-gallery > .wp-block-image {
  min-width: 0;
  margin: 0;
}

.oev-gallery__link {
  display: block;
  line-height: 0;
  text-decoration: none;
}

.oev-gallery__image,
body .wp-block-gallery > .wp-block-image img {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
  border-radius: var(--oev-gallery-radius, 6px);
}

.oev-gallery__caption,
body .wp-block-gallery > .wp-block-image figcaption {
  margin-top: .45rem;
  font-size: .86rem;
  line-height: 1.35;
  color: inherit;
}

@media (max-width: 767px) {
  .oev-gallery,
  body .wp-block-gallery {
    grid-template-columns: repeat(var(--oev-gallery-cols-mobile, 2), minmax(0, 1fr));
    gap: max(8px, calc(var(--oev-gallery-gap, 12px) * .75));
  }
}

.oev-gallery-lightbox {
  width: min(96vw, 1400px);
  max-width: 96vw;
  height: min(94vh, 1000px);
  max-height: 94vh;
  padding: 0;
  border: 0;
  background: transparent;
  overflow: visible;
}

.oev-gallery-lightbox::backdrop {
  background: rgba(0,0,0,.88);
}

.oev-gallery-lightbox__frame {
  position: relative;
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: 56px minmax(0,1fr) 56px;
  align-items: center;
}

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

.oev-gallery-lightbox__image {
  display: block;
  max-width: 100%;
  max-height: calc(94vh - 80px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: var(--oev-gallery-radius, 6px);
  background: #fff;
}

.oev-gallery-lightbox__caption {
  margin-top: 10px;
  max-width: 900px;
  color: #fff;
  text-align: center;
  line-height: 1.4;
}

.oev-gallery-lightbox__close,
.oev-gallery-lightbox__prev,
.oev-gallery-lightbox__next {
  border: 0;
  background: rgba(0,0,0,.45);
  color: #fff;
  cursor: pointer;
  border-radius: 999px;
  font: inherit;
}

.oev-gallery-lightbox__close {
  position: absolute;
  z-index: 2;
  top: 4px;
  right: 4px;
  width: 44px;
  height: 44px;
  font-size: 32px;
  line-height: 1;
}

.oev-gallery-lightbox__prev,
.oev-gallery-lightbox__next {
  width: 44px;
  height: 44px;
  justify-self: center;
  font-size: 28px;
  line-height: 1;
}

.oev-gallery-lightbox__close:focus-visible,
.oev-gallery-lightbox__prev:focus-visible,
.oev-gallery-lightbox__next:focus-visible,
.oev-gallery__link:focus-visible {
  outline: 3px solid currentColor;
  outline-offset: 3px;
}

@media (max-width: 640px) {
  .oev-gallery-lightbox__frame {
    grid-template-columns: 42px minmax(0,1fr) 42px;
  }
  .oev-gallery-lightbox__prev,
  .oev-gallery-lightbox__next {
    width: 38px;
    height: 38px;
    font-size: 24px;
  }
}
