/* the gallery page: share.css's greyscale, a square grid of thumbnails, a full-screen lightbox; no colour but errors */
#gallery-page { max-width: 1200px; }
.grid { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 4px;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
@media (min-width: 700px) { .grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); } }
.grid li { margin: 0; }
.tile { display: block; position: relative; width: 100%; aspect-ratio: 1; padding: 0; border: 0; border-radius: 4px;
  overflow: hidden; background: var(--soft); color: var(--muted); }
.tile img { display: block; width: 100%; height: 100%; object-fit: cover; }
.tile .label { position: absolute; left: 0; right: 0; bottom: 0; padding: 4px 6px; font-size: 12px; text-align: left;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.tile .play { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 32px; }
.tile.video .label, .tile.missing .label { background: var(--soft); }
.tile:focus-visible { outline: 3px solid var(--fg); outline-offset: 2px; }

.lightbox { position: fixed; inset: 0; z-index: 10; display: flex; flex-direction: column; background: #000; color: #eee; }
.lb-bar { display: flex; gap: 6px; align-items: center; padding: 8px; }
.lb-caption { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.lb-pos { color: #999; font-size: 13px; }
.lb-bar button { min-width: 44px; min-height: 44px; font-size: 22px; line-height: 1; background: #222; color: #eee;
  border-color: #444; }
.lb-bar button:focus-visible { outline: 3px solid #eee; outline-offset: 1px; }
.lb-stage { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 0 4px 8px;
  touch-action: pan-y pinch-zoom; }
.lb-stage img, .lb-stage video { max-width: 100%; max-height: 100%; object-fit: contain; }
.lb-stage p { color: #999; }
body.lb-open { overflow: hidden; }
