button.as-case__cta[data-as-gallery] {
  border: 0;
  font: inherit;
  cursor: pointer;
}

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

.as-gallery-modal {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: grid;
  place-items: center;
  padding: clamp(12px, 3vw, 32px);
  background: rgba(10, 10, 10, 0.94);
  touch-action: none;
  overscroll-behavior: contain;
}

.as-gallery-modal__frame {
  position: relative;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 48px;
  align-items: center;
  width: min(1180px, 100%);
  height: min(820px, calc(100dvh - 24px));
}

.as-gallery-modal__figure {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  align-items: center;
  justify-items: center;
  width: 100%;
  height: 100%;
  margin: 0;
  min-width: 0;
  min-height: 0;
}

.as-gallery-modal__image {
  display: block;
  max-width: 100%;
  max-height: calc(100dvh - 88px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  user-select: none;
  -webkit-user-drag: none;
}

.as-gallery-modal__counter {
  padding-top: 10px;
  color: #fff;
  font: 500 14px/1.2 Arial, sans-serif;
}

.as-gallery-modal__close,
.as-gallery-modal__arrow {
  border: 0;
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.as-gallery-modal__close {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 2;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font: 300 34px/40px Arial, sans-serif;
}

.as-gallery-modal__arrow {
  width: 42px;
  height: 56px;
  border-radius: 10px;
  font: 300 44px/48px Arial, sans-serif;
}

.as-gallery-modal__arrow:hover,
.as-gallery-modal__arrow:focus-visible,
.as-gallery-modal__close:hover,
.as-gallery-modal__close:focus-visible {
  background: rgba(255, 255, 255, 0.24);
  outline: 2px solid rgba(255, 255, 255, 0.85);
  outline-offset: 2px;
}

@media (max-width: 640px) {
  .as-gallery-modal {
    padding: 8px;
  }

  .as-gallery-modal__frame {
    grid-template-columns: 40px minmax(0, 1fr) 40px;
    height: calc(100dvh - 16px);
  }

  .as-gallery-modal__image {
    max-height: calc(100dvh - 72px);
    border-radius: 5px;
  }

  .as-gallery-modal__arrow {
    width: 36px;
    height: 52px;
    font-size: 38px;
  }

  .as-gallery-modal__close {
    width: 40px;
    height: 40px;
    font-size: 30px;
  }
}

