.project-gallery {
  background: #e9ede5;
  scroll-margin-top: 1rem;
}
.project-heading {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.project-heading img { border-radius: 5px; }
.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem 1.15rem;
}
.project-photo a { display: block; border-radius: 5px; cursor: zoom-in; }
.project-photo img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 5px;
}
.featured-photos img { aspect-ratio: 5 / 6; }
.project-photo figcaption { margin-top: .5rem; font-weight: 600; }
.more-projects { margin-top: 1.5rem; }
.more-projects summary {
  cursor: pointer;
  color: #244036;
  width: fit-content;
  padding: .65rem 1rem;
  border: 1px solid #899888;
  border-radius: 5px;
  font-weight: 600;
}
.more-projects summary:focus-visible { outline: 3px solid #b97c18; outline-offset: 3px; }
.more-projects .when-open, .more-projects[open] .when-closed { display: none; }
.more-projects[open] .when-open { display: inline; }
.project-group { margin-top: 2rem; }
.project-group h3 {
  font: 400 clamp(1.5rem, 2.5vw, 2.1rem)/1.2 var(--serif);
  margin-bottom: 1rem;
}
.project-viewer {
  width: min(60rem, 96vw);
  max-height: 96vh;
  max-height: 96dvh;
  padding: .75rem 1rem;
  border: none;
  border-radius: 8px;
  background: #122019;
  color: white;
}
.project-viewer::backdrop { background: rgb(12 19 16 / 88%); }
.project-viewer figure img {
  display: block;
  width: 100%;
  height: min(65vh, 52rem);
  height: min(65dvh, 52rem);
  object-fit: contain;
}
.project-viewer figcaption { text-align: center; margin: .4rem auto; }
.viewer-controls, .viewer-buttons {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
}
.viewer-controls { margin-bottom: .5rem; }
.project-viewer button {
  min-height: 44px;
  padding: .45rem 1rem;
  border: 1px solid #839183;
  border-radius: 5px;
  color: white;
  background: transparent;
}
@media (max-width: 700px) {
  .photo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem .75rem; }
  .featured-photos figure:first-child { grid-column: 1 / -1; }
  .featured-photos figure:first-child img { aspect-ratio: 4 / 3; object-position: 50% 39%; }
  .project-heading img { width: 48px; height: 48px; }
  .project-photo figcaption { line-height: 1.4; }
}
