html:has(#property-gallery[open]){background:var(--gallery-background,#49392E)}
#property-gallery:not([open]){display:none}
#property-gallery{position:fixed;inset:0;width:100%;height:100dvh;max-width:none;max-height:none;margin:0;padding:0;border:0;overflow:hidden;background:var(--gallery-background,#49392E);color:var(--gallery-foreground,#EFE7D7);font-family:var(--nav-display)}
#property-gallery::backdrop{background:transparent}
#property-gallery[open]{display:grid;grid-template-rows:auto minmax(0,1fr) auto}
.pg-top{display:flex;align-items:center;justify-content:space-between;gap:25px;padding:20px var(--nav-gutter)}
.pg-top h2{font-size:18px;line-height:1.2;letter-spacing:-.035em;font-weight:600;margin:0}
.pg-close{min-height:44px;min-width:65px;background:none;border:0;color:inherit;font:inherit;font-size:12px;cursor:pointer}
.pg-image{position:relative;min-height:0;margin:0 var(--nav-gutter)}
.pg-image img{position:absolute;inset:0;width:100%;height:100%;max-width:100%;max-height:100%;object-fit:contain;background:var(--gallery-background,#49392E)}
.pg-bottom{padding:20px var(--nav-gutter) 26px;display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:0 30px}
.pg-caption{font-family:var(--nav-reading);font-size:18px;line-height:1.3;margin:0;max-width:65%}
.pg-notice{flex:0 0 100%;margin:10px 0 0;font-family:var(--nav-display);font-size:12px;line-height:1.4}
#property-gallery [hidden]{display:none}
.pg-controls{display:flex;align-items:center;gap:15px;font-size:12px;white-space:nowrap}
.pg-controls button{height:44px;width:44px;display:grid;place-items:center;border:1px solid #efe7d766;background:none;color:inherit;cursor:pointer}
.pg-controls svg{height:22px;width:22px;fill:none;stroke:currentColor;stroke-width:1.2}
#property-gallery :focus-visible{outline:2px solid currentColor;outline-offset:5px}
@media(max-width:760px){.pg-top{padding-block:16px}.pg-top h2{font-size:16px;max-width:230px}.pg-image{margin-inline:0}.pg-bottom{display:block;padding-block:20px}.pg-caption{max-width:none;margin-bottom:20px}.pg-controls{justify-content:space-between;gap:20px}}
@media(max-width:360px){.pg-top h2{max-width:190px}}

/* Keep each property's own gallery colors and desktop framing. */
#property-gallery[data-gallery-mobile="property"]{overscroll-behavior:contain}
#property-gallery[data-gallery-mobile="property"] .pg-image{touch-action:pan-y pinch-zoom;user-select:none;-webkit-user-select:none}
#property-gallery[data-gallery-mobile="property"] .pg-controls button{border-color:currentColor;border-color:color-mix(in srgb,currentColor 45%,transparent);flex-shrink:0}
#property-gallery[data-gallery-mobile="property"] .pg-close{flex-shrink:0}

@media(max-width:760px),(min-width:761px) and (max-width:1024px) and (max-height:480px){
 #property-gallery[data-gallery-mobile="property"] .pg-top{padding:calc(8px + env(safe-area-inset-top,0px)) var(--nav-gutter) 8px;gap:16px;min-width:0}
 #property-gallery[data-gallery-mobile="property"] .pg-top h2{min-width:0;max-width:none;max-height:3.6em;overflow-y:auto;overscroll-behavior:contain;font-size:17px;line-height:1.2;overflow-wrap:anywhere}
 #property-gallery[data-gallery-mobile="property"] .pg-close{min-width:66px;min-height:44px}
 #property-gallery[data-gallery-mobile="property"] .pg-bottom{display:grid;grid-template-columns:minmax(0,1fr);gap:12px;min-height:0;padding:12px var(--nav-gutter) calc(14px + env(safe-area-inset-bottom,0px))}
 #property-gallery[data-gallery-mobile="property"] .pg-caption{max-width:none;max-height:5em;overflow-y:auto;overscroll-behavior:contain;margin:0;font-size:18px;line-height:1.25;overflow-wrap:anywhere}
 #property-gallery[data-gallery-mobile="property"] .pg-controls{justify-content:space-between;width:100%;gap:12px}
 #property-gallery[data-gallery-mobile="property"] .pg-controls button{width:48px;height:48px}
 #property-gallery[data-gallery-mobile="property"] [data-gallery-count]{min-width:42px;text-align:center}
 #property-gallery[data-gallery-mobile="property"] .pg-notice{grid-column:1/-1;margin:0;max-height:4em;overflow-y:auto;overscroll-behavior:contain}
}
@media(min-width:480px) and (max-width:1024px) and (max-height:480px){
 #property-gallery[data-gallery-mobile="property"][open]{grid-template-columns:minmax(0,1fr) minmax(160px,34%);grid-template-rows:auto minmax(0,1fr)}
 #property-gallery[data-gallery-mobile="property"] .pg-top{grid-column:1/-1;padding-block:calc(6px + env(safe-area-inset-top,0px)) 6px}
 #property-gallery[data-gallery-mobile="property"] .pg-top h2{max-height:2.4em}
 #property-gallery[data-gallery-mobile="property"] .pg-image{grid-column:1;grid-row:2;margin:0 0 calc(12px + env(safe-area-inset-bottom,0px)) 16px}
 #property-gallery[data-gallery-mobile="property"] .pg-bottom{grid-column:2;grid-row:2;grid-template-rows:minmax(0,1fr) auto auto;align-content:stretch;padding:8px 16px calc(12px + env(safe-area-inset-bottom,0px)) 12px;gap:8px}
 #property-gallery[data-gallery-mobile="property"] .pg-caption{align-self:start;min-height:0;max-height:100%;font-size:16px}
 #property-gallery[data-gallery-mobile="property"] .pg-controls{grid-row:2;gap:4px}
 #property-gallery[data-gallery-mobile="property"] .pg-controls button{width:44px;height:44px}
 #property-gallery[data-gallery-mobile="property"] [data-gallery-count]{min-width:32px}
 #property-gallery[data-gallery-mobile="property"] .pg-notice{grid-row:3;max-height:4em}
}
@media(max-width:479px) and (max-height:480px){
 #property-gallery[data-gallery-mobile="property"] .pg-top{padding-block:calc(6px + env(safe-area-inset-top,0px)) 6px}
 #property-gallery[data-gallery-mobile="property"] .pg-top h2{max-height:2.4em}
 #property-gallery[data-gallery-mobile="property"] .pg-bottom{gap:8px;padding-block:8px calc(8px + env(safe-area-inset-bottom,0px))}
 #property-gallery[data-gallery-mobile="property"] .pg-caption{max-height:2.5em;font-size:16px}
 #property-gallery[data-gallery-mobile="property"] .pg-controls button{width:44px;height:44px}
}
