/* Project overview cards and responsive grid. */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px 14px;
}

.project-card {
  display: block;
  min-width: 0;
  text-align: center;
}

.project-card-image {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
}

.project-card-image img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform .25s ease;
}

.project-card-label {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 8px 10px;
  background: rgba(248, 247, 245, .94);
  color: var(--brown);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .13em;
}

.project-card:hover img,
.project-card:focus-visible img {
  transform: scale(1.015);
}

.project-card h3 {
  margin: 15px 0 0;
  min-height: 2.6em;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brown);
  font-family: var(--heading);
  font-size: 18px;
  font-weight: 500;
  line-height: 1.3;
}

.project-card:focus-visible {
  outline: 1px solid var(--brown);
  outline-offset: 5px;
}

.projects-footer {
  align-items: center;
}

/* Match the centered presentation of the homepage AI gallery. */
.project-detail .section-heading {
  justify-content: center;
  text-align: center;
}

.project-detail .gallery-thumbnails {
  justify-content: center;
}

.project-detail .gallery-footer {
  justify-content: center;
}

.project-detail .single-gallery-stage {
  position: relative;
  height: clamp(320px, 58vh, 620px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.project-detail .single-gallery-stage > img {
  width: 100%;
  height: 100%;
  margin: 0;
  object-fit: contain;
  object-position: center;
}

.project-detail .thumbnail {
  width: clamp(90px, 12vw, 140px);
  padding-bottom: 0;
}

.project-detail .thumbnail img {
  height: 68px;
}

@media (max-width: 800px) {
  .projects-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .project-detail .thumbnail img {
    height: 82px;
  }

  .project-detail .single-gallery-stage {
    height: clamp(280px, 58vh, 500px);
  }
}

@media (max-width: 440px) {
  .projects-grid {
    grid-template-columns: 1fr;
    gap: 22px;
  }

  .project-detail .single-gallery-stage {
    height: clamp(260px, 56vh, 420px);
  }

  .project-detail .thumbnail img {
    height: 72px;
  }
}
