/* Thumbnail gallery */
.rv50-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-start;
}

.rv50-gallery a {
  display: block;
  flex: 0 0 auto;
  line-height: 0;
  text-decoration: none;
}

.rv50-gallery img {
  display: block;
  width: 80px;
  height: auto;
  border: 0;
  cursor: pointer;
}

.rv50-gallery br {
  display: none;
}

/* Modal background */
.rv50-modal {
  display: none;
  position: fixed;
  z-index: 999999;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  padding: 30px;
  box-sizing: border-box;
  background: rgba(0, 0, 0, 0.82);
  overflow: auto;
  text-align: center;
}

.rv50-modal.is-open {
  display: block;
}

/* Modal box */
.rv50-modal-box {
  position: relative;
  display: inline-block;
  width: 100%;
  max-width: 1000px;
  padding: 48px 20px 20px;
  box-sizing: border-box;
  background: #fff;
  border-radius: 4px;
  text-align: center;
}

/* Full-size image */
.rv50-modal-image {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: 75vh;
  height: auto;
  margin: 0 auto;
  border: 0;
}

/* Close button */
.rv50-modal-close {
  position: absolute;
  top: 8px;
  right: 12px;
  padding: 4px 10px;
  border: 0;
  background: transparent;
  color: #333;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

/* Previous and next buttons */
.rv50-modal-prev,
.rv50-modal-next {
  position: absolute;
  top: 50%;
  width: 42px;
  height: 60px;
  margin-top: -30px;
  padding: 0;
  border: 0;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font-size: 30px;
  line-height: 60px;
  cursor: pointer;
}

.rv50-modal-prev {
  left: 10px;
}

.rv50-modal-next {
  right: 10px;
}

/* Modal links */
.rv50-modal-actions {
  margin-top: 16px;
  line-height: 1.4;
}

.rv50-modal-actions a {
  display: inline-block;
  margin: 4px 6px;
  padding: 9px 14px;
  border-radius: 3px;
  background: #4acbd6;
  color: #fff;
  text-decoration: none;
  line-height: 1.2;
}

/* Image counter */
.rv50-modal-counter {
  margin-top: 10px;
  color: #505255;
  font-size: 14px;
  line-height: 1.3;
}

/* Prevent background scrolling while open */
body.rv50-modal-open {
  overflow: hidden;
}

@media (max-width: 736px) {
  .rv50-gallery img {
    width: 90px;
  }

  .rv50-modal {
    padding: 12px;
  }

  .rv50-modal-box {
    padding: 44px 8px 14px;
  }

  .rv50-modal-image {
    max-height: 68vh;
  }

  .rv50-modal-prev,
  .rv50-modal-next {
    width: 34px;
    height: 50px;
    margin-top: -25px;
    line-height: 50px;
  }
}