.portfolio-galleries .gallery, .category-page .project-photos {
  position: relative;
  display: grid;
  grid-template-columns: none;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - 32px) / 3);
  gap: 16px;
  overflow-x: auto;
  padding: 5px 4px 13px;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: 4px;
  scroll-behavior: smooth;
  scrollbar-color: #b69477 #352b24;
  overscroll-behavior-inline: contain;
}
.portfolio-galleries .gallery > figure, .category-page .project-photos > figure {
  grid-column: auto;
  min-width: 0;
  scroll-snap-align: start;
}
.category-page .project-photos > figure img {
  height: clamp(180px, 27vw, 330px);
  max-height: none;
  width: 100%;
  object-fit: contain;
}
.gallery-controls {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin: 0 4px 9px;
}
.gallery-controls[hidden] { display: none; }
.gallery-controls button {
  border: 1px solid #b69477;
  border-radius: 50%;
  background: transparent;
  color: #f2d7be;
  font: 26px/1 Georgia, serif;
  width: 44px;
  height: 44px;
  cursor: pointer;
}
.gallery-controls button:hover:not(:disabled) { background: #71533e; }
.gallery-controls button:disabled { opacity: .38; cursor: default; }
.gallery-controls button:focus-visible, .project-photos:focus-visible, .gallery:focus-visible {
  outline: 2px solid #f2d7be;
  outline-offset: 2px;
}
@media (max-width: 760px) {
  .portfolio-galleries .gallery, .category-page .project-photos {
    grid-auto-columns: 44%;
  }
}
@media (prefers-reduced-motion: reduce) {
  .portfolio-galleries .gallery, .category-page .project-photos { scroll-behavior: auto; }
}
