/* Filter bar */
.booths-filters {
	display: flex;
	flex-wrap: wrap;
	gap: 1em;
	align-items: end;
	margin-block-end: 2em;
	padding-block-end: 1em;
	border-block-end: 1px solid rgba( 127, 127, 127, .3 );
}
.booths-filters label {
	display: flex;
	flex-direction: column;
	gap: .3em;
	font-size: .9em;
}
.booths-filters input,
.booths-filters select {
	height:2em;
}
.booths-filters input[type="search"],
.booths-filters select {
	font: inherit;
	font-size: 1rem;
	padding: .4em .6em;
	border: 1px solid rgba( 127, 127, 127, .5 );
	border-radius: .3em;
	background: transparent;
	color: inherit;
	min-width: 12ch;
}
.booths-filters input[type="search"] {
	min-width: 20ch;
}

/* Chips: toggle buttons. Pressed ones show an ✕ to clear them. */
.booths-chips {
	display: flex;
	flex-wrap: wrap;
	gap: .5em;
	align-items: center;
}
.booths-chip {
	display: inline-flex;
	align-items: center;
	gap: .4em;
	font: inherit;
	font-size: .85rem;
	line-height: 1.4;
	padding: .4em .9em;
	border: 1px solid rgba( 127, 127, 127, .5 );
	border-radius: 2em;
	background: transparent;
	color: inherit;
	cursor: pointer;
}
/* The theme paints buttons on :focus, and focus survives the click — so a
   deselected chip kept the theme's colour and still read as selected. Own
   every state, scoped under .booths to outrank the theme without !important. */
.booths .booths-chip,
.booths .booths-chip:hover,
.booths .booths-chip:focus,
.booths .booths-chip:active {
	background: transparent;
	color: inherit;
	border-color: rgba( 127, 127, 127, .5 );
}
.booths .booths-chip:hover {
	border-color: currentColor;
}
.booths .booths-chip[aria-pressed="true"],
.booths .booths-chip[aria-pressed="true"]:hover,
.booths .booths-chip[aria-pressed="true"]:focus,
.booths .booths-chip[aria-pressed="true"]:active {
	background: rgba( 127, 127, 127, .25 );
	border-color: currentColor;
	color: inherit;
	font-weight: 600;
}
/* Keyboard users still need to see where they are. */
.booths .booths-chip:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}
.booths-chip .booths-chip-x {
	display: none;
	font-size: .85em;
	opacity: .7;
}
.booths-chip[aria-pressed="true"] .booths-chip-x {
	display: inline;
}
.booths .booths-chip[aria-disabled="true"],
.booths .booths-chip[aria-disabled="true"]:hover,
.booths .booths-chip[aria-disabled="true"]:focus {
	opacity: .45;
	cursor: not-allowed;
	border-style: dashed;
	border-color: rgba( 127, 127, 127, .5 );
	background: transparent;
}
.booths-count {
	margin: 0;
	margin-inline-start: auto;
	font-size: .9em;
	opacity: .75;
}

/* Cards. One grid serves both views; only the track sizes and the placement of
   the description change. Queried against the list's own width, not the
   window's: this block also lives in narrow columns and in the editor pane. */
.booths-list {
	container: booths / inline-size;
}
.booths-list article {
	display: grid;
	grid-template-columns: 200px 1fr;
	gap: .2rem 1rem;
	align-items: start;
	margin-block-end: 3rem;
}
.booths-list article[hidden] {
	display: none;
}
.booths-list .thumb {
	/* Spans both rows, and holds its width even when empty, so a booth with no
	   logo keeps its text column aligned with everyone else's. */
	grid-column: 1;
	grid-row: 1 / span 2;
	width: 200px;
	text-align: start;
}
.booths-list .booths-head {
	grid-column: 2;
	grid-row: 1;
}
.booths-list .description {
	grid-column: 2;
	grid-row: 2;
	line-height: 1.3;
}
.booths-list .thumb img {
	width: 100%;
	height: auto;
	/* Variants are fit-inside and not upscaled, so reserve a square and letterbox
	   into it: no layout shift, no distortion, rows stay aligned. */
	aspect-ratio: 1;
	object-fit: contain;
	object-position: center;
}
.booths-list .booths-head h2 {
	font-size: 2rem;
	margin: 0 0 .2em;
	line-height: 1.2;
}
.booths-list .description p,
.booths-list .description .freetext {
	margin: 0 0 .4em;
}
.booths-badges {
	display: flex;
	flex-wrap: wrap;
	gap: .4em;
	margin: 0 0 .5em;
}
.booths-badge {
	/* Square-ish and borderless, so it never reads as one of the round filter
	   chips: these state something about the booth, they are not controls. */
	display: inline-flex;
	align-items: baseline;
	gap: .35em;
	padding: .2em .6em;
	border-radius: .4em;
	font-size: .85em;
	font-weight: 600;
}
.booths-badge[hidden] {
	display: none; /* the class above would otherwise beat the [hidden] default */
}
/* Tints, not solid colours: they sit readably on a light or a dark theme, and
   each badge carries its own mark so colour is never the only signal. */
.booths-badge--discount {
	background: rgba( 46, 160, 67, .20 );
}
.booths-badge--today {
	background: rgba( 31, 111, 235, .20 );
}
.booths-badge--only {
	background: rgba( 219, 109, 0, .24 );
}
.booths-location,
.booths-tags,
.booths-list time {
	font-size: .9em;
	opacity: .8;
}

@container booths (max-width: 544px) {
	.booths-list article {
		grid-template-columns: 150px 1fr;
		gap: .5rem .8rem;
	}
	.booths-list .thumb {
		grid-row: 1;
		width: 150px;
	}
	.booths-list .description {
		grid-column: 1 / -1;
		grid-row: 2;
	}
	.booths-list .booths-head h2 {
		font-size: 1.4rem;
	}
}
