/* ============================================================
   Digital Justice Theme — Archive & Discovery Stylesheet
   العدالة الرقمية للحلول التقنية
   ============================================================ */

/* ── 1. Archive Hero Banner ──────────────────────────────── */
.dj-archive-hero {
	background: linear-gradient(135deg, #071B3B 0%, #030A16 100%);
	padding: 60px 0;
	position: relative;
	border-bottom: 2px solid var(--dj-border-color);
	color: #FFFFFF;
}

[data-theme="light"] .dj-archive-hero {
	background: linear-gradient(135deg, #EEF2F6 0%, #FFFFFF 100%);
	color: #0F172A;
}

.archive-hero-inner {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 30px;
}

.archive-hero-content {
	flex: 1;
}

.archive-hero-title {
	font-size: 2.2rem;
	font-weight: 800;
	color: #FFFFFF;
	margin-bottom: 15px;
	letter-spacing: -0.5px;
}

[data-theme="light"] .archive-hero-title {
	color: #071B3B;
}

.archive-hero-subtitle {
	font-size: 1.1rem;
	color: rgba(255, 255, 255, 0.7);
	max-width: 750px;
	line-height: 1.6;
}

[data-theme="light"] .archive-hero-subtitle {
	color: #475569;
}

/* Hero Stats Metric Badge */
.archive-hero-stat-box {
	background: rgba(13, 71, 161, 0.25);
	border: 1px solid rgba(212, 175, 55, 0.3);
	border-radius: var(--dj-radius-md);
	padding: 18px 25px;
	text-align: center;
	min-width: 160px;
	backdrop-filter: blur(8px);
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
	animation: floatHeroStat 4s ease-in-out infinite;
}

[data-theme="light"] .archive-hero-stat-box {
	background: rgba(255, 255, 255, 0.9);
	border: 1px solid #D4AF37;
	box-shadow: 0 8px 30px rgba(0, 0, 0, 0.05);
}

.archive-hero-stat-box .stat-value {
	display: block;
	font-size: 2.2rem;
	font-weight: 800;
	color: #D4AF37; /* Metallic Gold */
	line-height: 1.1;
	margin-bottom: 5px;
	font-family: var(--dj-font-english);
}

.archive-hero-stat-box .stat-label {
	display: block;
	font-size: 0.85rem;
	font-weight: 600;
	color: rgba(255, 255, 255, 0.9);
}

[data-theme="light"] .archive-hero-stat-box .stat-label {
	color: #071B3B;
}

@keyframes floatHeroStat {
	0%, 100% { transform: translateY(0); }
	50% { transform: translateY(-5px); }
}

/* ── 2. Reusable Horizontal Filter Bar ───────────────────── */
.dj-filter-bar-container {
	background: var(--dj-bg-secondary);
	border-bottom: 1px solid var(--dj-border-color);
	padding: 15px 0;
	position: sticky;
	top: 80px; /* Below header */
	z-index: 90;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

.dj-filter-bar {
	display: flex;
	gap: 12px;
	overflow-x: auto;
	scrollbar-width: none; /* Hide scrollbars */
	-ms-overflow-style: none;
	padding: 4px 0;
}

.dj-filter-bar::-webkit-scrollbar {
	display: none;
}

.filter-pill {
	display: inline-block;
	background: transparent;
	border: 1px solid var(--dj-border-color);
	color: var(--dj-text-secondary);
	padding: 8px 22px;
	border-radius: var(--dj-radius-full);
	font-family: var(--dj-font-arabic);
	font-size: 0.9rem;
	font-weight: 600;
	cursor: pointer;
	text-decoration: none;
	transition: all 0.3s var(--dj-ease);
	white-space: nowrap;
}

.filter-pill:hover {
	border-color: #D4AF37;
	color: var(--dj-text-primary);
	background: var(--dj-bg-tertiary);
}

.filter-pill.active {
	background: #D4AF37; /* Gold active color */
	border-color: #D4AF37;
	color: #071B3B; /* Deep Blue text */
	box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
}

/* ── 3. Premium Service/Project Grids ────────────────────── */
.dj-archive-grid-section {
	background: var(--dj-bg-primary);
	min-height: 400px;
}

.dj-archive-grid {
	grid-template-columns: repeat(3, 1fr);
	gap: 30px;
	transition: all 0.4s var(--dj-ease);
}

/* Dynamic Filtering CSS Hooks */
.dj-archive-grid-item {
	transition: opacity 0.4s var(--dj-ease), transform 0.4s var(--dj-ease);
	will-change: opacity, transform;
}

.dj-archive-grid-item.filtered-out {
	display: none;
	opacity: 0;
	transform: scale(0.95);
}

/* Hover layouts for Project card overlays */
.project-archive-grid .card-project-wrapper {
	overflow: hidden;
	position: relative;
	border-radius: var(--dj-radius-lg);
}

/* ── 4. Reusable Pagination Layout ──────────────────────── */
.dj-pagination-nav {
	background: var(--dj-bg-primary);
	padding-top: 0;
}

.dj-pagination-inner {
	display: flex;
	justify-content: center;
}

.dj-pagination-list {
	list-style: none;
	display: flex;
	align-items: center;
	gap: 8px;
	background: var(--dj-bg-secondary);
	padding: 8px;
	border-radius: var(--dj-radius-full);
	border: 1px solid var(--dj-border-color);
}

.dj-pagination-item {
	display: inline-block;
}

.dj-pagination-item a,
.dj-pagination-item span {
	display: flex;
	align-items: center;
	justify-content: center;
	min-width: 42px;
	height: 42px;
	border-radius: var(--dj-radius-full);
	font-family: var(--dj-font-english);
	font-size: 0.95rem;
	font-weight: 700;
	color: var(--dj-text-secondary);
	text-decoration: none;
	transition: all 0.2s var(--dj-ease);
}

.dj-pagination-item a:hover {
	background: var(--dj-bg-tertiary);
	color: var(--dj-text-primary);
}

.dj-pagination-item.active span {
	background: #071B3B;
	color: #FFFFFF;
}

[data-theme="light"] .dj-pagination-item.active span {
	background: #0D47A1;
}

/* ── 5. Empty States Layout ─────────────────────────────── */
.dj-archive-empty-state {
	grid-column: 1 / -1;
	text-align: center;
	padding: 80px 40px;
	background: var(--dj-bg-secondary);
	border: 1px dashed var(--dj-border-color);
	border-radius: var(--dj-radius-lg);
	max-width: 600px;
	margin: 40px auto;
}

.empty-state-icon {
	color: #D4AF37;
	margin-bottom: 20px;
}

.empty-state-icon .dashicons {
	font-size: 4rem;
	width: auto;
	height: auto;
}

.empty-state-title {
	font-size: 1.5rem;
	font-weight: 800;
	color: var(--dj-text-primary);
	margin-bottom: 10px;
}

.empty-state-message {
	font-size: 0.95rem;
	color: var(--dj-text-secondary);
	margin-bottom: 30px;
}

.empty-state-search-box {
	margin-bottom: 25px;
}

.dj-empty-search-form {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	max-width: 400px;
	margin: 0 auto;
}

.dj-empty-search-form label {
	flex: 1;
}

.dj-empty-search-form .search-field {
	width: 100%;
	padding: 10px 18px;
	border: 1px solid var(--dj-border-color);
	border-radius: var(--dj-radius-full);
	background: var(--dj-bg-primary);
	color: var(--dj-text-primary);
	font-family: var(--dj-font-arabic);
	outline: none;
	font-size: 0.9rem;
	transition: border var(--dj-transition-fast);
}

.dj-empty-search-form .search-field:focus {
	border-color: #0D47A1;
}

.dj-empty-search-form .search-submit {
	padding: 10px 20px;
	border-radius: var(--dj-radius-full);
	height: auto;
}

.empty-state-actions .dj-btn {
	padding: 10px 25px;
	border-radius: var(--dj-radius-full);
}

/* ── 6. 404 Error Template ───────────────────────────────── */
.dj-error-404-page {
	background: #030A16;
	color: #FFFFFF;
	padding: 120px 0;
	text-align: center;
}

[data-theme="light"] .dj-error-404-page {
	background: #F8FAFC;
	color: #0F172A;
}

.error-404-inner {
	max-width: 700px;
	margin: 0 auto;
}

.error-code {
	font-size: 8rem;
	font-weight: 900;
	color: #D4AF37;
	line-height: 1;
	margin-bottom: 20px;
	letter-spacing: -2px;
	text-shadow: 0 10px 30px rgba(212, 175, 55, 0.2);
}

.error-title {
	font-size: 2.2rem;
	font-weight: 800;
	margin-bottom: 15px;
}

.error-desc {
	font-size: 1.1rem;
	color: var(--dj-text-secondary);
	margin-bottom: 40px;
	line-height: 1.6;
}

.error-navigation-card {
	background: #071B3B;
	border: 1px solid var(--dj-border-color);
	border-radius: var(--dj-radius-lg);
	padding: 30px;
	margin-bottom: 40px;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .error-navigation-card {
	background: #FFFFFF;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.error-card-title {
	font-size: 1.1rem;
	margin-bottom: 20px;
	color: #FFFFFF;
}

[data-theme="light"] .error-card-title {
	color: #071B3B;
}

.error-shortcuts-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 15px;
}

.shortcut-item {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	padding: 15px;
	background: rgba(13, 71, 161, 0.2);
	border: 1px solid rgba(13, 71, 161, 0.3);
	border-radius: var(--dj-radius-md);
	color: #FFFFFF;
	text-decoration: none;
	transition: all 0.3s var(--dj-ease);
}

[data-theme="light"] .shortcut-item {
	background: #F8FAFC;
	border: 1px solid #E2E8F0;
	color: #0F172A;
}

.shortcut-item:hover {
	border-color: #D4AF37;
	background: rgba(212, 175, 55, 0.15);
	transform: translateY(-3px);
}

.shortcut-item .dashicons {
	font-size: 2rem;
	width: auto;
	height: auto;
	color: #D4AF37;
}

.shortcut-label {
	font-size: 0.9rem;
	font-weight: 600;
}

/* ── 7. Fallback CPT Card Styles (Blog) ─────────────────── */
.post-card-archive {
	background: var(--dj-bg-secondary);
	border: 1px solid var(--dj-border-color);
	border-radius: var(--dj-radius-lg);
	overflow: hidden;
	display: flex;
	flex-direction: column;
	height: 100%;
	transition: transform 0.3s var(--dj-ease), border 0.3s var(--dj-ease);
}

.post-card-archive:hover {
	transform: translateY(-5px);
	border-color: #D4AF37;
}

.post-card-header {
	padding: 20px 24px;
	border-bottom: 1px solid var(--dj-border-color);
}

.post-card-meta {
	display: flex;
	align-items: center;
	gap: 15px;
	font-size: 0.8rem;
	color: var(--dj-text-muted);
	margin-bottom: 10px;
}

.post-card-meta .dashicons {
	font-size: 1rem;
	width: auto;
	height: auto;
	vertical-align: middle;
}

.post-card-title {
	font-size: 1.25rem;
	margin: 0;
	line-height: 1.4;
}

.post-card-title a {
	color: var(--dj-text-primary);
	text-decoration: none;
}

.post-card-title a:hover {
	color: #D4AF37;
}

.post-card-body {
	padding: 20px 24px;
	flex: 1;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	gap: 15px;
}

.post-card-excerpt {
	font-size: 0.9rem;
	color: var(--dj-text-secondary);
	margin: 0;
	line-height: 1.6;
}

.post-card-footer {
	border-top: 1px solid var(--dj-border-color);
	padding: 15px 24px;
	display: flex;
	justify-content: flex-end;
}

.post-card-link {
	font-size: 0.9rem;
	font-weight: 700;
	color: #D4AF37;
	text-decoration: none;
	display: inline-flex;
	align-items: center;
	gap: 5px;
}

.post-card-link:hover {
	color: var(--dj-text-primary);
}

/* ── 8. Responsive Breakpoints ──────────────────────────── */
@media (max-width: 960px) {
	.archive-hero-inner {
		flex-direction: column;
		text-align: center;
	}
	.archive-hero-stat-box {
		width: 100%;
		max-width: 280px;
	}
	.dj-archive-grid {
		grid-template-columns: repeat(2, 1fr);
		gap: 20px;
	}
	.error-shortcuts-grid {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 600px) {
	.dj-archive-grid {
		grid-template-columns: 1fr;
	}
	.dj-filter-bar {
		padding-left: 20px;
		padding-right: 20px;
	}
	.archive-hero-title {
		font-size: 1.8rem;
	}
}
