/*
Theme Name: Selected Property Child 0.3.5
Description: Selected Property Website mit kuratiertem Startseiten-Slider und druckbaren Objekt-Exposés.
Author: Selected Property
Template: selected-property-wpvibe-backup
Version: 0.3.5
Requires at least: 6.3
Requires PHP: 8.0
Text Domain: selected-property-child
*/

/* Listing cards match the approved three-column reference layout. */
main.overview-page .property-card-grid,
main.town-page .property-card-grid {
	display: grid !important;
	grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
	gap: 32px 26px !important;
}

main.overview-page article.property-card--overview,
main.town-page article.property-card--overview {
	min-width: 0;
	border: 0 !important;
	background: transparent !important;
	box-shadow: none !important;
}

article.property-card--overview .property-picture {
	display: block;
	width: 100%;
	aspect-ratio: 1.44 / 1;
	overflow: hidden;
	background: #f3f4f2;
}

article.property-card--overview .property-picture img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform .35s ease;
}

article.property-card--overview .property-picture:hover img {
	transform: scale(1.025);
}

article.property-card--overview .property-card-placeholder {
	width: 100%;
	height: 100%;
	background: linear-gradient(135deg, #f3f4f2, #e9ece8);
}

article.property-card--overview > .location {
	margin: 14px 0 7px !important;
	color: #68736d;
	font-size: .7rem !important;
	line-height: 1.35 !important;
	letter-spacing: .1em !important;
	text-transform: uppercase;
}

article.property-card--overview > h3 {
	min-height: 0 !important;
	margin: 0 0 10px !important;
	font-size: 1.22rem !important;
	line-height: 1.25 !important;
	font-weight: 500 !important;
	display: -webkit-box !important;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	overflow: hidden;
}

article.property-card--overview > h3 a {
	color: #18382f;
	text-decoration: none;
}

article.property-card--overview > .price {
	margin: 0 0 4px !important;
	color: #18382f;
	font-size: 1.05rem !important;
	line-height: 1.35 !important;
	font-weight: 500;
}

article.property-card--overview > .card-reference {
	margin: 0 0 5px;
	color: #6b756f;
	font-size: .72rem;
	line-height: 1.35;
}

article.property-card--overview > .property-facts {
	display: flex;
	flex-wrap: wrap;
	gap: 2px 12px;
	margin: 0;
	color: #59675f;
	font-size: .74rem;
	line-height: 1.4;
}

article.property-card--overview .property-fact {
	white-space: nowrap;
}

@media (max-width: 900px) {
	main.overview-page .property-card-grid,
	main.town-page .property-card-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
	}
}

@media (max-width: 650px) {
	main.overview-page .property-card-grid,
	main.town-page .property-card-grid {
		grid-template-columns: 1fr !important;
		gap: 28px !important;
	}
	article.property-card--overview > h3 {
		font-size: 1.12rem !important;
	}
}

/* Exposé details: tighter copy, clearer paragraph breaks, compact CEE image. */
body.single-sp_estate .sp-estate-page-heading h1 {
	font-size: clamp(calc(1.9rem - 4pt), calc(3vw - 4pt), calc(2.5rem - 4pt)) !important;
	/* Keep short property titles below the location label, like longer titles. */
	flex: 0 0 100%;
	width: 100%;
}

/* A quiet PDF exposé action sits on the property's existing reference line. */
body.single-sp_estate .sp-online-expose-wrap {
	display: inline-flex;
	vertical-align: middle;
	margin-left: 12px;
}

body.single-sp_estate .sp-online-expose-link {
	display: inline-flex;
	align-items: center;
	min-height: 28px;
	padding: 3px 0;
	border-bottom: 1px solid #8a9891;
	color: #173b32;
	font-size: 11px;
	line-height: 1.3;
	text-decoration: none;
	transition: color .2s ease, border-color .2s ease;
}

body.single-sp_estate .sp-online-expose-link:hover,
body.single-sp_estate .sp-online-expose-link:focus-visible {
	border-color: #173b32;
	color: #0f2c24;
}

body.single-sp_estate .sp-online-expose-fallback {
	margin: 8px 0 0;
}

.sp-property-detail .sp-detail-copy,
body.single-sp_estate .sp-estate-page-content .sp-detail-copy {
	font-size: 14px;
	line-height: 1.65;
	white-space: pre-line;
}

