/*
 * Hemlock Hills - Property Cards
 *
 * One design for every cabin card on the listing pages, matching the card design of the
 * custom OwnerRez frontend (hemlockhills theme, properties.css "Property Card Redesign").
 *
 * Card markup (Elementor shortcode widget, unchanged):
 *   .elementor-widget-shortcode > .elementor-widget-container > .elementor-shortcode > a
 *     .single-image | .blur-border-carousel   image / photo carousel (the viewing badge is styled by hh-live-viewers)
 *     .property-content > .left-heading, .property-details > .detail-item, .property-price
 *
 * Every rule is scoped to card widgets (.elementor-widget-shortcode:has(.single-image, .blur-border-carousel)).
 * !important is used only where Elementor writes per-card styles (corner radius, shadow)
 * with higher-specificity selectors; it makes all cards identical.
 */

/* ── Card box ── */
.elementor-widget-shortcode:has(.single-image, .blur-border-carousel) > .elementor-widget-container {
	position: relative;
	margin: 0 !important;
	padding: 0 !important;
	background: #ffffff !important;
	border: none !important;
	border-radius: 16px !important;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
	overflow: hidden !important;
	font-family: 'Poppins', sans-serif;
	transition: transform 0.3s ease, box-shadow 0.3s ease;
	animation: hhPropertyCardFadeInUp 0.6s ease-out;
	/* Safari/WebKit: keep the rounded corners clipping the image while the card is
	   animated or transformed on hover. */
	-webkit-transform: translateZ(0);
	transform: translateZ(0);
	-webkit-backface-visibility: hidden;
	backface-visibility: hidden;
}

.elementor-widget-shortcode:has(.single-image, .blur-border-carousel):hover > .elementor-widget-container {
	-webkit-transform: translateY(-4px) translateZ(0);
	transform: translateY(-4px) translateZ(0);
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15) !important;
}

.elementor-widget-shortcode:has(.single-image, .blur-border-carousel) .elementor-shortcode > a {
	display: block;
	color: inherit;
	text-decoration: none;
}

/* ── Image ── */
.elementor-widget-shortcode:has(.single-image, .blur-border-carousel) .single-image,
.elementor-widget-shortcode:has(.single-image, .blur-border-carousel) .blur-border-carousel {
	position: relative;
	width: 100%;
	overflow: hidden;
	border-radius: 16px 16px 0 0;
	background: linear-gradient(135deg, #e2e8f0, #f8fafc);
}

.elementor-widget-shortcode:has(.single-image, .blur-border-carousel) .single-image {
	height: 230px;
}

.elementor-widget-shortcode:has(.single-image, .blur-border-carousel) .single-image img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
	border-radius: 0;
	transition: transform 0.3s ease;
}

.elementor-widget-shortcode:has(.single-image, .blur-border-carousel):hover .single-image img {
	transform: scale(1.05);
}

/* ── Equal card heights ──
 * Every card in a row stretches to the row's height, and the price sits at the bottom,
 * so cards line up even when a cabin name wraps. */
.elementor-widget-shortcode:has(.single-image, .blur-border-carousel) {
	align-self: stretch;
}

/* Same width for every card. The card grid centres its items, so without a width each card took
 * the width of its photo at the fixed photo height (a wide photo made a wider card in Chrome).
 * 345px is the width of a card with a regular 3:2 photo. */
.elementor-widget-shortcode:has(.single-image, .blur-border-carousel) {
	justify-self: center;
	width: 100% !important; /* Elementor sets widget widths with more specific rules */
	max-width: 345px !important;
}

.elementor-widget-shortcode:has(.single-image, .blur-border-carousel) > .elementor-widget-container,
.elementor-widget-shortcode:has(.single-image, .blur-border-carousel) .elementor-shortcode,
.elementor-widget-shortcode:has(.single-image, .blur-border-carousel) .elementor-shortcode > a {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	height: 100%;
}

.elementor-widget-shortcode:has(.single-image, .blur-border-carousel) .single-image,
.elementor-widget-shortcode:has(.single-image, .blur-border-carousel) .blur-border-carousel {
	flex-shrink: 0;
}

/* ── Card body ── */
.elementor-widget-shortcode:has(.single-image, .blur-border-carousel) .property-content {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	padding: 20px 24px 24px 24px;
	background: #ffffff;
	border-radius: 0;
	box-sizing: border-box;
}

.elementor-widget-shortcode:has(.single-image, .blur-border-carousel) .property-content .left-heading {
	margin: 0 0 16px 0;
	padding: 0;
	font-family: 'Poppins', sans-serif;
	font-size: 18px;
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: normal;
	text-align: left;
	text-transform: none;
	color: #2c3e50;
	/* Long cabin names: at most two lines. */
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	overflow: hidden;
}

