/* Bold Form Template - front-end layout */

.bft-wrap {
	--bft-columns: 3;
	--bft-primary: #2f6bff;
	--bft-primary-soft: #dbe6ff;
	--bft-text: #1f2a44;
	--bft-muted: #8a93a6;
	--bft-border: #eef1f6;
	--bft-radius: 14px;
	max-width: 1200px;
	margin: 0 auto;
	color: var(--bft-text);
	box-sizing: border-box;
}

.bft-wrap *,
.bft-wrap *::before,
.bft-wrap *::after {
	box-sizing: border-box;
}

/* Heading */
.bft-head {
	text-align: center;
	margin-bottom: 36px;
}

.bft-head__title {
	font-size: 40px;
	font-weight: 800;
	margin: 0 0 12px;
	color: var(--bft-text);
}

.bft-head__subtitle {
	margin: 0 auto;
	max-width: 520px;
	color: var(--bft-muted);
	font-size: 15px;
	line-height: 1.6;
}

/* Layout */
.bft-layout {
	display: grid;
	grid-template-columns: 240px 1fr;
	gap: 28px;
	align-items: start;
}

/* Sidebar */
.bft-sidebar {
	background: #fff;
	border: 1px solid var(--bft-border);
	border-radius: var(--bft-radius);
	padding: 16px;
	box-shadow: 0 8px 30px rgba(20, 30, 60, 0.05);
}

.bft-search {
	position: relative;
	margin-bottom: 14px;
}

.bft-search__input {
	width: 100%;
	border: 1px solid var(--bft-border);
	border-radius: 8px;
	padding: 10px 12px;
	font-size: 13px;
	outline: none;
	background: #f8fafc;
	color: var(--bft-text);
}

.bft-search__input:focus {
	border-color: var(--bft-primary);
	background: #fff;
}

/* Search bar above the grid */
.bft-search--top {
	margin: 0 0 24px;
}

.bft-search--top .bft-search__input {
	padding: 13px 16px;
	font-size: 14px;
	background: #fff;
	border-radius: 10px;
}

