/* ==========================================================================
   FlowFact Estates — Styles
   ========================================================================== */

/* ---------- Common ---------- */
.ff-loading {
	text-align: center;
	padding: 3rem 1rem;
	color: #666;
	font-size: 1rem;
}

.ff-error {
	text-align: center;
	padding: 2rem 1rem;
	color: #c00;
	background: #fff0f0;
	border-radius: 8px;
}

.ff-empty {
	text-align: center;
	padding: 3rem 1rem;
	color: #999;
}

/* ---------- Filter Bar ---------- */
.ff-filters {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	margin-bottom: 2rem;
	padding: 1rem 1.25rem;
	background: #f7f7f7;
	border-radius: 8px;
}

.ff-filters select,
.ff-filters input {
	padding: 0.5rem 0.75rem;
	border: 1px solid #ddd;
	border-radius: 4px;
	font-size: 0.9rem;
	background: #fff;
	min-width: 160px;
}

.ff-filters select:focus,
.ff-filters input:focus {
	border-color: #1a3c5e;
	outline: none;
}

/* ---------- Estates Grid ---------- */
.ff-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
	gap: 1.5rem;
}

/* ---------- Estate Card ---------- */
.ff-card {
	background: #fff;
	border-radius: 8px;
	overflow: hidden;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
	transition: transform 0.2s ease, box-shadow 0.2s ease;
	cursor: pointer;
	text-decoration: none;
	color: inherit;
	display: block;
}

.ff-card:hover {
	transform: translateY(-4px);
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.ff-card-image {
	position: relative;
	width: 100%;
	padding-top: 66.67%; /* 3:2 ratio */
	overflow: hidden;
	background: #eee;
}

.ff-card-image img {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.ff-card-placeholder {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #e8e8e8;
	color: #aaa;
	font-size: 2rem;
}

.ff-card-badge {
	position: absolute;
	top: 0.75rem;
	left: 0.75rem;
	background: #1a3c5e;
	color: #fff;
	font-size: 0.75rem;
	padding: 0.25rem 0.6rem;
	border-radius: 3px;
	text-transform: uppercase;
	letter-spacing: 0.03em;
}

.ff-card-body {
	padding: 1.25rem;
}

.ff-card-title {
	font-size: 1.1rem;
	font-weight: 600;
	margin: 0 0 0.75rem;
	line-height: 1.3;
	color: #222;
}

.ff-card-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 1rem;
	font-size: 0.85rem;
	color: #666;
}

.ff-card-meta span {
	display: flex;
	align-items: center;
	gap: 0.3rem;
}

.ff-card-price {
	font-size: 1.15rem;
	font-weight: 700;
	color: #1a3c5e;
	margin-top: 0.75rem;
}

/* ---------- Detail Page ---------- */
/* Override Hello Elementor theme.css max-width on .site-main for our template */
.site-main.ff-detail-page {
	max-width: 1720px !important;
	width: 100% !important;
}

.ff-detail {
	max-width: 1720px;
	margin: 0 auto;
	padding: 2rem 1rem;
	width: 100%;
}

.ff-detail-back {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	margin-bottom: 1.5rem;
	color: #1a3c5e;
	text-decoration: none;
	font-size: 0.9rem;
	font-weight: 500;
}

.ff-detail-back:hover {
	text-decoration: underline;
}

.ff-detail-title {
	font-size: 1.75rem;
	font-weight: 700;
	color: #222;
	margin: 0 0 0.5rem;
}

.ff-detail-subtitle {
	font-size: 0.95rem;
	color: #666;
	margin-bottom: 1.5rem;
}

/* ---------- Layout: Main content + Sidebar ---------- */
.ff-hero {
	display: grid;
	grid-template-columns: 2fr 1fr;
	grid-template-rows: auto 1fr;
	gap: 1.5rem;
	margin-bottom: 2rem;
}

.ff-hero-gallery {
	grid-column: 1;
	grid-row: 1;
	min-width: 0;
}

.ff-hero-gallery .ff-gallery {
	margin-bottom: 0.5rem;
}

/* Content sections below gallery, same left column */
.ff-hero-content {
	grid-column: 1;
	grid-row: 2;
	min-width: 0;
}

/* Sticky sidebar spans all rows on the right */
.ff-hero-sidebar {
	grid-column: 2;
	grid-row: 1 / -1;
	position: sticky;
	top: 1rem;
	align-self: start;
	display: flex;
	flex-direction: column;
	gap: 1rem;
	max-height: calc(100vh - 2rem);
	overflow-y: auto;
}

/* Map in sidebar */
.ff-sidebar-map {
	border-radius: 8px;
	overflow: hidden;
	border: 1px solid #ddd;
	height: 220px;
}

.ff-sidebar-map iframe {
	width: 100%;
	height: 100%;
	border: 0;
	display: block;
}

/* Gallery */
.ff-gallery {
	position: relative;
	border-radius: 8px;
	overflow: hidden;
	background: #eee;
}

.ff-gallery-main {
	width: 100%;
	aspect-ratio: 16 / 10;
	object-fit: cover;
	display: block;
}

.ff-gallery-nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	background: rgba(0, 0, 0, 0.5);
	color: #fff;
	border: none;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	cursor: pointer;
	font-size: 1.2rem;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.2s;
}

