.reference-gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.15rem;
}

.reference-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
  color: var(--text, #232323);
  text-align: left;
  background: #fff;
  border: 1px solid var(--border, #ded8ce);
  border-radius: 14px;
  cursor: pointer;
  box-shadow: 0 3px 9px rgba(31, 35, 40, .025);
  transition: transform .2s ease, box-shadow .2s ease;
}

.reference-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow, 0 14px 35px rgba(31, 35, 40, .08));
}

.reference-card:focus-visible {
  outline: 3px solid var(--champagne, #d6b778);
  outline-offset: 3px;
}

.reference-card-image {
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--bg-soft, #f7f5f1);
}

.reference-card-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.reference-card-copy {
  display: grid;
  gap: .22rem;
  padding: .9rem 1rem 1rem;
}

.reference-card-copy strong {
  color: var(--graphite, #1f2328);
  font-size: 1rem;
  line-height: 1.25;
}

.reference-card-copy small {
  color: var(--text-muted, #667085);
  line-height: 1.45;
}

.lightbox-visual:has(img) {
  height: auto;
  max-height: min(68vh, 680px);
  background: #15181c;
}

.lightbox-visual img {
  display: block;
  width: 100%;
  max-height: min(68vh, 680px);
  object-fit: contain;
}

@media (max-width: 960px) {
  .reference-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  .reference-gallery { grid-template-columns: 1fr; }
}
