#gallery .project-grid,.project-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,220px),1fr));gap:16px;margin:24px 0}.pg-tile{display:flex;flex-direction:column;overflow:hidden;border:1px solid #dce4df;border-radius:14px;background:#fff;color:#073e30;padding:0;text-align:left;cursor:pointer;font:inherit}.pg-tile img{width:100%;aspect-ratio:4/3;object-fit:cover;display:block}.pg-tile span{padding:12px;font-weight:600}#project-gallery{box-sizing:border-box;width:min(1100px,94vw);max-width:94vw;max-height:90vh;max-height:90dvh;padding:0;border:0;border-radius:18px;background:#f7f7f2;color:#073e30;overflow:hidden}#project-gallery[open]{display:flex;flex-direction:column}#project-gallery::backdrop{background:rgba(0,20,14,.8)}.pg-head{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:16px 24px;background:#073e30;color:white}.pg-head h2{margin:0;color:white;font-size:clamp(20px,3vw,30px)}.pg-head button,.pg-stage button{border:0;border-radius:50%;width:44px;height:44px;flex:none;background:#e8c77f;color:#073e30;font-size:28px;cursor:pointer}.pg-scroll{overflow-y:auto;overscroll-behavior:contain;padding:20px;min-height:0}.pg-stage{display:flex;align-items:center;justify-content:center;gap:8px;background:#e5ebe5;border-radius:12px;padding:8px}.pg-stage img{min-width:0;max-width:calc(100% - 104px);max-height:52vh;object-fit:contain}.pg-stage button:disabled{opacity:.35}#pg-caption{text-align:center;overflow-wrap:anywhere}#gallery-open[hidden],#pg-view[hidden]{display:none!important}html:has(#project-gallery[open]){overflow:hidden}@media(max-width:600px){.pg-scroll{padding:12px}.pg-head{padding:12px}.pg-stage button{width:36px;height:36px}.pg-stage img{max-width:calc(100% - 88px)}#gallery .project-grid,.project-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.pg-tile span{font-size:13px}}
/* Gallery controls: reset shared website button spacing and alignment. */
#project-gallery #pg-close,#project-gallery #pg-prev,#project-gallery #pg-next{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;padding:0;margin:0;line-height:1;text-align:center;text-indent:0;letter-spacing:0;font-family:Arial,sans-serif;font-weight:600;min-width:0;min-height:0;flex-shrink:0;appearance:none;position:relative;inset:auto;transform:none;}
#project-gallery #pg-close svg,#project-gallery #pg-prev svg,#project-gallery #pg-next svg{display:block;width:22px;height:22px;flex:none;pointer-events:none;}
#project-gallery .pg-stage{align-items:center;}

#gallery #gallery-list{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:12px;overflow-x:auto;align-items:start}#gallery #gallery-list .pg-tile{min-width:0;width:100%}#gallery #gallery-list .pg-tile span{font-size:12px;overflow-wrap:anywhere}@media(max-width:900px){#gallery #gallery-list{grid-template-columns:repeat(6,minmax(145px,1fr));padding-bottom:8px;scroll-snap-type:x proximity}#gallery #gallery-list .pg-tile{scroll-snap-align:start}}
