.news-card-media[data-portrait] img {
  object-position: center 15%;
}

.news-card-media[data-poster] {
  background: #f2f1ec;
}

.news-card-media[data-poster] img {
  inset: 8px;
  width: calc(100% - 16px);
  height: calc(100% - 16px);
}

.news-card:focus-visible,
.record-photo:focus-visible {
  outline: 2px solid var(--green-ink);
  outline-offset: 3px;
}

.news-article-head > p,
.news-article-body > p {
  max-width: 64ch;
  line-height: 1.8;
}

.news-article-photo[data-poster] img,
.news-article-photos img {
  height: auto;
}

.news-article-photos figure:only-child {
  width: min(100%, 560px);
  margin-inline: auto;
}

.news-poster-link {
  display: block;
}

.news-poster-link > span {
  display: block;
  margin-block-start: 8px;
  color: var(--green-ink);
  text-align: end;
  text-underline-offset: 4px;
  text-decoration: underline;
  font-size: 13px;
}

.record-viewer-stage {
  touch-action: pan-y pinch-zoom;
}

@media (max-width: 580px) {
  .news-card-media[data-poster] img {
    inset: 5px;
    width: calc(100% - 10px);
    height: calc(100% - 10px);
  }

  .news-photo-caption {
    inset-inline: 4px auto;
    inset-block-end: 4px;
  }

  .record-viewer-stage img {
    max-height: 58dvh;
  }
}

/* A standing portrait and five photographs share the same outer edges. */
:is(#record-collection-companions, .secom-gallery) {
  container-type: inline-size;
}

:is(#record-collection-companions, .secom-gallery) .record-photo-grid {
  --essay-gap: clamp(10px, 1.8cqw, 22px);
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  grid-auto-rows: calc(21.5cqw + 2.75rem);
  gap: var(--essay-gap);
}

:is(#record-collection-companions, .secom-gallery) .record-photo-grid li {
  grid-column: span 2;
  min-width: 0;
}

:is(#record-collection-companions, .secom-gallery) .record-photo-grid li:first-child {
  grid-area: span 2 / span 3;
}

:is(#record-collection-companions, .secom-gallery) .record-photo-grid li:nth-child(2),
:is(#record-collection-companions, .secom-gallery) .record-photo-grid li:nth-child(3) {
  grid-column: span 3;
}

:is(#record-collection-companions, .secom-gallery) .record-photo {
  display: grid;
  grid-template-rows: minmax(0, 1fr) 2.75rem;
}

:is(#record-collection-companions, .secom-gallery) .record-photo-grid li .record-photo-frame {
  min-height: 0;
  aspect-ratio: auto;
}

:is(#record-collection-companions, .secom-gallery) .record-photo-frame img {
  object-fit: cover;
}

.secom-lead figure {
  justify-self: end;
}

.secom-activity-links {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0 clamp(12px, 2vw, 26px);
  margin-block: 16px 0;
}

.secom-activity-links .room-link {
  justify-content: space-between;
  width: 100%;
}

.secom-activities .related-pages {
  margin-top: 20px;
  padding-top: 0;
  border-top: 0;
}

@container (max-width: 620px) {
  :is(#record-collection-companions, .secom-gallery) .record-photo-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: auto;
    gap: 14px 10px;
  }

  :is(#record-collection-companions, .secom-gallery) .record-photo-grid li:nth-child(n) {
    grid-area: auto;
  }

  :is(#record-collection-companions, .secom-gallery) .record-photo-grid li:first-child {
    grid-row: span 2;
  }

  :is(#record-collection-companions, .secom-gallery) .record-photo-grid li:last-child {
    grid-column: 1 / -1;
  }

  :is(#record-collection-companions, .secom-gallery) .record-photo {
    grid-template-rows: minmax(0, 1fr) 3rem;
  }

  :is(#record-collection-companions, .secom-gallery) .record-photo-grid li:not(:first-child) .record-photo-frame {
    aspect-ratio: 3 / 2;
  }

  :is(#record-collection-companions, .secom-gallery) .record-photo-grid li:last-child .record-photo-frame {
    aspect-ratio: 16 / 9;
  }
}

@media (max-width: 780px) {
  .record-archive .record-collection:not(#record-collection-companions) .record-photo-grid li:last-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 700px) {
  .secom-lead figure { justify-self: start; }
  .secom-activity-links { grid-template-columns: 1fr; }
}

.visitor-walk-copy { grid-area: title; max-width: 33ch; }
.visitor-walk-copy p { color: var(--muted); margin-block-start: 6px; line-height: 1.6; }

.visitor-first-photos {
  display: grid;
  gap: 0 clamp(12px, 2vw, 22px);
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-block: 16px 12px;
}
.visitor-first-photos figure { margin: 0; min-width: 0; }
.visitor-first-photos img { width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; }
.visitor-first-photos figcaption a { font-size: 13px; }

.first-visit-links { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; margin-block: 1rem 1.75rem; }
.visitor-first-photos figcaption { margin: .4rem 0 1rem; }
.visitor-first-photos figcaption a { font-size: .875rem; }
