/**
 * Tool List page styles — Zenix shop-style design
 *
 * Design tokens follow the live Elementor Kit (kit-4746):
 *   Primary  #B9FB6A (lime)  — pills / badges / buttons, navy text
 *   Secondary #13213B (navy) — headings, titles
 *   Text     #64748B
 *   Link green #74CC3A (zenix_neutral_7) — category links
 *   Tile bg  #F5F5F5 (zenix_neutral_1)
 *   Font     "Inter Tight"
 */

/* ----------------------------- Tokens ------------------------------ */

.tl-page {
	--tl-primary: #b9fb6a;
	--tl-primary-dark: #a5ef55;
	--tl-secondary: #13213b;
	--tl-text: #64748b;
	--tl-accent: #1b4200;
	--tl-link: #74cc3a;
	--tl-tile: #f5f5f5;
	--tl-border: rgba(19, 33, 59, 0.12);
	--tl-shadow: 0 24px 48px -24px rgba(19, 33, 59, 0.16);
	font-family: "Inter Tight", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	color: var(--tl-text);
}

/* ----------------------------- Layout ------------------------------ */

.tl-page {
	padding: 48px 0 80px;
	background: #fff;
}

.tl-container {
	max-width: 1340px;
	margin: 0 auto;
	padding: 0 24px;
}

/* Sidebar on the right, like the shop layout. */
.tl-layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 300px;
	grid-template-areas: "main side";
	gap: 48px;
	align-items: start;
}

.tl-main {
	grid-area: main;
	min-width: 0;
}

.tl-side {
	grid-area: side;
	min-width: 0;
}

/* --------------------------- Grid top bar --------------------------- */

.tl-gridtop {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 24px;
}

.tl-results {
	margin: 0;
	font-size: 14px;
	color: var(--tl-text);
}

.tl-results strong {
	color: var(--tl-secondary);
	font-weight: 700;
}

.tl-sort {
	height: 46px;
	padding: 0 36px 0 16px;
	background-color: #fff;
	border: 1px solid var(--tl-border);
	border-radius: 10px;
	font-family: inherit;
	font-size: 14px;
	font-weight: 500;
	color: var(--tl-secondary);
	cursor: pointer;
	appearance: none;
	background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 14px center;
}

.tl-sort:focus {
	outline: none;
	border-color: var(--tl-primary);
}

/* ---------------------------- Cards grid --------------------------- */

.tl-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 40px 24px;
}

.tl-card {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

/* Big neutral tile, like product images. */
.tl-thumb {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	aspect-ratio: 1 / 1;
	width: 100%;
	background: var(--tl-tile);
	border-radius: 12px;
	overflow: hidden;
	transition: box-shadow 0.2s ease, transform 0.2s ease;
}

a.tl-thumb:hover {
	box-shadow: var(--tl-shadow);
	transform: translateY(-2px);
}

.tl-logo {
	max-width: 42%;
	max-height: 42%;
	object-fit: contain;
	border-radius: 12px;
}

.tl-avatar {
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 64px;
	font-weight: 800;
	color: var(--tl-secondary);
	user-select: none;
	line-height: 1;
}

/* Pricing badge, top-left like the SALE! tag. */
.tl-badge {
	position: absolute;
	top: 14px;
	left: 14px;
	padding: 5px 12px;
	background: var(--tl-primary);
	border-radius: 999px;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--tl-secondary);
}

/* Project stage badge variants. */
.tl-badge--beta {
	background: #ffbb29;
}