/* Bed / bath / guests: may wrap to a second line on narrow cards, and every card reserves two
 * lines, so cards stay the same height at any width, zoom level and browser font rendering. */
.elementor-widget-shortcode:has(.single-image, .blur-border-carousel) .property-details {
	display: flex;
	flex-direction: row; /* some pages' own CSS stacks these below 1000px */
	align-items: center;
	align-content: flex-start;
	flex-wrap: wrap;
	gap: 6px 12px;
	width: 100%;
	min-height: 48px;
	margin: 0 0 8px 0;
}

.elementor-widget-shortcode:has(.single-image, .blur-border-carousel) .detail-item,
.elementor-widget-shortcode:has(.single-image, .blur-border-carousel) .property-type {
	display: flex;
	align-items: center;
	gap: 6px;
	min-width: 0;
	white-space: nowrap; /* "12 Sleeps" never splits */
	font-size: 14px;
	font-weight: 500;
	color: #555;
	transition: color 0.2s ease;
}

.elementor-widget-shortcode:has(.single-image, .blur-border-carousel):hover .detail-item,
.elementor-widget-shortcode:has(.single-image, .blur-border-carousel):hover .property-type {
	color: #2c3e50;
}

.elementor-widget-shortcode:has(.single-image, .blur-border-carousel) .detail-item::before,
.elementor-widget-shortcode:has(.single-image, .blur-border-carousel) .property-type::before {
	content: "";
	display: inline-block;
	width: 18px;
	height: 18px;
	margin: 0;
	flex-shrink: 0;
	background: currentColor;
	-webkit-mask-position: center;
	mask-position: center;
	-webkit-mask-size: contain;
	mask-size: contain;
	-webkit-mask-repeat: no-repeat;
	mask-repeat: no-repeat;
}

.elementor-widget-shortcode:has(.single-image, .blur-border-carousel) .detail-item.bedroom::before {
	-webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='1.75'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M4%2019V10.75C4%209.50736%205.00736%208.5%206.25%208.5H17.75C18.9926%208.5%2020%209.50736%2020%2010.75V19M4%2014.5H20M6.75%208.5V6.75C6.75%205.7835%207.5335%205%208.5%205H11.5C12.4665%205%2013.25%205.7835%2013.25%206.75V8.5M2.75%2019H21.25'/%3E%3C/svg%3E");
	mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='1.75'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M4%2019V10.75C4%209.50736%205.00736%208.5%206.25%208.5H17.75C18.9926%208.5%2020%209.50736%2020%2010.75V19M4%2014.5H20M6.75%208.5V6.75C6.75%205.7835%207.5335%205%208.5%205H11.5C12.4665%205%2013.25%205.7835%2013.25%206.75V8.5M2.75%2019H21.25'/%3E%3C/svg%3E");
}

.elementor-widget-shortcode:has(.single-image, .blur-border-carousel) .detail-item.bathroom::before {
	-webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='1.75'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M7.25%2010.25H16.75C18.2688%2010.25%2019.5%2011.4812%2019.5%2013V14.5C19.5%2017.5376%2017.0376%2020%2014%2020H10C6.96243%2020%204.5%2017.5376%204.5%2014.5V13C4.5%2011.4812%205.73122%2010.25%207.25%2010.25Z'/%3E%3Cpath%20d='M8%2010.25V6.5C8%205.11929%209.11929%204%2010.5%204H13.5C14.8807%204%2016%205.11929%2016%206.5V10.25M12%2014.25V16.25'/%3E%3C/svg%3E");
	mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='1.75'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M7.25%2010.25H16.75C18.2688%2010.25%2019.5%2011.4812%2019.5%2013V14.5C19.5%2017.5376%2017.0376%2020%2014%2020H10C6.96243%2020%204.5%2017.5376%204.5%2014.5V13C4.5%2011.4812%205.73122%2010.25%207.25%2010.25Z'/%3E%3Cpath%20d='M8%2010.25V6.5C8%205.11929%209.11929%204%2010.5%204H13.5C14.8807%204%2016%205.11929%2016%206.5V10.25M12%2014.25V16.25'/%3E%3C/svg%3E");
}

