/**
 * TPF Fund List — front-end styles.
 * Matched to tpfund.org: Roboto body, Bebas Neue display,
 * amber #f5a700 accent, blue #1a9dd8 highlights, ink #1a1b27.
 *
 * Form controls carry !important on their visual properties on purpose:
 * the widget renders inside arbitrary themes (BeTheme scopes its own form
 * styles under the #Wrapper id, which outranks any class selector), and the
 * controls must look identical regardless of the surrounding theme CSS.
 */
.tpfl {
	--tpfl-amber: #f5a700;
	--tpfl-amber-dark: #d18e00;
	--tpfl-amber-soft: #fdf3dc;
	--tpfl-amber-text: #8a6100;
	--tpfl-blue: #1a9dd8;
	--tpfl-blue-soft: #e8f5fc;
	--tpfl-ink: #1a1b27;
	--tpfl-muted: #747780;
	--tpfl-line: #e3e6ea;
	--tpfl-bg: #ffffff;
	--tpfl-bg-soft: #f7f8f8;
	--tpfl-radius: 10px;
	--tpfl-font: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
	--tpfl-display: 'Bebas Neue', 'Oswald', 'Arial Narrow', sans-serif;

	font-family: var(--tpfl-font);
	color: var(--tpfl-ink);
	margin: 0 0 2.5em;
	font-size: 15px;
	line-height: 1.55;
}

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

/* Cards/notes are display:grid|flex below; make sure the [hidden] attribute
   always wins regardless of author display values. */
.tpfl [hidden] {
	display: none !important;
}

.tpfl .screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
}

/* ---------- Filter panel ---------- */
.tpfl-panel {
	background: var(--tpfl-bg);
	border: 1px solid var(--tpfl-line);
	border-radius: var(--tpfl-radius);
	box-shadow: 0 4px 18px rgba(26, 27, 39, 0.05);
	padding: 22px 24px;
	margin-bottom: 24px;
}

/* Search — icon sits in a fixed 52px gutter; the input padding reserves it. */
.tpfl-searchwrap {
	position: relative;
	margin-bottom: 18px;
}

.tpfl-searchicon {
	position: absolute;
	left: 18px;
	top: 50%;
	transform: translateY(-50%);
	color: var(--tpfl-muted);
	pointer-events: none;
	z-index: 2;
}

