/* "In Images" gallery: bento grid + in-frame parallax + lightbox (js/gallery.js) */
.g-wrap{max-width:1170px;margin:0 auto;padding:6px 0 10px;text-align:center}
.g-grid{--cols:2;--gap:8px;container-type:inline-size;display:grid;gap:var(--gap);
  grid-template-columns:repeat(var(--cols),minmax(0,1fr));
  grid-auto-rows:calc((100cqi - (var(--cols) - 1) * var(--gap)) / var(--cols) * 9 / 16);
  grid-auto-flow:row dense;margin:0;padding:0}
@media (min-width:768px){.g-grid{--cols:4;--gap:10px}}
.g-item{position:relative;display:block;overflow:hidden;border-radius:8px;background:#dfe5ea;
  box-shadow:0 1px 3px rgba(44,62,80,.12);outline-offset:3px;-webkit-tap-highlight-color:transparent;
  transform:translateZ(0)}
.g-item.g-wide{grid-column:span 2;grid-row:span 2}
.g-item img{position:absolute;left:0;top:-7%;width:100%;height:114%;max-width:none;object-fit:cover;display:block;
  will-change:transform;transition:filter .45s ease}
.g-item::after{content:"";position:absolute;inset:0;border-radius:inherit;pointer-events:none;
  background:linear-gradient(180deg,rgba(0,0,0,0) 55%,rgba(0,0,0,.18));opacity:0;transition:opacity .35s ease}
.g-item .g-in{position:absolute;inset:0;transition:transform 1.8s cubic-bezier(.2,.6,.2,1)}
.g-item:hover .g-in,.g-item:focus-visible .g-in{transform:scale(1.09)}
/* the zoom grows out of a corner, not the centre, so the photo drifts along a diagonal; the corner changes from tile to tile */
.g-item:nth-child(4n+1) .g-in{transform-origin:12% 18%}
.g-item:nth-child(4n+2) .g-in{transform-origin:88% 82%}
.g-item:nth-child(4n+3) .g-in{transform-origin:85% 15%}
.g-item:nth-child(4n+4) .g-in{transform-origin:15% 85%}
.g-item:hover img,.g-item:focus-visible img{filter:brightness(1.08) saturate(1.06)}
.g-item:hover::after{opacity:1}
.g-more{display:none}
.g-grid.g-open .g-more{display:block}
/* reveal on scroll (only when JS is running and motion is OK) */
.g-anim .g-item{opacity:0;translate:0 22px;transition:opacity .7s ease,translate .7s cubic-bezier(.2,.7,.2,1)}
.g-anim .g-item.g-seen{opacity:1;translate:0 0}
.g-btn{display:inline-flex;align-items:center;gap:8px;margin-top:22px;padding:11px 24px;border:2px solid var(--accent2);
  border-radius:999px;background:transparent;color:var(--accent2);font:700 15px/1 Montserrat,"Helvetica Neue",Arial,sans-serif;
  text-transform:uppercase;letter-spacing:.06em;cursor:pointer;transition:background .25s,color .25s}
.g-btn:hover,.g-btn:focus-visible{background:var(--accent2);color:#fff;outline:0}
.g-btn[hidden]{display:none}
/* lightbox */
.g-lb{position:fixed;inset:0;z-index:2000;display:flex;align-items:center;justify-content:center;
  background:rgba(12,17,24,.93);opacity:0;visibility:hidden;transition:opacity .25s ease,visibility 0s .25s;
  touch-action:pan-y;-webkit-user-select:none;user-select:none}
.g-lb.g-on{opacity:1;visibility:visible;transition:opacity .25s ease}
.g-lb img{max-width:94vw;max-height:86vh;width:auto;height:auto;border-radius:6px;box-shadow:0 12px 48px rgba(0,0,0,.5);
  transition:opacity .2s ease,transform .25s ease}
.g-lb img.g-fade{opacity:0;transform:scale(.985)}
.g-lb button{position:absolute;border:0;background:rgba(255,255,255,.1);color:#fff;cursor:pointer;
  width:48px;height:48px;border-radius:50%;font-size:26px;line-height:48px;padding:0;transition:background .2s}
.g-lb button:hover,.g-lb button:focus-visible{background:rgba(255,255,255,.24);outline:0}
.g-lb .g-x{top:16px;right:16px;font-size:30px}
.g-lb .g-prev{left:16px;top:50%;margin-top:-24px}
.g-lb .g-next{right:16px;top:50%;margin-top:-24px}
.g-lb .g-count{position:absolute;bottom:18px;left:0;right:0;text-align:center;color:rgba(255,255,255,.7);
  font:600 14px/1 Lato,"Helvetica Neue",Arial,sans-serif;letter-spacing:.08em}
@media (max-width:767px){.g-lb .g-prev,.g-lb .g-next{top:auto;bottom:6px;margin:0}.g-lb .g-prev{left:12px}.g-lb .g-next{right:12px}
  .g-lb .g-count{bottom:22px}.g-lb img{max-width:100vw;max-height:78vh;border-radius:0}}
html.g-lock,html.g-lock body{overflow:hidden}
@media (prefers-reduced-motion:reduce){
  .g-item img,.g-item .g-in,.g-lb,.g-lb img{transition:none}
  .g-item:hover .g-in{transform:none}
}

/* filled by default: accent bar colour with white text (the outlined version was hard to read) */
.g-btn{background:var(--accent2) !important;color:#fff !important}
.g-btn:hover,.g-btn:focus-visible{background:var(--accent2d) !important;border-color:var(--accent2d)}
/* room under the button: the next chapter slides over the bottom of this one, so keep the button clear of it for a while */
#photos{padding-bottom:160px}