.sp-property-detail .sp-detail-copy p,
body.single-sp_estate .sp-estate-page-content .sp-detail-copy p {
	margin: 0 0 1.05em;
	line-height: 1.65;
}

.sp-property-detail .sp-detail-copy p + p,
body.single-sp_estate .sp-estate-page-content .sp-detail-copy p + p {
	margin-top: 1em;
}

.sp-property-detail .sp-energy-section img,
body.single-sp_estate .sp-energy-section img,
.sp-property-detail img.sp-energy-certificate-image,
body.single-sp_estate img.sp-energy-certificate-image {
	display: block;
	width: auto !important;
	height: auto !important;
	max-width: min(100%, 280px) !important;
	max-height: 210px !important;
	object-fit: contain !important;
	object-position: left center;
}

.sp-property-detail .sp-energy-image-wrap,
body.single-sp_estate .sp-energy-image-wrap {
	width: fit-content;
	max-width: min(100%, 280px);
	margin: 16px 0 22px;
}

.sp-property-detail .sp-facts li.sp-feature-flag strong,
body.single-sp_estate .sp-facts li.sp-feature-flag strong {
	display: none;
}

.property-page .detail-main h1 {
	font-size: calc(clamp(31px, 3vw, 45px) - 4pt) !important;
}

@media (max-width: 600px) {
	body.single-sp_estate .sp-estate-page-heading h1 {
		font-size: calc(31px - 4pt) !important;
	}
	.property-page .detail-main h1 {
		font-size: calc(34px - 4pt) !important;
	}
}

/* Keep the enquiry panel in the description row and sticky only on desktop. */
@media (min-width: 851px) {
	body.single-sp_estate .sp-estate-page,
	body.single-sp_estate .sp-estate-page-content,
	body.single-sp_estate .sp-estate-page-content > .sp-property-detail,
	body.single-sp_estate .sp-estate-page-content > .sp-property-detail .sp-detail-main,
	body.single-sp_estate .sp-estate-page-content > .sp-property-detail .sp-description-contact {
		overflow: visible !important;
	}
	body.single-sp_estate .sp-estate-page-content > .sp-property-detail {
		display: block !important;
	}
	body.single-sp_estate .sp-estate-page-content > .sp-property-detail .sp-detail-main {
		display: block !important;
		width: 100% !important;
		min-width: 0 !important;
	}
	body.single-sp_estate .sp-estate-page-content > .sp-property-detail .sp-description-contact {
		display: grid !important;
		grid-template-columns: minmax(0, 1fr) minmax(280px, 340px) !important;
		align-items: start !important;
		gap: clamp(2rem, 5vw, 5rem) !important;
		position: relative !important;
	}
	body.single-sp_estate .sp-estate-page-content > .sp-property-detail .sp-description-contact > .sp-contact-panel {
		position: sticky !important;
		position: -webkit-sticky !important;
		top: 24px !important;
		align-self: start !important;
		grid-area: auto !important;
		margin: 0 !important;
		transform: none !important; /* Clear the old Customizer offset. */
		max-height: calc(100vh - 48px) !important;
		overflow-y: auto !important;
	}
}

@media (max-width: 850px) {
	body.single-sp_estate .sp-estate-page-content > .sp-property-detail .sp-description-contact {
		display: grid !important;
		grid-template-columns: minmax(0, 1fr) !important;
	}
	body.single-sp_estate .sp-estate-page-content > .sp-property-detail .sp-description-contact > .sp-contact-panel {
		position: static !important;
		margin: 24px 0 0 !important;
		max-height: none !important;
		overflow: visible !important;
	}
}


/* Curated homepage hero slider with centered dots and quiet image arrows. */
.hero-image.sp-home-hero-slider {
	position: relative;
	isolation: isolate;
}

.sp-home-slider-track {
	position: absolute;
	inset: 0;
}

.sp-home-slider-slide {
	position: absolute;
	inset: 0;
	display: block;
	color: inherit;
	opacity: 0;
	visibility: hidden;
	transition: opacity .55s ease, visibility .55s ease;
}

.sp-home-slider-slide.is-active {
	z-index: 1;
	opacity: 1;
	visibility: visible;
}

.sp-home-slider-slide img {
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: 55% 55%;
}

