/* ============================================================
 * CATEGORY ARCHIVE PAGE  (cat-*)
 * ============================================================ */

/* ── Page wrapper ─────────────────────────────────────────── */
.cat-wrap {
	width: 100%;
	font-family: inherit;
}

.cat-wrap *,
.cat-wrap *::before,
.cat-wrap *::after {
	font-family: inherit;
}

/* ── Hero header ──────────────────────────────────────────── */
.cat-hero {
	background: linear-gradient(135deg, #123e8a 0%, #0d2d65 100%);
	color: #fff;
	padding: 48px 0 40px;
}

.cat-hero__inner {
	max-width: 1200px;
	margin-inline: auto;
	padding: 0 1.5rem;
}

.cat-hero__badge {
	display: inline-block;
	padding: 3px 10px;
	background: rgba(255, 255, 255, 0.15);
	border: 1px solid rgba(255, 255, 255, 0.25);
	border-radius: 20px;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: rgba(255, 255, 255, 0.85);
	margin-bottom: 14px;
}

.cat-hero__title {
	font-size: clamp(24px, 5vw, 42px);
	font-weight: 800;
	letter-spacing: -0.02em;
	line-height: 1.15;
	margin-bottom: 10px;
}

.cat-hero__desc {
	font-size: 16px;
	color: rgba(255, 255, 255, 0.75);
	line-height: 1.65;
	max-width: 560px;
	margin-bottom: 18px;
}

.cat-hero__meta {
	display: flex;
	align-items: center;
	gap: 16px;
	font-size: 13px;
	color: rgba(255, 255, 255, 0.65);
}

.cat-hero__meta-item {
	display: flex;
	align-items: center;
	gap: 5px;
}

/* ── Breadcrumb ───────────────────────────────────────────── */
.cat-breadcrumb {
	border-bottom: 1px solid rgba(0, 0, 0, 0.07);
	padding: 13px 0;
}

.cat-breadcrumb__inner {
	max-width: 1200px;
	margin-inline: auto;
	padding: 0 1.5rem;
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 13px;
	color: #6b7280;
	flex-wrap: wrap;
}

.cat-breadcrumb__inner a {
	color: #123e8a;
	text-decoration: none;
}

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

.cat-breadcrumb__sep {
	color: #d1d5db;
}

/* ── Main layout: 2 columns (articles | sidebar) ──────── */
.cat-layout {
	max-width: 1200px;
	margin-inline: auto;
	padding: 40px 1.5rem 60px;
	display: grid;
	grid-template-columns: 1fr 300px;
	gap: 40px;
	align-items: start;
}

@media (max-width: 1023px) {
	.cat-layout {
		grid-template-columns: 1fr;
	}
}

/* ── Section heading inside main ──────────────────────────── */
.cat-section-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 24px;
	padding-bottom: 14px;
	border-bottom: 2px solid #123e8a;
}

.cat-section-head__title {
	font-size: 17px;
	font-weight: 800;
	color: #111827;
	letter-spacing: -0.01em;
}

.cat-section-head__count {
	font-size: 13px;
	color: #6b7280;
}

/* ── Post list (1 article per row) ──────────────────── */
.cat-grid {
	display: flex;
	flex-direction: column;
	gap: var(--spacing-md);
}

/* ── Row item card (mirrors news-row-item) ─────────────────── */
.cat-row-item {
	display: flex;
	gap: var(--spacing-md);
	background: var(--bg-white);
	border: 2px solid var(--border-primary);
	border-radius: var(--radius-md);
	padding: var(--spacing-lg);
	text-decoration: none;
	color: inherit;
}

/* ── Image (mirrors news-row-image) ────────────────────────── */
.cat-row-image {
	flex-shrink: 0;
	width: 9rem;
	height: 80px;
	background: var(--bg-gray-200);
	border-radius: var(--radius-sm);
	overflow: hidden;
}

