/* Image captions: one consistent, readable overlay system. */
.map-pair figure,
.reference-gallery figure,
.inline-media {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--navy-950);
}

.map-pair figure,
.reference-gallery figure {
  border-radius: var(--radius-md);
}

.map-pair .image-button,
.reference-gallery .image-button,
.inline-media img {
  border-radius: inherit;
}

.map-pair figcaption,
.reference-gallery figcaption,
.inline-media figcaption,
.detail-hero-media figcaption {
  position: absolute;
  z-index: 2;
  right: 0;
  bottom: 0;
  left: 0;
  margin: 0;
  padding: clamp(3.25rem, 8vw, 5.5rem) var(--space-5) var(--space-5);
  border: 0;
  background: linear-gradient(180deg, rgb(7 23 38 / 0%) 0%, rgb(7 23 38 / 24%) 28%, rgb(7 23 38 / 92%) 100%);
  color: var(--white);
  font-size: var(--text-sm);
  line-height: 1.45;
  text-shadow: 0 1px 2px rgb(0 0 0 / 36%);
  pointer-events: none;
  backdrop-filter: none;
}

.detail-hero-media figcaption {
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.map-pair figcaption span {
  margin-bottom: var(--space-1);
  color: var(--white);
  font-weight: 700;
}

.map-pair figcaption p {
  color: var(--on-dark-muted);
}

@media (max-width: 640px) {
  .map-pair figcaption,
  .reference-gallery figcaption,
  .inline-media figcaption,
  .detail-hero-media figcaption {
    padding: 3.5rem var(--space-4) var(--space-4);
    font-size: var(--text-xs);
  }
}
