/* Continuous media gallery, using the shared page width and title banner. */
.gallery-page .site-header::before{background:transparent;backdrop-filter:none;-webkit-backdrop-filter:none}
.gallery-page .site-header.scrolled::before{background:rgba(255,255,255,.94);backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px)}
.gallery-page .site-header .menu-toggle{color:var(--ink)}
.gallery-page .title-banner{background:#e9e5dc}
.gallery-feed{max-width:1440px;margin:0 auto;padding:48px 24px 80px}
.gallery-bento{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));grid-auto-rows:clamp(150px,16vw,220px);gap:16px}
.gallery-tile,.gallery-reel{position:relative;display:block;overflow:hidden;min-width:0;border-radius:16px;background:#eeebe4}
.gallery-tile:nth-child(8n+1){grid-column:span 2;grid-row:span 2}
.gallery-tile:nth-child(8n+4){grid-row:span 2}
.gallery-tile:nth-child(8n+8){grid-column:span 2}
.gallery-tile:nth-child(3n+2),.gallery-reel:nth-child(2n){background:#e2dfd7}
.gallery-tile:nth-child(3n){background:#f6f4ef}
.gallery-tile img,.gallery-reel img{display:block;width:100%;height:100%;object-fit:cover;transition:transform .5s var(--ease)}
.gallery-tile:hover img,.gallery-reel:hover img{transform:scale(1.04)}
.gallery-expand{position:absolute;right:14px;bottom:14px;display:grid;place-items:center;width:36px;height:36px;border-radius:50%;background:#fff;color:var(--ink);font-size:21px;opacity:0;transform:translateY(5px);transition:opacity .2s,transform .2s}
.gallery-tile:hover .gallery-expand,.gallery-reel:hover .gallery-expand,.project-gallery-link:focus-visible .gallery-expand{opacity:1;transform:none}
.gallery-feed a:focus-visible,.gallery-feed button:focus-visible,.gallery-reels-track:focus-visible{outline:3px solid var(--red-dark);outline-offset:4px}
.gallery-instagram{margin:56px 0}
.gallery-reels-heading{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:22px}
.gallery-reels-heading h2{display:flex;align-items:center;gap:10px;font-size:22px;line-height:1.3;letter-spacing:-.025em;margin:0;font-weight:550}
.gallery-reels-heading>a{font-size:14px;display:flex;gap:12px;align-items:center}
.gallery-reels-heading>a:hover{text-decoration:underline;text-underline-offset:4px}
.gallery-reels-window{margin:-5px;padding:5px;overflow:hidden}
.gallery-reels-track{display:flex;gap:16px;overflow-x:auto;scrollbar-width:none;padding:5px;margin:-5px;overscroll-behavior-x:contain}
.gallery-reels-track::-webkit-scrollbar{display:none}
.gallery-reel{flex:0 0 23%;aspect-ratio:9/16}
.gallery-reels-controls{display:flex;justify-content:center;gap:10px;margin-top:20px}
.gallery-reels-controls button{display:grid;place-items:center;min-width:40px;height:40px;border:1px solid var(--line);border-radius:50%;background:#fff;color:var(--ink);font:inherit;font-size:16px;cursor:pointer}
.gallery-reels-controls [data-reels-toggle]{border-radius:24px;min-width:82px;font-size:12px}
.gallery-reels-controls button:hover{background:var(--paper)}
.gallery-bento-second .gallery-tile:first-child{grid-column:span 1;grid-row:span 2}
.gallery-bento-second .gallery-tile:nth-child(2){grid-column:span 2;grid-row:span 2}
.gallery-bento-second .gallery-tile:nth-child(4){grid-row:span 1}
@media(max-width:700px){.gallery-feed{padding-top:28px;padding-bottom:48px}.gallery-bento{grid-template-columns:repeat(2,minmax(0,1fr));grid-auto-rows:150px;gap:10px}.gallery-tile{border-radius:12px}.gallery-tile:nth-child(8n+1){grid-column:span 2}.gallery-tile:nth-child(8n+4){grid-row:span 1}.gallery-bento-second .gallery-tile:first-child{grid-column:span 2;grid-row:span 2}.gallery-bento-second .gallery-tile:nth-child(2){grid-column:span 1;grid-row:span 1}.gallery-instagram{margin:36px 0}.gallery-reels-heading{align-items:flex-start;flex-direction:column;gap:8px}.gallery-reel{flex-basis:44%;border-radius:12px}.gallery-reels-track{gap:10px}.gallery-expand{opacity:1;transform:none;width:30px;height:30px;right:10px;bottom:10px}}
@media(prefers-reduced-motion:reduce){.gallery-feed img,.gallery-expand{transition:none}}

@media(max-width:700px){.gallery-feed{padding-left:20px;padding-right:20px}}

/* Reserve the page scrollbar even while the media viewer locks scrolling.
   GLightbox also adds body padding; the reserved gutter replaces that fix. */
html:has(.gallery-page){scrollbar-gutter:stable}
.gallery-page.gscrollbar-fixer{padding-right:0!important}
.gallery-play{position:absolute;inset:0;margin:auto;width:60px;height:60px;display:grid;place-items:center;border-radius:50%;background:rgba(255,255,255,.94);color:var(--ink);box-shadow:0 4px 24px rgba(0,0,0,.16);pointer-events:none;transition:transform .2s}
.gallery-play svg{margin-left:3px}
[data-type="video"]:hover .gallery-play{transform:scale(1.08)}
@media(max-width:700px){.gallery-play{width:48px;height:48px}}
@media(prefers-reduced-motion:reduce){.gallery-play{transition:none}}

.gallery-page .gallery-intro{max-width:58ch;margin:18px auto 0;color:#5f655c;font-size:15px;line-height:1.7}
@media(max-width:600px){.gallery-page .gallery-intro{font-size:14px;margin-top:14px}}
