/* Gallery page (29 Oct 2026): photo grid, type filter and a full-size viewer. */
.gl-chips { margin: 0 0 24px; }
.gl-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; grid-auto-flow: dense; }
@media (min-width: 900px) {
  .gl-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
  .gl-item:nth-child(5n + 1) { grid-column: span 2; grid-row: span 2; }
}
.gl-item { position: relative; margin: 0; }
.gl-item[hidden] { display: none; }
.gl-open { display: block; width: 100%; height: 100%; padding: 0; border: 0; border-radius: 12px; overflow: hidden; background: var(--espresso-2); cursor: zoom-in; aspect-ratio: 4 / 5; }
.gl-open img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.gl-open:hover img { transform: scale(1.03); }
.gl-open:focus-visible { outline: 2px solid var(--saffron); outline-offset: 3px; }
.gl-cap {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 32px 12px 10px; border-radius: 0 0 12px 12px;
  font-size: 14px; line-height: 1.35; color: var(--cream); pointer-events: none;
  background: linear-gradient(transparent, rgba(20, 10, 4, .88));
}
.gl-close { margin-top: 40px; align-items: center; }
.gl-close p { color: var(--ink-soft); font-size: 18px; }

.gl-view { width: min(100vw, 1100px); max-width: none; max-height: none; height: 100svh; margin: auto; padding: 0; border: 0; background: transparent; color: var(--cream); }
.gl-view::backdrop { background: rgba(14, 7, 3, .92); }
.gl-view figure { display: grid; place-items: center; align-content: center; gap: 12px; height: 100%; margin: 0; padding: 56px 16px; }
.gl-view img { max-width: 100%; max-height: calc(100svh - 150px); border-radius: 10px; object-fit: contain; }
.gl-view figcaption { color: var(--ink-soft); text-align: center; }
.gl-x, .gl-nav {
  position: fixed; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%;
  border: 1px solid var(--line-strong); background: rgba(27, 13, 6, .7); color: var(--cream); font-size: 22px; cursor: pointer;
}
.gl-x { top: 14px; right: 14px; }
.gl-prev { left: 14px; top: 50%; transform: translateY(-50%); }
.gl-next { right: 14px; top: 50%; transform: translateY(-50%); }
.gl-x:hover, .gl-nav:hover, .gl-x:focus-visible, .gl-nav:focus-visible { border-color: var(--saffron); }
@media (max-width: 600px) { .gl-prev, .gl-next { top: auto; bottom: 18px; transform: none; } .gl-prev { left: calc(50% - 60px); } .gl-next { right: calc(50% - 60px); } }
@media (prefers-reduced-motion: reduce) { .gl-open img { transition: none; } }
