/*
 * CTData Site Functions: Blog page topic filter ([ctd_topic_filter]).
 * Colours are set once in the variables on .ctd-topics.
 */

.ctd-topics {
	--ctd-navy: #262558;
	--ctd-teal: #477289;
	--ctd-muted: #6b6b7b;
	--ctd-line: #d9dbe3;
	--ctd-active-bg: #f5f3fe;
	--ctd-hover-bg: #eaf4f8;
	font-family: Poppins, sans-serif;
	border-top: 1px solid #e3e5ea;
	padding-top: 24px;
	margin-top: 4px;
}

.ctd-topics__bar {
	display: flex;
	align-items: center;
	gap: 16px;
	flex-wrap: wrap;
	margin-bottom: 20px;
}

.ctd-topics .ctd-topics__all {
	font: 500 14px/1 Poppins, sans-serif;
	color: var(--ctd-navy);
	background: #fff;
	border: 1px solid var(--ctd-line);
	border-radius: 0;
	padding: 12px 20px;
	cursor: pointer;
	transition: border-color 0.15s, background 0.15s;
}

.ctd-topics .ctd-topics__all.is-active {
	border-color: var(--ctd-navy);
}

.ctd-topics .ctd-topics__all:hover,
.ctd-topics .ctd-topics__all:focus-visible {
	border-color: var(--ctd-navy);
	background: var(--ctd-active-bg);
	color: var(--ctd-navy);
}

/* Four columns, A to Z top to bottom. PHP splits the topics evenly
   into one list per column. */
.ctd-topics .ctd-topics__cols {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	column-gap: 22px;
}

.ctd-topics .ctd-topics__list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.ctd-topics .ctd-topics__list li {
	margin: 0;
	padding: 0;
	break-inside: avoid;
}

.ctd-topics .ctd-topics__item {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
	width: 100%;
	text-align: left;
	font: 400 14px/1.3 Poppins, sans-serif;
	color: var(--ctd-navy);
	background: transparent;
	border: 0;
	border-left: 2px solid transparent;
	border-radius: 0;
	padding: 8px 12px;
	cursor: pointer;
	white-space: normal;
	word-break: normal;
	transition: background 0.15s, border-color 0.15s;
}

.ctd-topics .ctd-topics__item:hover,
.ctd-topics .ctd-topics__item:focus-visible {
	background: var(--ctd-hover-bg);
	color: var(--ctd-navy);
}

.ctd-topics .ctd-topics__item.is-active {
	background: var(--ctd-active-bg);
	border-left-color: var(--ctd-navy);
	font-weight: 600;
}

.ctd-topics__name {
	flex: 1 1 auto;
	min-width: 0;
}

.ctd-topics__count {
	font-size: 11px;
	color: var(--ctd-muted);
	flex-shrink: 0;
}

/* The selected topic, between the list and the post cards. */
.ctd-topics .ctd-topics__current {
	font: 600 28px/1.25 Poppins, sans-serif;
	color: var(--ctd-navy);
	margin: 36px 0 0;
	padding: 0;
}

/* The Elementor Taxonomy Filter this drives stays hidden. */
.ctd-hidden-filter {
	display: none !important;
}

/* Smaller screens: the four lists flow into two columns, then one,
   still reading A to Z top to bottom. */
@media (max-width: 1024px) {
	.ctd-topics .ctd-topics__cols {
		display: block;
		column-count: 2;
		column-gap: 22px;
	}
}

@media (max-width: 767px) {
	.ctd-topics .ctd-topics__cols {
		column-gap: 16px;
	}

	.ctd-topics .ctd-topics__current {
		font-size: 24px;
		margin-top: 28px;
	}
}

@media (max-width: 480px) {
	.ctd-topics .ctd-topics__cols {
		column-count: 1;
	}
}
