.has-open-gallery {
  overflow: hidden;
}

.media-gallery {
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  padding: 0;
  border: 0;
  background: rgba(18, 27, 31, 0.98);
  color: #fff;
}

.media-gallery::backdrop {
  background: rgba(18, 27, 31, 0.72);
  backdrop-filter: blur(5px);
}

.media-gallery-shell {
  display: grid;
  width: 100%;
  height: 100%;
  padding: 12px;
  grid-template-rows: auto minmax(0, 1fr);
}

.media-gallery-toolbar {
  display: flex;
  min-height: 50px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.media-gallery-toolbar p {
  margin: 0;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
  font-weight: 760;
}

.media-gallery-close,
.media-gallery-arrow {
  display: grid;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  cursor: pointer;
  place-items: center;
}

.media-gallery-close {
  width: 42px;
  height: 42px;
  border-radius: 10px;
}

.media-gallery-stage {
  display: grid;
  min-height: 0;
  align-items: center;
  gap: 12px;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
}

.media-gallery-stage figure {
  display: grid;
  min-width: 0;
  min-height: 0;
  margin: 0;
  place-items: center;
}

.media-gallery-stage img {
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: calc(100vh - 125px);
  object-fit: contain;
}

.media-gallery-stage figcaption {
  max-width: 700px;
  margin-top: 10px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.8125rem;
  text-align: center;
}

.media-gallery-arrow {
  width: 44px;
  height: 54px;
  border-radius: 10px;
}

.media-gallery-arrow.is-previous svg {
  transform: rotate(180deg);
}

.media-gallery button:hover,
.media-gallery button:focus-visible {
  border-color: #fff;
  background: #fff;
  color: #173f4a;
}

@media (max-width: 620px) {
  .media-gallery-shell {
    padding: 8px;
  }

  .media-gallery-stage {
    align-items: end;
    grid-template-columns: 1fr 1fr;
  }

  .media-gallery-stage figure {
    min-height: 0;
    align-self: center;
    grid-column: 1 / -1;
    grid-row: 1;
  }

  .media-gallery-arrow {
    width: 100%;
    height: 44px;
    grid-row: 2;
  }
}
