/* Gallery: natural-height introduction, TPR-style CSS column masonry. */
html.gallery-page{scroll-padding-top:var(--header)}
.midcity-gallery{padding-block:clamp(26px,4vw,62px) clamp(44px,5vw,76px)}
.midcity-gallery-intro{display:flex;align-items:center;justify-content:space-between;gap:30px;margin-bottom:clamp(24px,3vw,40px)}
.midcity-gallery-intro h1{font:400 clamp(46px,6.3vw,100px)/1.04 var(--serif);letter-spacing:-.055em;color:var(--forest)}
.midcity-gallery-intro h1 em{color:#907447;font-weight:400}
.midcity-gallery-intro>p{max-width:340px;flex:0 1 340px;font-size:clamp(14px,1.1vw,17px);line-height:1.55;text-align:right}
.midcity-gallery-mobile-filter{display:none}
.midcity-gallery-filters{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:8px;margin-bottom:clamp(18px,2.1vw,30px)}
.midcity-gallery-filters button{display:inline-flex;justify-content:center;align-items:center;min-height:42px;padding:9px 22px;border:1px solid var(--line);border-radius:4px;background:transparent;color:var(--forest);font:500 13px/1.2 var(--sans);transition:background .2s,color .2s,border-color .2s}
.midcity-gallery-filters button:hover{background:#eeece3;border-color:var(--forest)}
.midcity-gallery-filters button[aria-pressed="true"]{background:var(--forest);color:var(--paper);border-color:var(--forest)}
.midcity-gallery-masonry{column-count:2;column-gap:10px}
.midcity-gallery-item{display:block;width:100%;margin:0 0 14px;padding:0;border:0;border-radius:4px;overflow:hidden;break-inside:avoid;position:relative;background:#d9d6cc;text-align:left;isolation:isolate}
.midcity-gallery-item img{display:block;width:100%;height:auto;object-fit:contain;transition:transform .45s var(--ease)}
.midcity-gallery-overlay{position:absolute;inset:auto 0 0;display:flex;justify-content:space-between;align-items:center;gap:12px;padding:24px 16px 14px;background:linear-gradient(transparent,rgba(24,45,38,.84));color:var(--paper);font:600 12px/1.3 var(--sans);opacity:0;transition:opacity .25s}
.midcity-gallery-overlay .ui-icon{width:16px;height:16px;filter:brightness(0) invert(1)}
.midcity-gallery-item:focus-visible .midcity-gallery-overlay{opacity:1}
@media(hover:hover) and (pointer:fine){.midcity-gallery-item:hover img{transform:scale(1.035)}.midcity-gallery-item:hover .midcity-gallery-overlay{opacity:1}}
.midcity-gallery-more{display:flex;justify-content:center;margin-top:24px}
.midcity-load-more{display:inline-flex;align-items:center;justify-content:center;gap:14px;min-height:48px;padding:12px 22px;border:1px solid var(--forest);border-radius:4px;background:var(--forest);color:var(--paper);font:600 13px/1.2 var(--sans);transition:background .2s}
.midcity-load-more:hover{background:var(--forest-deep)}
.midcity-load-more .ui-icon{display:block;width:16px;height:16px;filter:brightness(0) invert(1)}
.midcity-gallery-empty{text-align:center;margin:45px auto}
.midcity-gallery-status{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.midcity-gallery-viewer{position:fixed;inset:0;width:100%;height:100%;max-width:none;max-height:none;margin:0;border:0;padding:0;background:rgba(15,25,21,.97);color:var(--paper);overflow:hidden}
.midcity-gallery-viewer[open]{display:grid;place-items:center}
.midcity-gallery-viewer::backdrop{background:#0f1915}
html[data-gallery-viewer-open]{overflow:hidden}
.gallery-viewer-content{display:flex;flex-direction:column;align-items:center;gap:12px;max-width:calc(100% - 48px);max-height:calc(100% - 150px)}
.gallery-viewer-content img{display:block;width:auto;max-width:100%;height:auto;max-height:calc(100dvh - 180px);object-fit:contain;background:transparent;border-radius:4px;touch-action:pan-y}
.gallery-viewer-caption{color:var(--paper);font-size:13px;text-align:center;line-height:1.4}
.midcity-gallery-viewer button{position:absolute;display:grid;place-items:center;width:46px;height:46px;border:1px solid #ffffff45;border-radius:50%;background:#ffffff09;z-index:1}
.midcity-gallery-viewer button:hover:not(:disabled){background:#ffffff22}
.midcity-gallery-viewer button:disabled{opacity:.3;cursor:default}
.midcity-gallery-viewer button .ui-icon{width:22px;height:22px;filter:brightness(0) invert(1)}
.gallery-viewer-close{top:20px;right:20px}
.gallery-viewer-controls{position:absolute;bottom:max(20px,env(safe-area-inset-bottom));left:50%;transform:translateX(-50%);display:grid;grid-template-columns:46px minmax(72px,auto) 46px;gap:16px;align-items:center;justify-items:center}
.midcity-gallery-viewer .gallery-viewer-controls button{position:static}
.gallery-viewer-counter{color:var(--paper);font:500 14px/1.2 var(--sans);font-variant-numeric:tabular-nums;white-space:nowrap;text-align:center}
@media(min-width:768px){.midcity-gallery-masonry{column-count:2;column-gap:14px}}
@media(min-width:1024px){.midcity-gallery-masonry{column-count:3}}
@media(min-width:1440px){.midcity-gallery-masonry{column-count:4}}
@media(max-width:900px){
 .midcity-gallery-intro{flex-direction:column;text-align:center;gap:10px;margin-bottom:24px}
 .midcity-gallery-intro h1{font-size:clamp(38px,8vw,68px)}
 .midcity-gallery-intro>p{flex:none;text-align:center;font-size:14px;max-width:46ch}
 .midcity-gallery-filters{justify-content:center}
}
@media(max-width:650px){
 .midcity-gallery{padding-block:28px 40px}
 .midcity-gallery-filters{display:none}
 .midcity-gallery-mobile-filter{display:block;position:relative;margin-bottom:18px;z-index:4}
 .midcity-gallery-filter-trigger{display:flex;align-items:center;justify-content:space-between;gap:14px;width:100%;min-height:48px;padding:12px 15px;border:1px solid #cfcbbf;border-radius:4px;background:var(--paper);color:var(--forest);font:600 13px/1.2 var(--sans);text-align:left;user-select:none}
 .midcity-gallery-filter-trigger[aria-expanded="true"]{border-color:var(--forest)}
 .midcity-gallery-filter-chevron{position:relative;width:18px;height:18px;flex:none}
 .midcity-gallery-filter-chevron::before,.midcity-gallery-filter-chevron::after{content:"";position:absolute;top:8px;width:8px;height:1.5px;border-radius:2px;background:var(--forest);transition:transform .2s var(--ease)}
 .midcity-gallery-filter-chevron::before{left:2px;transform:rotate(45deg)}
 .midcity-gallery-filter-chevron::after{right:2px;transform:rotate(-45deg)}
 .midcity-gallery-filter-trigger[aria-expanded="true"] .midcity-gallery-filter-chevron::before{transform:rotate(-45deg)}
 .midcity-gallery-filter-trigger[aria-expanded="true"] .midcity-gallery-filter-chevron::after{transform:rotate(45deg)}
 .midcity-gallery-filter-menu{position:absolute;left:0;right:0;top:calc(100% + 6px);max-height:min(56vh,360px);overflow-y:auto;padding:6px;border:1px solid #cfcbbf;border-radius:4px;background:var(--paper);box-shadow:0 18px 42px rgba(24,45,38,.16)}
 .midcity-gallery-filter-menu[hidden]{display:none}
 .midcity-gallery-filter-option{display:flex;align-items:center;justify-content:space-between;width:100%;min-height:44px;padding:10px 12px;border:0;border-radius:3px;background:transparent;color:var(--forest);font:500 13px/1.3 var(--sans);text-align:left;user-select:none}
 .midcity-gallery-filter-option:hover,.midcity-gallery-filter-option:focus-visible{background:#eeece3}
 .midcity-gallery-filter-option[aria-selected="true"]{background:var(--forest);color:var(--paper)}
 .midcity-gallery-filter-option[aria-selected="true"]::after{content:"✓";font-size:13px;font-weight:700}
 .midcity-gallery-item{margin-bottom:10px}
 .gallery-viewer-content{max-width:calc(100% - 24px);max-height:calc(100% - 130px)}
 .gallery-viewer-content img{max-height:calc(100dvh - 180px)}
 .gallery-viewer-close{top:14px;right:14px}
 .gallery-viewer-controls{grid-template-columns:44px minmax(64px,auto) 44px;gap:12px}
 .gallery-viewer-counter{font-size:13px}
 .midcity-gallery-viewer button{width:44px;height:44px}
}

@media(max-height:420px){.gallery-viewer-content img{max-height:calc(100dvh - 136px)}.gallery-viewer-content{gap:6px}.gallery-viewer-controls{bottom:10px}.gallery-viewer-close{top:10px;right:10px}}