.ff-gallery-nav:hover {
	background: rgba(0, 0, 0, 0.7);
}

.ff-gallery-prev { left: 0.75rem; }
.ff-gallery-next { right: 0.75rem; }

.ff-gallery-counter {
	position: absolute;
	bottom: 0.75rem;
	right: 0.75rem;
	background: rgba(0, 0, 0, 0.5);
	color: #fff;
	font-size: 0.8rem;
	padding: 0.25rem 0.6rem;
	border-radius: 3px;
}

.ff-gallery-badge {
	position: absolute;
	bottom: 0.75rem;
	left: 0.75rem;
	background: rgba(0, 0, 0, 0.6);
	color: #fff;
	font-size: 0.8rem;
	padding: 0.35rem 0.75rem;
	border-radius: 3px;
	display: flex;
	align-items: center;
	gap: 0.3rem;
}

.ff-gallery-thumbs {
	display: flex;
	gap: 0.5rem;
	margin-top: 0.5rem;
	overflow-x: auto;
	padding-bottom: 0.5rem;
}

.ff-gallery-thumb {
	width: 80px;
	height: 60px;
	object-fit: cover;
	border-radius: 4px;
	cursor: pointer;
	opacity: 0.6;
	transition: opacity 0.2s;
	flex-shrink: 0;
}

.ff-gallery-thumb:hover,
.ff-gallery-thumb.active {
	opacity: 1;
}

/* ---------- Sidebar Facts ---------- */
.ff-hero-facts {
	background: #f7f7f7;
	border-radius: 8px;
	padding: 1.25rem;
	display: flex;
	flex-direction: column;
	gap: 0;
}

.ff-hero-facts .ff-fact {
	display: flex;
	flex-direction: column;
	padding: 0.75rem 0;
	border-bottom: 1px solid #e0e0e0;
}

.ff-hero-facts .ff-fact:first-child {
	padding-top: 0;
}

.ff-hero-facts .ff-fact:last-child {
	padding-bottom: 0;
	border-bottom: none;
}

.ff-hero-facts .ff-fact-price .ff-fact-value {
	font-size: 1.4rem;
	color: #1a3c5e;
}

.ff-fact {
	display: flex;
	flex-direction: column;
}

.ff-fact-label {
	font-size: 0.8rem;
	color: #888;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	margin-bottom: 0.2rem;
}

.ff-fact-value {
	font-size: 1.05rem;
	font-weight: 600;
	color: #222;
}

/* Description */
.ff-description {
	margin-bottom: 2rem;
	line-height: 1.7;
	color: #444;
}

.ff-description h3 {
	font-size: 1.2rem;
	font-weight: 600;
	color: #222;
	margin-bottom: 0.75rem;
}

/* Features list */
.ff-features {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	gap: 0.25rem 1.5rem;
	list-style: none;
	padding: 0;
	margin: 0 0 1rem;
}