.tpfl input.tpfl-search {
	display: block !important;
	width: 100% !important;
	height: 54px !important;
	margin: 0 !important;
	padding: 0 18px 0 52px !important;
	border: 1px solid var(--tpfl-line) !important;
	border-radius: 999px !important;
	background: var(--tpfl-bg-soft) !important;
	background-image: none !important;
	box-shadow: none !important;
	color: var(--tpfl-ink) !important;
	font-family: var(--tpfl-font) !important;
	font-size: 15.5px !important;
	line-height: 52px !important;
	-webkit-appearance: none !important;
	appearance: none !important;
	transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.tpfl input.tpfl-search::placeholder {
	color: #9a9da6 !important;
	opacity: 1;
}

.tpfl input.tpfl-search:focus {
	outline: none !important;
	border-color: var(--tpfl-blue) !important;
	background: var(--tpfl-bg) !important;
	box-shadow: 0 0 0 3px rgba(26, 157, 216, 0.18) !important;
}

.tpfl input.tpfl-search::-webkit-search-decoration,
.tpfl input.tpfl-search::-webkit-search-cancel-button {
	-webkit-appearance: none;
}

/* Labeled filter grid */
.tpfl-filters {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
	gap: 14px;
	align-items: end;
}

.tpfl-field {
	display: flex;
	flex-direction: column;
	gap: 6px;
	min-width: 0;
}

.tpfl-field-label {
	display: block;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.07em;
	text-transform: uppercase;
	color: var(--tpfl-muted);
	line-height: 1.2;
}

/* Selects — custom chevron, theme-proof */
.tpfl select.tpfl-select {
	display: block !important;
	width: 100% !important;
	height: 46px !important;
	margin: 0 !important;
	padding: 0 38px 0 14px !important;
	border: 1px solid var(--tpfl-line) !important;
	border-radius: 8px !important;
	background-color: var(--tpfl-bg) !important;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23747780' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
	background-repeat: no-repeat !important;
	background-position: right 14px center !important;
	background-size: 12px 8px !important;
	box-shadow: none !important;
	color: var(--tpfl-ink) !important;
	font-family: var(--tpfl-font) !important;
	font-size: 14px !important;
	line-height: 44px !important;
	text-overflow: ellipsis;
	white-space: nowrap;
	overflow: hidden;
	cursor: pointer;
	-webkit-appearance: none !important;
	-moz-appearance: none !important;
	appearance: none !important;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.tpfl select.tpfl-select:hover {
	border-color: #c8cdd4 !important;
}

.tpfl select.tpfl-select:focus {
	outline: none !important;
	border-color: var(--tpfl-blue) !important;
	box-shadow: 0 0 0 3px rgba(26, 157, 216, 0.18) !important;
}

/* Amount inputs — theme-proof */
.tpfl-amountrange {
	display: flex;
	align-items: center;
	gap: 6px;
}

.tpfl input.tpfl-num {
	display: block !important;
	flex: 1 1 0;
	width: 100% !important;
	min-width: 0 !important;
	height: 46px !important;
	margin: 0 !important;
	padding: 0 12px !important;
	border: 1px solid var(--tpfl-line) !important;
	border-radius: 8px !important;
	background: var(--tpfl-bg) !important;
	background-image: none !important;
	box-shadow: none !important;
	color: var(--tpfl-ink) !important;
	font-family: var(--tpfl-font) !important;
	font-size: 14px !important;
	-webkit-appearance: none !important;
	appearance: textfield !important;
	-moz-appearance: textfield !important;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.tpfl input.tpfl-num::-webkit-outer-spin-button,
.tpfl input.tpfl-num::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.tpfl input.tpfl-num::placeholder {
	color: #9a9da6 !important;
	opacity: 1;
}

.tpfl input.tpfl-num:focus {
	outline: none !important;
	border-color: var(--tpfl-blue) !important;
	box-shadow: 0 0 0 3px rgba(26, 157, 216, 0.18) !important;
}

.tpfl-dash {
	color: var(--tpfl-muted);
	flex: 0 0 auto;
}

/* "Clear filters" — quiet bordered button, theme-proof */
.tpfl button.tpfl-clear {
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	height: 46px !important;
	margin: 0 !important;
	padding: 0 18px !important;
	border: 1px solid var(--tpfl-line) !important;
	border-radius: 8px !important;
	background: var(--tpfl-bg-soft) !important;
	background-image: none !important;
	box-shadow: none !important;
	color: var(--tpfl-muted) !important;
	font-family: var(--tpfl-font) !important;
	font-size: 13.5px !important;
	font-weight: 500 !important;
	letter-spacing: 0 !important;
	text-transform: none !important;
	line-height: 1 !important;
	cursor: pointer;
	white-space: nowrap;
	transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}

.tpfl button.tpfl-clear:hover {
	border-color: var(--tpfl-blue) !important;
	color: var(--tpfl-blue) !important;
	background: var(--tpfl-bg) !important;
}

.tpfl button.tpfl-clear:focus-visible {
	outline: none !important;
	border-color: var(--tpfl-blue) !important;
	box-shadow: 0 0 0 3px rgba(26, 157, 216, 0.18) !important;
}

/* ---------- Stats bar ---------- */
.tpfl-statsbar {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
	margin-bottom: 18px;
}

.tpfl-stats {
	display: flex;
	align-items: center;
	gap: 18px;
	margin: 0;
	padding-left: 14px;
	border-left: 4px solid var(--tpfl-amber);
}

.tpfl-stat {
	display: flex;
	align-items: baseline;
	gap: 8px;
}

.tpfl-stat-num {
	font-family: var(--tpfl-display);
	font-size: 32px;
	line-height: 1;
	letter-spacing: 0.5px;
	color: var(--tpfl-ink);
}

.tpfl-stat-label {
	font-size: 11.5px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--tpfl-muted);
}

.tpfl-stat-sep {
	width: 1px;
	height: 26px;
	background: var(--tpfl-line);
}

.tpfl-perpage {
	font-size: 13px;
	color: var(--tpfl-muted);
	display: inline-flex;
	align-items: center;
	gap: 8px;
}

.tpfl select.tpfl-perpage-sel {
	display: inline-block !important;
	width: auto !important;
	height: 38px !important;
	margin: 0 !important;
	padding: 0 32px 0 12px !important;
	border: 1px solid var(--tpfl-line) !important;
	border-radius: 8px !important;
	background-color: var(--tpfl-bg) !important;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23747780' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
	background-repeat: no-repeat !important;
	background-position: right 10px center !important;
	background-size: 12px 8px !important;
	box-shadow: none !important;
	color: var(--tpfl-ink) !important;
	font-family: var(--tpfl-font) !important;
	font-size: 13px !important;
	cursor: pointer;
	-webkit-appearance: none !important;
	-moz-appearance: none !important;
	appearance: none !important;
}

.tpfl select.tpfl-perpage-sel:focus {
	outline: none !important;
	border-color: var(--tpfl-blue) !important;
	box-shadow: 0 0 0 3px rgba(26, 157, 216, 0.18) !important;
}

/* ---------- Card grid ---------- */
.tpfl-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
	gap: 20px;
	align-items: start;
}

.tpfl-row {
	position: relative;
	background: var(--tpfl-bg);
	border: 1px solid var(--tpfl-line);
	border-radius: var(--tpfl-radius);
	padding: 22px 22px 18px;
	cursor: pointer;
	transition: box-shadow 0.18s ease, transform 0.18s ease, border-color 0.18s ease;
	overflow: hidden;
}

.tpfl-row::before {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 3px;
	background: var(--tpfl-blue);
}

.tpfl-row:hover {
	box-shadow: 0 10px 26px rgba(26, 27, 39, 0.1);
	transform: translateY(-2px);
	border-color: #d5d7dc;
}

.tpfl-row.is-open {
	border-color: var(--tpfl-blue);
	box-shadow: 0 10px 26px rgba(26, 27, 39, 0.08);
}

.tpfl-chiprow {
	margin-bottom: 12px;
}

.tpfl-chip {
	display: inline-block;
	padding: 3px 11px;
	margin: 0 4px 4px 0;
	border-radius: 999px;
	background: var(--tpfl-amber-soft);
	color: var(--tpfl-amber-text);
	font-size: 11.5px;
	font-weight: 700;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	white-space: nowrap;
}

.tpfl-chip-loc {
	background: var(--tpfl-bg-soft);
	color: var(--tpfl-ink);
	border: 1px solid var(--tpfl-line);
	text-transform: none;
	font-weight: 500;
	font-size: 12.5px;
}

.tpfl-name {
	margin: 0 0 2px;
	font-family: var(--tpfl-font);
	font-size: 17px;
	font-weight: 700;
	line-height: 1.35;
	color: var(--tpfl-ink);
}

.tpfl-name-sub {
	margin: 0;
	font-size: 13px;
	color: var(--tpfl-muted);
}

.tpfl-card-figures {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 10px;
	margin: 14px 0 6px;
}

.tpfl-amount {
	font-family: var(--tpfl-display);
	font-size: 30px;
	line-height: 1;
	letter-spacing: 0.5px;
	color: var(--tpfl-ink);
	font-variant-numeric: tabular-nums;
}

.tpfl-round {
	font-size: 11.5px;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--tpfl-muted);
	white-space: nowrap;
}

