.wl-project-gallery {
  padding-block: clamp(52px, 5.2083vw, 100px) clamp(72px, 7.2917vw, 140px);
  background: #ececec;
}

.wl-project-gallery__inner {
  width: calc(100% - var(--space-page-fluid) - var(--space-page-fluid));
  max-width: var(--container-max);
  margin-inline: auto;
}

.wl-project-gallery__title {
  position: relative;
  margin: 0 0 clamp(24px, 2.6042vw, 50px);
  padding-bottom: clamp(16px, 1.5625vw, 30px);
  font-size: clamp(24px, 1.875vw, 36px);
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: 0.06em;
}

.wl-project-gallery__title::after {
  position: absolute;
  right: calc(-1 * var(--space-page-fluid));
  bottom: 0;
  left: calc(-1 * var(--space-page-fluid));
  height: 1px;
  background: rgba(var(--color-text-rgb), 0.4);
  content: '';
}

.wl-project-gallery__grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: clamp(12px, 1.0417vw, 20px);
}

.wl-project-gallery__item {
  grid-column: span 2;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}

.wl-project-gallery__item:nth-child(7n + 1),
.wl-project-gallery__item:nth-child(7n + 2),
.wl-project-gallery__item:nth-child(7n + 6),
.wl-project-gallery__item:nth-child(7n + 7) {
  grid-column: span 3;
}

.wl-project-gallery__image {
  display: block;
  width: 100%;
  aspect-ratio: 1.65;
  object-fit: cover;
  transition: transform 300ms ease;
}

.wl-project-gallery__item:hover .wl-project-gallery__image {
  transform: scale(1.025);
}

.wl-project-gallery__item:focus-visible,
.wl-project-gallery__lightbox button:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 4px;
}

.wl-project-gallery__lightbox {
  width: min(94vw, 1440px);
  max-width: none;
  max-height: 94dvh;
  padding: 0;
  overflow: visible;
  border: 0;
  background: transparent;
}

.wl-project-gallery__lightbox::backdrop {
  background: rgba(0, 0, 0, 0.92);
}

.wl-project-gallery__lightbox-content {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 30vh;
}

.wl-project-gallery__lightbox-image {
  display: block;
  max-width: 100%;
  max-height: 88dvh;
  object-fit: contain;
}

.wl-project-gallery__lightbox button {
  position: absolute;
  z-index: 1;
  display: grid;
  width: clamp(44px, 3.125vw, 60px);
  height: clamp(44px, 3.125vw, 60px);
  place-items: center;
  padding: 0;
  border: 1px solid var(--color-on-dark);
  border-radius: 0;
  color: var(--color-on-dark);
  background: rgba(33, 40, 43, 0.65);
  cursor: pointer;
}

.wl-project-gallery__lightbox button:hover {
  background: var(--color-dark);
}

.wl-project-gallery__lightbox button svg {
  display: block;
  width: 24px;
  height: 24px;
}

.wl-project-gallery__close {
  top: 16px;
  right: 16px;
}

.wl-project-gallery__previous {
  top: 50%;
  left: 16px;
  transform: translateY(-50%);
}

.wl-project-gallery__next {
  top: 50%;
  right: 16px;
  transform: translateY(-50%);
}

@media (max-width: 767px) {
  .wl-project-gallery__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .wl-project-gallery__item,
  .wl-project-gallery__item:nth-child(7n + 1),
  .wl-project-gallery__item:nth-child(7n + 2),
  .wl-project-gallery__item:nth-child(7n + 6),
  .wl-project-gallery__item:nth-child(7n + 7) {
    grid-column: span 1;
  }

  .wl-project-gallery__item:nth-child(3n + 1) {
    grid-column: span 2;
  }

  .wl-project-gallery__lightbox button {
    width: 44px;
    height: 44px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .wl-project-gallery__image {
    transition: none;
  }
}
