.wedding-gallery {
  width: 100%;
  position: relative;
}

.wedding-gallery-preview-wrap {
  width: 100%;
  overflow: hidden;
  background: #f4f4f4;
}

.wedding-gallery-preview {
  display: block;
  position: relative;
  width: 100%;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}

#wedding-gallery-preview-image {
  display: block;
  width: 100%;
  height: min(56vw, 520px);
  min-height: 280px;
  object-fit: contain;
  background: #f4f4f4;
}

.wedding-gallery-open-hint {
  position: absolute;
  right: 1rem;
  bottom: 1rem;
  padding: 0.45rem 0.75rem;
  border-radius: 2rem;
  background: rgb(0 0 0 / 68%);
  color: #fff;
  font-size: 0.85rem;
  opacity: 0;
  transition: opacity 160ms ease;
}

.wedding-gallery-preview:hover .wedding-gallery-open-hint,
.wedding-gallery-preview:focus-visible .wedding-gallery-open-hint {
  opacity: 1;
}

.wedding-gallery-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 0.85rem 0.25rem;
}

.wedding-gallery-nav,
.wedding-gallery-modal-nav,
.wedding-gallery-close {
  display: grid;
  place-items: center;
  border: 0;
  color: #fff;
  background: #d71920;
  cursor: pointer;
}

.wedding-gallery-nav {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  font-size: 1.8rem;
  line-height: 1;
}

.wedding-gallery-nav:hover,
.wedding-gallery-modal-nav:hover,
.wedding-gallery-close:hover {
  background: #a70f15;
}

.wedding-gallery-progress {
  display: block;
  width: min(30vw, 180px);
  height: 4px;
  overflow: hidden;
  border-radius: 99px;
  background: #dedede;
}

#wedding-gallery-progress-value {
  display: block;
  width: 0;
  height: 100%;
  background: #d71920;
  transition: width 160ms ease;
}

.wedding-gallery-count {
  min-width: 4.5rem;
  color: #555;
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.wedding-gallery-modal[hidden] {
  display: none !important;
}

.wedding-gallery-modal {
  position: fixed;
  z-index: 10001;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3.5rem 5rem 2rem;
  background: rgb(0 0 0 / 94%);
}

.wedding-gallery-modal-figure {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  margin: 0;
}

#wedding-gallery-modal-image {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 7rem);
  object-fit: contain;
}

#wedding-gallery-modal-count {
  padding-top: 0.75rem;
  color: #fff;
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
}

.wedding-gallery-close {
  position: absolute;
  top: 1rem;
  right: 1.25rem;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  background: rgb(255 255 255 / 16%);
  font-size: 2rem;
  line-height: 1;
}

.wedding-gallery-modal-nav {
  position: absolute;
  top: 50%;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  transform: translateY(-50%);
  font-size: 2.4rem;
  line-height: 1;
}

.wedding-gallery-modal-nav.previous {
  left: 1rem;
}

.wedding-gallery-modal-nav.next {
  right: 1rem;
}

body.wedding-gallery-modal-open {
  overflow: hidden;
}

@media (max-width: 575px) {
  #wedding-gallery-preview-image {
    min-height: 220px;
    height: 65vw;
  }

  .wedding-gallery-modal {
    padding: 3.5rem 2.75rem 2rem;
  }

  .wedding-gallery-modal-nav {
    width: 2.25rem;
    height: 2.25rem;
    font-size: 1.8rem;
  }

  .wedding-gallery-modal-nav.previous {
    left: 0.25rem;
  }

  .wedding-gallery-modal-nav.next {
    right: 0.25rem;
  }
}
