.custom-gallery {
  margin: 0;
  padding: 0;
}
.custom-gallery__grid {
  display: -ms-grid;
  display: grid;
  -ms-grid-columns: 1fr 1rem 1fr;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}
.custom-gallery.columns-3 .custom-gallery__grid .custom-gallery__item, .custom-gallery.columns-2 .custom-gallery__grid .custom-gallery__item {
  border-radius: 50px;
  overflow: hidden;
}
.custom-gallery.columns-3 .custom-gallery__grid {
  -ms-grid-columns: (1fr)[3];
  grid-template-columns: repeat(3, 1fr);
  margin-top: 25px;
}
.custom-gallery.columns-3 .custom-gallery__grid .custom-gallery__item:nth-child(3n-1) {
  -webkit-transform: translateY(-25px);
          transform: translateY(-25px);
}
.custom-gallery.columns-3 .custom-gallery__grid .custom-gallery__item:nth-child(3n-1):hover {
  -webkit-transform: translateY(-30px);
          transform: translateY(-30px);
}
@media (min-width: 768px) {
  .custom-gallery.columns-3 .custom-gallery__grid {
    margin-top: 50px;
  }
  .custom-gallery.columns-3 .custom-gallery__grid .custom-gallery__item:nth-child(3n-1) {
    -webkit-transform: translateY(-50px);
            transform: translateY(-50px);
  }
  .custom-gallery.columns-3 .custom-gallery__grid .custom-gallery__item:nth-child(3n-1):hover {
    -webkit-transform: translateY(-55px);
            transform: translateY(-55px);
  }
}
.custom-gallery__item {
  position: relative;
  overflow: hidden;
  -webkit-transition: -webkit-transform 0.3s ease;
  transition: -webkit-transform 0.3s ease;
  transition: transform 0.3s ease;
  transition: transform 0.3s ease, -webkit-transform 0.3s ease;
}
.custom-gallery__item:hover {
  -webkit-transform: translateY(-5px);
          transform: translateY(-5px);
}
.custom-gallery__item:hover .custom-gallery__caption {
  opacity: 1;
}
.custom-gallery__link {
  display: block;
  text-decoration: none;
  color: inherit;
}
.custom-gallery__link:focus {
  outline: 1px solid #292929;
}
.custom-gallery__image {
  display: block;
  width: 100%;
  height: auto; /* Changed from height: 0 with padding-bottom */
  -o-object-fit: cover;
     object-fit: cover; /* Added to maintain aspect ratio */
  -webkit-transition: -webkit-transform 0.3s ease;
  transition: -webkit-transform 0.3s ease;
  transition: transform 0.3s ease;
  transition: transform 0.3s ease, -webkit-transform 0.3s ease;
  margin: 0;
}
.custom-gallery__placeholder {
  padding: 2rem;
  background: #f5f5f5;
  border: 1px dashed #ccc;
  text-align: center;
  font-style: italic;
  color: #666;
}
.custom-gallery__item.slick-slide {
  overflow: hidden;
  -webkit-transform: translateY(0);
          transform: translateY(0);
}
.custom-gallery__item.slick-slide__image:hover, .custom-gallery__item.slick-slide__image:focus {
  -webkit-transform: scale(1.1);
          transform: scale(1.1);
}
.custom-gallery .slick-arrow {
  position: absolute;
  top: 50%;
  -webkit-transform: translatey(-50%);
          transform: translatey(-50%);
  opacity: 0.5;
}
.custom-gallery .slick-arrow.slick-next {
  right: 0;
  width: 0;
  height: 0;
  border-top: 1.3rem solid transparent;
  border-bottom: 1.3rem solid transparent;
  border-left: 1.3rem solid var(--wp--preset--color--primary);
}
.custom-gallery .slick-arrow.slick-prev {
  left: 0;
  width: 0;
  height: 0;
  border-top: 1.3rem solid transparent;
  border-bottom: 1.3rem solid transparent;
  border-right: 1.3rem solid var(--wp--preset--color--primary);
}
.custom-gallery .slick-dots {
  position: relative;
  margin: var(--wp--preset--spacing--20) 0 0 0;
  left: 0;
  right: 0;
  padding: 0;
  text-align: center;
}
.custom-gallery .slick-dots li {
  display: inline-block;
  margin: 0 0.5em;
  background-color: var(--wp--preset--color--secondary);
  width: 13px;
  height: 13px;
  border-radius: 50%;
  cursor: pointer;
}
.custom-gallery .slick-dots li.slick-active {
  background-color: var(--wp--preset--color--primary);
}