/* ==========================================================================
   CIL Category Pages - Styles
   Follows existing CIL-Theme conventions (Poppins, Roboto, container, mp-button)
   ========================================================================== */

/* ---- Articles Grid (uses existing .posts_list styles from theme) ---- */

.cil-category-page .posts_list {
	margin-bottom: 40px;
}

/* ---- Table of Contents ---- */

.cil-cat-toc-section {
	margin-bottom: 40px;
}

.cil-cat-toc {
	background: #f8f9fb;
	border: 1px solid #e2e6ed;
	border-radius: 8px;
	padding: 20px 24px;
	max-width: 360px;
}

.cil-cat-toc__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	cursor: pointer;
}

.cil-cat-toc__title {
	font-family: 'Poppins', sans-serif;
	font-weight: 600;
	font-size: 18px;
	color: #1a1a2e;
}

.cil-cat-toc__toggle {
	background: none;
	border: none;
	cursor: pointer;
	padding: 4px;
	color: #1a1a2e;
	transition: transform 0.3s ease;
}

.cil-cat-toc__toggle[aria-expanded="false"] {
	transform: rotate(-90deg);
}

.cil-cat-toc__nav {
	margin-top: 12px;
	overflow: hidden;
	transition: max-height 0.3s ease, opacity 0.3s ease;
}

.cil-cat-toc__nav.collapsed {
	max-height: 0 !important;
	opacity: 0;
	margin-top: 0;
}

.cil-cat-toc__nav ol {
	list-style: none;
	margin: 0;
	padding: 0;
	counter-reset: toc-counter;
}

.cil-cat-toc__nav li {
	counter-increment: toc-counter;
	margin-bottom: 8px;
}

.cil-cat-toc__nav li a {
	font-family: 'Roboto', sans-serif;
	font-size: 15px;
	color: #2a78ff;
	text-decoration: none;
	display: flex;
	align-items: baseline;
	gap: 8px;
	transition: color 0.2s;
}

.cil-cat-toc__nav li a::before {
	content: counter(toc-counter) ".";
	font-weight: 600;
	color: #1a1a2e;
	flex-shrink: 0;
}

.cil-cat-toc__nav li a:hover {
	color: #1a1a2e;
}

.cil-cat-toc__nav li a.active {
	font-weight: 600;
	color: #1a1a2e;
}

/* Sticky TOC on desktop */
@media (min-width: 1024px) {
	.cil-cat-toc-section {
		position: relative;
	}

	.cil-cat-content {
		position: relative;
	}

	.cil-cat-toc.is-sticky {
		position: fixed;
		top: 20px;
		max-width: 300px;
		z-index: 50;
	}

	.cil-cat-toc.is-stuck-bottom {
		position: absolute;
		bottom: 0;
	}
}

/* ---- Category Content ---- */

.cil-cat-content {
	margin-bottom: 60px;
	font-family: 'Roboto', sans-serif;
	font-size: 16px;
	line-height: 1.7;
	color: #333;
}

.cil-cat-content h2 {
	font-family: 'Poppins', sans-serif;
	font-size: 28px;
	font-weight: 600;
	color: #1a1a2e;
	margin: 40px 0 16px;
	scroll-margin-top: 80px;
}

.cil-cat-content h3 {
	font-family: 'Poppins', sans-serif;
	font-size: 22px;
	font-weight: 600;
	color: #1a1a2e;
	margin: 32px 0 12px;
}

.cil-cat-content p {
	margin-bottom: 16px;
}

.cil-cat-content ul,
.cil-cat-content ol {
	margin-bottom: 16px;
	padding-left: 24px;
}

.cil-cat-content a {
	color: #2a78ff;
	text-decoration: none;
}

.cil-cat-content a:hover {
	text-decoration: underline;
}

/* ---- Promo Blocks ---- */

.cil-promo-block {
	display: flex;
	align-items: stretch;
	gap: 24px;
	margin: 32px 0;
	padding: 24px;
	background: #f8f9fb;
	border: 1px solid #e2e6ed;
	border-radius: 8px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
	transition: box-shadow 0.3s ease;
}

.cil-promo-block:hover {
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.cil-promo-block__image {
	flex: 0 0 280px;
	border-radius: 6px;
	overflow: hidden;
}

.cil-promo-block__image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.cil-promo-block__content {
	flex: 1;
	display: flex;
	flex-direction: column;
	justify-content: center;
}

.cil-promo-block__title {
	font-family: 'Poppins', sans-serif;
	font-size: 20px;
	font-weight: 600;
	margin: 0 0 12px;
}

.cil-promo-block__title a {
	color: #1a1a2e;
	text-decoration: none;
}

.cil-promo-block__title a:hover {
	color: #2a78ff;
}

.cil-promo-block__text {
	font-family: 'Roboto', sans-serif;
	font-size: 15px;
	line-height: 1.6;
	color: #555;
	margin: 0 0 16px;
}

.cil-promo-block__btn {
	align-self: flex-start;
	display: inline-block;
	padding: 10px 24px;
	font-size: 14px;
	font-weight: 600;
	text-decoration: none;
	border-radius: 4px;
}

/* ---- Load More ---- */

.cil-cat-loadmore-btn {
	display: block;
	margin: 30px auto 0;
	cursor: pointer;
}

.cil-cat-loadmore-btn.hidden {
	display: none;
}

/* ---- Mobile ---- */

@media (max-width: 1023px) {
	.cil-cat-toc {
		max-width: 100%;
	}
}

@media (max-width: 767px) {
	.cil-promo-block {
		flex-direction: column;
		gap: 16px;
	}

	.cil-promo-block__image {
		flex: none;
		width: 100%;
		max-height: 200px;
	}

	.cil-cat-content h2 {
		font-size: 22px;
	}

	.cil-cat-content h3 {
		font-size: 18px;
	}
}