.ff-features li::before {
	content: "\2713\00a0";
	color: #1a3c5e;
	font-weight: 700;
}

/* Energy section */
.ff-energy {
	margin-bottom: 2rem;
}

.ff-energy h3 {
	font-size: 1.2rem;
	font-weight: 600;
	color: #222;
	margin-bottom: 0.75rem;
}

/* Energy scale A+ to H */
.ff-energy-scale {
	display: flex;
	gap: 2px;
	margin-bottom: 1.25rem;
	border-radius: 6px;
	overflow: hidden;
}

.ff-energy-bar {
	flex: 1;
	padding: 0.5rem 0.25rem;
	text-align: center;
	font-size: 0.8rem;
	font-weight: 700;
	color: #fff;
	position: relative;
	opacity: 0.4;
	transition: opacity 0.2s;
}

.ff-energy-bar span {
	text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.ff-energy-bar.active {
	opacity: 1;
	transform: scaleY(1.15);
}

.ff-energy-arrow {
	display: block;
	font-size: 0.7rem;
	line-height: 1;
	margin-top: 2px;
}

.ff-energy-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	gap: 1rem;
	padding: 1.25rem;
	background: #f7f7f7;
	border-radius: 8px;
}

/* Contact Form */
.ff-contact {
	margin-top: 2rem;
	padding: 2rem;
	background: #f7f7f7;
	border-radius: 8px;
}

.ff-contact h3 {
	font-size: 1.2rem;
	font-weight: 600;
	color: #222;
	margin: 0 0 1rem;
}

.ff-contact-form {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 1rem;
}

.ff-contact-form .ff-form-full {
	grid-column: 1 / -1;
}

.ff-contact-form label {
	display: block;
	font-size: 0.85rem;
	font-weight: 500;
	color: #444;
	margin-bottom: 0.3rem;
}

.ff-contact-form input,
.ff-contact-form textarea,
.ff-contact-form select {
	width: 100%;
	padding: 0.6rem 0.75rem;
	border: 1px solid #ddd;
	border-radius: 4px;
	font-size: 0.95rem;
	font-family: inherit;
	box-sizing: border-box;
	background: #fff;
}

.ff-contact-form input:focus,
.ff-contact-form textarea:focus,
.ff-contact-form select:focus {
	border-color: #1a3c5e;
	outline: none;
}

.ff-contact-zip-city {
	display: grid;
	grid-template-columns: 100px 1fr;
	gap: 0.5rem;
}

.ff-checkbox-label {
	display: flex !important;
	align-items: flex-start;
	gap: 0.5rem;
	font-size: 0.85rem !important;
	line-height: 1.4;
	cursor: pointer;
}

.ff-checkbox-label input[type="checkbox"] {
	width: auto;
	margin-top: 0.15rem;
	flex-shrink: 0;
}

.ff-checkbox-label a {
	color: #1a3c5e;
}

.ff-contact-form textarea {
	min-height: 100px;
	resize: vertical;
}

.ff-contact-submit {
	grid-column: 1 / -1;
	padding: 0.75rem 2rem;
	background: #ddaa00;
	color: #fff;
	border: none;
	border-radius: 4px;
	font-size: 1rem;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.2s;
	justify-self: start;
}

.ff-contact-submit:hover {
	background: #c49800;
}

.ff-contact-submit:disabled {
	background: #999;
	cursor: not-allowed;
}

.ff-contact-success {
	padding: 1rem;
	background: #e8f5e9;
	color: #2e7d32;
	border-radius: 4px;
	margin-top: 1rem;
}

.ff-contact-error {
	padding: 1rem;
	background: #fff0f0;
	color: #c00;
	border-radius: 4px;
	margin-top: 1rem;
}

/* ---------- Lightbox ---------- */
.ff-lightbox {
	position: fixed;
	top: 0;
	left: 0;
	width: 100vw;
	height: 100vh;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
}

.ff-lightbox-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.9);
}

