:root {
	--cpf-radius: 30px;          /* search box + dropdown pills */
	--cpf-control-height: 54px;  /* search, dropdowns and reset share this height */
	--cpf-card-radius: 25px;     /* project tiles */
	--cpf-gap: 24px;             /* space between project tiles */
}

.cpf-wrapper {
	width: 100%;
	padding: 40px 0;
	box-sizing: border-box;
}

/* ------------------------------------------------------------------------
 * Filter bar (max 1200px; otherwise follows the WPBakery row/column width)
 * ---------------------------------------------------------------------- */
.cpf-filter-bar {
	display: flex;
	flex-wrap: wrap;
	gap: 14px;
	max-width: 1200px;
	margin: 0 auto 40px;
	padding: 0;
	box-sizing: border-box;
}

.cpf-search-wrap {
	flex: 1 1 280px;
}

.cpf-search {
	width: 100%;
	height: var(--cpf-control-height) !important;
	min-height: 0 !important;
	margin: 0 !important;
	padding: 0 22px !important;
	box-sizing: border-box;
	background: #ececec;
	border: none;
	border-radius: var(--cpf-radius) !important;
	font-size: 15px;
	line-height: 1.2 !important;
	text-align: left;
	color: #333;
}

.cpf-search::placeholder {
	color: #8a8a8a;
	text-align: left;
}

.cpf-select-wrap {
	flex: 0 0 auto;
}

.cpf-select {
	appearance: none;
	-webkit-appearance: none;
	height: var(--cpf-control-height) !important;
	min-height: 0 !important;
	margin: 0 !important;
	padding: 0 40px 0 22px !important;
	box-sizing: border-box;
	background: #fff;
	border: 1px solid #d8d8d8;
	border-radius: var(--cpf-radius) !important;
	font-size: 15px;
	line-height: 1.2 !important;
	color: #333;
	cursor: pointer;
	background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8'><path d='M1 1l5 5 5-5' stroke='%23333' stroke-width='1.5' fill='none' fill-rule='evenodd' stroke-linecap='round' stroke-linejoin='round'/></svg>");
	background-repeat: no-repeat;
	background-position: right 18px center;
}

.cpf-select:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.cpf-select:focus,
.cpf-search:focus {
	outline: none;
	box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.15);
}

.cpf-reset,
.cpf-load-more {
	appearance: none;
	-webkit-appearance: none;
	cursor: pointer;
	font-size: 15px;
	line-height: 1.2;
	border-radius: var(--cpf-radius) !important;
	transition: background 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}

.cpf-reset {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: var(--cpf-control-height) !important;
	margin: 0 !important;
	padding: 0 24px !important;
	box-sizing: border-box;
	background: transparent;
	color: #524a4a;
	border: 1px solid #524a4a;
}

.cpf-reset:hover {
	background: #524a4a;
	color: #fff;
}

.cpf-reset[hidden],
.cpf-load-more[hidden] {
	display: none !important;
}

/* ------------------------------------------------------------------------
 * Project grid: follows the WPBakery row ("In container" or "Full width
 * content"), 4 square tiles per row
 * ---------------------------------------------------------------------- */
.cpf-grid-wrap {
	width: 100%;
}

.cpf-grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: var(--cpf-gap);
	transition: opacity 0.15s ease;
}

.cpf-grid.cpf-loading {
	opacity: 0.4;
}

.cpf-card {
	position: relative;
	display: block;
	aspect-ratio: 1 / 1 !important;
	overflow: hidden;
	isolation: isolate; /* keeps rounded corners clean during the hover zoom (Safari) */
	border-radius: var(--cpf-card-radius);
	background: #c6c6c6;
	color: #fff;
	text-decoration: none !important;
}

.cpf-card:focus-visible {
	outline: 3px solid #87a259;
	outline-offset: -3px;
}

.cpf-card-image {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	overflow: hidden;
	background: #c6c6c6;
}

