/* Topics page (page-topic.php): heading line, quick-jump chips, search box.
   The topic cards themselves reuse the home topics styles (.topics-grid .row-topic). */
.tp-sub {
	margin: -.6rem 0 1.25rem;
	color: var(--text-base);
	font-size: 14px;
}

.tp-bar {
	position: sticky;
	top: 70px;
	z-index: 20;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: .75rem;
	margin: 0 0 2rem;
	padding: .75rem;
	border: 1px solid rgb(255 255 255 / .06);
	border-radius: 1rem;
	background: rgb(25 27 36 / .88);
	-webkit-backdrop-filter: blur(10px);
	backdrop-filter: blur(10px);
}

.tp-chips {
	display: flex;
	flex-wrap: wrap;
	gap: .5rem;
}

.tp-chip {
	display: inline-flex;
	align-items: center;
	gap: .45rem;
	padding: .5rem 1rem;
	border-radius: 999px;
	background: rgb(255 255 255 / .06);
	color: #fff;
	font-size: 14px;
	font-weight: 600;
	text-decoration: none;
	transition: background-color .2s, color .2s;
}

.tp-chip:hover {
	background: rgb(255 255 255 / .12);
	color: #fff;
}

.tp-chip.is-active {
	background: var(--primary-color);
	color: #11131b;
}

.tp-chip-num {
	min-width: 1.6em;
	padding: 0 .4em;
	border-radius: 999px;
	background: rgb(0 0 0 / .25);
	font-size: 12px;
	line-height: 1.6;
	text-align: center;
}

.tp-chip.is-active .tp-chip-num {
	background: rgb(17 19 27 / .15);
}

.tp-search {
	position: relative;
	flex: 0 1 280px;
	margin: 0;
	font-size: 14px;
}

.tp-search::before {
	content: "";
	position: absolute;
	top: 50%;
	left: 12px;
	width: 16px;
	height: 16px;
	margin-top: -8px;
	background: var(--text-base);
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E") center / contain no-repeat;
	pointer-events: none;
}

.tp-search input {
	width: 100%;
	height: 40px;
	padding: 0 14px 0 36px;
	border: 1px solid rgb(255 255 255 / .1);
	border-radius: 999px;
	outline: 0;
	background: rgb(255 255 255 / .05);
	color: #fff;
}

.tp-search input:focus {
	border-color: var(--primary-color);
}

.tp-search input::placeholder {
	color: var(--text-base);
}

/* Search / group filter: .row-topic sets display:flex, so hidden needs its own rule. */
.tp-page .row-topic[hidden],
.tp-page .tp-section[hidden] {
	display: none;
}

.tp-section {
	scroll-margin-top: 150px;
}

.tp-empty {
	padding: 3rem 0;
	color: var(--text-base);
	text-align: center;
}

@media screen and (max-width: 640px) {
	.tp-bar {
		top: 60px;
		padding: .6rem;
		border-radius: .75rem;
	}

	.tp-chip {
		padding: .4rem .8rem;
		font-size: 13px;
	}

	.tp-search {
		flex: 1 1 100%;
	}
}
