/* Default styling matching the DTF Prints Design System's Select/Checkbox/Tag
 * components (tokens/colors.css, radius.css, elevation.css, typography.css) —
 * pulled from the actual design system, not guessed. Every property here is
 * still fully overridable per-instance via the widget's own Style tab.
 *
 * Every selector is prefixed with .elementor-widget-dtf-filter-field (the
 * wrapper Elementor puts on every instance of this widget) specifically to
 * out-specificity the site's own Kit-level global rules — e.g.
 * ".elementor-kit-13 label { color: var(--e-global-color-secondary) }" (a
 * known, previously-flagged sitewide rule) has specificity (0,1,1) and beats
 * a plain ".dtfpf-checkbox-row" (0,1,0) regardless of stylesheet load order.
 * (0,2,0) beats (0,1,1), so two classes here reliably wins. The widget's OWN
 * Style-tab controls still win over THIS file, since Elementor compiles those
 * with a {{WRAPPER}} ID-based selector — higher specificity than any of this. */

.elementor-widget-dtf-filter-field .dtfpf-field {
	display: flex;
	flex-direction: column;
	gap: 6px;
	margin-bottom: 12px;
}

.elementor-widget-dtf-filter-field .dtfpf-field label,
.elementor-widget-dtf-filter-field .dtfpf-group-label {
	font-family: "DM Sans", system-ui, sans-serif;
	font-weight: 700;
	font-size: 11px;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: #5c5c5c;
}

.elementor-widget-dtf-filter-field .dtfpf-field select {
	appearance: none;
	-webkit-appearance: none;
	width: 100%;
	min-height: 38px;
	background-color: #ffffff;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23141414' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 12px center;
	border: 2px solid #000000;
	border-radius: 4px;
	padding: 8px 38px 8px 12px;
	font-family: "DM Sans", system-ui, sans-serif;
	font-weight: 600;
	font-size: 14px;
	color: #141414;
	cursor: pointer;
}

.elementor-widget-dtf-filter-field .dtfpf-field select:focus {
	outline: 3px solid #009de0;
	outline-offset: 2px;
}

.elementor-widget-dtf-filter-field .dtfpf-group {
	display: flex;
	flex-direction: column;
	gap: 10px;
	padding-bottom: 20px;
	margin-bottom: 20px;
	border-bottom: 1px solid #d8d7d3;
}

.elementor-widget-dtf-filter-field .dtfpf-checkbox-row {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	cursor: pointer;
	font-family: "DM Sans", system-ui, sans-serif;
	font-size: 14px;
	color: #141414;
}

.elementor-widget-dtf-filter-field .dtfpf-checkbox-row input[type="checkbox"] {
	appearance: none;
	-webkit-appearance: none;
	width: 20px;
	height: 20px;
	flex: 0 0 auto;
	margin: 0;
	border: 2px solid #000000;
	border-radius: 2px;
	background-color: #ffffff;
	cursor: pointer;
	position: relative;
}

.elementor-widget-dtf-filter-field .dtfpf-checkbox-row input[type="checkbox"]:checked {
	background-color: #009de0;
}

.elementor-widget-dtf-filter-field .dtfpf-checkbox-row input[type="checkbox"]:checked::after {
	content: "";
	position: absolute;
	left: 5px;
	top: 1px;
	width: 6px;
	height: 11px;
	border: solid #ffffff;
	border-width: 0 2px 2px 0;
	transform: rotate(45deg);
}

.elementor-widget-dtf-filter-field .dtfpf-checkbox-row input[type="checkbox"]:focus-visible {
	outline: 3px solid #009de0;
	outline-offset: 2px;
}

.elementor-widget-dtf-filter-field .dtfpf-checkbox-count {
	margin-left: auto;
	font-family: "Space Mono", ui-monospace, monospace;
	font-size: 12px;
	color: #8a8a8a;
}

.elementor-widget-dtf-filter-field .dtfpf-tag {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 5px 10px;
	border: 1px solid #d8d7d3;
	background: #ffffff;
	color: #262626;
	border-radius: 2px;
	font-family: "DM Sans", system-ui, sans-serif;
	font-weight: 600;
	font-size: 13px;
	line-height: 1.2;
	text-decoration: none;
}

.elementor-widget-dtf-filter-field a.dtfpf-tag:hover {
	border-color: #000000;
}

.elementor-widget-dtf-filter-field .dtfpf-reset {
	font-family: "DM Sans", system-ui, sans-serif;
	font-weight: 600;
	font-size: 13px;
	color: #c4007a;
	text-decoration: underline;
}

.elementor-widget-dtf-filter-field .dtfpf-reset:hover {
	color: #99005f;
}

