.site-photo-frame {
  position: relative;
  container-type: inline-size;
  isolation: isolate;
  width: 100%;
  min-width: 0;
  overflow: hidden;
}

.site-photo-frame > picture,
.site-photo-frame > picture > img { display: block; }
.site-photo-frame > img { display: block; width: 100%; height: auto; }

.site-photo-brand {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  grid-template: minmax(0, 1fr) auto / minmax(0, 1fr) max-content;
  gap: 0 clamp(5px, 2cqi, 24px);
  align-items: end;
  padding: 4cqi;
  background:
    linear-gradient(0deg, rgb(9 15 20 / 94%), rgb(9 15 20 / 72%) 15%, rgb(9 15 20 / 24%) 37%, transparent 61%),
    radial-gradient(ellipse at top right, rgb(12 21 28 / 76%), transparent 47%);
  color: #fff;
  font-family: Roboto, system-ui, sans-serif;
  font-size: clamp(6px, 1.042cqi, 12.5px);
  font-weight: 545;
  line-height: 1.15;
  letter-spacing: .015em;
  pointer-events: none;
}

.site-photo-brand__title {
  grid-area: 2 / 1;
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-photo-brand__credit {
  grid-area: 2 / 2;
  text-align: right;
  white-space: nowrap;
}

.site-photo-brand__mark {
  position: relative;
  grid-area: 1 / 2;
  align-self: start;
  height: 0;
}

.site-photo-frame .site-photo-brand .site-photo-brand__mark img {
  position: absolute;
  top: 0;
  left: 0;
  display: block;
  width: 108%;
  max-width: none;
  height: auto;
  max-height: none;
  aspect-ratio: 1;
  margin: 0;
  border: 0;
  border-radius: 0;
  object-fit: contain;
  transform: translate(-3.7%, -3.7%);
}

/* Keep photo credits outside the image and its branding. */
.editorial-photo > .media-disclosure,
.p-guide-card-media > .media-disclosure {
  position: static;
}

.service-card-media:has(.site-photo-frame) { height: auto; }
.service-card-media .site-photo-frame { height: 210px; }
.p-guide-card-media:has(> .site-photo-frame) { aspect-ratio: auto; }
.p-guide-card-media > .site-photo-frame { aspect-ratio: 8 / 5; }
.p-guide-card-media > .media-disclosure { width: auto; max-width: none; }

:is(.resource-card-media, .resource-related-media):has(> .editorial-photo) { aspect-ratio: auto; }
:is(.resource-card-media, .resource-related-media) .site-photo-frame { aspect-ratio: 3 / 2; }
:is(.editorial-evidence-photo, .learning-lab-photo) > .site-photo-frame { border-radius: 10px; }

:is(.service-card-media, .p-guide-card-media, .resource-card-media, .resource-related-media)
.site-photo-frame > picture { height: 100%; }