.tpfl-metaline {
	display: flex;
	align-items: flex-start;
	gap: 6px;
	margin: 0 0 14px;
	font-size: 13px;
	color: var(--tpfl-muted);
}

.tpfl-pin {
	flex: 0 0 auto;
	margin-top: 3px;
	color: var(--tpfl-blue);
}

/* "Details" — Bebas label with the site's growing blue underline */
.tpfl button.tpfl-chevbtn {
	display: inline-flex !important;
	align-items: center;
	gap: 8px;
	border: 0 !important;
	background: none !important;
	margin: 0 !important;
	padding: 2px 0 6px !important;
	font-family: var(--tpfl-display) !important;
	font-size: 15px !important;
	letter-spacing: 1.5px !important;
	text-transform: uppercase !important;
	color: var(--tpfl-ink) !important;
	line-height: 1.2 !important;
	box-shadow: none !important;
	cursor: pointer;
	background-image: linear-gradient(var(--tpfl-blue), var(--tpfl-blue)) !important;
	background-repeat: no-repeat !important;
	background-size: 54px 2px !important;
	background-position: 0 100% !important;
	transition: background-size 0.15s ease;
}

.tpfl button.tpfl-chevbtn:hover {
	background-size: 100% 2px !important;
}

.tpfl button.tpfl-chevbtn:focus-visible {
	outline: 2px solid var(--tpfl-blue) !important;
	outline-offset: 2px;
}

