.project-filter-bar {
  grid-template-columns: auto minmax(0, 1fr) minmax(190px, 240px) auto;
  gap: 18px 24px;
}

.project-type-filter {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.project-type-filter legend,
.project-location-filter > span {
  margin-bottom: 7px;
  color: var(--ink);
  font-size: 11px;
  font-weight: 700;
}

.project-type-filter > div {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.project-type-filter button {
  min-width: 0;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid #c8c0b5;
  background: #fbfaf7;
  color: var(--ink);
  font-size: 10px;
  letter-spacing: 0.8px;
}

.project-type-filter button.is-active {
  border-color: var(--charcoal);
  background: var(--charcoal);
  color: #fff;
}

.project-filter-bar .project-filter-reset {
  align-self: end;
}

.project-filter-reset-label {
  display: none;
}

@media (max-width: 1180px) {
  .project-filter-bar {
    grid-template-columns: minmax(0, 1fr) minmax(190px, 240px) auto;
  }

  .project-filter-title {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .project-filter-bar {
    grid-template-areas:
      "title reset"
      "type type"
      "location location";
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 22px 16px;
    padding-top: 24px;
    padding-bottom: 26px;
  }

  .project-filter-title {
    grid-area: title;
    align-self: center;
    margin: 0;
  }

  .project-type-filter {
    grid-area: type;
  }

  .project-type-filter > div {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .project-type-filter button {
    justify-self: stretch;
    width: 100%;
    min-height: 50px;
    padding: 9px 12px;
    line-height: 1.25;
  }

  .project-type-filter button:first-child {
    grid-column: 1 / -1;
  }

  .project-location-filter {
    grid-area: location;
    min-width: 0;
  }

  .project-filter-bar .project-filter-reset {
    grid-area: reset;
    align-self: center;
    justify-self: end;
    width: auto;
    min-width: 0;
    height: auto;
    min-height: 44px;
    padding: 0 2px 0 10px;
    border: 0;
    gap: 7px;
    display: inline-flex;
  }

  .project-filter-reset-icon {
    order: 2;
    font-size: 20px;
    line-height: 1;
  }

  .project-filter-reset-label {
    display: inline;
    font-size: 11px;
    letter-spacing: 1px;
  }

  .project-filter-bar select {
    min-height: 52px;
  }
}

.project-directory-card .project-directory-image {
  aspect-ratio: 3 / 2 !important;
  height: auto !important;
}

.project-testimonial img.project-image-contained {
  object-fit: contain;
  object-position: center;
  background: #ecebea;
}

.project-case-study .project-carousel-main {
  aspect-ratio: 16 / 9 !important;
  height: auto !important;
  min-height: 0;
  overflow: hidden;
}

.project-carousel-main > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.project-case-study .project-carousel-thumbs button,
.project-case-study .project-gallery-grid button {
  aspect-ratio: 4 / 3 !important;
  height: auto !important;
  overflow: hidden;
}

.project-carousel-thumbs button > img,
.project-gallery-grid button > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.projects-mind .button {
  position: relative;
  z-index: 1;
  pointer-events: auto;
}

.project-lightbox {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 12px;
  place-items: stretch;
  width: 100vw;
  height: 100dvh;
  padding: clamp(68px, 8vh, 88px) clamp(72px, 7vw, 120px) 20px;
  overflow: hidden;
  overscroll-behavior: contain;
  touch-action: pan-y;
}

body.gallery-is-open .mobile-nav-toggle {
  display: none;
}

.project-lightbox .lightbox-stage {
  display: flex;
  grid-column: 1;
  grid-row: 1;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.project-lightbox .lightbox-stage img {
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 100%;
  object-fit: contain;
  object-position: center;
  margin: auto;
}

.project-lightbox .lightbox-close,
.project-lightbox .lightbox-prev,
.project-lightbox .lightbox-next {
  z-index: 10;
  position: fixed;
  display: grid;
  place-items: center;
  opacity: 1;
  visibility: visible;
  color: #fff;
  background: rgba(12, 13, 12, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.72);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.28);
}

.project-lightbox .lightbox-close {
  top: max(12px, calc(env(safe-area-inset-top, 0px) + 8px));
  right: max(14px, calc(env(safe-area-inset-right, 0px) + 14px));
  width: 48px;
  min-width: 48px;
  height: 48px;
  min-height: 48px;
}

.project-lightbox .lightbox-prev {
  top: 50%;
  left: clamp(12px, 2.5vw, 40px);
  transform: translateY(-50%);
}

.project-lightbox .lightbox-next {
  top: 50%;
  right: clamp(12px, 2.5vw, 40px);
  transform: translateY(-50%);
}

.project-lightbox > p {
  grid-column: 1;
  grid-row: 2;
  justify-self: center;
}

.project-directory-image > img,
.project-directory-image > picture,
.project-directory-image > picture > img {
  width: 100%;
  height: 100%;
}

.project-directory-image > img,
.project-directory-image > picture > img {
  aspect-ratio: auto;
  object-fit: cover;
}

.project-case-study .related-project-image {
  aspect-ratio: 3 / 2 !important;
  height: auto !important;
}

.related-project-image > img,
.related-project-image > picture,
.related-project-image > picture > img {
  width: 100%;
  height: 100%;
}

.related-project-image > img,
.related-project-image > picture > img {
  object-fit: cover;
}

@media (max-width: 680px) {
  .project-lightbox {
    padding: 62px 48px 18px;
  }

  .project-lightbox .lightbox-prev {
    left: 8px;
  }

  .project-lightbox .lightbox-next {
    right: 8px;
  }
}
