/**
 * Blog Listing Styles
 *
 * Styles for blog hero, post grid, post cards, pagination,
 * archive headers, and no-results states.
 *
 * @package AgenticWP
 */

/* ==========================================================================
   Blog Hero Section
   ========================================================================== */

.blog-hero {
	padding: 100px 0 60px;
	background: linear-gradient(
		to bottom,
		#fefcfb 0%,
		var(--bg) 100%
	);
	text-align: center;
}

.blog-hero-content {
	max-width: 600px;
	margin: 0 auto;
}

.blog-hero-title {
	font-size: clamp(36px, 6vw, 52px);
	font-weight: 700;
	color: var(--accent);
	line-height: 1.1;
	margin: 0 0 16px;
	letter-spacing: -0.02em;
}

.blog-hero-description {
	font-size: 18px;
	line-height: 1.6;
	color: var(--muted);
	margin: 0 0 32px;
}

/* ==========================================================================
   Search Form
   ========================================================================== */

.blog-search-form {
	max-width: 480px;
	margin: 0 auto;
}

.search-input-wrapper {
	position: relative;
	display: flex;
	align-items: center;
	background: var(--bg);
	border: 1px solid var(--line);
	border-radius: 12px;
	overflow: hidden;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-input-wrapper:focus-within {
	border-color: var(--accent);
	box-shadow: 0 0 0 3px rgba(5, 14, 57, 0.1);
}

.search-icon {
	position: absolute;
	left: 16px;
	width: 20px;
	height: 20px;
	color: var(--muted);
	pointer-events: none;
}

.search-input {
	flex: 1;
	padding: 14px 16px 14px 48px;
	border: none;
	background: transparent;
	font-size: 16px;
	color: var(--ink);
	outline: none;
}

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

.search-submit {
	padding: 14px 24px;
	background: var(--accent);
	color: var(--bg);
	border: none;
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
	transition: background-color 0.2s ease;
}

.search-submit:hover {
	background: #0a1a4d;
}

.search-submit:focus {
	outline: 2px solid var(--accent);
	outline-offset: 2px;
}

/* ==========================================================================
   Category Filters
   ========================================================================== */

.category-filters {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 12px;
	margin-bottom: 40px;
}

.filter-btn {
	padding: 10px 20px;
	background: var(--bg);
	color: var(--ink);
	border: 1px solid var(--line);
	border-radius: 100px;
	font-size: 14px;
	font-weight: 500;
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.filter-btn:hover {
	border-color: var(--accent);
	color: var(--accent);
}

.filter-btn:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 2px;
}

.filter-btn.is-active {
	background: var(--accent);
	color: var(--bg);
	border-color: var(--accent);
}

.filter-btn.is-active:hover {
	background: #0a1a4d;
	border-color: #0a1a4d;
	color: var(--bg);
}

/* Screen reader only - for live announcements */
.sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* ==========================================================================
   Post Grid
   ========================================================================== */

.blog-posts {
	padding: 40px 0 80px;
}

.post-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 32px;
}

/* ==========================================================================
   Post Card
   ========================================================================== */

.post-card {
	display: flex;
	flex-direction: column;
	background: var(--bg);
	border-radius: 16px;
	overflow: hidden;
	border: 1px solid var(--line);
	transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.post-card:hover {
	transform: translateY(-4px);
	box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08);
}

.post-card-link {
	display: block;
	text-decoration: none;
}

.post-card-thumbnail {
	position: relative;
	aspect-ratio: 3 / 2;
	overflow: hidden;
	background: #f3f4f6;
}

.post-card-image {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.3s ease;
}

.post-card:hover .post-card-image {
	transform: scale(1.05);
}

.post-card-placeholder {
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
	color: var(--muted);
}

.post-card-placeholder svg {
	width: 48px;
	height: 48px;
	opacity: 0.5;
}

.post-card-content {
	display: flex;
	flex-direction: column;
	flex: 1;
	padding: 24px;
}

