/* Project imagery is editorially contained so no architectural information is lost. */
.dialog-image-wrap {
  height: auto;
  min-height: 220px;
  max-height: 72vh;
  display: grid;
  place-items: center;
  padding: clamp(.75rem, 2vw, 1.5rem);
  background: var(--paper);
}

.dialog-image-wrap img {
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: calc(72vh - 3rem);
  object-fit: contain;
}

.detail-gallery {
  align-items: stretch;
  grid-auto-rows: clamp(250px, 27vw, 420px);
}

/* Every gallery cell follows one exact format. Photographs are cropped only
   within their own frame, keeping the project pages visually ordered. */
.detail-gallery figure {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  height: 100%;
  min-height: 0;
  aspect-ratio: auto;
  overflow: hidden;
  background: var(--paper);
}

.detail-gallery img {
  width: 100%;
  height: 100%;
  min-height: 0;
  aspect-ratio: auto;
  object-fit: cover;
  background: var(--paper);
  padding: 0;
}

.social-links {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.social-link {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  color: inherit;
  font-size: 1rem;
  letter-spacing: .03em;
  text-decoration: none;
}

.social-link:hover,
.social-link:focus-visible { opacity: .65; }

.social-icon {
  width: 1.15rem;
  height: 1.15rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
}

@media (max-width: 760px) {
  .dialog-image-wrap { min-height: 160px; max-height: 58vh; }
  .dialog-image-wrap img { max-height: calc(58vh - 2rem); }
  .detail-gallery { grid-auto-rows: clamp(220px, 68vw, 340px); }
  .social-links { gap: 1rem; flex-wrap: wrap; }
}
