/* Kilagbe Main Site — Khatian Search page.
 * Loaded only on the page containing [kilagbe_khatian_search]. Light,
 * uncluttered layout; Bangla-first labels rely on the browser's normal
 * Bangla-capable system fonts (no external font dependency added). Class
 * names below that start with "facetwp-" are FacetWP's own real output
 * (verified against its front.css/front.min.js) -- only used as selectors
 * here, never redefined/duplicated.
 */

.kilagbe-khatian-search {
	font-family: -apple-system, "Segoe UI", Roboto, "Noto Sans Bengali", "Hind Siliguri", Arial, sans-serif;
	color: #1f2933;
	max-width: 1100px;
	margin: 0 auto;
	padding: 8px 0 32px;
	position: relative;
}

.kilagbe-khatian-search * {
	box-sizing: border-box;
}

/* Loading indicator: shown only while .kilagbe-khatian-search carries
 * .is-refreshing, toggled by kilagbe-khatian-search.js listening for
 * FacetWP's real "facetwp-refresh" / "facetwp-loaded" events. */
.kilagbe-khatian-search-loading {
	display: none;
	position: sticky;
	top: 0;
	z-index: 5;
	background: #eef6ff;
	color: #0b5fa5;
	border: 1px solid #cfe6fb;
	border-radius: 8px;
	padding: 8px 14px;
	font-size: 14px;
	margin-bottom: 14px;
}

.kilagbe-khatian-search.is-refreshing .kilagbe-khatian-search-loading {
	display: block;
}

.kilagbe-khatian-search.is-refreshing .kilagbe-khatian-search-results,
.kilagbe-khatian-search.is-refreshing .kilagbe-khatian-search-pager {
	opacity: 0.5;
	transition: opacity 150ms ease;
}

.kilagbe-khatian-search-filters {
	background: #fafbfc;
	border: 1px solid #e4e9ee;
	border-radius: 12px;
	padding: 20px 20px 8px;
	margin-bottom: 24px;
}

.kilagbe-khatian-search-filters fieldset {
	border: 0;
	padding: 0;
	margin: 0 0 18px;
}

.kilagbe-khatian-search-filters legend {
	font-size: 13px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.02em;
	color: #52606d;
	padding: 0 0 10px;
}

.kilagbe-khatian-search-geo-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 14px;
}

.kilagbe-khatian-field-row {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 14px;
	margin-top: 14px;
}

.kilagbe-khatian-field-wide {
	max-width: 420px;
}

.kilagbe-khatian-field-label {
	display: block;
	font-size: 13px;
	font-weight: 600;
	color: #334155;
	margin-bottom: 6px;
}

/* FacetWP's own generated controls (real selectors, not custom) */
.kilagbe-khatian-field .facetwp-dropdown,
.kilagbe-khatian-field input.facetwp-search {
	width: 100%;
	padding: 9px 10px;
	border: 1px solid #cbd2d9;
	border-radius: 8px;
	background: #fff;
	font-size: 14px;
}

.kilagbe-khatian-field .facetwp-checkbox {
	font-size: 14px;
	padding-left: 24px;
}

/* A field whose FacetWP control rendered with no actual choices (e.g. a
 * Checkboxes facet before there is any published, indexed content) is
 * collapsed entirely -- both the control and its label -- instead of
 * leaving an empty labeled gap. Toggled by kilagbe-khatian-search.js on
 * FacetWP's real "facetwp-loaded" event; reappears automatically once the
 * facet has real choices, with no further change needed here. */
.kilagbe-khatian-field-empty {
	display: none;
}

/* If every field in a row collapses (e.g. both Khatian Type and Source
 * Type have zero indexed choices right now), collapse the row itself too,
 * rather than leaving its grid gap/margin behind. Progressive enhancement
 * (:has support) -- worst case on an unsupported browser is today's
 * existing spacing, not breakage. */
.kilagbe-khatian-field-row:not(:has(.kilagbe-khatian-field:not(.kilagbe-khatian-field-empty))) {
	display: none;
}

.kilagbe-khatian-search-actions {
	display: flex;
	justify-content: flex-end;
	padding: 4px 0 16px;
}

.kilagbe-khatian-search-actions .facetwp-reset {
	border: 1px solid #cbd2d9;
	background: #fff;
	border-radius: 8px;
	padding: 8px 16px;
	font-size: 14px;
	cursor: pointer;
	color: #334155;
}

.kilagbe-khatian-search-actions .facetwp-reset:hover {
	background: #f3f5f7;
}

/* Active-filter chips (FacetWP's [facetwp selections] output) */
.kilagbe-khatian-search-selections .facetwp-selections {
	list-style: none;
	margin: 0 0 20px;
	padding: 0;
}

.kilagbe-khatian-search-selections:empty {
	margin: 0;
}

.kilagbe-khatian-search-selections .facetwp-selection-value {
	background: #eef2f6;
	border-radius: 999px;
	padding: 6px 28px 6px 12px;
	font-size: 13px;
	color: #334155;
}

