.rm-gallery.rg-gallery {
  position: relative;
  display: block;
  width: 100%;
  overflow: hidden;
  isolation: isolate;
  aspect-ratio: auto;
  background: transparent;
}
.rg-gallery .rm-tile {
  position: absolute;
  z-index: 1;
  display: block;
  margin: 0;
  padding: 0;
  min-width: 0;
  min-height: 0;
  border: 0;
  border-radius: 0;
  overflow: hidden;
  background: transparent;
  cursor: pointer;
}
/* Each photo is a rounded chip: half a pixel is cut from every side, which leaves 1px between photos. */
.rg-gallery .rm-tile,
.rg-underlay img { clip-path: inset(.5px round 6px); }
.rg-gallery .rm-tile.is-open { z-index: 3; clip-path: inset(.5px round 14px); }
.rg-gallery .rm-tile img,
.rg-underlay img {
  display: block;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  object-fit: cover;
  object-position: center;
  transition: filter 280ms ease;
}
/* The opened photo has no frame; the photos around it step back. */
.rg-gallery.rg-open .rm-tile:not(.is-open) img,
.rg-gallery.rg-open .rg-underlay img { filter: brightness(.38); }
.rg-gallery .rm-tile.is-open img { filter: none; }
/* A small photo under the pointer turns lime, the colour of the play buttons (owner, 2026-11-13). */
/* .rg-pointer is set while a mouse or pen is over the wall, so a tapped photo does not stay lime. */
.rg-gallery.rg-pointer .rm-tile:not(.is-open):hover img { filter: grayscale(1) brightness(1.2); }
.rg-gallery.rg-pointer .rm-tile:not(.is-open):hover::after { content: ''; position: absolute; inset: 0; background: var(--lime); mix-blend-mode: multiply; pointer-events: none; }
.rg-gallery .rm-tile[data-visible='false'] { pointer-events: none; }
.rg-gallery .rm-tile:focus-visible {
  z-index: 4;
  outline: 3px solid var(--lime);
  outline-offset: -3px;
}
.rg-underlay {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: grid;
  gap: 0;
  pointer-events: none;
}
.rg-underlay[hidden] { display: none; }
@media (max-width: 600px) {
  .rg-gallery .rm-tile,
  .rg-underlay img { clip-path: inset(.5px round 4px); }
  .rg-gallery .rm-tile.is-open { clip-path: inset(.5px round 10px); }
}
@media (prefers-reduced-motion: reduce) {
  .rg-gallery .rm-tile img, .rg-underlay img { transition: none; }
}
