/* CLAUDE #238: the boards' filters (board_filters.php, filter-panel.js; owner, 2026-11-03). The pop-up hangs from the board's buttons like a
   context menu, compact, over the list but not the whole page; each tag has its count and All, Any and None (its radios, as buttons). On a
   phone it spans the buttons' width. The filters on show as chips under the buttons, in All, Any and None groups. The search's words are
   marked on the cards, with where a card matched. */

/* the chips (owner, 2026-11-03: their buttons and labels at 0.8em) */
.filter-chips {
	font-size: 0.8em;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem 1rem;
	margin: 0.75rem 0 0;
}

.filter-chip-group {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.4rem;
}

.filter-chip-label {
	font-weight: 600;
}

.filter-chip-label::after {
	content: ":";
}

.filter-chip-group ul {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.filter-chips button {
	background: none;
	border: 1px solid var(--link-color);
	border-radius: 1rem;
	padding: 0.1rem 0.6rem;
	font: inherit;
	font-weight: 500;
	color: var(--link-color);
	cursor: pointer;
}

.filter-chip-group button::after {
	content: "\00d7";
	margin-left: 0.4rem;
}

.filter-chips .filter-chips-clear {
	border: 0;
	padding: 0;
}

/* the pop-up, hanging from the board's buttons */
#results > header.has-filter-popover {
	position: relative;
}

.filter-popover {
	position: absolute;
	top: calc(100% + 0.4rem);
	right: 0;
	z-index: 20;
	box-sizing: border-box;
	width: min(23rem, calc(100vw - 2rem));
	max-height: min(70vh, 34rem);
	overflow-y: auto;
	padding: 0.6rem 0.75rem;
	background: var(--content-background-dark, var(--content-background));
	border: 2px solid var(--border-color);
	border-radius: 0.5rem;
	box-shadow: 0 0.5rem 1.5rem rgb(0 0 0 / 0.45);
	text-align: start;
}

.filter-popover[hidden] {
	display: none;
}

.filter-head {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	margin-bottom: 0.4rem;
}

.filter-key {
	font-size: 0.8em;
	opacity: 0.75;
}

.filter-popover .filter-close {
	margin-left: auto;
	background: none;
	border: 0;
	padding: 0 0.25rem;
	color: var(--link-color);
	font-size: 1.5rem;
	line-height: 1;
	cursor: pointer;
}

/* CLAUDE #614: Search In (filter-panel.js): each part the search compares, a button that's on or off, as the tags' All, Any and None are */
.filter-search-in {
	margin: 0 0 0.6rem;
	padding: 0;
	border: 0;
	min-width: 0;
}

.filter-search-in[hidden] {
	display: none;
}

.filter-search-in legend {
	margin: 0 0 0.3rem;
	padding: 0;
	font-size: 0.85em;
	font-weight: 600;
}

.filter-search-fields {
	display: flex;
	flex-wrap: wrap;
	gap: 0.3rem;
}

.filter-search-field input {
	position: absolute;
	width: 0;
	height: 0;
	margin: 0;
	opacity: 0;
}

.filter-search-field label {
	display: inline-block;
	padding: 0 0.4rem 0.05rem;
	border: 1px solid var(--link-color);
	border-radius: 0.4rem;
	color: var(--link-color);
	font-size: 0.85em;
	font-weight: 500;
	cursor: pointer;
}

.filter-search-field input:checked + label {
	background: var(--link-color);
	color: var(--content-background-dark);
}

.filter-search-field input:focus-visible + label {
	outline: 2px solid var(--link-color);
	outline-offset: 1px;
}

/* CLAUDE #754: Search In under the board's search box (filter-panel.js moves it there from the Filter panel): a row of its own in the search's
   row, its name and then its parts, toward the search box's side */
.filter-search-in.at-search {
	flex-basis: 100%;
	margin: 0;
}

.filter-search-in.at-search .filter-search-fields {
	justify-content: flex-end;
	align-items: center;
}

.filter-search-label {
	margin-right: 0.2rem;
	font-size: 0.85em;
	font-weight: 600;
}

.filter-popover input.filter-find {
	box-sizing: border-box;
	width: 100%;
	max-width: none;
	margin: 0 0 0.5rem;
	font-size: 0.85em;
}

.filter-note {
	margin: 0 0 0.5rem;
	font-size: 0.8em;
	opacity: 0.85;
}

.filter-group {
	border-top: 1px solid var(--border-color);
	padding: 0.35rem 0;
}

.filter-group summary {
	cursor: pointer;
	font-weight: 600;
}

.filter-group ul {
	display: grid;
	row-gap: 0.3rem;
	margin: 0.35rem 0 0.2rem;
	padding: 0;
	list-style: none;
}

.filter-group li {
	display: flex;
	align-items: center;
	gap: 0.35rem;
}

.filter-group li[hidden],
.filter-group[hidden] {
	display: none;
}

.filter-group .filter-name {
	flex: 1;
}

.filter-group .filter-count {
	min-width: 2ch;
	text-align: end;
	font-size: 0.8em;
	opacity: 0.75;
}

.filter-group .filter-modes {
	display: flex;
	gap: 0.2rem;
}

.filter-group .filter-modes input {
	position: absolute;
	width: 0;
	height: 0;
	margin: 0;
	opacity: 0;
}

.filter-group .filter-modes label {
	padding: 0 0.4rem 0.05rem;
	border: 1px solid var(--link-color);
	border-radius: 0.4rem;
	color: var(--link-color);
	font-size: 0.85em;
	font-weight: 500;
	cursor: pointer;
}

.filter-group .filter-modes input:checked + label {
	background: var(--link-color);
	color: var(--content-background-dark);
}

.filter-group .filter-modes input:focus-visible + label {
	outline: 2px solid var(--link-color);
	outline-offset: 1px;
}

.filter-group li.filter-unused:not(:has(input:checked:not(.filter-off))) .filter-name,
.filter-group li.filter-unused .filter-count {
	opacity: 0.5;
}

.filter-nothing {
	margin: 0.5rem 0 0;
	font-size: 0.85em;
}

/* on a phone, it spans the buttons' width */
@media screen and (max-width: 600px) {
	.filter-popover {
		left: 0;
		width: auto;
		max-height: 60vh;
	}
}

/* the search's words on the cards, and where a card matched */
mark.search-match {
	background: var(--accent-color, #facf05);
	color: #111;
	border-radius: 0.15rem;
	padding: 0 0.05rem;
}

.found-in {
	margin: 0.25rem 0 0;
	font-size: 0.85em;
	font-style: italic;
	opacity: 0.85;
}