.cpf-card-img {
	position: absolute !important;
	top: 0;
	left: 0;
	display: block !important;
	width: 100% !important;
	height: 100% !important;
	max-width: 100% !important;
	max-height: none !important;
	object-fit: cover !important;
	object-position: center !important;
	transition: transform 0.4s ease;
}

.cpf-card:hover .cpf-card-img {
	transform: scale(1.05);
}

/* Title on the photo: white, left aligned, on a black-to-transparent fade */
.cpf-card-overlay {
	position: absolute;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 1;
	padding: 64px 24px 22px;
	background: linear-gradient(to top, rgba(0, 0, 0, 0.78) 0%, rgba(0, 0, 0, 0.45) 55%, rgba(0, 0, 0, 0) 100%);
	text-align: left;
}

.cpf-card-title {
	margin: 0 !important;
	padding: 0 !important;
	color: #fff !important;
	font-size: 20px;
	font-weight: 600;
	line-height: 1.25;
	text-align: left !important;
	text-transform: none;
	text-decoration: none !important;
	text-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

/* Project-attribute icons, top-right corner */
.cpf-card-icons {
	position: absolute;
	top: 14px;
	right: 14px;
	z-index: 2;
	display: flex;
	gap: 6px;
}

.cpf-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.45);
	color: #fff;
	font-size: 15px;
	line-height: 1;
	-webkit-backdrop-filter: blur(4px);
	backdrop-filter: blur(4px);
}

.cpf-icon i {
	color: #fff;
}

.cpf-no-results {
	text-align: center;
	color: #888;
	padding: 40px 0;
}

/* ------------------------------------------------------------------------
 * Infinite scroll sentinel + loader
 * ---------------------------------------------------------------------- */
.cpf-sentinel {
	width: 100%;
	height: 1px;
}

.cpf-load-more-wrap {
	min-height: 24px;
	margin-top: 40px;
	text-align: center;
}

.cpf-load-more {
	background: #87a259;
	color: #fff;
	border: 1px solid #87a259;
	padding: 14px 36px;
}

.cpf-load-more:hover {
	background: #748f43;
	border-color: #748f43;
}

.cpf-load-more:disabled {
	opacity: 0.5;
	cursor: wait;
}

.cpf-loader {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	font-size: 14px;
	color: #666666;
}

.cpf-loader[hidden] {
	display: none !important;
}

.cpf-spinner {
	width: 18px;
	height: 18px;
	border: 2px solid #cccccc;
	border-top-color: #87a259;
	border-radius: 50%;
	animation: cpf-spin 0.8s linear infinite;
}

@keyframes cpf-spin {
	to {
		transform: rotate(360deg);
	}
}

/* ------------------------------------------------------------------------
 * Responsive
 * ---------------------------------------------------------------------- */
@media (max-width: 1100px) {
	:root {
		--cpf-gap: 20px;
	}

	.cpf-grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

@media (max-width: 900px) {
	.cpf-select-wrap {
		flex: 1 1 45%;
	}
}

@media (max-width: 760px) {
	:root {
		--cpf-gap: 16px;
	}

	.cpf-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.cpf-card-overlay {
		padding: 48px 18px 18px;
	}

	.cpf-card-title {
		font-size: 17px;
	}
}

@media (max-width: 600px) {
	:root {
		--cpf-control-height: 48px;
	}

	.cpf-filter-bar {
		gap: 10px;
	}

	.cpf-search-wrap {
		flex: 1 1 100%;
		width: 100%;
	}

	.cpf-select-wrap {
		flex: 1 1 45%;
		min-width: 0;
	}

	.cpf-select {
		width: 100%;
		padding: 0 28px 0 14px !important;
		font-size: 13px;
		background-position: right 10px center;
		white-space: nowrap;
		overflow: hidden;
		text-overflow: ellipsis;
	}

	.cpf-reset {
		flex: 1 1 100%;
		width: 100%;
	}
}

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

	.cpf-card-title {
		font-size: 19px;
	}
}