.property-gallery { position: relative; display: grid; grid-template-columns: 2fr 1fr; grid-template-rows: repeat(2, minmax(0, 1fr)); gap: 5px; height: min(57vw, 610px); min-height: 400px; overflow: hidden; border-radius: 12px; background: var(--bg); }
.property-gallery .gallery-tile { display: block; width: 100%; height: 100%; min-width: 0; overflow: hidden; background: var(--bg); }
.property-gallery .gallery-tile:first-child { grid-row: span 2; }
.property-gallery .gallery-tile img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.property-gallery .gallery-tile:hover img { transform: scale(1.035); }
.property-gallery.single { display: block; }
.property-gallery.two-photos { grid-template-rows: minmax(0, 1fr); }
.property-gallery.two-photos .gallery-tile:first-child { grid-row: auto; }
.property-gallery .gallery-count { position: absolute; right: 20px; bottom: 20px; z-index: 1; padding: 13px 18px; border: 1px solid var(--line); border-radius: 5px; background: white; color: var(--navy); font-size: 12px; font-weight: 650; letter-spacing: .04em; text-align: center; }
.gallery-dialog { width: 100vw; max-width: 100vw; height: 100vh; height: 100dvh; max-height: 100dvh; margin: 0; padding: 0; border: 0; background: #121b22; color: white; overflow: hidden; }
.gallery-dialog[open] { display: grid; grid-template-rows: 68px minmax(0, 1fr) 100px; }
.gallery-dialog::backdrop { background: #091219f5; }
.gallery-dialog-bar { display: flex; align-items: center; gap: 18px; padding: 8px 22px; border-bottom: 1px solid #ffffff20; }
.gallery-dialog-title { min-width: 0; flex: 1; display: grid; gap: 4px; }
.gallery-dialog-title strong { font-size: 12px; font-weight: 650; }
.gallery-dialog-title > span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 12px; color: #d1dce4; }
#gallery-progress { flex-shrink: 0; font-size: 13px; font-variant-numeric: tabular-nums; }
.gallery-dialog button { border: 0; border-radius: 5px; background: transparent; color: white; cursor: pointer; }
#gallery-close { width: 44px; height: 44px; padding: 8px; font-size: 22px; flex-shrink: 0; }
.gallery-dialog-stage { min-height: 0; display: flex; align-items: center; gap: 12px; padding: 14px 18px; touch-action: pan-y pinch-zoom; }
.gallery-dialog-stage > button { flex: 0 0 44px; height: 54px; padding: 8px; font-size: 28px; }
.gallery-dialog-image { flex: 1; min-width: 0; height: 100%; display: flex; align-items: center; justify-content: center; }
#gallery-active { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
#gallery-active.is-loading { opacity: .3; }
.gallery-image-error { font-size: 14px; color: #e8d5bc; text-align: center; }
.gallery-dialog-thumbs { display: flex; gap: 7px; overflow-x: auto; overflow-y: hidden; padding: 10px 18px; border-top: 1px solid #ffffff20; scrollbar-width: thin; scrollbar-color: #9bafbb #121b22; }
.gallery-dialog-thumbs > button { flex: 0 0 102px; height: 74px; padding: 0; opacity: .55; border: 2px solid transparent; overflow: hidden; }
.gallery-dialog-thumbs > button:first-child { margin-left: auto; }
.gallery-dialog-thumbs > button:last-child { margin-right: auto; }
.gallery-dialog-thumbs > button.active { opacity: 1; border-color: var(--gold); }
.gallery-dialog-thumbs img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 1050px) { .property-gallery { height: 52vw; min-height: 350px; } }
@media (max-width: 760px) {
  .property-gallery { height: 430px; min-height: 0; grid-template-columns: 1fr 1fr; grid-template-rows: 2fr 1fr; }
  .property-gallery .gallery-tile:first-child { grid-column: span 2; grid-row: auto; }
  .property-gallery.two-photos { grid-template-columns: 1fr; grid-template-rows: 2fr 1fr; }
  .property-gallery.two-photos .gallery-tile:first-child { grid-column: auto; }
  .property-gallery .gallery-count { right: 10px; bottom: 10px; padding: 10px; font-size: 10px; }
  .gallery-dialog[open] { grid-template-rows: 64px minmax(0, 1fr) 82px; }
  .gallery-dialog-bar { padding-inline: 10px; gap: 10px; }
  .gallery-dialog-stage { gap: 5px; padding: 10px 5px; }
  .gallery-dialog-stage > button { flex-basis: 40px; padding: 5px; font-size: 22px; }
  .gallery-dialog-thumbs { padding: 8px; }
  .gallery-dialog-thumbs > button { flex-basis: 82px; height: 58px; }
}
@media (prefers-reduced-motion: reduce) { .property-gallery .gallery-tile img { transition: none; } }
@media print { .gallery-dialog, .gallery-count { display: none !important; } .property-gallery { height: 350px; min-height: 0; } }
