.wp-block-post-content:has(.property-page) {
	padding-top: var(--wp--preset--spacing--xs);
}

.property-page {
	--status-tag-color: #383838;
	--status-tag-bg: #eaeaeacc;
	--agent-photo-size: 72px;
}

.property-main-content {
	display: grid;
	grid-template-columns: 2fr 1fr;
	gap: var(--wp--preset--spacing--lm);

	& > .property-section {
		grid-column: 1 / 2;
	}
}

.open-houses-wrapper {
	max-width: 100%;
	overflow: hidden;
}

.property-gallery {
	margin-bottom: var(--wp--preset--spacing--lm);
}

.property-gallery.single-photo {
	display: flex;
	justify-content: center;

	.gallery-item {
		width: 100%;
		background-color: var(--wp--preset--color--neutral-90);
		border-radius: var(--wp--preset--spacing--xs);
	}
	img {
		width: 100%;
		height: 100%;
		object-fit: contain;
		display: block;
	}
}

.property-gallery.two-photos {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: var(--wp--preset--spacing--lm);
}

.property-gallery.multiple-photos {
	display: grid;
	grid-template-columns: 2fr 1fr;
	grid-template-rows: 1fr 1fr;
	gap: var(--wp--preset--spacing--lm);
}

.property-gallery .gallery-item {
	overflow: hidden;
}

.property-gallery:not(.single-photo) .gallery-item {
	width: 100%;
	height: 100%;
	border-radius: var(--wp--preset--spacing--xs);
}

.property-gallery:not(.single-photo) .gallery-item img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.property-gallery.multiple-photos .gallery-item:nth-child(1) {
	grid-column: 1 / 2;
	grid-row: 1 / 3;
}

.gallery-item:not(.overlay-wrapper) {
	cursor: pointer;
	position: relative;

	&::after {
		content: "";
		position: absolute;
		inset: 0;
		background: rgb(from var(--wp--preset--color--foreground) r g b / 0);
		transition: background 0.3s ease;
		border-radius: var(--wp--preset--spacing--xs);
	}

	&:hover::after {
		background: rgb(from var(--wp--preset--color--foreground) r g b / 0.2);
	}
}

.gallery-item.overlay-wrapper {
	position: relative;
}

.gallery-overlay {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-color: rgba(0, 0, 0, 0.5);
	color: #fff;
	display: flex;
	justify-content: center;
	align-items: center;
	flex-direction: column;
	border-radius: var(--wp--preset--spacing--xs);
	transition: background-color 0.3s ease;
	z-index: 1;
}
.gallery-overlay:hover {
	background-color: rgba(0, 0, 0, 0.7);
	cursor: pointer;
}

.photo-count {
	font-size: 3rem;
	line-height: 1.1;
}

.property-gallery-wrapper {
	position: relative;
}

.upcoming-open-house {
	position: absolute;
	padding: var(--wp--preset--spacing--2-xs) var(--wp--preset--spacing--xs);
	border-radius: var(--wp--preset--spacing--2-xs);
	background-color: var(--wp--preset--color--foreground);
	color: var(--wp--preset--color--background);
	display: flex;
	flex-direction: column;
	gap: 2px;

	.open-house-details {
		display: flex;
		gap: var(--wp--preset--spacing--3-xs);

		svg {
			margin-top: 2px;
		}
	}
}

.property-gallery-wrapper:has(.no-photos) .upcoming-open-house {
	right: var(--wp--preset--spacing--l);
	top: calc(-1 * var(--wp--preset--spacing--xs));
}

.property-gallery-wrapper:not(:has(.no-photos)) .upcoming-open-house {
	left: var(--wp--preset--spacing--xs);
	top: var(--wp--preset--spacing--2-xs);
}

.property-section {
	width: 100%;
	border-radius: var(--wp--preset--spacing--xs);
	background-color: var(--wp--preset--color--neutral-100);
	padding: var(--wp--preset--spacing--lm);
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--xs);
}

.property-general-details {
	padding-bottom: var(--wp--preset--spacing--s);
}

.property-info {
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--xs);
	max-width: 100%;
	overflow: hidden;
}

.property-specs {
	flex-wrap: wrap;
}

.property-attribute {
	display: flex;
	align-items: center;
	gap: var(--wp--preset--spacing--3-xs);
}

.property-see-more {
	margin-left: auto;
}

a.property-see-more span::after {
	height: 1px;
}

.property-status {
	background-color: var(--status-tag-bg);
	color: var(--status-tag-color);
	padding: var(--wp--preset--spacing--3-xs) var(--wp--preset--spacing--xs);
	border-radius: var(--wp--preset--spacing--l);
}