.hero-image.sp-home-hero-slider .photo-label {
	right: auto;
	left: 25px;
	z-index: 2;
}

.hero-image.sp-home-hero-slider::after {
	pointer-events: none;
}

.sp-home-slider-controls {
	position: absolute;
	inset: 0;
	z-index: 5;
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0 17px;
	pointer-events: none;
}

.sp-home-slider-controls button {
	display: grid;
	place-items: center;
	width: 42px;
	height: 54px;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: transparent;
	color: rgba(78, 86, 82, .78);
	text-shadow: 0 1px 4px rgba(255, 255, 255, .58);
	cursor: pointer;
	pointer-events: auto;
	transition: color .2s ease;
}

.sp-home-slider-controls button:hover {
	color: rgba(48, 57, 52, .96);
}

.sp-home-slider-controls button:focus-visible,
.sp-home-slider-navigation button:focus-visible {
	outline: 1px solid rgba(78, 86, 82, .75);
	outline-offset: 3px;
}

.sp-home-slider-controls svg {
	width: 28px;
	height: 28px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.55;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.sp-home-slider-navigation {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 16px;
	z-index: 6;
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 16px;
	pointer-events: none;
}

.sp-home-slider-dots {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 9px;
}

.sp-home-slider-dot {
	display: block;
	width: 8px;
	height: 8px;
	min-width: 8px;
	padding: 0;
	border: 1px solid rgba(82, 90, 86, .82);
	border-radius: 50%;
	background: rgba(255, 255, 255, .62);
	cursor: pointer;
	pointer-events: auto;
	transition: background-color .2s ease, transform .2s ease;
}

.sp-home-slider-dot[aria-pressed="true"] {
	background: rgba(76, 84, 80, .9);
	transform: scale(1.12);
}

.sp-home-slider-toggle {
	position: absolute;
	right: 17px;
	top: 50%;
	transform: translateY(-50%);
	display: grid;
	place-items: center;
	width: 32px;
	height: 32px;
	padding: 5px;
	border: 0;
	background: transparent;
	color: rgba(78, 86, 82, .78);
	text-shadow: 0 1px 4px rgba(255, 255, 255, .58);
	cursor: pointer;
	pointer-events: auto;
}

.sp-home-slider-toggle:hover {
	color: rgba(48, 57, 52, .96);
}

.sp-home-slider-toggle svg {
	width: 18px;
	height: 18px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.6;
	stroke-linecap: round;
	stroke-linejoin: round;
}

@media (max-width: 600px) {
	.sp-home-slider-controls { padding-inline: 8px; }
	.sp-home-slider-controls button { width: 34px; height: 44px; }
	.sp-home-slider-controls svg { width: 24px; height: 24px; }
	.sp-home-slider-navigation { bottom: 12px; }
	.sp-home-slider-dots { gap: 8px; }
	.sp-home-slider-dot { width: 7px; height: 7px; min-width: 7px; }
	.sp-home-slider-toggle { right: 9px; }
}

@media (prefers-reduced-motion: reduce) {
	.sp-home-slider-slide,
	.sp-home-slider-dot,
	.sp-home-slider-toggle { transition: none; }
}

/* Empty slider state: never advertise a property that was not selected. */
.hero-image.sp-home-hero-empty {
	background: linear-gradient(135deg, #edf0eb, #dfe5df);
}


/* Flat, emoji-free flags in the language picker. */
.sp-language-flag {
	display: inline-flex;
	width: 20px;
	height: 14px;
	margin-right: 8px;
	vertical-align: -2px;
	flex: 0 0 20px;
	line-height: 0;
	box-shadow: none;
}

.sp-language-flag svg {
	display: block;
	width: 100%;
	height: 100%;
	border-radius: 1px;
	box-shadow: none;
}

#language-toggle.has-sp-language-flag {
	white-space: nowrap;
}

@media (max-width: 600px) {
	.sp-language-flag {
		width: 18px;
		height: 12px;
		flex-basis: 18px;
		margin-right: 7px;
	}
}


/* Make the PDF action more discreet beside the price and reference. */
body.single-sp_estate .sp-online-expose-wrap .sp-online-expose-link {
	min-height: 26px !important;
	padding: 6px 12px !important;
	font-size: 10px !important;
	line-height: 1.2 !important;
}
