.photo-installation {
  --installation-tile: clamp(7.875rem, calc(7.625rem + .833vw), 8.375rem);
  inline-size: calc(100% + 2 * var(--gutter));
  margin-inline: calc(-1 * var(--gutter));
  background: #fff;
}

.photo-installation.is-interactive {
  position: absolute;
  inset: 0 auto auto 0;
  inline-size: 0;
  block-size: 0;
  margin: 0;
  pointer-events: none;
}

html.photo-installation-locked {
  overflow: hidden;
  overscroll-behavior: none;
  scrollbar-gutter: stable;
}

/* Preserve the document's scroll position while the rail moves out of flow. */
html.photo-installation-active body::before {
  display: block;
  block-size: var(--photo-installation-rail-height);
  content: '';
}

html.photo-installation-active .rail {
  position: fixed;
  inset: 0 0 auto;
  background: transparent;
  color: #fff;
  mix-blend-mode: difference;
  pointer-events: none;
}

html.photo-installation-active .rail :is(a, button) {
  color: inherit;
  pointer-events: auto;
}

html.photo-installation-active .rail .identity:hover { text-decoration: none; }

html.photo-installation-active .rail[data-menu-ready] > nav {
  background: transparent;
  color: inherit;
}

html.photo-installation-active .rail .menu-toggle[aria-expanded="true"] + nav { pointer-events: auto; }

html.photo-installation-active .rail :is(a, button):focus-visible { outline-color: #fff; }

/* Invert the photo and the real rail lettering together inside the moving bar. */
html.photo-installation-active .navigation-indicator {
  background: #fff;
  color: transparent;
  mix-blend-mode: difference;
}

.photo-installation-archive-hidden > :not(.photo-installation) { opacity: 0; }
.photo-installation-white-pause .rail { visibility: hidden; }

.photo-installation__plane {
  position: fixed;
  z-index: 1;
  inset: 0 0 auto;
  block-size: 100dvh;
  visibility: hidden;
  background: #fff;
  pointer-events: none;
}

.photo-installation.is-field-visible .photo-installation__plane { visibility: visible; }
.photo-installation.is-docked .photo-installation__plane { pointer-events: auto; }

.photo-installation[data-motion="whitePause"] .photo-installation__viewport {
  visibility: hidden;
}

.photo-installation[data-motion="revealingGallery"] .photo-installation__tile-window { clip-path: inset(100% 0 0); }

.photo-installation__viewport {
  position: absolute;
  inset: 0;
  overflow: hidden;
  scrollbar-width: none;
  overscroll-behavior: none;
  user-select: none;
}

.photo-installation__viewport::-webkit-scrollbar { display: none; }
.photo-installation.is-docked .photo-installation__viewport { overflow: auto; }

.photo-installation__viewport:focus-visible {
  outline-offset: -3px;
}

.photo-installation__viewport.is-auto-focused:focus { outline: none; }

.photo-installation__surface {
  position: relative;
  contain: strict;
}

.photo-installation__measure {
  position: absolute;
  inline-size: var(--installation-tile);
}

.photo-installation__tile {
  position: absolute;
  inset: 0 auto auto 0;
  inline-size: var(--installation-tile);
  margin: 0;
  translate: var(--photo-pointer-x, 0px) var(--photo-pointer-y, 0px);
}

.photo-installation__tile-window { display: block; }

.photo-installation__tile-window > img,
.photo-installation__still figure > img {
  display: block;
  inline-size: 100%;
  block-size: auto;
  aspect-ratio: 1;
  object-fit: cover;
}

.photo-installation__tile-window > img { pointer-events: none; }

.photo-installation figcaption {
  position: absolute;
  inset: auto 0 calc(100% + .375rem);
  overflow: hidden;
  font-size: .6875rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.photo-installation__still {
  display: grid;
  grid-template-columns: repeat(auto-fit, var(--installation-tile));
  justify-content: space-around;
  gap: var(--installation-tile) calc(var(--installation-tile) * .55);
  padding: calc(var(--installation-tile) * .65) calc(var(--installation-tile) * .2);
}

.photo-installation__still > figure {
  position: relative;
  align-self: start;
  margin: 0;
}

.photo-installation__still > figure:nth-child(even) {
  margin-block-start: calc(var(--installation-tile) * .4);
}

.photo-installation__instructions {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (hover: hover) and (pointer: fine) {
  .photo-installation.is-docked .photo-installation__viewport { cursor: grab; }
  .photo-installation.is-docked .photo-installation__viewport.is-dragging { cursor: grabbing; }
}

@media (prefers-reduced-motion: no-preference) {
  .photo-installation__tile-window > img {
    transition: transform 300ms cubic-bezier(.33, 0, 0, 1);
  }
  .photo-installation[data-motion="immersive"] .photo-installation__tile.is-hovered img {
    transform: scale(1.08);
  }
  .photo-installation__tile.is-hovered { z-index: 1; }
}

@media (max-width: 47.999rem) {
  .photo-installation {
    --installation-tile: clamp(4.75rem, calc(2.875rem + 10.256vw), 7rem);
  }
}

@media (min-width: 90rem) {
  .photo-installation {
    --installation-tile: clamp(8.375rem, calc(6.9rem + 1.638vw), 10rem);
  }
}