.row.property-specs {
	gap: var(--wp--preset--spacing--sm);
}

.agent-link,
.property-see-more {
	text-decoration: none;
	color: inherit;
}

.agent-link h2,
.property-see-more span {
	position: relative;
	line-height: 1.1;
}

.agent-link:not(.no-profile) h2::after,
.property-see-more span::after {
	content: "";
	height: 2px;
	width: 100%;
	background-color: var(--wp--preset--color--foreground);
	position: absolute;
	bottom: 0;
	left: 0;
	transition: transform 0.2s ease;
	transform: scaleX(0);
	transform-origin: left;
}

.agent-link:hover h2::after,
.property-see-more:hover span::after {
	transform: scaleX(1);
}

.agent-link.no-profile {
	cursor: auto;
	-webkit-user-select: text;
	-moz-select: text;
	-ms-select: text;
	user-select: text;
}

.agent-info > .property-section:first-child {
	position: sticky;
	top: var(--wp--preset--spacing--sm);
}

.agent-contact-buttons {
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--xs);
	margin-top: var(--wp--preset--spacing--s);
}

.agent-info .wp-element-button {
	width: 100%;
}

.wp-block-button svg path {
	transition: fill 0.2s ease-in-out, stroke 0.2s ease-in-out;
}

.wp-block-button[class*="is-style-ohp-button-stroke-alt"]:hover svg path[fill] {
	fill: var(--wp--preset--color--accent-01);
}

.wp-block-button[class*="is-style-ohp-button-stroke-alt"]:hover svg path[stroke] {
	stroke: var(--wp--preset--color--accent-01);
}

.button-label {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: var(--wp--preset--spacing--2-xs);
}

.property-open-houses {
	position: relative;
}

.property-open-houses-next,
.property-open-houses-prev {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	background-color: var(--wp--preset--color--neutral-90);
	border: none;
	cursor: pointer;
	padding: var(--wp--preset--spacing--2-xs);
	display: flex;
	justify-content: center;
	align-items: center;
	border-radius: 50%;
	width: 40px;
	height: 40px;
	transition: transform 0.4s ease, opacity 0.2s ease;
	z-index: 10;

	svg {
		width: 24px;
		height: 24px;
	}
}

.property-open-houses-prev.swiper-button-disabled,
.property-open-houses-next.swiper-button-disabled {
	opacity: 0.3;
	cursor: default;
}

.property-open-houses-prev.swiper-button-disabled {
	transform: translateY(-50%) translateX(calc(-8 * var(--wp--preset--spacing--2-xs)));
}

.property-open-houses-next.swiper-button-disabled {
	transform: translateY(-50%) translateX(calc(8 * var(--wp--preset--spacing--2-xs)));
}
.property-open-houses-next {
	right: 0;
}

.property-open-houses .swiper-slide {
	width: 187px;
}

.open-house {
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	width: 100%;
	border: 1px solid var(--wp--preset--color--neutral-95);
	padding: var(--wp--preset--spacing--s) var(--wp--preset--spacing--xs);
	border-radius: var(--wp--preset--spacing--xs);
}

.open-house-weekday,
.open-house-timerange {
	color: var(--wp--preset--color--neutral-20);
}

.calendar-link {
	margin-top: var(--wp--preset--spacing--2-xs);
	color: var(--wp--preset--color--accent-02);
	text-decoration: none;
	transition: color 0.2s ease;
	display: flex;
	align-items: center;
	gap: var(--wp--preset--spacing--2-xs);
}

.calendar-link:hover {
	color: var(--wp--preset--color--accent-01);
}

.calendar-link svg path {
	stroke: var(--wp--preset--color--accent-02);
	transition: stroke 0.2s ease-in-out;
}

.calendar-link:hover svg path {
	stroke: var(--wp--preset--color--accent-01);
}

/* LIGHTBOX */
#property-lightbox {
	position: fixed;
	inset: 0;
	background-color: rgb(from var(--wp--preset--color--foreground) r g b / 0.95);
	pointer-events: none;
	opacity: 0;
	transition: opacity 0.3s ease;
	z-index: 100010;
	margin-block-start: 0;
	margin-block-end: 0;
}

#property-lightbox[aria-hidden="false"] {
	pointer-events: auto;
	opacity: 1;
}

.property-lightbox-header {
	width: 100%;
	position: relative;
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin: var(--wp--preset--spacing--sm) auto;
}

.property-lightbox-header .property-lightbox-contact-agent-button .icon {
	display: none;
}

