/* ===========================================
   Category Archive — techkle.com
   Mobile-first. Colours from editor-color-palette.
   =========================================== */

/* --- Top Section: Image + Title Grid --- */

.tk-category-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 0;
	margin-bottom: 60px;
	max-width: 1280px;
	margin-left: auto;
	margin-right: auto;
}

.tk-grid-item {
	position: relative;
	overflow: hidden;
	border-radius: 0;
}

.tk-grid-link {
	display: block;
	position: relative;
	text-decoration: none;
}

.tk-grid-link img {
	display: block;
	width: 100%;
	height: 300px;
	object-fit: cover;
	transition: transform 0.3s ease;
}

.tk-grid-item:hover .tk-grid-link img {
	transform: scale(1.05);
}

.tk-grid-placeholder {
	width: 100%;
	height: 300px;
	background: var(--wp--preset--color--grey, #798897);
}

.tk-grid-title {
	position: absolute;
	top: 0;
	bottom: 0;
	left: 0;
	right: 0;
	display: flex;
	align-items: flex-end;
	font-size: 1.5rem;
	padding: 14px 16px;
	background: linear-gradient(transparent 40%, rgba(0, 0, 0, 0.75));
	color: var(--wp--preset--color--white, #fff);
	font-weight: 600;
}

/* --- Bottom Section: Alternating Rows --- */

.tk-category-list {
	margin-bottom: 40px;
	max-width: 1024px;
	margin-left: auto;
	margin-right: auto;
}

.tk-list-row {
	display: flex;
	flex-direction: column;
	gap: 40px;
	margin-bottom: 30px;
	padding-bottom: 30px;
	border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.tk-list-row:last-child {
	border-bottom: none;
	margin-bottom: 0;
	padding-bottom: 0;
}

.tk-list-image {
	display: block;
	flex-shrink: 0;
	border-radius: 8px;
	overflow: hidden;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.tk-list-image img {
	display: block;
	width: 100%;
	height: 200px;
	object-fit: cover;
	transition: transform 0.3s ease;
}

.tk-list-image:hover img {
	transform: scale(1.03);
}

.tk-list-placeholder {
	width: 100%;
	height: 200px;
	background: var(--wp--preset--color--grey, #798897);
}

.tk-list-content {
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: flex-start;
}

.tk-list-title {
	margin: 0 0 10px;
}

.tk-list-title a {
	color: var(--wp--preset--color--black, #000);
	text-decoration: none;
}

.tk-list-title a:hover {
	color: var(--wp--preset--color--orange, #EE6464);
}

.tk-list-excerpt {
	margin: 0 0 14px;
	color: var(--wp--preset--color--grey, #798897);
}

.tk-read-more {
	display: inline-block;
	padding: 8px 20px;
	border-radius: 4px;
	background: var(--wp--preset--color--orange, #EE6464);
	color: var(--wp--preset--color--white, #fff);
	text-decoration: none;
	transition: background 0.2s ease;
}

.tk-read-more:hover {
	background: var(--wp--preset--color--red, #9C001A);
	color: var(--wp--preset--color--white, #fff);
}

/* --- Pagination --- */

.tk-category-pagination {
	text-align: center;
	margin: 30px 0;
	margin-left: auto;
	margin-right: auto;
}

.tk-category-pagination .page-numbers {
	display: inline-block;
	padding: 8px 14px;
	margin: 0 3px;
	border-radius: 4px;
	text-decoration: none;
	color: var(--wp--preset--color--black, #000);
	background: var(--wp--preset--color--yellow, #F3EED9);
	font-size: 0.9rem;
	transition: background 0.2s ease, color 0.2s ease;
}

.tk-category-pagination .page-numbers.current,
.tk-category-pagination .page-numbers:hover {
	background: var(--wp--preset--color--orange, #EE6464);
	color: var(--wp--preset--color--white, #fff);
}

/* --- Tablet: 2-column grid, horizontal rows --- */

@media (min-width: 600px) {
	.tk-category-grid {
		grid-template-columns: repeat(2, 1fr);
	}

	.tk-grid-link img,
	.tk-grid-placeholder {
		height: 220px;
	}

	.tk-list-row {
		flex-direction: row;
		align-items: center;
	}

	.tk-list-row--img-right {
		flex-direction: row-reverse;
	}

	.tk-list-image {
		width: 45%;
	}

	.tk-list-image img,
	.tk-list-placeholder {
		height: 180px;
	}

	.tk-list-content {
		flex: 1;
	}
}

/* --- Desktop: 3-column grid --- */

@media (min-width: 1024px) {
	.tk-category-grid {
		grid-template-columns: repeat(3, 1fr);
		gap: 0;
	}

	.tk-grid-link img,
	.tk-grid-placeholder {
		height: 300px;
	}

	.tk-list-image {
		width: 40%;
	}

	.tk-list-image img {
		height: 400px;
	}
}
