#gallery-grid.gallery-mosaic{display:grid;width:min(100%,820px);margin-inline:auto;aspect-ratio:1;grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:repeat(2,minmax(0,1fr));gap:clamp(8px,1.5vw,16px)}#gallery-grid .gallery-group{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:repeat(2,minmax(0,1fr));gap:4px;min-width:0;min-height:0}#gallery-grid .gallery-group>.gallery-piece:only-child{grid-column:1/-1;grid-row:1/-1}#gallery-grid.gallery-mosaic .gallery-piece{margin:0;min-width:0;min-height:0;height:100%;display:block}#gallery-grid.gallery-mosaic .pixel-frame{height:100%;min-height:0;aspect-ratio:auto;overflow:hidden;padding:2px;border-width:4px}#gallery-grid .gallery-group .pixel-frame{border-width:3px}#gallery-grid.gallery-mosaic img{width:100%;height:100%;object-fit:cover;display:block}#gallery-grid.gallery-mosaic figcaption{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}.mp-dialog-gallery .mp-gallery-title{margin:0;padding:12px 16px;background:#fff8df;color:#314b3a;text-align:center;font-size:18px;line-height:1.5}.mp-dialog-gallery>img{display:block;max-height:75svh;width:auto;max-width:100%;height:auto;object-fit:contain;margin:auto}.mp-dialog-gallery{background:#fff8df;padding:0}.gallery-piece:focus-visible{outline:3px solid #d4a33b;outline-offset:2px}
/* Separate the image from its wooden title sign. */
.mp-dialog-gallery{background:transparent!important;border:0!important;box-shadow:none!important;padding:0!important;overflow:visible;max-height:88svh}
.mp-dialog-gallery>img{display:block;max-height:68svh;width:auto;max-width:100%;height:auto;object-fit:contain;margin:0 auto;border:4px solid #715334;box-sizing:border-box;background:#221e18}
.mp-dialog-gallery .mp-gallery-title{position:relative;display:table;max-width:90%;min-width:180px;margin:26px auto 0;padding:12px 28px;border:4px solid #715334;box-shadow:inset 0 0 0 2px #e6cd99,3px 4px #17271d55;background:repeating-linear-gradient(0deg,#d4b47e 0 22px,#c8a56e 22px 24px);color:#3f3425;text-align:center;font-size:20px;line-height:1.5;overflow-wrap:anywhere}
.mp-dialog-gallery .mp-gallery-title:before,.mp-dialog-gallery .mp-gallery-title:after{content:"";position:absolute;width:5px;height:22px;top:-26px;background:#756c51}
.mp-dialog-gallery .mp-gallery-title:before{left:24px}.mp-dialog-gallery .mp-gallery-title:after{right:24px}
@media(max-width:600px){.mp-dialog-gallery .mp-gallery-title{font-size:18px;padding:10px 18px;min-width:150px}.mp-dialog-gallery>img{max-height:64svh}}

.mp-dialog-gallery .mp-gallery-title::before,.mp-dialog-gallery .mp-gallery-title::after{display:none}

/* Four equal square photos per horizontal page. */
#gallery-grid.gallery-paged{display:grid;grid-template-columns:none;grid-template-rows:auto;grid-auto-flow:column;grid-auto-columns:100%;width:min(100%,700px);aspect-ratio:auto;gap:0;overflow-x:auto;overflow-y:hidden;scroll-snap-type:x mandatory;overscroll-behavior-x:contain;scrollbar-width:thin;padding:4px 0 12px;scroll-padding:0}#gallery-grid.gallery-paged .gallery-page{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:repeat(2,minmax(0,1fr));gap:12px;aspect-ratio:1;min-width:0;padding:0 6px;scroll-snap-align:start;scroll-snap-stop:always;align-content:start}#gallery-grid.gallery-paged .gallery-piece{width:100%;height:auto;aspect-ratio:1;align-self:start}#gallery-grid.gallery-paged .pixel-frame{width:100%;height:100%;aspect-ratio:1}#gallery-grid.gallery-paged .gallery-piece{animation-delay:0ms!important;transition-delay:0ms!important}.gallery-page-controls{display:flex;justify-content:center;align-items:center;gap:22px;margin:18px auto 0;font-size:14px}.gallery-page-controls button{font:inherit;color:#4a3922;background:#e4cba0;border:2px solid #82623e;padding:9px 16px;cursor:pointer}.gallery-page-controls button:disabled{opacity:.4;cursor:default}.gallery-page-controls button:focus-visible,#gallery-grid.gallery-paged:focus-visible{outline:3px solid #b88d34;outline-offset:3px}@media(max-width:600px){#gallery-grid.gallery-paged .gallery-page{gap:8px;padding-inline:4px}.gallery-page-controls{gap:16px}.gallery-page-controls button{padding:8px 12px}}

#gallery-grid.gallery-paged .gallery-page{grid-template-columns:repeat(4,minmax(0,1fr));grid-template-rows:repeat(4,minmax(0,1fr));gap:8px}#gallery-grid.gallery-paged{width:min(100%,820px)}@media(max-width:600px){#gallery-grid.gallery-paged .gallery-page{gap:5px}#gallery-grid.gallery-paged .pixel-frame{border-width:2px;padding:1px}}

/* Four fixed 4-by-4 boxes per page, arranged as a 2-by-2. */
#gallery-grid.gallery-paged .gallery-page{grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:repeat(2,minmax(0,1fr));gap:18px}#gallery-grid.gallery-paged .gallery-fixed-block{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));grid-template-rows:repeat(4,minmax(0,1fr));gap:5px;min-width:0;min-height:0;aspect-ratio:1;align-content:start}#gallery-grid.gallery-paged .gallery-fixed-block .pixel-frame{border-width:3px;padding:1px}@media(max-width:600px){#gallery-grid.gallery-paged .gallery-page{gap:12px}#gallery-grid.gallery-paged .gallery-fixed-block{gap:3px}#gallery-grid.gallery-paged .gallery-fixed-block .pixel-frame{border-width:2px;padding:0}}

#gallery-grid.gallery-paged .gallery-fixed-block[data-layout="featured"]{grid-auto-flow:row dense}#gallery-grid.gallery-paged .gallery-featured{grid-column:span 2;grid-row:span 2;aspect-ratio:auto;height:100%}#gallery-grid.gallery-paged .gallery-featured .pixel-frame{height:100%}
