/* A full portrait in the document flow. Its height follows its width as on paper. */
.building-preview {
  --cover-inset: min(6vw, 67.2px);
  --masthead-top: 40px;
  isolation: isolate;
  position: relative;
}
.building-preview .page { padding-inline: var(--cover-inset); }
.building-preview .site-frame { display: block; }
.building-preview #main-content, .building-preview :is(h1, h2, h3)[id] {
  scroll-margin-top: 5rem;
}
/* A zero-width float reserves the portrait's full height. The title and
   sticky navigation flow over it; clearing the float starts the mission. */
.building-image-layer {
  float: left;
  width: 100%;
  margin-right: -100%;
  position: relative;
  z-index: -1;
  pointer-events: none;
}
.building-descent { clear: both; }
.building-opening { width: min(100%, 1120px); margin-inline: auto; container-type: inline-size; }
.building-descent + .page {
  position: relative;
  margin-top: max(-110px, -8vw);
  padding-top: 0;
}
.building-cover,
.building-paper .building-portrait {
  width: min(100%, 1120px);
  margin-inline: auto;
}
.building-cover {
  position: relative;
  container-type: inline-size;
}
.building-portrait {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 4;
}
.building-cover > .building-portrait {
  /* Reinforce the scan's ink while keeping its paper transparent. */
  filter: brightness(0) drop-shadow(0 0 0 rgb(0 0 0 / 42%));
  mask-image: linear-gradient(to bottom, black 0% 77%, rgb(0 0 0 / 42%) 88%, rgb(0 0 0 / 6%) 94%, transparent 97%);
}
.building-cover__type {
  position: relative;
  padding-top: var(--masthead-top);
  margin-inline: var(--cover-inset);
}
.building-university {
  font-family: var(--wordmark-font);
  margin: 0 0 .65em;
  font-size: clamp(14px, 2.2cqw, 25px);
  line-height: 1.2;
  letter-spacing: .018em;
}
.building-mark { margin: 0 0 0 -.05em; color: var(--ink); }
.building-title {
  margin: .3em 0 0;
  font: 400 clamp(21px, 4.45cqw, 50px)/1.07 var(--serif);
  letter-spacing: -.035em;
}
.building-paper {
  position: absolute;
  inset: 0;
  overflow: hidden;
  /* On short pages, fade the image before the page boundary. */
  mask-image: linear-gradient(to bottom, black 0% 82%, transparent 100%);
  z-index: -1;
  pointer-events: none;
}
.building-paper .building-portrait {
  opacity: .10;
  mask-image: linear-gradient(to bottom, black 0% 56%, transparent 96%);
}
/* The menu sits on the cover's text axis and sticks to the viewport as the photograph scrolls. */
.building-menu {
  position: sticky;
  top: 0;
  z-index: 3;
  max-width: 1120px;
  margin: 14px auto 0;
  padding-inline: var(--cover-inset);
  pointer-events: none;
}
.building-menu .section-nav {
  pointer-events: auto;
  width: fit-content;
  max-width: 100%;
  margin-left: -8px;
  padding: 2px 0;
  border-radius: 5px;
  background: var(--background);
  background: color-mix(in srgb, var(--background) 94%, transparent);
}
.building-menu .section-nav > ul {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.building-menu .nav-item--research { display: list-item; }
.building-menu .section-nav a {
  padding: 2px 7px;
  text-align: left;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.25;
  letter-spacing: -.015em;
}

@media screen and (min-width: 821px) {
  /* Lift the portrait past the scan's transparent top margin (188 / 1518). */
  .building-image-layer,
  .building-paper .building-portrait { margin-top: max(-12.38vw, -138.7px); }
  /* Leave a column beside the article for the floating menu. */
  .building-preview .site-frame { padding-inline-start: 9rem; }
  .building-inner + .building-menu { height: 0; }
}
/* Keep the balcony below Contact as the portrait scales down on narrow phones. */
@media screen and (max-width: 820px) {
  .building-image-layer,
  .building-paper .building-portrait { margin-top: max(8px, calc(379px - 89vw)); }
  .building-menu .section-nav {
    background: transparent;
  }
  /* An outline keeps individual letters legible where they cross the scan. */
  .building-menu .nav-label {
    text-shadow: -1px 0 1px var(--background), 1px 0 1px var(--background),
                 0 -1px 1px var(--background), 0 1px 1px var(--background);
  }
}
@media (max-width: 820px), (max-height: 400px) {
  .building-menu { position: relative; }
}
@media (max-width: 359px) {
  .building-descent + .page { margin-top: 0; }
}
@media screen and (max-width: 362px) {
  /* Leave space between the end of the first line and the top balcony. */
  .building-title { font-size: 5.8cqw; }
}
.building-areas { max-width: 760px; margin-bottom: 16px; font: 500 14px/1.45 var(--wordmark-font); }
.building-areas summary { cursor: pointer; width: fit-content; }
.building-areas ul { display: flex; flex-wrap: wrap; gap: 8px 18px; padding: 0; margin: 10px 0; list-style: none; }
.building-areas a[aria-current="page"] { font-weight: 700; }
@media (max-width: 600px) {
  .building-preview { --masthead-top: 28px; }
  .building-paper .building-portrait { opacity: .08; }
}
@media print {
  .building-descent + .page { margin-top: 0; }
  .building-cover { max-width: 40ch; }
  .building-image-layer { float: none; width: 100%; margin: 0; }
  .building-menu, .building-areas, .building-paper { display: none; }
}