/* Results grid + cards (kilagbe-khatian-* classes are ours, defined in the
 * khatian_results FacetWP template). Redesigned 2026-09-05 as a land-
 * record/document-summary card rather than a generic product card: a
 * strong Khatian No. heading, structured label/value geography cells, a
 * labeled record section, and compact aligned actions -- separated by
 * thin borders instead of color/shadow decoration. Target ~380px wide,
 * ~280-320px tall depending on content (no forced min-height, so a card
 * with fewer populated fields stays shorter rather than leaving empty
 * space). */
.kilagbe-khatian-results {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 380px));
	gap: 16px;
}

.kilagbe-khatian-card {
	border: 1px solid #d8dee3;
	border-radius: 6px;
	padding: 14px 16px 12px;
	background: #fff;
	display: flex;
	flex-direction: column;
	gap: 10px;
	max-width: 380px;
	width: 100%;
}

.kilagbe-khatian-card-header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 10px;
	padding-bottom: 10px;
	border-bottom: 1px solid #e4e9ee;
}

.kilagbe-khatian-card-header-main {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.kilagbe-khatian-card-eyebrow {
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	color: #7b8794;
}

.kilagbe-khatian-card-title {
	font-size: 19px;
	font-weight: 700;
	margin: 0;
	color: #102a43;
	line-height: 1.25;
	overflow-wrap: anywhere;
}

.kilagbe-khatian-card-badges {
	flex: 0 0 auto;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 4px;
}

.kilagbe-khatian-card-badge-type,
.kilagbe-khatian-card-badge-test {
	display: inline-block;
	font-size: 11px;
	padding: 2px 8px;
	border-radius: 4px;
	white-space: nowrap;
}

.kilagbe-khatian-card-badge-type {
	background: #eef2f6;
	color: #334155;
	border: 1px solid #d8dee3;
	font-weight: 600;
}

.kilagbe-khatian-card-badge-test {
	background: #fff3cd;
	color: #7a5b00;
	border: 1px solid #f0dca0;
}

/* Geography: four structured label/value cells (not one joined line) in a
 * compact 2x2 grid so four fields cost two row-heights, not four. */
.kilagbe-khatian-card-geo-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 8px 12px;
}

.kilagbe-khatian-card-geo-item {
	display: flex;
	flex-direction: column;
	gap: 1px;
	min-width: 0;
}

.kilagbe-khatian-card-geo-label {
	font-size: 11px;
	color: #7b8794;
}

.kilagbe-khatian-card-geo-value {
	font-size: 13px;
	font-weight: 600;
	color: #1f2933;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* Record metadata: a small labeled table, separated from geography by a
 * top border rather than added color. */
.kilagbe-khatian-card-record {
	display: flex;
	flex-direction: column;
	gap: 4px;
	padding-top: 8px;
	border-top: 1px solid #e4e9ee;
}

.kilagbe-khatian-card-record-row {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	font-size: 13px;
}

.kilagbe-khatian-card-record-label {
	color: #7b8794;
}

.kilagbe-khatian-card-record-value {
	color: #1f2933;
	font-weight: 500;
	text-align: right;
}

.kilagbe-khatian-card-actions {
	margin-top: auto;
	display: flex;
	align-items: stretch;
	gap: 8px;
	padding-top: 10px;
	border-top: 1px solid #e4e9ee;
}

.kilagbe-khatian-card-link {
	flex: 1 1 55%;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	text-align: center;
	background: #0f5132;
	color: #fff;
	text-decoration: none;
	border-radius: 6px;
	padding: 8px 10px;
	font-size: 13px;
	font-weight: 600;
	border: 0;
}

.kilagbe-khatian-card-link:hover {
	background: #0c3f27;
}

/* Future "খতিয়ান কপি সংগ্রহ করুন" purchase CTA -- visually present and
 * WooCommerce-compatible in placement, but intentionally inert (no cart/
 * payment logic exists yet; this button stays disabled until that flow
 * is built in a later milestone). Sized to match the primary action's
 * height so the pair reads as one compact, aligned row. */
.kilagbe-khatian-card-cta-future {
	flex: 1 1 45%;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	text-align: center;
	background: #fff;
	color: #7b8794;
	border: 1px solid #d8dee3;
	border-radius: 6px;
	padding: 8px 10px;
	font-size: 12px;
	cursor: not-allowed;
}

.kilagbe-khatian-no-results {
	grid-column: 1 / -1;
	text-align: center;
	color: #52606d;
	padding: 40px 12px;
	background: #fafbfc;
	border: 1px dashed #cbd2d9;
	border-radius: 10px;
}

.kilagbe-khatian-search-pager {
	margin-top: 20px;
	text-align: center;
}

/* Responsive */
@media (max-width: 900px) {
	.kilagbe-khatian-search-geo-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 560px) {
	.kilagbe-khatian-search-geo-grid,
	.kilagbe-khatian-field-row {
		grid-template-columns: 1fr;
	}

	.kilagbe-khatian-search-filters {
		padding: 16px 14px 4px;
	}

	.kilagbe-khatian-results {
		grid-template-columns: 1fr;
	}

	.kilagbe-khatian-search-actions {
		justify-content: stretch;
	}

	.kilagbe-khatian-search-actions .facetwp-reset {
		width: 100%;
	}
}
