/*
 * Category lists built with Terms Query (phone menu).
 * "pst-term-list": name + count rows, two columns when there is room.
 * "is-chips": the same terms as outlined chips.
 * Type tiles: see the end of this file.
 */
.pst-term-list .wp-block-term-template {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr));
	gap: 2px 16px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.pst-term-list .wp-block-term-template > li,
.pst-term-list .wp-block-term-template > li > .wp-block-group {
	margin: 0;
}

.pst-term-list .wp-block-term-template > li > .wp-block-group {
	min-height: 40px;
	padding: 0 10px;
	border-radius: var(--wp--preset--border-radius--sm);
	align-items: center;
}

.pst-term-list .wp-block-term-template > li > .wp-block-group:hover {
	background: var(--wp--preset--color--line);
}

.pst-term-list .wp-block-term-name {
	margin: 0;
}

.pst-term-list .wp-block-term-name a {
	color: var(--wp--preset--color--contrast);
	text-decoration: none;
}

.pst-term-list .wp-block-term-count {
	margin: 0;
}

.pst-term-list.is-chips .wp-block-term-template {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.pst-term-list.is-chips .wp-block-term-template > li > .wp-block-group {
	min-height: 40px;
	padding: 0 14px;
	border: 1px solid var(--wp--preset--color--line);
	border-radius: var(--wp--preset--border-radius--full);
	gap: 6px;
}

/*
 * Type tiles (templates/archive-pst_download.html): on phones the tile grid
 * becomes one row that scrolls sideways. Above that, the term template's own
 * grid layout setting applies.
 */
@media (max-width: 782px) {

	.wp-block-term-template:has(> li > .is-style-type-tile) {
		display: flex;
		overflow-x: auto;
		margin-inline: calc(-1 * var(--wp--preset--spacing--gutter));
		padding-inline: var(--wp--preset--spacing--gutter);
		padding-bottom: 4px;
		scroll-padding-inline: var(--wp--preset--spacing--gutter);
		scroll-snap-type: x proximity;
		scrollbar-width: none;
	}

	.wp-block-term-template:has(> li > .is-style-type-tile) > li {
		flex: 0 0 8.5rem;
		scroll-snap-align: start;
	}
}
