/* r54 (3 Nov 2026): Project Photos on the project pages (r54_gallery.py). A ruled grid with the first photo large, and a
   full-screen viewer on charcoal. Square corners, thin rules, the site red for focus and the counter. */
.pg-head{display:flex;justify-content:space-between;align-items:end;gap:24px;margin-bottom:clamp(24px,3vw,40px)}
.pg-head h2{margin:0}
.pg-count{margin:0;font-size:15px;color:#5c6468}
.pg-grid{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:repeat(4,1fr);grid-auto-rows:clamp(150px,15vw,240px);gap:12px}
.pg-grid li{position:relative;margin:0;overflow:hidden;background:#eceeef}
.pg-grid li:first-child{grid-column:span 2;grid-row:span 2}
.pg-grid.pg-n3{grid-template-columns:2fr 1fr}.pg-grid.pg-n3 li:first-child{grid-column:1;grid-row:span 2}
.pg-grid.pg-n4 li:first-child,.pg-grid.pg-n5 li:first-child{grid-row:span 2}
.pg-open{display:block;width:100%;height:100%;padding:0;border:0;background:none;cursor:zoom-in}
.pg-open img{display:block;width:100%;height:100%;object-fit:cover;transition:transform .9s cubic-bezier(.16,1,.3,1)}
.pg-open:hover img,.pg-open:focus-visible img{transform:scale(1.035)}
.pg-open:focus-visible{outline:2px solid #b43f29;outline-offset:-2px}
.pg-cap{position:absolute;left:0;bottom:0;padding:7px 10px;background:#fff;color:#22272b;font-size:13px;line-height:1.2;pointer-events:none}

.pg-view{position:fixed;inset:0;z-index:1000;display:grid;grid-template-rows:auto 1fr auto;background:#1c242a;color:#fff;margin:0;padding:0;border:0;width:100%;height:100%;max-width:none;max-height:none}
.pg-view::backdrop{background:#1c242a}
.pg-view[open]{animation:pg-in .3s ease-out}
@keyframes pg-in{from{opacity:0}to{opacity:1}}
.pg-bar{display:flex;justify-content:space-between;align-items:center;padding:16px var(--gutter,4.5vw);font-size:15px;color:#c4cacd}
.pg-bar b{color:#e0644b;font-weight:500}
.pg-stage{display:grid;place-items:center;min-height:0;padding:0 var(--gutter,4.5vw)}
.pg-stage img{max-width:100%;max-height:100%;object-fit:contain;display:block}
.pg-foot{display:flex;justify-content:space-between;align-items:center;gap:16px;padding:16px var(--gutter,4.5vw) 22px;font-size:15px;color:#c4cacd}
.pg-view button{display:inline-grid;place-items:center;width:48px;height:48px;padding:0;border:1px solid rgba(255,255,255,.28);background:none;color:#fff;cursor:pointer;transition:background .25s,border-color .25s}
.pg-view button:hover,.pg-view button:focus-visible{background:#b43f29;border-color:#b43f29;outline:none}
.pg-view button svg{width:18px;height:18px}
.pg-nav{display:flex;gap:8px}

@media(max-width:900px){
  .pg-grid,.pg-grid.pg-n3{grid-template-columns:1fr 1fr;grid-auto-rows:clamp(130px,34vw,220px)}
  .pg-grid li:first-child,.pg-grid.pg-n3 li:first-child{grid-column:1/-1;grid-row:span 2}
  .pg-head{flex-direction:column;align-items:start}
}
@media(prefers-reduced-motion:reduce){.pg-open img{transition:none}.pg-view[open]{animation:none}}