.tpfl-chevron {
	display: inline-block;
	width: 7px;
	height: 7px;
	border-right: 2px solid var(--tpfl-blue);
	border-bottom: 2px solid var(--tpfl-blue);
	transform: rotate(45deg) translateY(-2px);
	transition: transform 0.15s ease;
}

.tpfl-row.is-open .tpfl-chevron {
	transform: rotate(-135deg) translateY(-2px);
}

/* Detail area (inside the card) */
.tpfl-detail {
	margin-top: 16px;
	padding-top: 16px;
	border-top: 1px solid var(--tpfl-line);
	cursor: auto;
}

.tpfl-desc {
	margin: 0 0 14px;
	font-size: 14px;
	line-height: 1.6;
	color: #33343f;
}

.tpfl-detail-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 12px;
	margin: 0;
}

.tpfl-detail-grid dt {
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.07em;
	color: var(--tpfl-muted);
	margin: 0 0 4px;
}

.tpfl-detail-grid dd {
	margin: 0;
	font-size: 13.5px;
	color: var(--tpfl-ink);
}

/* ---------- Empty states ---------- */
.tpfl-empty,
.tpfl-none {
	grid-column: 1 / -1;
	text-align: center;
	padding: 48px 20px;
	background: var(--tpfl-bg-soft);
	border-radius: var(--tpfl-radius);
	color: var(--tpfl-muted);
}

.tpfl-empty p,
.tpfl-none p {
	margin: 0 0 14px;
	font-size: 15px;
}

.tpfl-none p {
	margin-bottom: 0;
}

/* ---------- Pagination ---------- */
.tpfl-pagination {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 18px;
	margin-top: 26px;
}

.tpfl button.tpfl-page-btn {
	margin: 0 !important;
	padding: 11px 26px 9px !important;
	border: 1px solid var(--tpfl-ink) !important;
	border-radius: 8px !important;
	background: var(--tpfl-bg) !important;
	background-image: none !important;
	box-shadow: none !important;
	color: var(--tpfl-ink) !important;
	font-family: var(--tpfl-display) !important;
	font-size: 15px !important;
	letter-spacing: 1.5px !important;
	text-transform: uppercase !important;
	line-height: 1 !important;
	cursor: pointer;
	transition: background-color 0.15s ease, border-color 0.15s ease;
}

.tpfl button.tpfl-page-btn:hover:not(:disabled) {
	background: var(--tpfl-amber) !important;
	border-color: var(--tpfl-amber) !important;
	color: var(--tpfl-ink) !important;
}

.tpfl button.tpfl-page-btn:focus-visible {
	outline: 2px solid var(--tpfl-blue) !important;
	outline-offset: 2px;
}

.tpfl button.tpfl-page-btn:disabled {
	opacity: 0.35;
	cursor: default;
}

.tpfl-page-info {
	font-size: 13px;
	color: var(--tpfl-muted);
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
	.tpfl-grid {
		grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
	}
}

@media (max-width: 640px) {
	.tpfl-panel {
		padding: 16px;
	}

	.tpfl-filters {
		grid-template-columns: 1fr 1fr;
	}

	.tpfl-field-amount,
	.tpfl-field-clear {
		grid-column: 1 / -1;
	}

	.tpfl-grid {
		grid-template-columns: 1fr;
		gap: 14px;
	}

	.tpfl-statsbar {
		flex-direction: column;
		align-items: flex-start;
	}

	.tpfl-stat-num {
		font-size: 26px;
	}

	.tpfl-row {
		padding: 18px 16px 14px;
	}
}

@media (max-width: 420px) {
	.tpfl-filters {
		grid-template-columns: 1fr;
	}
}
