/* Product screenshots keep their native proportions in both the directory and the detail view. */
.project-gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1.25rem, 3vw, 2.75rem);
  align-items: start;
}
.project-gallery-section h2 { margin-block: 0 clamp(1.3rem, 3vw, 2.25rem); }
.project-gallery-grid h3 { font-size: clamp(1rem, 1.5vw, 1.3rem); margin: 0 0 .7rem; }
.project-gallery-grid p { margin: 0 0 1rem; }
.project-gallery-grid > * { min-width: 0; }
.project-gallery-grid > figure:only-child { grid-column: 1 / -1; }
#main .project-gallery-grid .project-screenshot { margin: 0; }
#main .project-gallery-grid .project-screenshot img { display: block; width: 100%; height: auto; max-height: none; }
.project-gallery-grid.gallery-count-1 { grid-template-columns: minmax(0, 1fr); }
.gallery-landscape.gallery-count-5 .gallery-shot:first-child { grid-column: 1 / -1; }
.project-gallery-grid.gallery-portrait {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr));
}
.project-gallery-grid.gallery-portrait.gallery-count-2 {
  max-width: 760px;
}
#main .gallery-portrait .project-screenshot,
#main .gallery-scorecard .screenshot-link {
  max-width: 310px;
  margin-inline: auto;
}
#main .gallery-scorecard img { width: 100%; height: auto; max-height: none; }
#main .catalog-entry-visual.gallery-catalog {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: clamp(5px, .8vw, 12px);
  aspect-ratio: auto;
  margin: 0;
}
#main .gallery-catalog .screenshot-link { height: auto; min-width: 0; }
#main .gallery-catalog img { width: 100%; height: auto; object-fit: contain; }
#main .gallery-catalog.gallery-phones {
  padding-inline: clamp(12px, 2vw, 22px);
  padding-bottom: clamp(12px, 2vw, 22px);
}
#main .gallery-phones .screenshot-link { max-width: 125px; }
@media (max-width: 680px) {
  .project-gallery-grid { grid-template-columns: minmax(0, 1fr); }
  .project-gallery-grid.gallery-portrait { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 480px) {
  .project-gallery-grid.gallery-portrait { grid-template-columns: minmax(0, 1fr); row-gap: 2.25rem; }
  #main .gallery-portrait .gallery-shot { width: min(100%, 310px); margin-inline: auto; }
}
