#gallery-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .35rem .5rem;
  margin-block: 1.25rem;
}
#gallery-filters:empty { display: none; }
.pg-filter {
  appearance: none;
  border: 1px solid #c8ceda;
  border-radius: 2rem;
  background: white;
  color: #26354b;
  padding: .55rem 1rem;
  min-height: 44px;
  font-family: inherit;
  font-size: .9375rem;
  font-weight: 500;
  line-height: 1.2;
  cursor: pointer;
}
.pg-filter[aria-pressed="true"] { color: white; background: #012169; border-color: #012169; }
.pg-filter:hover:not([aria-pressed="true"]) { border-color: #012169; color: #012169; }
#gallery-grid {
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  align-items: start;
  gap: clamp(.5rem, 1.2vw, 1.25rem);
  scroll-margin-top: 7rem;
}
.pg-tile {
  display: block;
  width: 100%;
  position: relative;
  overflow: hidden;
  aspect-ratio: 1.48;
  margin: 0;
  padding: 0;
  background: #e3e6e9;
  border: 0;
  border-radius: 0;
  cursor: zoom-in;
}
.pg-tile img {
  display: block;
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .3s ease;
}
.pg-zoom-icon {
  position: absolute;
  right: .65rem; bottom: .65rem;
  width: 2rem; height: 2rem;
  display: grid;
  place-items: center;
  background: #fff;
  color: #012169;
  border-radius: 50%;
  font: 400 1.3rem/1 system-ui, sans-serif;
  pointer-events: none;
}
@media (hover:hover) {
  .pg-tile:hover img { transform: scale(1.025); }
}
#gallery-more[hidden], .property-viewer [hidden] { display: none; }
.pg-tile:focus-visible, .pg-filter:focus-visible, .property-viewer :focus-visible {
  outline: 3px solid #3983dc;
  outline-offset: 3px;
}
.pv-open { overflow: hidden; }
dialog.property-viewer {
  box-sizing: border-box;
  position: fixed;
  inset: 0;
  width: min(100%, 94rem);
  max-width: none;
  height: min(100%, 76rem);
  max-height: none;
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: #080e19;
  color: white;
  overflow: hidden;
}
.property-viewer::backdrop { background: rgba(0, 5, 14, .97); }
.property-viewer[open] { display: grid; grid-template-rows: auto minmax(0,1fr) auto; }
.pv-head, .pv-caption, .pv-plan-foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: .7rem; min-width: 0;
  padding: .55rem clamp(1rem, 3vw, 3rem);
}
.pv-head {
  padding-top: max(.6rem, env(safe-area-inset-top));
  border-bottom: 1px solid #ffffff26;
}
.pv-heading {
  color: white;
  margin: 0;
  font: 500 1.125rem/1.25 system-ui, sans-serif;
  letter-spacing: normal;
}
.pv-tools { display: flex; }
.pv-button, .pv-arrow {
  display: inline-flex;
  align-items: center; justify-content: center;
  font: 500 .9375rem/1.3 system-ui, sans-serif;
  color: white;
  min-height: 44px;
  border: 1px solid #ffffff66;
  background: #15202e;
  padding: .55rem 1rem;
  border-radius: .2rem;
  text-decoration: none; cursor: pointer;
}
.pv-button:hover, .pv-arrow:hover { background: #28374b; color: white; }
.pv-close { gap: .6rem; }
.pv-x { display: block; position: relative; width: .9rem; height: .9rem; }
.pv-x::before, .pv-x::after {
  content: ''; display: block; position: absolute;
  height: 1.5px; width: 100%; top: 50%;
  background: currentColor; transform: rotate(45deg);
}
.pv-x::after { transform: rotate(-45deg); }
.pv-stage-frame {
  display: grid;
  gap: clamp(.4rem, 1.5vw, 1.5rem);
  grid-template-columns: auto minmax(0,1fr) auto;
  grid-template-areas: "previous image next";
  padding: .7rem clamp(.65rem,2vw,2rem);
  min-height: 0;
}
.pv-stage {
  grid-area: image;
  display: grid;
  position: relative;
  place-items: center;
  min-width: 0; min-height: 0;
  touch-action: pan-y pinch-zoom;
}
.pv-stage img { width: 100%; height: 100%; object-fit: contain; min-width: 0; min-height: 0; }
.pv-arrow {
  width: 46px; height: 46px;
  align-self: center; padding: 0; border-radius: 50%;
}
.pv-arrow::before {
  display: block; content: ''; height: .62rem; width: .62rem;
  border-top: 2px solid currentColor; border-right: 2px solid currentColor;
}
.pv-prev { grid-area: previous; }
.pv-next { grid-area: next; }
.pv-prev::before { transform: translateX(.14rem) rotate(-135deg); }
.pv-next::before { transform: translateX(-.14rem) rotate(45deg); }
.pv-error { position: absolute; font: 1rem system-ui,sans-serif; }
.pv-caption, .pv-plan-foot {
  padding-top: .8rem;
  padding-bottom: max(1rem, env(safe-area-inset-bottom));
  border-top: 1px solid #ffffff26;
}
.pv-description { margin: 0; color: white; font: 400 1rem/1.5 system-ui,sans-serif; }
.pv-counter { flex: none; color: #dce3ef; font: 500 .95rem/1.4 system-ui,sans-serif; font-variant-numeric: tabular-nums; }
.pv-plan-stage {
  overflow: auto; min-height: 0;
  background: white;
  overscroll-behavior: contain;
}
.pv-plan-stage img { display: block; width: 100%; height: 100%; object-fit: contain; max-width: none; }
.pv-plan-stage.is-zoomed img { width: max(165%, 1050px); height: auto; }
.pv-plan-foot { justify-content: center; flex-wrap: wrap; }
.pv-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; border: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.property-share-feedback:not(:empty) {
  position: fixed; z-index: 50; bottom: max(1.5rem,env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%);
  padding: .75rem 1.1rem; max-width: 90vw;
  display: block; background: #012169; color: #fff; border: 1px solid white;
  border-radius: .25rem; font: 500 .95rem/1.3 system-ui,sans-serif;
}
@media (max-width: 650px) {
  #gallery-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  #gallery-grid:has(> :nth-child(3):last-child) > :first-child { grid-column: 1 / -1; aspect-ratio: 1.65; }
  .pg-zoom-icon { width: 1.5rem; height: 1.5rem; font-size: 1.05rem; right: .45rem; bottom: .45rem; }
  .pg-filter { padding: .45rem .82rem; }
  .pv-stage-frame {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: minmax(0,1fr) auto;
    grid-template-areas: "image image" "previous next";
    gap: .25rem .65rem;
    padding: 0 0 .65rem;
  }
  .pv-prev { justify-self:end; } .pv-next { justify-self:start; }
  .pv-caption { align-items: flex-start; }
  .pv-stage:only-child { grid-column: 1 / -1; }
}
@media (prefers-reduced-motion: reduce) {
  .pg-tile img { transition: none; }
}