.elementor-widget-dtf-filter-field .dtfpf-count {
	font-family: "Space Mono", ui-monospace, monospace;
	font-size: 13px;
	color: #5c5c5c;
}

/* Rendered inside the connected Loop Grid's own container, not inside this
 * widget's wrapper — no .elementor-widget-dtf-filter-field ancestor to anchor
 * to, so the class is doubled instead to reach the same (0,2,0) specificity. */
.dtfpf-no-results.dtfpf-no-results {
	font-family: "DM Sans", system-ui, sans-serif;
	font-size: 16px;
	color: #141414;
	padding: 24px;
	border: 2px solid #000000;
	border-radius: 8px;
	background: #f5f4f0;
	grid-column: 1 / -1;
}

/* Taxonomy Chips — the design system's Blog Archive filter bar (single-select
 * pills with an "All" chip). Values taken from BlogArchive.dc.html's own chip
 * button: uppercase DM Sans 700 / 12px / .1em tracking, 8px 14px padding, 2px
 * ink border, and an active state that fills with ink and flips the text white.
 * Every property is overridable per-instance via the widget's Chips Style tab. */

.elementor-widget-dtf-filter-field .dtfpf-chip-row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
}

.elementor-widget-dtf-filter-field a.dtfpf-chip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 8px 14px;
	border: 2px solid #141414;
	border-radius: 999px;
	background-color: #ffffff;
	color: #141414;
	font-family: "DM Sans", system-ui, sans-serif;
	font-weight: 700;
	font-size: 12px;
	line-height: 1.2;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	text-decoration: none;
	cursor: pointer;
}

.elementor-widget-dtf-filter-field a.dtfpf-chip:hover {
	background-color: #f5f4f0;
	color: #141414;
}

.elementor-widget-dtf-filter-field a.dtfpf-chip.dtfpf-chip--active,
.elementor-widget-dtf-filter-field a.dtfpf-chip.dtfpf-chip--active:hover {
	background-color: #141414;
	color: #ffffff;
}

.elementor-widget-dtf-filter-field a.dtfpf-chip:focus-visible {
	outline: 3px solid #009de0;
	outline-offset: 2px;
}

.elementor-widget-dtf-filter-field .dtfpf-chip-count {
	font-family: "Space Mono", ui-monospace, monospace;
	font-size: 11px;
	font-weight: 400;
	letter-spacing: 0;
	opacity: 0.7;
}

/* ── AJAX filtering: loading state ───────────────────────────────────────────
 * The results widget is a separate Elementor element, outside this widget's own
 * wrapper, so these selectors can't be anchored to
 * .elementor-widget-dtf-filter-field — the class is doubled instead to reach the
 * same (0,2,0) specificity that beats Kit-level global rules. Same reasoning as
 * .dtfpf-no-results above. */

/* Layout-transparent: carries the query/field ids without becoming a box that
 * could disturb the widget's own flex/grid layout. */
.dtfpf-w {
	display: contents;
}

.dtfpf-loading.dtfpf-loading {
	position: relative;
}

.dtfpf-loading.dtfpf-loading > * {
	opacity: 0.4;
	transition: opacity 120ms ease-out;
}

.dtfpf-loading.dtfpf-loading::after {
	content: "";
	position: absolute;
	top: 0;
	left: 50%;
	transform: translateX(-50%);
	/* Pinned near the top of the results rather than centred: on a tall grid a
	 * centred spinner can land below the fold, which is the whole problem. */
	margin-top: clamp(24px, 12vh, 140px);
	width: 44px;
	height: 44px;
	border-radius: 50%;
	border: 4px solid #d8d7d3;
	border-top-color: #009de0;
	border-right-color: #c4007a;
	border-bottom-color: #ffed00;
	animation: dtfpf-spin 700ms linear infinite;
	z-index: 2;
}

@keyframes dtfpf-spin {
	to {
		transform: translateX(-50%) rotate(360deg);
	}
}

/* Inert while loading — this is what stops the repeat-clicking. */
.dtfpf-busy.dtfpf-busy {
	pointer-events: none;
	opacity: 0.55;
	transition: opacity 120ms ease-out;
}

.dtfpf-sr {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

@media (prefers-reduced-motion: reduce) {
	.dtfpf-loading.dtfpf-loading::after {
		animation: none;
		border-top-color: #009de0;
		border-right-color: #009de0;
		border-bottom-color: #009de0;
		border-left-color: #009de0;
		opacity: 0.7;
	}

	.dtfpf-loading.dtfpf-loading > *,
	.dtfpf-busy.dtfpf-busy {
		transition: none;
	}
}
