/**
 * Archive / Blog Templates — Grid & List layouts.
 *
 * Used by archive.php, index.php, search.php fallback templates.
 * Consumes --cc-* CSS custom properties from the theme settings.
 *
 * @package CyberCanvas
 * @since   1.1.0
 */

/* ============================================================
   Archive Header
   ============================================================ */
.cc-archive-header {
	padding: 48px 0 32px;
	text-align: center;
}
.cc-archive-header__title {
	font-family: var(--cc-font-heading);
	font-weight: var(--cc-font-heading-weight, 700);
	font-size: clamp(1.75rem, 4vw, 2.75rem);
	color: var(--cc-heading);
	margin: 0 0 8px;
	line-height: 1.2;
}
.cc-archive-header__desc {
	font-size: 1rem;
	color: var(--cc-muted);
	max-width: 640px;
	margin: 0 auto;
	line-height: 1.6;
}

/* ============================================================
   Grid Layout
   ============================================================ */
.cc-archive-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
	gap: 28px;
	padding: 0 0 48px;
}

/* ============================================================
   Card (grid item)
   ============================================================ */
.cc-post-card {
	display: flex;
	flex-direction: column;
	border-radius: 14px;
	overflow: hidden;
	background: var(--cc-surface);
	border: 1px solid var(--cc-border);
	transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1),
	            box-shadow 0.25s;
}
.cc-post-card:hover {
	transform: translateY(-3px);
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}
[data-theme="dark"] .cc-post-card:hover {
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

/* Thumbnail */
.cc-post-card__thumb {
	position: relative;
	aspect-ratio: 16 / 10;
	overflow: hidden;
	background: var(--cc-border);
}
.cc-post-card__thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.35s;
}
.cc-post-card:hover .cc-post-card__thumb img {
	transform: scale(1.04);
}
.cc-post-card__thumb--placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--cc-muted);
	font-size: 2rem;
}

/* Categories overlay */
.cc-post-card__cats {
	position: absolute;
	top: 12px;
	left: 12px;
	display: flex;
	gap: 6px;
	flex-wrap: wrap;
}
.cc-post-card__cat {
	display: inline-block;
	padding: 3px 10px;
	border-radius: 20px;
	font-size: 0.7rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	background: var(--cc-primary);
	color: #fff;
	text-decoration: none;
	transition: background 0.2s;
}
.cc-post-card__cat:hover {
	background: var(--cc-accent);
	color: #fff;
	text-decoration: none;
}

/* Body */
.cc-post-card__body {
	padding: 20px;
	display: flex;
	flex-direction: column;
	flex: 1;
}
.cc-post-card__title {
	font-family: var(--cc-font-heading);
	font-weight: var(--cc-font-heading-weight, 700);
	font-size: 1.15rem;
	line-height: 1.35;
	color: var(--cc-heading);
	margin: 0 0 8px;
}
.cc-post-card__title a {
	color: inherit;
	text-decoration: none;
}
.cc-post-card__title a:hover {
	color: var(--cc-primary);
}
.cc-post-card__excerpt {
	font-size: 0.9rem;
	color: var(--cc-text);
	line-height: 1.6;
	margin: 0 0 16px;
	flex: 1;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* Meta */
.cc-post-card__meta {
	display: flex;
	align-items: center;
	gap: 12px;
	font-size: 0.78rem;
	color: var(--cc-muted);
	margin-top: auto;
	padding-top: 12px;
	border-top: 1px solid var(--cc-border);
}
.cc-post-card__meta-item {
	display: flex;
	align-items: center;
	gap: 4px;
}
.cc-post-card__meta svg {
	width: 14px;
	height: 14px;
	opacity: 0.7;
}

/* ============================================================
   List Layout
   ============================================================ */
.cc-archive-list {
	display: flex;
	flex-direction: column;
	gap: 20px;
	padding: 0 0 48px;
}

.cc-post-list-item {
	display: grid;
	grid-template-columns: 260px 1fr;
	gap: 24px;
	border-radius: 14px;
	overflow: hidden;
	background: var(--cc-surface);
	border: 1px solid var(--cc-border);
	transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1),
	            box-shadow 0.25s;
}
.cc-post-list-item:hover {
	transform: translateY(-2px);
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
}
[data-theme="dark"] .cc-post-list-item:hover {
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
}

