/* Project and gallery headings sit above the photographs. */
[data-mc-gallery] .mcg-copy > div:first-child:not(.mcg-controls),
.project-slide-caption, .project-gallery-copy,
.mcd-project-photo figcaption, .commercial-slide figcaption,
.mcg-photo-caption { display: none; }

[data-mc-gallery] .mcg-window {
  display: block;
  min-height: 0;
  clip-path: none;
  background: transparent;
}
main .mc-gallery[data-mc-gallery] .mcg-stage {
  aspect-ratio: auto !important;
  min-height: 0;
  max-height: none;
  background: transparent;
}
main [data-mc-gallery] .mcg-single {
  height: auto;
  max-height: none;
  aspect-ratio: auto;
  background: transparent;
}
main [data-mc-gallery] .mcg-single img {
  position: static;
  height: auto;
  width: 100%;
  max-height: 80svh;
  object-fit: contain;
  background: transparent;
}
main [data-mc-gallery] .mcg-copy {
  display: block;
  min-height: 0;
  border: 0;
  padding: .3rem .75rem;
  background: var(--brand-navy-deep);
}
[data-mc-gallery] .mcg-controls { width: 100%; gap: .25rem; }
[data-mc-gallery] .mcg-controls button { min-width: 44px; min-height: 44px; }
[data-mc-gallery] .mcg-thumbs { margin-inline: 0; padding-inline: 4px; }
.mcg-expand::after { display: none; }
.mcg-photo-gallery .mcg-photo-stage, .mcg-photo-dialog .mcg-photo-stage { padding: 0; }
.mcg-photo-gallery .mcg-photo-nav, .mcg-photo-dialog .mcg-photo-nav { padding: .25rem .75rem; }

.project-reel { display: flex; flex-direction: column; }
.project-reel-controls { order: 1; align-items: center; margin-block: .3rem 0; }
.project-reel-controls button:disabled { opacity: .4; }
.project-photo-count { margin-right: auto; font-size: .84rem; font-variant-numeric: tabular-nums; }
.project-reel .project-rail { padding-bottom: .25rem; }

.project-gallery-image, .project-slide-media, .mcd-project-photo, .commercial-slide figure,
.mcg-single, .mcg-photo-frame { position: relative; }
.mcd-photo-hit, .mcg-photo-gallery button.mcd-photo-hit {
  position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%;
  background: transparent; border: 0; border-radius: 0; padding: 0; cursor: zoom-in;
}
.mcd-photo-hit:focus-visible { outline: 3px solid var(--focus-light, white); outline-offset: -5px; }
.mcd-photo-dialog {
  position: fixed; inset: 0; margin: auto; width: 100%; max-width: none;
  height: 100%; max-height: none; padding: 0; border: 0; color: white; background: #071a28;
}
.mcd-photo-dialog[open] { display: grid; grid-template-rows: minmax(0,1fr) auto; }
.mcd-photo-dialog img { width: 100%; height: 100%; object-fit: contain; }
.mcd-photo-dialog footer {
  display: flex; align-items: center; gap: .5rem;
  padding: .4rem max(12px,env(safe-area-inset-right)) max(.4rem,env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left));
}
.mcd-photo-dialog button { min-height: 44px; min-width: 44px; padding: .45rem .75rem; background: transparent; color: white; border: 1px solid #75909d; border-radius: 6px; }
html:has(.mcd-photo-dialog[open]) { overflow: hidden; }

@media (max-width: 700px) {
  main :is(.mc-gallery, .project-gallery-grid, .mcd-project-photo-grid, .commercial-slider) {
    width: 100vw; max-width: none; margin-inline: calc(50% - 50vw);
  }
  [data-mc-gallery] .mcg-thumbs { padding-inline: .5rem; }
  main .mcg-photo-gallery .mcg-photo-view, main .mcd-project-photo { border-radius: 0; }
  main .project-rail { padding-inline: 0; scroll-padding-inline: 0; }
  main .project-slide { flex-basis: 100%; min-width: 0; }
  main .project-reel-controls { margin-inline: .75rem; }
  main :is(.project-slide-media, .project-gallery-image) { aspect-ratio: auto; clip-path: none; }
  main :is(.project-slide-media, .project-gallery-image, .mcd-project-photo, .commercial-slide) img {
    position: relative; width: 100%; height: auto; max-height: 80svh; aspect-ratio: auto; object-fit: contain;
  }
  main .commercial-photo-pair { grid-template-columns: 1fr; }
}
.mcd-photo-dialog img { touch-action: pan-y pinch-zoom; }
