/* Vatreja Listings — self-contained, theme-agnostic card grid. */
.vatreja-listings { --vtj-cols: 3; margin: 1.5rem 0; }

.vatreja-listings .vtj-grid {
	display: grid;
	grid-template-columns: repeat(var(--vtj-cols), minmax(0, 1fr));
	gap: 1.25rem;
}
@media (max-width: 1024px) { .vatreja-listings .vtj-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px)  { .vatreja-listings .vtj-grid { grid-template-columns: 1fr; } }

.vatreja-listings .vtj-card {
	display: flex; flex-direction: column;
	border: 1px solid #e5e7eb; border-radius: 12px; overflow: hidden;
	background: #fff; color: inherit; text-decoration: none;
	transition: box-shadow .15s ease, transform .15s ease;
}
.vatreja-listings .vtj-card:hover { box-shadow: 0 6px 20px rgba(0,0,0,.10); transform: translateY(-2px); }

.vatreja-listings .vtj-card__media { position: relative; aspect-ratio: 4 / 3; background: #f3f4f6; }
.vatreja-listings .vtj-card__img { width: 100%; height: 100%; object-fit: cover; display: block; }
.vatreja-listings .vtj-card__img--empty { width: 100%; height: 100%; }

.vatreja-listings .vtj-badge {
	position: absolute; top: 10px; left: 10px;
	padding: 3px 10px; border-radius: 999px;
	font-size: 12px; font-weight: 700; color: #fff; background: #0f172a;
}
.vatreja-listings .vtj-badge--rent { background: #2563eb; }
.vatreja-listings .vtj-badge--sale { background: #059669; }

.vatreja-listings .vtj-card__photos {
	position: absolute; bottom: 10px; right: 10px;
	padding: 2px 8px; border-radius: 999px;
	font-size: 12px; font-weight: 600; color: #fff; background: rgba(0,0,0,.6);
}
.vatreja-listings .vtj-card__photos::before { content: "\1F4F7"; margin-right: 4px; }

.vatreja-listings .vtj-card__body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 4px; }
.vatreja-listings .vtj-card__price { font-size: 1.05rem; font-weight: 800; letter-spacing: -.01em; }
.vatreja-listings .vtj-card__title { font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.vatreja-listings .vtj-card__loc { color: #6b7280; font-size: .9rem; }
.vatreja-listings .vtj-card__stats { color: #374151; font-size: .85rem; margin-top: 2px; }

.vatreja-listings .vtj-notice {
	grid-column: 1 / -1; margin-top: 1rem; padding: 12px 14px;
	border: 1px dashed #cbd5e1; border-radius: 10px; background: #f8fafc; color: #334155; font-size: .92rem;
}
.vatreja-listings .vtj-attrib { margin-top: .9rem; font-size: .8rem; color: #9ca3af; text-align: right; }
.vatreja-listings .vtj-attrib a { color: inherit; text-decoration: underline; }

.vatreja-listings--empty { color: #6b7280; }

@media (prefers-color-scheme: dark) {
	.vatreja-listings .vtj-card { background: #0b1120; border-color: #1f2937; }
	.vatreja-listings .vtj-card__loc { color: #94a3b8; }
	.vatreja-listings .vtj-card__stats { color: #cbd5e1; }
	.vatreja-listings .vtj-notice { background: #0b1120; border-color: #334155; color: #cbd5e1; }
}

/* ---- vatreja/* blocks (structure only; the theme pack owns the look through its colour slots) ---- */
.vtj-b { box-sizing: border-box; }
.vtj-b .vtj-grid { display: grid; gap: 1rem; grid-template-columns: repeat(var(--vtj-cols, 3), minmax(0, 1fr)); }
@media (max-width: 782px) { .vtj-b .vtj-grid { grid-template-columns: repeat(min(var(--vtj-cols, 3), 2), minmax(0, 1fr)); } }
@media (max-width: 480px) { .vtj-b .vtj-grid { grid-template-columns: minmax(0, 1fr); } }
.vtj-card--compact .vtj-card__media { display: none; }
.vtj-card--photo { position: relative; }
.vtj-card--photo .vtj-card__body { position: absolute; inset: auto 0 0 0; background: var(--wp--preset--color--contrast, #000); color: var(--wp--preset--color--base, #fff); }
.vtj-search { display: flex; flex-wrap: wrap; gap: .75rem; align-items: end; }
.vtj-search--stacked { flex-direction: column; align-items: stretch; }
.vtj-field { display: flex; flex-direction: column; gap: .25rem; }
.vtj-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.vtj-paging { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.vtj-gal--grid { display: grid; gap: .5rem; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.vtj-gal--grid .vtj-gal__item:first-child { grid-column: 1 / -1; }
.vtj-gal--carousel { display: flex; gap: .5rem; overflow-x: auto; scroll-snap-type: x mandatory; }
.vtj-gal--carousel .vtj-gal__item { flex: 0 0 85%; scroll-snap-align: start; }
.vtj-gal__item { margin: 0; }
.vtj-gal__item img { display: block; width: 100%; height: auto; }
.vtj-facts--grid { display: grid; gap: .75rem 1.5rem; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.vtj-facts__row dt { opacity: .7; }
.vtj-facts__row dd { margin: 0; font-weight: 600; }
.vtj-map__frame { display: block; width: 100%; border: 0; }
.vtj-map--small .vtj-map__frame { height: 240px; }
.vtj-map--medium .vtj-map__frame { height: 360px; }
.vtj-map--large .vtj-map__frame { height: 480px; }
.vtj-contact--card { display: flex; flex-direction: column; gap: .4rem; }
.vtj-contact--inline { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; }
.vtj-form .vtj-field input, .vtj-form .vtj-field textarea { width: 100%; box-sizing: border-box; }
.vtj-form { display: flex; flex-direction: column; gap: .75rem; }
.vtj-search .vtj-field { flex: 1 1 160px; min-width: 0; }
.vtj-search .vtj-field input, .vtj-search .vtj-field select { width: 100%; box-sizing: border-box; }
.vtj-search .vtj-btn { flex: 0 0 auto; }
.vtj-search--stacked .vtj-field { flex: 0 0 auto; }

/* ---- the search on phones: type + Filters + Search in one row, the rest opens under it ----
 * The script adds `hidden` to .vtj-search__more and .vtj-js-collapsible to the form; without it nothing is hidden.
 * On wide screens the hidden attribute is ignored, so desktop always shows every filter. */
.vtj-search__more { display: contents; }
.vtj-search__primary { display: contents; }
.vtj-search .vtj-search__toggle { display: none; } /* two classes: a theme's button rule (button.vtj-btn) must not show it on wide screens */
.vtj-search .vtj-search__primary > .vtj-field { order: 1; }
.vtj-search .vtj-search__more > .vtj-field { order: 2; }
.vtj-search .vtj-search__submit { order: 3; }
@media (min-width: 783px) {
	.vtj-search__more[hidden] { display: contents; }
}
@media (max-width: 782px) {
	.vtj-search.vtj-js-collapsible { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: end; gap: .5rem; }
	.vtj-search.vtj-js-collapsible .vtj-search__primary { display: block; grid-row: 1; grid-column: 1; min-width: 0; }
	.vtj-search.vtj-js-collapsible .vtj-search__toggle { display: inline-flex; grid-row: 1; grid-column: 2; }
	.vtj-search.vtj-js-collapsible .vtj-search__submit { grid-row: 1; grid-column: 3; }
	.vtj-search.vtj-js-collapsible .vtj-search__more { display: flex; grid-row: 2; grid-column: 1 / -1; flex-direction: column; gap: .75rem; }
	.vtj-search.vtj-js-collapsible .vtj-search__more[hidden] { display: none; }
	.vtj-search.vtj-js-collapsible .vtj-field { flex: 0 0 auto; }
}

/* ---- agency sections on the home: areas as links, about as text ---- */
.vtj-agency-areas__list { display: flex; flex-wrap: wrap; gap: .5rem 1rem; list-style: none; margin: 0; padding: 0; }

/* ---- cards in blocks: the structure the shortcode's rules give .vatreja-listings, so a theme without the pack's CSS still crops photos ---- */
.vtj-b .vtj-card__media { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: #f3f4f6; }
.vtj-b .vtj-card__img { width: 100%; height: 100%; object-fit: cover; display: block; }
.vtj-b .vtj-card__body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 4px; }

/* ---- the gallery viewer (vatreja-gallery.js); without the script the links open the photos ---- */
.vtj-gal__link { display: block; }
.vtj-gal__link img { display: block; width: 100%; }
dialog.vtj-lightbox { position: fixed; inset: 0; margin: 0; border: 0; padding: 0; width: 100%; height: 100%; height: 100dvh; max-width: none; max-height: none; overflow: hidden; background: #000; color: #fff; }
dialog.vtj-lightbox::backdrop { background: #000; }
dialog.vtj-lightbox .vtj-lightbox__img { position: absolute; inset: 0; box-sizing: border-box; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: calc(3.5rem + env(safe-area-inset-top, 0px)) calc(3.5rem + env(safe-area-inset-right, 0px)) calc(1rem + env(safe-area-inset-bottom, 0px)) calc(3.5rem + env(safe-area-inset-left, 0px)); object-fit: contain; background: transparent; border: 0; border-radius: 0; box-shadow: none; }
dialog.vtj-lightbox button { position: absolute; display: inline-flex; align-items: center; justify-content: center; min-width: 44px; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 999px; background: rgba(255,255,255,.18); color: #fff; font: inherit; font-size: 1.5rem; line-height: 1; cursor: pointer; }
dialog.vtj-lightbox .vtj-lightbox__close { top: calc(.5rem + env(safe-area-inset-top, 0px)); right: calc(.5rem + env(safe-area-inset-right, 0px)); }
dialog.vtj-lightbox .vtj-lightbox__prev { left: calc(.25rem + env(safe-area-inset-left, 0px)); top: 50%; transform: translateY(-50%); }
dialog.vtj-lightbox .vtj-lightbox__next { right: calc(.25rem + env(safe-area-inset-right, 0px)); top: 50%; transform: translateY(-50%); }
@media (max-width: 600px) { dialog.vtj-lightbox .vtj-lightbox__img { padding: calc(3.5rem + env(safe-area-inset-top, 0px)) env(safe-area-inset-right, 0px) calc(1rem + env(safe-area-inset-bottom, 0px)) env(safe-area-inset-left, 0px); } }

/* ---- 0.2.6 structure only; the look is the theme's ---- */
.vtj-seg { display: inline-flex; }
.vtj-seg__opt { position: relative; cursor: pointer; }
.vtj-seg__opt input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.vtj-seg__opt input:focus-visible + span { outline: 2px solid currentColor; outline-offset: 2px; }
.vtj-hero { position: relative; }
.vtj-hero__media { position: absolute; inset: 0; overflow: hidden; }
.vtj-hero__img { width: 100%; height: 100%; object-fit: cover; display: block; }
.vtj-hero__inner { position: relative; }
.vtj-gal--carousel { position: relative; }
.vtj-gal__track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.vtj-gal__track::-webkit-scrollbar { display: none; }
.vtj-gal__track > .vtj-gal__item { flex: 0 0 100%; scroll-snap-align: start; margin: 0; }
.vtj-gal__counter { position: absolute; top: .75rem; right: .75rem; background: rgba(0,0,0,.6); color: #fff; border-radius: 999px; padding: .15rem .65rem; font-size: .8rem; }
.vtj-gal__dots { display: flex; justify-content: center; gap: .4rem; padding: .5rem 0; }
.vtj-gal__dot { width: .55rem; height: .55rem; padding: 0; border: 0; border-radius: 50%; background: currentColor; opacity: .3; cursor: pointer; }
.vtj-gal__dot[aria-current] { opacity: 1; }
.vtj-gal__thumbs { display: flex; gap: .5rem; overflow-x: auto; }
.vtj-gal__thumb { flex: 0 0 auto; width: 96px; padding: 0; border: 0; background: none; cursor: pointer; }
.vtj-gal__thumb img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; }
.vtj-gal__thumb:focus-visible, .vtj-gal__dot:focus-visible, .vtj-gal__track:focus-visible, .vtj-gal__link:focus-visible { outline: 3px solid currentColor; outline-offset: 2px; }
dialog.vtj-lightbox button:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.vtj-card__media picture, .vtj-gal__link picture { display: contents; }
.vtj-card__price { position: absolute; left: .75rem; bottom: .75rem; }
.vtj-card--row .vtj-card__price { position: static; }
.vtj-card--row { display: grid; grid-template-columns: minmax(96px, 40%) 1fr; }
.vtj-card__facts, .vtj-features__list, .vtj-agency-areas__list { list-style: none; margin: 0; padding: 0; }
.vtj-card__facts { display: flex; flex-wrap: wrap; gap: .35rem; }
.vtj-features__list { columns: 2; gap: 1rem; }
.vtj-features--1 .vtj-features__list { columns: 1; }
.vtj-agent__photo { border-radius: 50%; object-fit: cover; }
.vtj-agent__actions { display: flex; flex-wrap: wrap; gap: .5rem; }
