/**
 * Vandas Properties front-end styles.
 * All colours and layout values are driven by CSS custom properties which are
 * printed inline from the plugin settings, so the client controls them.
 * Logical properties are used throughout so the layout is direction-safe.
 */

.vdp-listing {
	inline-size: 100%;
}

/* Grid */

.vdp-grid {
	display: grid;
	grid-template-columns: repeat(var(--vdp-cols-mobile, 1), minmax(0, 1fr));
	gap: 24px;
}

@media (min-width: 768px) {
	.vdp-grid {
		grid-template-columns: repeat(var(--vdp-cols-tablet, 2), minmax(0, 1fr));
	}
}

@media (min-width: 1025px) {
	.vdp-grid {
		grid-template-columns: repeat(var(--vdp-cols-desktop, 3), minmax(0, 1fr));
	}
}

/* Card */

.vdp-card {
	display: flex;
	flex-direction: column;
	background: var(--vdp-card-bg, #e3f2f7);
	border-radius: var(--vdp-radius, 0);
	overflow: hidden;
	block-size: 100%;
}

.vdp-card__media {
	display: block;
	position: relative;
	aspect-ratio: 4 / 3;
	overflow: hidden;
	background: #d8e6ea;
}

.vdp-card__image {
	inline-size: 100%;
	block-size: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.4s ease;
}

@media (prefers-reduced-motion: reduce) {
	.vdp-card__image {
		transition: none;
	}
}

.vdp-card:hover .vdp-card__image {
	transform: scale(1.04);
}

.vdp-card__image--placeholder {
	background: linear-gradient(135deg, #d8e6ea, #c3d9df);
}

.vdp-card__body {
	padding: 20px;
	display: flex;
	flex-direction: column;
	gap: 10px;
	flex: 1 1 auto;
}

/* Rating */

.vdp-card__rating {
	display: flex;
	gap: 2px;
	line-height: 1;
}

.vdp-star {
	color: #c9d6da;
	font-size: 16px;
}

.vdp-star.is-filled {
	color: var(--vdp-star, #f5a623);
}

/* Title */

.vdp-card__title {
	margin: 0;
	font-size: 20px;
	line-height: 1.3;
	font-weight: 700;
}

.vdp-card__title a {
	color: var(--vdp-heading, #0a7d6e);
	text-decoration: none;
}

.vdp-card__title a:hover,
.vdp-card__title a:focus-visible {
	text-decoration: underline;
}

/* Location */

.vdp-card__location {
	margin: 0;
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 15px;
	color: #2f4a52;
}

.vdp-card__pin {
	color: var(--vdp-heading, #0a7d6e);
	display: inline-flex;
	flex: 0 0 auto;
}

/* Status */

.vdp-card__status {
	margin: 4px 0 0;
	color: var(--vdp-status, #e02b20);
	font-size: 22px;
	font-weight: 700;
	line-height: 1.2;
	text-transform: uppercase;
}

/* Price */

.vdp-card__price {
	margin: 0;
	font-size: 20px;
	font-weight: 700;
	color: var(--vdp-heading, #0a7d6e);
}

/* CTA */

.vdp-card__cta {
	margin: 8px 0 0;
	margin-block-start: auto;
	padding-block-start: 8px;
}

.vdp-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: var(--vdp-btn-bg, #0d7a8c);
	color: var(--vdp-btn-text, #fff);
	padding: 12px 22px;
	border: 0;
	border-radius: 4px;
	font-family: inherit;
	font-size: 15px;
	font-weight: 600;
	line-height: 1;
	text-decoration: none;
	text-align: center;
	cursor: pointer;
	box-sizing: border-box;
	transition: opacity 0.2s ease;
}

.vdp-button:hover,
.vdp-button:focus-visible {
	opacity: 0.88;
	color: var(--vdp-btn-text, #fff);
}

.vdp-button:focus-visible {
	outline: 3px solid var(--vdp-primary, #0d7a8c);
	outline-offset: 2px;
}

/* Search form */

.vdp-search {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	gap: 20px;
	background: #fff;
	border-radius: 10px;
	padding: 24px;
	box-shadow: 0 2px 18px rgba(15, 60, 70, 0.08);
}

/* Mobile stacks, because five controls on one line is not usable. */
.vdp-search__field {
	flex: 1 1 100%;
	min-inline-size: 0;
}

/**
 * From tablet up the form is locked to a single line.
 * min-inline-size:0 lets the fields shrink below their intrinsic content width,
 * which is what stops a long option label forcing a wrap.
 */
@media (min-width: 782px) {
	.vdp-search {
		flex-wrap: nowrap;
		gap: 16px;
	}

	.vdp-search__field {
		flex: 1 1 0;
		min-inline-size: 0;
	}
}

.vdp-search__label {
	display: block;
	margin-block-end: 8px;
	font-size: 13px;
	font-weight: 700;
	color: #22414a;
}

.vdp-search__select-wrap {
	position: relative;
}

.vdp-search__select {
	inline-size: 100%;
	max-inline-size: 100%;
	appearance: none;
	-webkit-appearance: none;
	background: #fff;
	border: 1px solid #d5dfe2;
	border-radius: 8px;
	/* An explicit height and matching line-height keep the label vertically
	   centred no matter what the theme sets on select elements. Padding alone
	   is not reliable, because a theme height rule would clip the text. */
	block-size: 48px;
	line-height: 46px;
	padding-block: 0;
	padding-inline: 14px 40px;
	margin: 0;
	font-size: 15px;
	font-family: inherit;
	color: #46626b;
	cursor: pointer;
	box-sizing: border-box;
	/* A long label is truncated rather than allowed to widen the select.
	   overflow is left at its default, since hiding it clips the text. */
	text-overflow: ellipsis;
	white-space: nowrap;
}

.vdp-search__select:focus-visible {
	outline: none;
	border-color: var(--vdp-primary, #0d7a8c);
	box-shadow: 0 0 0 3px rgba(13, 122, 140, 0.22);
}

.vdp-search__select-wrap::after {
	content: "";
	position: absolute;
	inset-inline-end: 16px;
	inset-block-start: 50%;
	inline-size: 9px;
	block-size: 9px;
	border-inline-end: 2px solid #6c8288;
	border-block-end: 2px solid #6c8288;
	/* Rotating a square shifts its visual centre, so the translate compensates
	   to keep the chevron optically centred against the 48px select. */
	transform: translateY(-75%) rotate(45deg);
	pointer-events: none;
}

.vdp-search__actions {
	display: flex;
	gap: 12px;
	flex: 0 0 auto;
	inline-size: 100%;
}

@media (min-width: 782px) {
	.vdp-search__actions {
		inline-size: auto;
	}
}

.vdp-button--search,
.vdp-button--reset {
	background: var(--vdp-primary, #0d7a8c);
	/* The height matches the select exactly so the row aligns cleanly. */
	block-size: 48px;
	padding-block: 0;
	padding-inline: 28px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
	letter-spacing: 0.04em;
	font-size: 14px;
	font-weight: 700;
	border-radius: 8px;
	box-sizing: border-box;
	/* The buttons hold their width so only the selects absorb the shrinking. */
	flex: 0 0 auto;
	white-space: nowrap;
}

/* No results */

.vdp-no-results {
	padding: 40px 24px;
	text-align: center;
	background: var(--vdp-card-bg, #e3f2f7);
	border-radius: var(--vdp-radius, 0);
}

/* Pagination */

.vdp-pagination {
	margin-block-start: 36px;
	display: flex;
	justify-content: center;
	gap: 8px;
}

.vdp-pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-inline-size: 40px;
	block-size: 40px;
	padding-inline: 10px;
	border-radius: 6px;
	background: #eef5f7;
	color: #22414a;
	text-decoration: none;
	font-weight: 600;
}

.vdp-pagination .page-numbers.current,
.vdp-pagination .page-numbers:hover {
	background: var(--vdp-primary, #0d7a8c);
	color: #fff;
}

/* Single property */

.vdp-single__inner {
	max-inline-size: 1200px;
	margin-inline: auto;
	padding: 40px 20px 72px;
}

.vdp-single__title {
	margin: 0 0 12px;
	font-size: clamp(28px, 4vw, 42px);
	line-height: 1.15;
	color: var(--vdp-heading, #0a7d6e);
}

.vdp-single__meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px 28px;
	margin-block-end: 28px;
}

.vdp-single__location {
	margin: 0;
	display: flex;
	align-items: center;
	gap: 6px;
	color: #2f4a52;
}

.vdp-single__status {
	margin: 0;
	color: var(--vdp-status, #e02b20);
	font-size: 20px;
	font-weight: 700;
	text-transform: uppercase;
}

.vdp-single__price {
	margin: 0;
	font-size: 26px;
	font-weight: 700;
	color: var(--vdp-heading, #0a7d6e);
}

.vdp-single__hero {
	margin: 0 0 40px;
	border-radius: var(--vdp-radius, 0);
	overflow: hidden;
}

.vdp-single__hero img {
	inline-size: 100%;
	block-size: auto;
	display: block;
}

.vdp-single__layout {
	display: grid;
	grid-template-columns: 1fr;
	gap: 40px;
	align-items: start;
}

@media (min-width: 900px) {
	.vdp-single__layout {
		grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
	}
}

.vdp-section {
	margin-block-end: 40px;
}

.vdp-section__title {
	margin: 0 0 16px;
	font-size: 24px;
	color: var(--vdp-heading, #0a7d6e);
}

/* Spec lists */

.vdp-specs {
	margin: 0;
	display: grid;
	gap: 0;
	border: 1px solid #e1ebee;
	border-radius: 8px;
	overflow: hidden;
}

.vdp-specs__row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
	padding: 12px 16px;
}

.vdp-specs__row:nth-child(odd) {
	background: #f4fafb;
}

.vdp-specs dt {
	margin: 0;
	font-weight: 600;
	color: #22414a;
}

.vdp-specs dd {
	margin: 0;
	color: #46626b;
}

/* Gallery */

.vdp-gallery-grid {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
	gap: 12px;
}

.vdp-gallery-grid img {
	inline-size: 100%;
	block-size: 100%;
	aspect-ratio: 4 / 3;
	object-fit: cover;
	display: block;
	border-radius: 6px;
}

/* Contact card */

.vdp-contact-card {
	background: var(--vdp-card-bg, #e3f2f7);
	border-radius: 10px;
	padding: 24px;
	position: sticky;
	inset-block-start: 24px;
}

.vdp-contact-card__title {
	margin: 0 0 14px;
	font-size: 20px;
	color: var(--vdp-heading, #0a7d6e);
}

.vdp-contact-card__name {
	margin: 0 0 8px;
	font-weight: 700;
}

.vdp-contact-card__row {
	margin: 0 0 10px;
}

.vdp-contact-card__row a {
	color: var(--vdp-primary, #0d7a8c);
}

/* Video */

.vdp-video iframe {
	inline-size: 100%;
	aspect-ratio: 16 / 9;
	block-size: auto;
	border: 0;
}

/* Accessibility helper, in case the theme does not provide it */

.vdp-card .screen-reader-text {
	position: absolute;
	inline-size: 1px;
	block-size: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}