.post-card-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
	margin-bottom: 12px;
	font-size: 13px;
	color: var(--muted);
}

.post-card-meta-sep {
	opacity: 0.5;
}

.post-card-category {
	color: var(--accent);
	text-decoration: none;
	font-weight: 500;
	transition: color 0.2s ease;
}

.post-card-category:hover {
	color: #0a1a4d;
}

.post-card-date {
	color: var(--muted);
}

.post-card-title {
	font-size: 20px;
	font-weight: 600;
	line-height: 1.3;
	margin: 0 0 12px;
	color: var(--ink);
}

.post-card-title a {
	color: inherit;
	text-decoration: none;
	transition: color 0.2s ease;
}

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

.post-card-excerpt {
	font-size: 15px;
	line-height: 1.6;
	color: var(--muted);
	margin: 0 0 16px;
	flex: 1;
}

.post-card-read-more {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 14px;
	font-weight: 600;
	color: var(--accent);
	text-decoration: none;
	transition: gap 0.2s ease;
}

.post-card-read-more:hover {
	gap: 10px;
}

.read-more-arrow {
	width: 16px;
	height: 16px;
}

/* ==========================================================================
   Post Card Filter States
   ========================================================================== */

/* Card hidden (removed from layout) */
.post-card.is-hidden {
	display: none;
}

/* ==========================================================================
   Pagination
   ========================================================================== */

.blog-pagination {
	padding: 0 0 80px;
}

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

.pagination-item a,
.pagination-item span {
	display: flex;
	align-items: center;
	justify-content: center;
	min-width: 44px;
	height: 44px;
	padding: 0 16px;
	border-radius: 8px;
	font-size: 15px;
	font-weight: 500;
	text-decoration: none;
	transition: all 0.2s ease;
}

.pagination-item a {
	color: var(--ink);
	background: var(--bg);
	border: 1px solid var(--line);
}

.pagination-item a:hover {
	background: var(--accent);
	border-color: var(--accent);
	color: var(--bg);
}

.pagination-item span.current {
	background: var(--accent);
	color: var(--bg);
	border: 1px solid var(--accent);
}

.pagination-item span.dots {
	border: none;
	background: transparent;
	color: var(--muted);
}

.pagination-item .prev,
.pagination-item .next {
	gap: 8px;
}

.pagination-arrow {
	width: 18px;
	height: 18px;
}

/* ==========================================================================
   Archive Header
   ========================================================================== */

.archive-header {
	padding: 100px 0 40px;
	background: linear-gradient(
		to bottom,
		#fefcfb 0%,
		var(--bg) 100%
	);
	text-align: center;
}

.archive-header-content {
	max-width: 600px;
	margin: 0 auto;
}

.archive-type {
	display: inline-block;
	padding: 6px 14px;
	background: var(--accent-weak);
	color: var(--accent);
	font-size: 13px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	border-radius: 20px;
	margin-bottom: 16px;
}

.archive-title {
	font-size: clamp(32px, 5vw, 44px);
	font-weight: 700;
	color: var(--accent);
	line-height: 1.1;
	margin: 0 0 16px;
	letter-spacing: -0.02em;
}

.archive-description {
	font-size: 17px;
	line-height: 1.6;
	color: var(--muted);
	margin: 0 0 16px;
}

.archive-description p {
	margin: 0;
}

.archive-count {
	font-size: 14px;
	color: var(--muted);
	margin: 0 0 24px;
}

.back-to-blog {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: 14px;
	font-weight: 500;
	color: var(--accent);
	text-decoration: none;
	transition: gap 0.2s ease;
}

.back-to-blog:hover {
	gap: 12px;
}

.back-arrow {
	width: 18px;
	height: 18px;
}

/* ==========================================================================
   No Results
   ========================================================================== */

.no-results {
	text-align: center;
	padding: 60px 0;
}

.no-results-icon {
	margin-bottom: 24px;
}

