/* The catalogue keeps the full frame at 1×. The image's own box follows its
   measured aspect ratio, magnification and pan, including inside letterboxing. */
#theater[data-project=meridian] #project-footer {
  --footer-ink:#f2f2f2;
  --footer-label:#c6c6c6;
  --entry-metal:#999;
}
#theater[data-project=meridian] #plate-open {--entry-metal:#999}
#demo-room[data-project=meridian] {--toolbar-ink:#e6e6e6}
#works #project-list .exhibit-pick[data-pick=meridian] {
  background:linear-gradient(120deg,#202020,#101010 68%);
  color:#e8e8e8;
}
#works #project-list [data-pick=meridian][aria-current] {
  border-color:#969696;
  box-shadow:inset 0 -2px #aaa;
}
:is(#theater #stage .mde-room,html[data-ver-cursor=meridian]) .md-galaxies {
  --md-field: #000;
  --obs-body: #000;
  --sf-night: #000;
  background: #000;
  border: 0;
  box-shadow: none;
}
:is(#theater #stage .mde-room,html[data-ver-cursor=meridian]) .md-galaxies :is(.md-panel,.md-titles,.fde-observations,.md-proof-line,.md-rights) {
  background: transparent;
  border: 0;
  box-shadow: none;
}
:is(#theater #stage .mde-room,html[data-ver-cursor=meridian]) .md-galaxies .md-image {
  background: #000;
  border: 0;
  box-shadow: none;
  mask-image: none;
}

:is(#theater #stage .mde-room,html[data-ver-cursor=meridian]) .md-galaxies .md-image .md-photograph {
  opacity: 1;
  filter: none;
  mask-image: none;
}

/* Zoom and pan update the geometric properties together, including when an
   exhibition-wide reduced-motion rule sets a tiny duration on every element. */
:is(#theater #stage .mde-room,html[data-ver-cursor=meridian]) .md-galaxies .md-image .md-photograph,
:is(#theater #stage .mde-room,html[data-ver-cursor=meridian]) .md-galaxies .md-image::after,
:is(#theater #stage .mde-room,html[data-ver-cursor=meridian]) .md-galaxies .md-image::before {
  transition-property: none !important;
}

/* This overlay uses the exact same measured edges as the photographic element.
   Keeping it on a separate plane preserves the browser's original image sampler. */
:is(#theater #stage .mde-room,html[data-ver-cursor=meridian]) .md-galaxies .md-image::after {
  --photo-x: clamp(14px,9%,80px);
  --photo-y: clamp(12px,10%,65px);
  content: "";
  position: absolute;
  z-index: 1;
  inset: auto;
  left: 0;
  top: 0;
  transform: translate3d(var(--md-photo-x,0px),var(--md-photo-y,0px),0);
  width: var(--md-photo-width,0px);
  height: var(--md-photo-height,0px);
  pointer-events: none;
  box-shadow: inset 0 0 0 1.5px #000, 0 0 0 1px #000;
  --photo-edge: #000 1px, #000e 18%, #000a 38%, #0004 64%, transparent;
  background:
    linear-gradient(to right, var(--photo-edge)) left top / var(--photo-x) 100% no-repeat,
    linear-gradient(to left, var(--photo-edge)) right top / var(--photo-x) 100% no-repeat,
    linear-gradient(to bottom, var(--photo-edge)) left top / 100% var(--photo-y) no-repeat,
    linear-gradient(to top, var(--photo-edge)) left bottom / 100% var(--photo-y) no-repeat;
}
/* In a magnified view, a moving edge can be outside the fixed field. Only the
   rim of that field rolls into black; its center remains fully transparent. */
:is(#theater #stage .mde-room,html[data-ver-cursor=meridian]) .md-galaxies .md-image[data-zoomed=true]::before {
  --rim-x: clamp(11px,6.6%,64px);
  --rim-y: clamp(10px,7.4%,49px);
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  box-shadow: inset 0 0 0 1.5px #000;
  --rim-edge: #000 1px, #000e 19%, #0009 44%, #0003 73%, transparent;
  background:
    linear-gradient(to right, var(--rim-edge)) left top / var(--rim-x) 100% no-repeat,
    linear-gradient(to left, var(--rim-edge)) right top / var(--rim-x) 100% no-repeat,
    linear-gradient(to bottom, var(--rim-edge)) left top / 100% var(--rim-y) no-repeat,
    linear-gradient(to top, var(--rim-edge)) left bottom / 100% var(--rim-y) no-repeat;
}
:is(#theater #stage .mde-room,html[data-ver-cursor=meridian]) .md-galaxies .md-image:focus-visible {
  outline: none;
}
:is(#theater #stage .mde-room,html[data-ver-cursor=meridian]) .md-galaxies .md-image:focus-visible::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  border: 0;
  pointer-events: none;
  outline: 2px solid #dadada;
  outline-offset: -5px;
}
:is(#theater #stage .mde-room,html[data-ver-cursor=meridian]) .md-galaxies .md-original[open] {
  background: #000;
  border:1px solid #575757;
  border-radius:8px;
  box-shadow:0 12px 60px #000;
  color:#eee;
}
.md-galaxies .md-original::backdrop {background:rgb(0 0 0 / .92)}
:is(#theater #stage .mde-room,html[data-ver-cursor=meridian]) .md-original .md-original-layout {
  padding:0;
  background:#000;
}
:is(#theater #stage .mde-room,html[data-ver-cursor=meridian]) .md-original-layout header {
  padding:4px clamp(10px,1.5vw,20px);
  background:#151515;
  border-bottom:1px solid #363636;
  color:#f2f2f2;
}
:is(#theater #stage .mde-room,html[data-ver-cursor=meridian]) .md-original-layout img {
  background:#000;
}
:is(#theater #stage .mde-room,html[data-ver-cursor=meridian]) .md-original-layout p {
  padding:8px clamp(10px,1.5vw,20px);
  background:#101010;
  color:#ccc;
}
/* Source references sit with their captions as text. */
.md-galaxies .fde-observe-copy a::after {
  content: "";
  display: inline-block;
  flex: none;
  width: 14px;
  height: 14px;
  margin-inline: 5px 2px;
  rotate: none;
  background: url("nav-external.svg") center / contain no-repeat;
}
@media (prefers-reduced-motion: no-preference) {
  html:not([data-studio-motion=off]) .md-galaxies .fde-observe-copy a::after {transition: translate .28s ease-out;}
  html:not([data-studio-motion=off]) .md-galaxies .fde-observe-copy a:is(:hover,:focus-visible)::after {translate: 2px -2px;}
}
@media (forced-colors: active) {
  .md-galaxies .fde-observe-copy a::after {
    background: LinkText;
    mask: url("nav-external.svg") center / contain no-repeat;
    forced-color-adjust: none;
  }
}
:is(#theater #stage .mde-room,html[data-ver-cursor=meridian]) .md-galaxies :is(.md-rights,.fde-observe-copy) a {
  padding-inline: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: #c8c8c8;
  text-decoration: underline;
  text-decoration-color: #777;
  text-underline-offset: .17em;
}
:is(#theater #stage .mde-room,html[data-ver-cursor=meridian]) .md-galaxies :is(.md-rights,.fde-observe-copy) a:is(:hover,:focus-visible) {
  color: #fff;
  text-decoration-color: currentColor;
}
@media (forced-colors: active) {
  :is(#theater #stage .mde-room,html[data-ver-cursor=meridian]) .md-galaxies .md-image:focus-visible::before { outline: 2px solid Highlight; }
}
