.invitation-story-gallery {
  width: 100%;
  max-width: 960px;
  margin: 36px auto 0;
}

.invitation-story-gallery__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
  gap: 16px;
}

.invitation-story-gallery__photo {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  padding: 0;
  border: 0;
  border-radius: 12px;
  overflow: hidden;
  background: transparent;
  cursor: pointer;
}

.invitation-story-gallery__photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.invitation-story-gallery__dialog {
  width: min(1040px, calc(100vw - 24px));
  max-width: calc(100vw - 24px);
  max-height: calc(100dvh - 24px);
  margin: auto;
  padding: 48px 16px 16px;
  border: 0;
  border-radius: 12px;
  background: #181513;
  color: #fff;
}

.invitation-story-gallery__dialog::backdrop {
  background: rgba(0, 0, 0, 0.85);
}

.invitation-story-gallery__dialog figure {
  margin: 0;
  text-align: center;
}

.invitation-story-gallery__dialog img {
  display: block;
  width: 100%;
  max-height: calc(100dvh - 200px);
  object-fit: contain;
}

.invitation-story-gallery__dialog figcaption {
  margin-top: 12px;
}

.invitation-story-gallery__dialog button {
  min-width: 44px;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 6px;
  background: transparent;
  color: inherit;
  font: 24px/1 sans-serif;
  cursor: pointer;
}

.invitation-story-gallery__close {
  position: absolute;
  top: 4px;
  right: 4px;
}

.invitation-story-gallery__controls {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 12px;
}

.invitation-story-gallery__dialog button:disabled {
  opacity: 0.4;
  cursor: default;
}

body.story-gallery-open {
  overflow: hidden;
}
