body.has-pro-gallery {
  overflow: hidden;
}

dialog.pro-gallery {
  box-sizing: border-box;
  width: min(1440px, calc(100vw - 32px));
  max-width: none;
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 0;
  border: 1px solid rgba(224, 209, 182, .3);
  background: #282a20;
  color: #e0d1b6;
  overflow: auto;
  overscroll-behavior: contain;
  font-family: inherit;
}

dialog.pro-gallery::backdrop {
  background: rgba(16, 18, 12, .88);
}

.pro-gallery__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 20px 24px;
}

.pro-gallery__title {
  margin: 0;
  color: inherit;
  font-family: Georgia, "Noto Serif", "Times New Roman", serif;
  font-size: clamp(21px, 2.3vw, 34px);
  font-weight: 400;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.pro-gallery__close {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid currentColor;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  line-height: 1.2;
}

.pro-gallery__close:hover {
  background: rgba(224, 209, 182, .1);
}

.pro-gallery__close:focus-visible {
  outline: 2px solid #e0d1b6;
  outline-offset: 4px;
}

.pro-gallery__viewer {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 180px;
  padding: 0 24px;
}

.pro-gallery__image {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: calc(100vh - 172px);
  max-height: calc(100dvh - 172px);
  margin: auto;
  object-fit: contain;
}

.pro-gallery__status {
  margin: 32px 0;
  color: inherit;
  font-size: 16px;
  line-height: 1.5;
  text-align: center;
}

.pro-gallery__caption {
  margin: 0;
  padding: 16px 24px 20px;
  color: inherit;
  font-size: 14px;
  line-height: 1.5;
}

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

@media (max-width: 600px) {
  dialog.pro-gallery {
    width: calc(100vw - 16px);
    max-height: calc(100vh - 16px);
    max-height: calc(100dvh - 16px);
  }

  .pro-gallery__header {
    gap: 12px;
    padding: 16px;
  }

  .pro-gallery__viewer {
    padding: 0 16px;
  }

  .pro-gallery__caption {
    padding: 14px 16px 16px;
  }
}
