.ffs-gallery {
  width: 100%;
  padding: 60px 0px;
}

.ffs-gallery-grid {
  column-count: 4;
  column-gap: 20px;
}

.ffs-gallery-item {
  display: block;
  width: 100%;
  margin: 0 0 20px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
  overflow: hidden;
  border-radius: 12px;
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
  box-shadow: none;
  text-align: left;
}
.ffs-gallery-item:focus {
  outline-width: 0px;
  outline-style: solid;
}

.ffs-gallery-item img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: inherit;
  transition: transform 0.35s ease;
}

.ffs-gallery-item:hover img,
.ffs-gallery-item:focus-visible img {
  transform: scale(1.025);
}

.ffs-gallery-item:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 4px;
}

.ffs-gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
}

.ffs-gallery-lightbox[hidden] {
  display: none;
}

.ffs-gallery-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  cursor: zoom-out;
}

.ffs-gallery-lightbox-inner {
  position: relative;
  z-index: 2;
  max-width: min(94vw, 1500px);
  max-height: 92vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ffs-gallery-lightbox-inner img {
  display: block;
  max-width: 94vw;
  max-height: 92vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 4px;
}

.ffs-gallery-lightbox-close {
  position: absolute;
  top: 18px;
  right: 22px;
  z-index: 3;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  color: #111;
  font-size: 34px;
  line-height: 42px;
  text-align: center;
  cursor: pointer;
}

.ffs-gallery-lightbox-close:hover {
  background: #fff;
}

body.ffs-gallery-lightbox-open {
  overflow: hidden;
}

.ffs-gallery-empty-frontend {
  margin: 0;
}

@media (max-width: 1199px) {
  .ffs-gallery-grid {
    column-count: 3;
  }
}

@media (max-width: 767px) {
  .ffs-gallery-grid {
    column-count: 2;
    column-gap: 12px;
  }

  .ffs-gallery-item {
    margin-bottom: 12px;
    border-radius: 10px;
  }

  .ffs-gallery-lightbox {
    padding: 18px;
  }

  .ffs-gallery-lightbox-inner img {
    max-width: 92vw;
    max-height: 88vh;
  }

  .ffs-gallery-lightbox-close {
    top: 10px;
    right: 10px;
    width: 42px;
    height: 42px;
    font-size: 30px;
    line-height: 38px;
  }
}