.elementor-widget-shortcode:has(.single-image, .blur-border-carousel) .detail-item.sleeps::before,
.elementor-widget-shortcode:has(.single-image, .blur-border-carousel) .property-type::before {
	-webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='1.75'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M16.5%2020.5V18.75C16.5%2017.0931%2015.1569%2015.75%2013.5%2015.75H7.5C5.84315%2015.75%204.5%2017.0931%204.5%2018.75V20.5M19.5%2020.5V18.75C19.499%2017.3654%2018.5561%2016.1588%2017.214%2015.824M14.214%203.926C15.5602%204.25957%2016.5057%205.46708%2016.5057%206.8545C16.5057%208.24192%2015.5602%209.44943%2014.214%209.783M12.75%206.75C12.75%208.40685%2011.4069%209.75%209.75%209.75C8.09315%209.75%206.75%208.40685%206.75%206.75C6.75%205.09315%208.09315%203.75%209.75%203.75C11.4069%203.75%2012.75%205.09315%2012.75%206.75Z'/%3E%3C/svg%3E");
	mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='1.75'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M16.5%2020.5V18.75C16.5%2017.0931%2015.1569%2015.75%2013.5%2015.75H7.5C5.84315%2015.75%204.5%2017.0931%204.5%2018.75V20.5M19.5%2020.5V18.75C19.499%2017.3654%2018.5561%2016.1588%2017.214%2015.824M14.214%203.926C15.5602%204.25957%2016.5057%205.46708%2016.5057%206.8545C16.5057%208.24192%2015.5602%209.44943%2014.214%209.783M12.75%206.75C12.75%208.40685%2011.4069%209.75%209.75%209.75C8.09315%209.75%206.75%208.40685%206.75%206.75C6.75%205.09315%208.09315%203.75%209.75%203.75C11.4069%203.75%2012.75%205.09315%2012.75%206.75Z'/%3E%3C/svg%3E");
}

.elementor-widget-shortcode:has(.single-image, .blur-border-carousel) .separator {
	display: none;
}

/* ── Price ── */
.elementor-widget-shortcode:has(.single-image, .blur-border-carousel) .property-price {
	display: flex;
	align-items: baseline;
	flex-wrap: wrap;
	gap: 4px;
	margin: auto 0 0 0; /* pushed to the bottom of the card */
	padding-top: 12px;
	font-family: 'Poppins', sans-serif;
	font-size: 20px;
	font-weight: 600;
	color: #2c3e50;
}

.elementor-widget-shortcode:has(.single-image, .blur-border-carousel) .property-price .period {
	font-size: 16px;
	font-weight: 400;
	color: #666;
}

/* ── Tablet / mobile ── */

/* One column: every card fills the full width (they shrank to their text before). */
@media (max-width: 767px) {
	.elementor-widget-shortcode:has(.single-image, .blur-border-carousel),
	.elementor-widget-shortcode:has(.single-image, .blur-border-carousel) > .elementor-widget-container {
		width: 100% !important;
		max-width: 100% !important;
	}
}

@media (max-width: 768px) {
	.elementor-widget-shortcode:has(.single-image, .blur-border-carousel) .single-image {
		height: 200px;
	}

	.elementor-widget-shortcode:has(.single-image, .blur-border-carousel) .property-content {
		padding: 16px 20px 20px 20px;
	}

	.elementor-widget-shortcode:has(.single-image, .blur-border-carousel) .property-content .left-heading {
		font-size: 18px;
	}

	.elementor-widget-shortcode:has(.single-image, .blur-border-carousel) .property-price {
		font-size: 18px;
	}
}

@media (max-width: 480px) {
	.elementor-widget-shortcode:has(.single-image, .blur-border-carousel) .single-image {
		height: 180px;
	}

	.elementor-widget-shortcode:has(.single-image, .blur-border-carousel) .property-content {
		padding: 14px 16px 16px 16px;
	}

	.elementor-widget-shortcode:has(.single-image, .blur-border-carousel) .detail-item,
	.elementor-widget-shortcode:has(.single-image, .blur-border-carousel) .property-type {
		font-size: 12px;
	}
}

@keyframes hhPropertyCardFadeInUp {
	from {
		opacity: 0;
		-webkit-transform: translateY(30px) translateZ(0);
		transform: translateY(30px) translateZ(0);
	}
	to {
		opacity: 1;
		-webkit-transform: translateY(0) translateZ(0);
		transform: translateY(0) translateZ(0);
	}
}

@media (prefers-reduced-motion: reduce) {
	.elementor-widget-shortcode:has(.single-image, .blur-border-carousel) > .elementor-widget-container,
	.elementor-widget-shortcode:has(.single-image, .blur-border-carousel) .single-image img {
		animation: none;
		transition: none;
	}

	.elementor-widget-shortcode:has(.single-image, .blur-border-carousel):hover > .elementor-widget-container,
	.elementor-widget-shortcode:has(.single-image, .blur-border-carousel):hover .single-image img {
		-webkit-transform: translateZ(0);
		transform: translateZ(0);
	}
}