.property-lightbox-header .close {
	background-color: var(--wp--preset--color--neutral-20);
	border: none;
	cursor: pointer;
	padding: var(--wp--preset--spacing--2-xs);
	display: flex;
	justify-content: center;
	align-items: center;
	border-radius: 50%;
	display: flex;
	width: var(--wp--preset--spacing--xl);
	height: var(--wp--preset--spacing--xl);
	transition: background-color 0.2s ease, color 0.2s ease;
}

.property-lightbox-header .close:hover {
	background-color: var(--wp--preset--color--neutral-30);
}

@media screen and (min-width: 1400px) {
	.property-lightbox-header {
		/* max-width: var(--wp--style--global--wide-size); */
		padding: 0;
		position: relative;
	}

	.property-lightbox-header .close {
		position: absolute;
		right: -50px;
		top: 50%;
		transform: translateY(-50%);
	}
}

.property-lightbox-content {
	display: flex;
	flex-direction: column;
	height: 100vh;
	max-height: 100vh;
	overflow: hidden;
}

.property-lightbox-header {
	flex: 0 0 auto;
}

.property-lightbox-actions {
	display: flex;
	flex-wrap: nowrap;
	gap: var(--wp--preset--spacing--2-xs);
}

.property-lightbox-actions span {
	text-wrap-mode: nowrap;
}

.property-lightbox-slider {
	flex: 1 1 0;
	min-height: 0;
	width: 100%;
	position: relative;
	margin-bottom: 0;
	overflow: hidden;
}

.property-lightbox-slide-overlay {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	pointer-events: none;
	z-index: 1;
	display: flex;
	justify-content: space-between;
	align-items: flex-end;
	padding: var(--wp--preset--spacing--xs);
}

.property-lightbox-slide-overlay > * {
	pointer-events: auto;
}

.property-lightbox-navigation,
.property-lightbox-counter {
	display: flex;
	align-items: center;
	gap: var(--wp--preset--spacing--3-xs);
	padding: var(--wp--preset--spacing--2-xs);
	background-color: var(--wp--preset--color--neutral-95);
	border-radius: var(--wp--preset--spacing--xl);
	border: 1px solid var(--wp--preset--color--neutral-60);
}

.property-lightbox-counter {
	padding: var(--wp--preset--spacing--2-xs) var(--wp--preset--spacing--sm);
}

.property-lightbox-prev,
.property-lightbox-next {
	background: none;
	border: none;
	width: var(--wp--preset--spacing--s);
	height: var(--wp--preset--spacing--s);
	display: flex;
	justify-content: center;
	align-items: center;
	cursor: pointer;
	padding: 0;
}

.property-lightbox-prev svg path,
.property-lightbox-next svg path {
	transition: fill 0.2s ease;
}

.property-lightbox-prev:disabled,
.property-lightbox-next:disabled {
	cursor: default;
	opacity: 0.5;
}

.property-lightbox-prev:hover:not([disabled]) svg path,
.property-lightbox-next:hover:not([disabled]) svg path {
	fill: var(--wp--preset--color--accent-02);
}

.property-lightbox-summary {
	display: flex;
	align-items: center;
	gap: var(--wp--preset--spacing--3-xs);
}

.property-lightbox-thumbs {
	flex: 0 0 max(10vh, 90px);
	max-height: max(10vh, 90px);
	width: 100%;
	overflow: hidden;
	margin: var(--wp--preset--spacing--xs) 0 var(--wp--preset--spacing--sm);
}

.property-lightbox-slider .swiper-slide {
	background-color: var(--wp--preset--color--neutral-20);
	border-radius: var(--wp--preset--spacing--xs);
	overflow: hidden;
	display: flex;
	justify-content: center;
	align-items: center;
	height: 100%;
}

.property-lightbox-slider .swiper-slide img {
	object-fit: contain;
	display: block;
	margin: 0 auto;
	width: 100%;
	height: 100%;
}

.property-lightbox-thumbs .swiper-wrapper {
	height: 100%;
}

.property-lightbox-thumbs .swiper-slide {
	border: 2px solid transparent;
	border-radius: var(--wp--preset--spacing--xs);
	overflow: hidden;
}

.property-lightbox-thumbs .swiper-slide.swiper-slide-thumb-active {
	border-color: var(--wp--preset--color--accent-01);
	box-sizing: border-box;
}

.property-lightbox-thumbs .swiper-slide img {
	object-fit: cover;
	height: 100%;
	width: 100%;
}

.property-map {
	width: 100%;
	height: 246px;
	border-radius: var(--wp--preset--spacing--xs);
}