.tl-badge--building {
	background: var(--tl-light, #e7fbda);
	color: var(--tl-accent, #1b4200);
}

.tl-title {
	margin: 4px 0 0;
	font-size: 17px;
	font-weight: 700;
	line-height: 1.3;
	color: var(--tl-secondary);
}

.tl-title a {
	color: inherit;
	text-decoration: none;
}

.tl-title a:hover {
	color: var(--tl-accent);
}

.tl-desc {
	margin: 0;
	font-size: 14px;
	line-height: 1.55;
	color: var(--tl-text);
	display: -webkit-box;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.tl-meta {
	margin: 0;
	font-size: 14px;
	font-weight: 500;
	color: var(--tl-link);
}

/* Lime pill button, like "Add to cart". */
.tl-btn {
	display: inline-flex;
	align-items: center;
	align-self: flex-start;
	gap: 6px;
	margin-top: 6px;
	padding: 10px 20px;
	background: var(--tl-primary);
	border-radius: 999px;
	font-size: 13px;
	font-weight: 600;
	color: var(--tl-secondary);
	text-decoration: none;
	transition: background-color 0.15s ease, transform 0.15s ease;
}

.tl-btn:hover {
	background: var(--tl-primary-dark);
	color: var(--tl-secondary);
	transform: translateY(-1px);
}

/* ----------------------------- Sidebar ------------------------------ */

.tl-search {
	display: flex;
	align-items: center;
	gap: 10px;
	height: 48px;
	padding: 0 16px;
	background: #fff;
	border: 1px solid var(--tl-border);
	border-radius: 10px;
	color: var(--tl-text);
	transition: border-color 0.15s ease;
}

.tl-search:focus-within {
	border-color: var(--tl-primary);
}

.tl-search input {
	flex: 1;
	height: 100%;
	border: 0;
	outline: 0;
	background: transparent;
	font-family: inherit;
	font-size: 14px;
	color: var(--tl-secondary);
}

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

.tl-search input::-webkit-search-cancel-button {
	cursor: pointer;
}

.tl-side-title {
	margin: 32px 0 14px;
	font-size: 24px;
	font-weight: 800;
	line-height: 1.2;
	color: var(--tl-secondary);
}

.tl-search + .tl-side-title {
	margin-top: 28px;
}

/* Price filter: select + lime Filter button, like the shop sidebar. */
.tl-price {
	display: flex;
	align-items: center;
	gap: 10px;
}

.tl-price .tl-select {
	flex: 1;
	min-width: 0;
}

.tl-filter-btn {
	flex-shrink: 0;
	padding: 0 20px;
	height: 46px;
	border: 0;
	border-radius: 999px;
	background: var(--tl-primary);
	font-family: inherit;
	font-size: 14px;
	font-weight: 600;
	color: var(--tl-secondary);
	cursor: pointer;
	transition: background-color 0.15s ease;
}

.tl-filter-btn:hover {
	background: var(--tl-primary-dark);
}

.tl-select {
	width: 100%;
	height: 46px;
	padding: 0 36px 0 16px;
	background-color: #fff;
	border: 1px solid var(--tl-border);
	border-radius: 10px;
	font-family: inherit;
	font-size: 14px;
	font-weight: 500;
	color: var(--tl-secondary);
	cursor: pointer;
	appearance: none;
	background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 14px center;
}

.tl-select:focus {
	outline: none;
	border-color: var(--tl-primary);
}

/* Category links: green, counts right-aligned. */
.tl-cats {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.tl-cat {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	font-size: 14px;
	font-weight: 500;
	line-height: 1.4;
	color: var(--tl-link);
	text-decoration: none;
	transition: color 0.15s ease;
}

.tl-cat:hover {
	color: var(--tl-secondary);
	text-decoration: underline;
}

.tl-cat.is-active {
	color: var(--tl-secondary);
	font-weight: 700;
}

.tl-cat .tl-count {
	flex-shrink: 0;
	font-size: 14px;
	font-weight: 400;
	color: var(--tl-text);
}

/* JS disables this button; shown only when scripts are unavailable. */
.tl-nojs-submit {
	display: none;
	margin-top: 24px;
	width: 100%;
	height: 46px;
	border: 0;
	border-radius: 999px;
	background: var(--tl-primary);
	font-family: inherit;
	font-size: 14px;
	font-weight: 600;
	color: var(--tl-secondary);
	cursor: pointer;
}

/* ------------------- Compact pill cards (Projects) ------------------ */

.tl-grid--compact {
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 16px;
}

.tl-pcard {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 12px 14px;
	background: #fff;
	border: 1px solid var(--tl-border);
	border-radius: 16px;
	text-decoration: none;
	transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

a.tl-pcard:hover {
	border-color: rgba(185, 251, 106, 0.7);
	box-shadow: var(--tl-shadow);
	transform: translateY(-2px);
}

.tl-pcard-logo {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: var(--tl-tile);
	object-fit: contain;
}

.tl-pcard-logo--letter {
	font-size: 17px;
	font-weight: 800;
	color: var(--tl-secondary);
}

.tl-pcard-info {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.tl-pcard-title {
	font-size: 14px;
	font-weight: 700;
	line-height: 1.3;
	color: var(--tl-secondary);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.tl-pcard-desc {
	font-size: 12.5px;
	line-height: 1.4;
	color: var(--tl-text);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* ----------------------------- Empty state -------------------------- */

.tl-empty {
	padding: 80px 24px;
	background: var(--tl-tile);
	border-radius: 12px;
	text-align: center;
	color: var(--tl-text);
}

.tl-empty p {
	margin: 0;
}

/* ---------------------------- Pagination --------------------------- */

.tl-pagination {
	margin-top: 48px;
}

.tl-pagination ul {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.tl-pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 38px;
	height: 38px;
	padding: 0 12px;
	background: #fff;
	border: 1px solid var(--tl-border);
	border-radius: 10px;
	font-size: 14px;
	font-weight: 500;
	color: var(--tl-secondary);
	text-decoration: none;
	transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}

.tl-pagination a.page-numbers:hover {
	border-color: var(--tl-primary);
	color: var(--tl-accent);
}

.tl-pagination .page-numbers.current {
	background: var(--tl-primary);
	border-color: var(--tl-primary);
	color: #fff;
	font-weight: 700;
}

/* --------------------------- Single tool ---------------------------- */

.tl-single-card {
	display: flex;
	flex-direction: column;
	gap: 12px;
	max-width: 760px;
	margin: 0 auto;
	padding: 0;
}

.tl-single-card .tl-thumb {
	width: 320px;
}

.tl-single-card .tl-title {
	font-size: 30px;
	font-weight: 800;
}

.tl-single-card .tl-btn {
	margin-top: 4px;
	padding: 12px 24px;
	font-size: 14px;
}

.tl-single-content {
	border-top: 1px solid rgba(19, 33, 59, 0.08);
	margin-top: 12px;
	padding-top: 20px;
	font-size: 15px;
	line-height: 1.6;
	color: var(--tl-text);
}

.tl-single-content a {
	color: var(--tl-accent);
	font-weight: 600;
}

.tl-single-back {
	max-width: 760px;
	margin: 24px auto 0;
	text-align: center;
}

.tl-single-back a {
	color: var(--tl-secondary);
	font-weight: 600;
	text-decoration: none;
}

.tl-single-back a:hover {
	color: var(--tl-accent);
	text-decoration: underline;
}

/* --------------------------- Responsive ---------------------------- */

@media (max-width: 1199px) {
	.tl-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.tl-layout {
		grid-template-columns: minmax(0, 1fr) 280px;
		gap: 32px;
	}
}

@media (max-width: 991px) {
	.tl-layout {
		grid-template-columns: minmax(0, 1fr);
		grid-template-areas:
			"side"
			"main";
	}

	.tl-side {
		padding-bottom: 8px;
	}

	.tl-side-title {
		margin-top: 24px;
	}

	.tl-cats {
		flex-direction: row;
		flex-wrap: wrap;
		gap: 8px 20px;
	}
}

@media (max-width: 640px) {
	.tl-page {
		padding: 24px 0 56px;
	}

	.tl-container {
		padding: 0 16px;
	}

	.tl-grid {
		grid-template-columns: minmax(0, 1fr);
		gap: 28px;
	}

	.tl-gridtop {
		flex-wrap: wrap;
	}

	.tl-grid--compact {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 1199px) {
	.tl-grid--compact {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}