.no-results-icon svg {
	width: 64px;
	height: 64px;
	color: var(--line);
}

.no-results-title {
	font-size: 24px;
	font-weight: 600;
	color: var(--ink);
	margin: 0 0 12px;
}

.no-results-title .search-term {
	color: var(--accent);
}

.no-results-message {
	font-size: 16px;
	line-height: 1.6;
	color: var(--muted);
	margin: 0 0 32px;
	max-width: 400px;
	margin-left: auto;
	margin-right: auto;
}

.no-results-actions {
	display: flex;
	justify-content: center;
	gap: 12px;
	flex-wrap: wrap;
}

.no-results-actions .btn {
	padding: 12px 24px;
	border-radius: 8px;
	font-size: 15px;
	font-weight: 600;
	text-decoration: none;
	transition: all 0.2s ease;
}

.no-results-actions .btn-primary {
	background: var(--accent);
	color: var(--bg);
}

.no-results-actions .btn-primary:hover {
	background: #0a1a4d;
}

.no-results-actions .btn-secondary {
	background: var(--bg);
	color: var(--ink);
	border: 1px solid var(--line);
}

.no-results-actions .btn-secondary:hover {
	border-color: var(--accent);
	color: var(--accent);
}

/* ==========================================================================
   Responsive: Tablet (max-width: 900px)
   ========================================================================== */

@media (max-width: 900px) {
	.post-grid {
		grid-template-columns: repeat(2, 1fr);
		gap: 24px;
	}

	.blog-hero {
		padding: 80px 0 48px;
	}

	.archive-header {
		padding: 80px 0 32px;
	}
}

/* ==========================================================================
   Responsive: Mobile (max-width: 640px)
   ========================================================================== */

@media (max-width: 640px) {
	.blog-hero {
		padding: 60px 0 40px;
	}

	.blog-hero-description {
		font-size: 16px;
	}

	.search-input-wrapper {
		flex-direction: column;
		border-radius: 12px;
	}

	.search-input {
		width: 100%;
		padding: 14px 16px 14px 48px;
	}

	.search-icon {
		top: 12px;
	}

	.search-submit {
		width: 100%;
		border-radius: 0 0 11px 11px;
	}

	.post-grid {
		grid-template-columns: 1fr;
		gap: 24px;
	}

	.post-card-content {
		padding: 20px;
	}

	.post-card-title {
		font-size: 18px;
	}

	.blog-posts {
		padding: 32px 0 60px;
	}

	.blog-pagination {
		padding: 0 0 60px;
	}

	.pagination-list {
		flex-wrap: wrap;
	}

	.pagination-item a,
	.pagination-item span {
		min-width: 40px;
		height: 40px;
		padding: 0 12px;
		font-size: 14px;
	}

	.archive-header {
		padding: 60px 0 24px;
	}

	.archive-title {
		font-size: clamp(28px, 8vw, 36px);
	}

	.no-results {
		padding: 40px 0;
	}

	.no-results-icon svg {
		width: 48px;
		height: 48px;
	}

	.no-results-title {
		font-size: 20px;
	}

	.no-results-actions {
		flex-direction: column;
		align-items: center;
	}

	.no-results-actions .btn {
		width: 100%;
		max-width: 280px;
		text-align: center;
	}
}

/* ==========================================================================
   Accessibility: Focus States
   ========================================================================== */

.post-card-title a:focus,
.post-card-category:focus,
.post-card-read-more:focus,
.back-to-blog:focus,
.pagination-item a:focus {
	outline: 2px solid var(--accent);
	outline-offset: 2px;
}

/* ==========================================================================
   Accessibility: Reduced Motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
	.post-card,
	.post-card-image,
	.search-input-wrapper,
	.search-submit,
	.pagination-item a,
	.post-card-read-more,
	.back-to-blog,
	.filter-btn {
		transition: none;
	}

	.post-card:hover {
		transform: none;
	}

	.post-card:hover .post-card-image {
		transform: none;
	}
}