/* Thumbnail (list) */
.cc-post-list-item__thumb {
	position: relative;
	overflow: hidden;
	min-height: 180px;
	background: var(--cc-border);
}
.cc-post-list-item__thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.35s;
}
.cc-post-list-item:hover .cc-post-list-item__thumb img {
	transform: scale(1.04);
}
.cc-post-list-item__thumb--placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--cc-muted);
	font-size: 2rem;
}

/* Body (list) */
.cc-post-list-item__body {
	padding: 20px 24px 20px 0;
	display: flex;
	flex-direction: column;
	justify-content: center;
}
.cc-post-list-item__cats {
	display: flex;
	gap: 6px;
	margin-bottom: 8px;
	flex-wrap: wrap;
}
.cc-post-list-item__cat {
	display: inline-block;
	padding: 2px 8px;
	border-radius: 20px;
	font-size: 0.68rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	background: var(--cc-primary);
	color: #fff;
	text-decoration: none;
}
.cc-post-list-item__cat:hover {
	background: var(--cc-accent);
	color: #fff;
}
.cc-post-list-item__title {
	font-family: var(--cc-font-heading);
	font-weight: var(--cc-font-heading-weight, 700);
	font-size: 1.2rem;
	line-height: 1.35;
	color: var(--cc-heading);
	margin: 0 0 8px;
}
.cc-post-list-item__title a {
	color: inherit;
	text-decoration: none;
}
.cc-post-list-item__title a:hover {
	color: var(--cc-primary);
}
.cc-post-list-item__excerpt {
	font-size: 0.9rem;
	color: var(--cc-text);
	line-height: 1.6;
	margin: 0 0 12px;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
.cc-post-list-item__meta {
	display: flex;
	align-items: center;
	gap: 12px;
	font-size: 0.78rem;
	color: var(--cc-muted);
}
.cc-post-list-item__meta-item {
	display: flex;
	align-items: center;
	gap: 4px;
}
.cc-post-list-item__meta svg {
	width: 14px;
	height: 14px;
	opacity: 0.7;
}

/* ============================================================
   Pagination
   ============================================================ */
.cc-archive-pagination {
	display: flex;
	justify-content: center;
	gap: 6px;
	padding: 0 0 60px;
}
.cc-archive-pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 40px;
	height: 40px;
	padding: 0 12px;
	border-radius: 10px;
	border: 1px solid var(--cc-border);
	background: var(--cc-surface);
	color: var(--cc-text);
	font-size: 0.9rem;
	font-weight: 500;
	text-decoration: none;
	transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.cc-archive-pagination .page-numbers:hover {
	background: var(--cc-primary);
	color: #fff;
	border-color: var(--cc-primary);
}
.cc-archive-pagination .page-numbers.current {
	background: var(--cc-primary);
	color: #fff;
	border-color: var(--cc-primary);
	font-weight: 700;
}
.cc-archive-pagination .page-numbers.dots {
	border: none;
	background: transparent;
	color: var(--cc-muted);
}

/* ============================================================
   No Results
   ============================================================ */
.cc-archive-empty {
	text-align: center;
	padding: 60px 20px;
	color: var(--cc-muted);
}
.cc-archive-empty__icon {
	font-size: 3rem;
	margin-bottom: 12px;
}
.cc-archive-empty__text {
	font-size: 1.1rem;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 768px) {
	.cc-archive-grid {
		grid-template-columns: 1fr;
		gap: 20px;
	}

	.cc-post-list-item {
		grid-template-columns: 1fr;
	}
	.cc-post-list-item__thumb {
		min-height: 200px;
	}
	.cc-post-list-item__body {
		padding: 16px 20px 20px;
	}
}

/* ============================================================
   Reduced motion
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
	.cc-post-card,
	.cc-post-card__thumb img,
	.cc-post-list-item,
	.cc-post-list-item__thumb img {
		transition: none !important;
	}
}
