/* Moments from past events (gallery.js). Colours come from the page: text inherits, lines and quiet
   text use the page's own tokens when it has them (--line, --soft-text). */
.gallery { margin-top: 34px; }
.g-event + .g-event { margin-top: 34px; }
.g-event:first-child { margin-top: 18px; }
.g-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.g-head h3 { margin: 0; font-family: var(--font-serif); font-weight: 400; font-size: 1.45rem; line-height: 1.1; }
.g-head span { display: block; margin-top: 3px; font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; color: var(--soft-text, var(--mute, currentColor)); }
.g-album { flex: none; font-size: .86rem; font-weight: 600; color: inherit; text-decoration: none; padding-bottom: 2px; border-bottom: 1px solid var(--line, rgba(127, 127, 127, .3)); }

/* the mosaic: the first tile large, the rest around it */
.g-grid { display: grid; gap: 6px; grid-template-columns: repeat(3, 1fr); grid-auto-rows: minmax(0, 1fr); aspect-ratio: 3 / 2; }
.g-1 { grid-template-columns: 1fr; aspect-ratio: 4 / 3; }
.g-2 { grid-template-columns: 1fr 1fr; aspect-ratio: 2 / 1.2; }
.g-3 .g-tile:first-child, .g-4 .g-tile:first-child, .g-5 .g-tile:first-child { grid-column: span 2; grid-row: span 2; }
.g-3 { grid-template-rows: 1fr 1fr; }
.g-4 { grid-template-rows: 1fr 1fr 1fr; aspect-ratio: 1 / 1; }
.g-4 .g-tile:first-child { grid-row: span 3; }
.g-5 { grid-template-rows: 1fr 1fr 1fr; aspect-ratio: 1 / 1; }
.g-5 .g-tile:first-child { grid-row: span 2; }
.g-5 .g-tile:nth-child(n+4) { grid-column: span 1; }
.g-5 .g-tile:nth-child(4) { grid-column: 1 / span 2; }
/* wider screens: a shorter mosaic, so one event doesn't fill the whole window */
@media (min-width: 700px) { .g-4, .g-5 { aspect-ratio: 16 / 10; } .g-3 { aspect-ratio: 2 / 1; } }

.g-tile { position: relative; display: block; min-height: 0; padding: 0; border: 0; border-radius: 16px; overflow: hidden; background: rgba(127, 127, 127, .14); cursor: zoom-in; }
.g-tile img, .g-tile video { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .6s cubic-bezier(.2, .8, .2, 1); }
.g-tile:hover img, .g-tile:hover video { transform: scale(1.03); }
.g-tile:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }
.g-tile.is-broken { background: rgba(127, 127, 127, .12); }
.g-tile.is-broken img { opacity: 0; }
.g-play { position: absolute; left: 10px; bottom: 10px; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: rgba(0, 0, 0, .5); color: #fff; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.g-play svg { width: 16px; height: 16px; margin-left: 2px; }
.g-more { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0, 0, 0, .45); color: #fff; font-size: 1.4rem; font-weight: 600; }

/* the viewer */
.gl { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: rgba(8, 7, 6, .94); color: #fff; touch-action: pan-y; }
.gl[hidden] { display: none; }
.gl-stage { display: grid; place-items: center; width: 100%; height: 100%; padding: 64px 12px 72px; box-sizing: border-box; }
.gl-stage img, .gl-stage video { max-width: 100%; max-height: 100%; border-radius: 10px; object-fit: contain; }
.gl-stage iframe { width: min(100%, 960px); aspect-ratio: 16 / 9; border: 0; border-radius: 10px; }
.gl-btn { position: absolute; display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .12); color: #fff; font-size: 1.6rem; line-height: 1; cursor: pointer; }
.gl-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.gl-close { top: max(14px, env(safe-area-inset-top)); right: 14px; }
.gl-prev { left: 12px; top: 50%; translate: 0 -50%; }
.gl-next { right: 12px; top: 50%; translate: 0 -50%; }
.gl-count { position: absolute; left: 0; right: 0; bottom: max(18px, env(safe-area-inset-bottom)); margin: 0; text-align: center; font-size: .86rem; color: rgba(255, 255, 255, .75); }
@media (prefers-reduced-motion: reduce) { .g-tile img, .g-tile video { transition: none; } }
/* loves: how many who were there gave it 4 or 5 stars; the heart in the page accent, the words quiet */
.g-head .g-loves { display: inline-flex; align-items: center; gap: 5px; margin: 0; }
.g-head .g-loves::before { content: "·"; margin: 0 6px 0 8px; }
.g-head .g-loves svg { width: 12px; height: 12px; color: var(--accent, var(--theme-accent, currentColor)); }