.ff-lightbox-img {
	position: relative;
	max-width: 90vw;
	max-height: 90vh;
	object-fit: contain;
	border-radius: 4px;
	z-index: 1;
}

.ff-lightbox-close {
	position: absolute;
	top: 1rem;
	right: 1.5rem;
	background: none;
	border: none;
	color: #fff;
	font-size: 2.5rem;
	cursor: pointer;
	z-index: 2;
	line-height: 1;
	opacity: 0.8;
	transition: opacity 0.2s;
}

.ff-lightbox-close:hover {
	opacity: 1;
}

.ff-lightbox-nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	background: rgba(255, 255, 255, 0.15);
	color: #fff;
	border: none;
	width: 50px;
	height: 50px;
	border-radius: 50%;
	cursor: pointer;
	font-size: 1.5rem;
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 2;
	transition: background 0.2s;
}

.ff-lightbox-nav:hover {
	background: rgba(255, 255, 255, 0.3);
}

.ff-lightbox-prev { left: 1.5rem; }
.ff-lightbox-next { right: 1.5rem; }

.ff-lightbox-counter {
	position: absolute;
	bottom: 1.5rem;
	left: 50%;
	transform: translateX(-50%);
	color: #fff;
	font-size: 0.9rem;
	z-index: 2;
	background: rgba(0, 0, 0, 0.5);
	padding: 0.3rem 0.8rem;
	border-radius: 3px;
}

/* ---------- Elementor Button Reset Overrides ---------- */
/* Hello Elementor sets [type=button] { border: 1px solid #c36; color: #c36 }
   and button:hover { background-color: #c36; color: #fff } — override these. */

button.ff-gallery-nav,
button.ff-gallery-nav:hover,
button.ff-gallery-nav:focus {
	background: rgba(0, 0, 0, 0.5);
	color: #fff;
	border: none;
	width: 40px;
	height: 40px;
}

button.ff-gallery-nav:hover {
	background: rgba(0, 0, 0, 0.7);
}

button.ff-lightbox-close,
button.ff-lightbox-close:hover,
button.ff-lightbox-close:focus {
	background: none;
	border: none;
	color: #fff;
}

button.ff-lightbox-nav,
button.ff-lightbox-nav:hover,
button.ff-lightbox-nav:focus {
	background: rgba(255, 255, 255, 0.15);
	color: #fff;
	border: none;
	width: 50px;
	height: 50px;
}

button.ff-lightbox-nav:hover {
	background: rgba(255, 255, 255, 0.3);
}

button.ff-contact-submit,
button.ff-contact-submit:hover,
button.ff-contact-submit:focus {
	background: #ddaa00;
	color: #fff;
	border: none;
}

button.ff-contact-submit:hover {
	background: #c49800;
}

button.ff-contact-submit:disabled,
button.ff-contact-submit:disabled:hover {
	background: #999;
	color: #fff;
	border: none;
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
	.ff-hero {
		grid-template-columns: 1fr;
		grid-template-rows: auto;
	}

	.ff-hero-gallery,
	.ff-hero-content,
	.ff-hero-sidebar {
		grid-column: 1;
		grid-row: auto;
	}

	.ff-hero-sidebar {
		position: static;
		flex-direction: row;
		flex-wrap: wrap;
		gap: 1rem;
		max-height: none;
		overflow-y: visible;
	}

	.ff-hero-facts {
		flex: 1;
		min-width: 280px;
	}

	.ff-sidebar-map {
		flex: 1;
		min-width: 280px;
		height: 250px;
	}
}

@media (max-width: 768px) {
	.ff-grid {
		grid-template-columns: 1fr;
	}

	.ff-filters {
		flex-direction: column;
	}

	.ff-filters select,
	.ff-filters input {
		min-width: unset;
		width: 100%;
	}

	.ff-contact-form {
		grid-template-columns: 1fr;
	}

	.ff-detail-title {
		font-size: 1.35rem;
	}

	.ff-hero-sidebar {
		flex-direction: column;
	}

	.ff-sidebar-map {
		min-width: unset;
	}

	.ff-features {
		grid-template-columns: 1fr;
	}
}
