.galleryapp[hidden] {
  display: none !important;
}

.galleryapp {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) 72px;
  align-items: center;
  gap: 12px;
  padding: 34px 22px;
  background: rgba(0, 0, 0, .94);
}

.galleryapp-stage {
  margin: 0;
  min-width: 0;
  display: grid;
  gap: 14px;
  justify-items: center;
}

.galleryapp-image-wrap {
  position: relative;
  width: 100%;
  max-width: 100%;
  max-height: calc(100vh - 128px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.galleryapp-canvas {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 128px);
  width: auto;
  height: auto;
}

.galleryapp-meta {
  position: absolute;
  right: 0;
  bottom: 0;
  padding: 5px 8px;
  color: var(--brand-yellow);
  background: rgba(0, 0, 0, .76);
  font-size: 16px;
  line-height: 1.1;
}

.galleryapp-caption {
  max-width: min(100%, 980px);
  color: #737373;
  font-style: italic;
  font-size: 16px;
  line-height: 1.2;
  text-align: center;
}

.galleryapp-close,
.galleryapp-nav {
  border: 0;
  background: transparent;
  color: var(--brand-yellow);
  font: inherit;
  cursor: pointer;
}

.galleryapp-close {
  position: absolute;
  top: 18px;
  right: 22px;
  z-index: 2;
  font-size: 34px;
  line-height: 1;
}

.galleryapp-nav {
  height: min(70vh, 520px);
  display: grid;
  place-items: center;
  font-size: clamp(54px, 8vw, 96px);
  line-height: 1;
}

.galleryapp-close:hover,
.galleryapp-close:focus-visible,
.galleryapp-nav:hover,
.galleryapp-nav:focus-visible {
  color: var(--accent-magenta);
  outline: none;
}

.galleryapp-item {
  cursor: zoom-in;
}

body.galleryapp-open {
  overflow: hidden;
}

@media (max-width: 720px) {
  .galleryapp {
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    gap: 4px;
    padding: 52px 8px 24px;
  }

  .galleryapp-image-wrap,
  .galleryapp-canvas {
    max-height: calc(100vh - 152px);
  }

  .galleryapp-caption {
    font-size: 17px;
  }

  .galleryapp-meta {
    font-size: 13px;
  }
}