.gallery-item:has(.ohp-image-error) {
	background-color: var(--wp--preset--color--neutral-80);
	display: flex;
	justify-content: center;
	align-items: center;
}

.property-lightbox-thumbs .swiper-slide:has(.ohp-image-error) {
	background-color: var(--wp--preset--color--neutral-40);
	display: flex;
	justify-content: center;
	align-items: center;
}

.property-gallery .gallery-item img.ohp-image-error,
.property-lightbox-thumbs .swiper-slide img.ohp-image-error,
.property-lightbox-slider .swiper-slide img.ohp-image-error {
	max-height: 60%;
	width: 100%;
	object-fit: contain;
	position: relative;
	opacity: 0.7;
}

/* DESKTOP ONLY */
@media screen and (min-width: 1025px) {
	.property-gallery:not(.no-photos) {
		height: 475px;
		max-height: 475px;
	}

	.agent-info {
		grid-column: 2 / 3;
		grid-row: 1 / 9;
	}

	.property-gallery-wrapper:has(.no-photos) {
		width: calc(2 / 3 * 100% - var(--wp--preset--spacing--lm) / 2);
	}
}

/* TABLET */

@media screen and (max-width: 1024px) {
	.property-gallery.multiple-photos {
		gap: var(--wp--preset--spacing--xs);
		grid-template-columns: 1fr 1fr;
		grid-template-rows: 2fr 1fr;
		max-height: 70vh;
	}

	.property-gallery.multiple-photos .gallery-item {
		height: auto;
	}
	.property-main-content {
		grid-template-columns: 1fr;
	}

	.agent-info > .property-section:first-child {
		position: static;
		top: unset;
		flex-direction: row;
		align-items: center;
		justify-content: space-between;
	}

	.agent-contact-buttons .wp-block-button {
		min-width: 250px;
	}

	.property-gallery {
		margin-bottom: var(--wp--preset--spacing--xs);
	}

	.property-gallery.multiple-photos .gallery-item:nth-child(1) {
		grid-column: 1 / 3;
		grid-row: 1 / 2;
	}

	.property-gallery.two-photos {
		gap: var(--wp--preset--spacing--xs);
	}
}

/* MOBILE */

@media screen and (max-width: 767px) {
	.property-lightbox-header {
		padding: 0 var(--wp--preset--spacing--sm);
		gap: var(--wp--preset--spacing--sm);
	}
	.property-section {
		padding: var(--wp--preset--spacing--sm) var(--wp--preset--spacing--xs);
	}

	.property-gallery.no-photos {
		margin-bottom: 0;
	}

	.no-photos ~ .upcoming-open-house {
		position: static;
		margin-bottom: var(--wp--preset--spacing--2-xs);
	}
	.agent-info > .property-section:first-child {
		position: static;
		top: unset;
		flex-direction: column;
		align-items: stretch;
		gap: var(--wp--preset--spacing--s);
	}

	.agent-contact-buttons {
		margin-top: 0;
	}

	.agent-contact-buttons .wp-block-button {
		width: 100%;
	}

	.row:has(.property-price) {
		justify-content: space-between;
	}

	.row.property-specs {
		display: grid;
		grid-template-columns: repeat(2, 1fr);
		column-gap: var(--wp--preset--spacing--xs);
		row-gap: var(--wp--preset--spacing--2-xs);
	}

	.property-see-more {
		grid-column: 1 / 3;
		margin-left: unset;
		margin-top: var(--wp--preset--spacing--xs);
	}

	.property-lightbox-slide-overlay {
		top: unset;
		bottom: 0;
		transform: translateX(-50%);
		justify-content: center;
		gap: var(--wp--preset--spacing--sm);
	}

	.property-lightbox-thumbs {
		display: none;
	}

	.property-lightbox-header
		.property-lightbox-actions
		.wp-element-button.wp-block-button__link.property-lightbox-contact-agent-button {
		width: var(--wp--preset--spacing--xl);
		height: var(--wp--preset--spacing--xl);
		padding: 0;
		margin: 0;
		border-radius: 50%;
		display: flex;
		justify-content: center;
		align-items: center;
	}

	.property-lightbox-header .property-lightbox-contact-agent-button .icon {
		display: flex;
		justify-content: center;
		align-items: center;

		svg > *[fill] {
			fill: white;
		}

		svg > *[stroke] {
			stroke: white;
		}
	}

	.property-lightbox-header .wp-element-button > span,
	.property-lightbox-counter,
	.property-lightbox-prev,
	.property-lightbox-next {
		display: none;
	}
}