.bft-cats {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.bft-cat > button,
.bft-cat > a {
	display: block;
	width: 100%;
	text-align: left;
	border: none;
	background: none;
	cursor: pointer;
	padding: 11px 14px;
	border-radius: 8px;
	font-size: 14px;
	color: var(--bft-text);
	text-decoration: none;
	transition: background 0.2s ease, color 0.2s ease;
	font-family: inherit;
}

.bft-cat > button:hover,
.bft-cat > a:hover {
	background: #f3f6fc;
}

.bft-cat.is-active > button,
.bft-cat.is-active > a {
	background: var(--bft-primary);
	color: #fff;
}

/* Content + grid */
.bft-content {
	min-height: 200px;
}

.bft-grid {
	display: grid;
	grid-template-columns: repeat(var(--bft-columns), 1fr);
	gap: 24px;
}

.bft-card {
	position: relative;
	display: flex;
	flex-direction: column;
}

.bft-card__preview {
	position: relative;
	border: 1px solid var(--bft-border);
	border-radius: var(--bft-radius);
	background: #fff;
	overflow: hidden;
	aspect-ratio: 4 / 3;
	box-shadow: 0 8px 30px rgba(20, 30, 60, 0.05);
}

.bft-card__media {
	position: absolute;
	inset: 0;
	display: block;
	z-index: 1;
}

.bft-card__preview .bft-card__img,
.bft-card__preview .bft-card__placeholder {
	width: 100%;
	height: 100%;
	display: block;
	object-fit: cover;
	/* Override WP 6.7 auto-sizes reservation: img:is([sizes=auto i],...) sets a huge contain-intrinsic-size. */
	contain-intrinsic-size: none;
}

.bft-card__placeholder {
	background: linear-gradient(135deg, #f3f6fc 0%, #e9eefb 100%);
}

.bft-badge {
	position: absolute;
	top: 12px;
	right: 12px;
	background: #ff6a3d;
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	padding: 4px 12px;
	border-radius: 999px;
	z-index: 3;
}

.bft-card__overlay {
	position: absolute;
	inset: 0;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	background: rgba(20, 30, 60, 0.35);
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.25s ease;
}

.bft-card:hover .bft-card__overlay {
	opacity: 1;
	pointer-events: auto;
}

.bft-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 9px 18px;
	border-radius: 8px;
	font-size: 13px;
	font-weight: 600;
	text-decoration: none;
	cursor: pointer;
	transition: transform 0.15s ease, background 0.2s ease;
}


.bft-btn--primary {
	background: var(--bft-primary);
	color: #fff;
}

.bft-btn--ghost {
	background: var(--bft-primary-soft);
	color: var(--bft-primary);
}

.bft-card__title {
	font-size: 17px;
	font-weight: 700;
	margin: 16px 0 6px;
	color: var(--bft-text);
}

.bft-card__title a {
	color: inherit;
	text-decoration: none;
	transition: color 0.2s ease;
}

.bft-card__title a:hover {
	color: var(--bft-primary);
}

.bft-card__desc {
	margin: 0;
	font-size: 13px;
	line-height: 1.6;
	color: var(--bft-muted);
}

.bft-empty {
	padding: 40px;
	text-align: center;
	color: var(--bft-muted);
}

/* Pagination */
.bft-pagination-wrap {
	margin-top: 32px;
	display: flex;
	justify-content: center;
}

.bft-pagination {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: center;
}

.bft-page,
.bft-page > a,
.bft-page > span {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 38px;
	height: 38px;
	padding: 0 12px;
	border: 1px solid var(--bft-border);
	border-radius: 8px;
	background: #fff;
	color: var(--bft-text);
	cursor: pointer;
	font-size: 14px;
	text-decoration: none;
	transition: background 0.2s ease, color 0.2s ease;
}

.bft-pagination--links .bft-page {
	border: none;
	padding: 0;
	min-width: 0;
	height: auto;
	background: none;
}

.bft-page:hover,
.bft-page > a:hover {
	background: #f3f6fc;
}

.bft-page.is-active,
.bft-page > .current {
	background: var(--bft-primary);
	border-color: var(--bft-primary);
	color: #fff;
}

/* Loading state */
.bft-results {
	position: relative;
	min-height: 140px;
}

.bft-wrap.is-loading .bft-results {
	pointer-events: none;
}

.bft-wrap.is-loading .bft-results::before {
	content: "";
	position: absolute;
	inset: 0;
	background: rgba( 255, 255, 255, 0.65 );
	border-radius: 8px;
	z-index: 4;
}

.bft-wrap.is-loading .bft-results::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 42px;
	height: 42px;
	margin: -21px 0 0 -21px;
	border: 3px solid var(--bft-primary-soft);
	border-top-color: var(--bft-primary);
	border-radius: 50%;
	animation: bft-spin 0.8s linear infinite;
	z-index: 5;
}

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

/* Touch devices: hover overlay can't be reached, so keep the action buttons visible. */
@media (hover: none) {
	.bft-card__overlay {
		opacity: 1;
		pointer-events: auto;
		background: rgba( 20, 30, 60, 0.18 );
	}
}

/* Responsive */

/* Tablet landscape */
@media screen and (max-width: 1024px) {
	.bft-layout {
		grid-template-columns: 200px 1fr;
		gap: 20px;
	}
	.bft-grid {
		grid-template-columns: repeat(2, 1fr);
		gap: 20px;
	}
}

/* Tablet portrait & below: sidebar moves on top, categories become a scrollable bar */
@media screen and (max-width: 782px) {
	.bft-layout {
		display: flex;
		flex-direction: column;
		gap: 20px;
	}
	.bft-head {
		margin-bottom: 24px;
	}
	.bft-head__title {
		font-size: 30px;
	}
	.bft-sidebar {
		padding: 14px;
	}
	.bft-cats {
		flex-wrap: wrap;
        flex-direction: row;
	}
	.bft-cat > button,
	.bft-cat > a {
		white-space: nowrap;
		padding: 8px 16px;
	}
}

/* Phones */
@media screen and (max-width: 560px) {
	.bft-grid {
		grid-template-columns: 1fr;
		gap: 18px;
	}
	.bft-head__title {
		font-size: 26px;
	}
	.bft-head__subtitle {
		font-size: 14px;
	}
	.bft-card__overlay {
		flex-direction: column;
	}
	.bft-btn {
		width: 100%;
		max-width: 200px;
	}
}