.cat-row-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.cat-row-no-img {
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	background: linear-gradient(135deg, #eef2ff, #dbeafe);
}

@media (max-width: 640px) {
	.cat-row-image {
		width: 80px;
		height: 80px;
	}
}

/* ── Content (mirrors news-row-content) ────────────────────── */
.cat-row-content {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 0.35rem;
}

/* ── Title (mirrors news-row-post-title) ───────────────────── */
.cat-row-title {
	font-size: 1rem;
	font-weight: 600;
	margin: 0;
	line-height: 1.375;
	color: var(--text-primary);
	display: -webkit-box;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	transition: color var(--transition-fast);
}

.cat-row-item:hover .cat-row-title {
	color: var(--primary);
}

/* ── Summary (mirrors news-row-summary) ────────────────────── */
.cat-row-summary {
	font-size: 0.8125rem;
	color: var(--text-muted);
	margin: 0;
	line-height: 1.45;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* ── Meta ──────────────────────────────────────────────────── */
.cat-row-meta {
	display: flex;
	align-items: center;
	gap: 5px;
	font-size: 11px;
	color: var(--text-light);
	margin-top: 4px;
}

.cat-row-meta__dot {
	opacity: 0.5;
}

/* ── Pagination ──────────────────────────────────────────── */
.cat-pagination {
	margin-top: 40px;
	display: flex;
	justify-content: center;
}

.cat-pagination .nav-links {
	display: flex;
	align-items: center;
	gap: 6px;
	flex-wrap: wrap;
}

.cat-pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 38px;
	height: 38px;
	padding: 0 10px;
	border: 1px solid #e5e7eb;
	border-radius: 8px;
	font-size: 14px;
	font-weight: 600;
	color: #374151;
	text-decoration: none;
	transition:
		background 0.18s,
		border-color 0.18s,
		color 0.18s;
}

.cat-pagination .page-numbers:hover {
	background: #eef2ff;
	border-color: rgba(18, 62, 138, 0.3);
	color: #123e8a;
}

.cat-pagination .page-numbers.current {
	background: #123e8a;
	border-color: #123e8a;
	color: #fff;
}

.cat-pagination .page-numbers.dots {
	border: none;
	background: transparent;
	cursor: default;
}

/* ── No posts state ──────────────────────────────────────── */
.cat-empty {
	grid-column: 1 / -1;
	text-align: center;
	padding: 60px 20px;
}

.cat-empty__icon {
	font-size: 48px;
	margin-bottom: 16px;
	opacity: 0.4;
}

.cat-empty__title {
	font-size: 20px;
	font-weight: 700;
	color: #111827;
	margin-bottom: 8px;
}

.cat-empty__text {
	font-size: 15px;
	color: #6b7280;
	margin-bottom: 24px;
}

.cat-empty__link {
	display: inline-block;
	padding: 10px 24px;
	background: #123e8a;
	color: #fff;
	border-radius: 8px;
	text-decoration: none;
	font-weight: 700;
	font-size: 14px;
	transition: background 0.2s;
}

.cat-empty__link:hover {
	background: #0d2d65;
}

/* ── Sidebar ─────────────────────────────────────────────── */
.cat-sidebar {
	position: sticky;
	top: calc(var(--nav-h) + 20px);
}

.cat-sidebar__section {
	margin-bottom: 32px;
}

.cat-sidebar__heading {
	font-size: 13px;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: #9ca3af;
	margin-bottom: 16px;
	padding-bottom: 10px;
	border-bottom: 1px solid #e5e7eb;
}

/* Subcategory pills */
.cat-sub-list {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.cat-sub-item {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 9px 14px;
	border: 1px solid #e5e7eb;
	border-radius: 8px;
	text-decoration: none;
	font-size: 14px;
	font-weight: 600;
	color: #374151;
	transition:
		background 0.18s,
		border-color 0.18s,
		color 0.18s;
}

.cat-sub-item:hover,
.cat-sub-item.is-current {
	background: #eef2ff;
	border-color: rgba(18, 62, 138, 0.3);
	color: #123e8a;
}

.cat-sub-item__count {
	font-size: 12px;
	font-weight: 500;
	color: #9ca3af;
}

.cat-sub-item:hover .cat-sub-item__count,
.cat-sub-item.is-current .cat-sub-item__count {
	color: #6b7280;
}

/* Popular posts in sidebar */
.cat-popular-list {
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.cat-popular-card {
	display: flex;
	gap: 12px;
	text-decoration: none;
}

.cat-popular-card:hover .cat-popular-card__title {
	color: #123e8a;
}

.cat-popular-card__img {
	width: 72px;
	height: 72px;
	border-radius: 8px;
	overflow: hidden;
	flex-shrink: 0;
	background: #f3f4f6;
}

.cat-popular-card__img img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.cat-popular-card__body {
	flex: 1;
	min-width: 0;
}

.cat-popular-card__title {
	font-size: 13px;
	font-weight: 700;
	color: #111827;
	line-height: 1.4;
	margin-bottom: 5px;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	transition: color 0.18s;
}

.cat-popular-card__date {
	font-size: 11px;
	color: #9ca3af;
}

/* ── Dark mode ───────────────────────────────────────────── */
body.dark-mode .cat-row-item {
	background: #23262d;
	border-color: rgba(255, 255, 255, 0.1);
	color: #e5e7eb;
}

body.dark-mode .cat-row-item:hover {
	border-color: rgba(99, 130, 199, 0.4);
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

body.dark-mode .cat-row-title {
	color: #f3f4f6;
}

body.dark-mode .cat-row-item:hover .cat-row-title {
	color: #60a5fa;
}

body.dark-mode .cat-row-summary {
	color: #9ca3af;
}

body.dark-mode .cat-row-meta {
	color: #6b7280;
}

body.dark-mode .cat-row-image {
	background: #2d3036;
}

body.dark-mode .cat-row-no-img {
	background: linear-gradient(135deg, #1e2a3a, #1a2540);
}

body.dark-mode .cat-section-head {
	border-bottom-color: #3b82f6;
}

body.dark-mode .cat-section-head__title {
	color: #f3f4f6;
}

body.dark-mode .cat-breadcrumb {
	border-bottom-color: rgba(255, 255, 255, 0.07);
}

body.dark-mode .cat-breadcrumb__inner {
	color: #9ca3af;
}

body.dark-mode .cat-breadcrumb__inner a {
	color: #60a5fa;
}

body.dark-mode .cat-sidebar__heading {
	color: #6b7280;
	border-bottom-color: rgba(255, 255, 255, 0.08);
}

body.dark-mode .cat-sub-item {
	background: transparent;
	border-color: rgba(255, 255, 255, 0.1);
	color: #d1d5db;
}

body.dark-mode .cat-sub-item:hover,
body.dark-mode .cat-sub-item.is-current {
	background: rgba(59, 130, 246, 0.1);
	border-color: rgba(59, 130, 246, 0.3);
	color: #60a5fa;
}

body.dark-mode .cat-popular-card__title {
	color: #e5e7eb;
}

body.dark-mode .cat-popular-card:hover .cat-popular-card__title {
	color: #60a5fa;
}

body.dark-mode .cat-popular-card__img {
	background: #2d3036;
}

body.dark-mode .cat-pagination .page-numbers {
	border-color: rgba(255, 255, 255, 0.1);
	color: #d1d5db;
}

body.dark-mode .cat-pagination .page-numbers:hover {
	background: rgba(59, 130, 246, 0.1);
	border-color: rgba(59, 130, 246, 0.3);
	color: #60a5fa;
}

body.dark-mode .cat-pagination .page-numbers.current {
	background: #123e8a;
	border-color: #123e8a;
	color: #fff;
}

body.dark-mode .cat-empty__title {
	color: #f3f4f6;
}

body.dark-mode .cat-empty__text {
	color: #9ca3af;
}

/* ── Responsive tweaks ───────────────────────────────────── */
@media (max-width: 1023px) {
	.cat-sidebar {
		position: static;
	}
}

@media (max-width: 640px) {
	.cat-hero {
		padding: 36px 0 30px;
	}

	.cat-layout {
		padding: 24px 1rem 40px;
		gap: 28px;
	}
}
