/**
 * Shared CPT archive styles (programs + news).
 * Mirrors the live premium arch-* layout.
 *
 * @package yCharitable
 */

:root {
	--arch-primary: var(--color-primary, #007aa1);
	--arch-primary-rgb: var(--color-primary-rgb, 0, 122, 161);
	--arch-secondary: var(--color-secondary, #ce8d58);
	--arch-dark: var(--color-dark, #121a2e);
}

/* Hero */
.arch-hero {
	position: relative;
	min-height: clamp(360px, 45vh, 500px);
	display: flex;
	align-items: center;
	background: linear-gradient(135deg, #0b1726, #0e1d35);
	background-size: cover;
	background-position: center;
	overflow: hidden;
}

@supports (background-attachment: fixed) {
	.arch-hero {
		background-attachment: fixed;
	}
}

.arch-hero__overlay {
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, rgba(11, 23, 38, 0.4) 0%, rgba(11, 23, 38, 0.85) 100%);
	z-index: 1;
}

.arch-hero__shapes {
	position: absolute;
	inset: 0;
	z-index: 1;
	pointer-events: none;
	overflow: hidden;
}

.arch-hero__shape {
	position: absolute;
	border-radius: 50%;
	opacity: 0.06;
}

.arch-hero__shape--1 {
	width: 500px;
	height: 500px;
	background: radial-gradient(circle, var(--arch-primary), transparent 70%);
	inset-block-start: -200px;
	inset-inline-end: -100px;
}

.arch-hero__shape--2 {
	width: 350px;
	height: 350px;
	background: radial-gradient(circle, var(--arch-secondary), transparent 70%);
	inset-block-end: -150px;
	inset-inline-start: -80px;
}

.arch-hero__inner {
	position: relative;
	z-index: 2;
	padding-block: clamp(3rem, 6vw, 5rem);
	text-align: center;
}

.arch-hero__bc {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	font-size: 0.82rem;
	color: rgba(255, 255, 255, 0.4);
	margin-block-end: 20px;
}

.arch-hero__bc a {
	color: rgba(255, 255, 255, 0.6);
	text-decoration: none;
}

.arch-hero__bc a:hover,
.arch-hero__bc a:focus-visible {
	color: var(--arch-secondary);
}

.arch-hero__title {
	font-family: var(--font-primary, 'Cairo', sans-serif);
	font-size: clamp(1.75rem, 4.5vw, 3rem);
	font-weight: 800;
	color: #fff;
	margin: 0 0 12px;
	line-height: 1.25;
}

.arch-hero__desc {
	font-size: 1rem;
	color: rgba(255, 255, 255, 0.55);
	max-width: 540px;
	margin: 0 auto 20px;
}

.arch-hero__count {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 8px 20px;
	border-radius: 999px;
	background: color-mix(in srgb, var(--arch-primary) 15%, transparent);
	border: 1px solid color-mix(in srgb, var(--arch-primary) 25%, transparent);
	color: rgba(255, 255, 255, 0.7);
	font-size: 0.85rem;
}

.arch-hero__count-num {
	font-weight: 800;
	font-size: 1.1rem;
	color: var(--arch-secondary);
}

/* Filter */
.arch-filter {
	background: #fff;
	padding-block: 20px;
	border-block-end: 1px solid rgba(0, 0, 0, 0.05);
	position: sticky;
	top: 0;
	z-index: 50;
}

.arch-filter__nav {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	justify-content: center;
}

.arch-filter__btn {
	padding: 9px 22px;
	border-radius: 999px;
	font-size: 0.85rem;
	font-weight: 600;
	color: #555;
	background: #f5f5f5;
	border: 1.5px solid transparent;
	text-decoration: none;
	transition: color 0.2s, background 0.2s, border-color 0.2s;
}

.arch-filter__btn:hover,
.arch-filter__btn:focus-visible {
	color: var(--arch-primary);
	background: color-mix(in srgb, var(--arch-primary) 6%, transparent);
	border-color: color-mix(in srgb, var(--arch-primary) 15%, transparent);
}

.arch-filter__btn.active {
	color: #fff;
	background: linear-gradient(135deg, #d65231, #006e91);
	border-color: transparent;
	box-shadow: 0 3px 12px color-mix(in srgb, var(--arch-primary) 20%, transparent);
}

/* Content */
.arch-content {
	padding-block: clamp(32px, 5vw, 60px);
	background: #f8f9fb;
	min-height: 40vh;
}

.arch-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
	gap: 24px;
}

/* Premium card (programs + news) */
.arch-grid .program-card-wrapper,
.arch-grid .news-card-wrapper {
	height: 100%;
	animation: archCardIn 0.55s ease both;
}

.arch-grid .program-card-wrapper:nth-child(2),
.arch-grid .news-card-wrapper:nth-child(2) {
	animation-delay: 0.05s;
}

.arch-grid .program-card-wrapper:nth-child(3),
.arch-grid .news-card-wrapper:nth-child(3) {
	animation-delay: 0.1s;
}

.arch-grid .program-card-wrapper:nth-child(4),
.arch-grid .news-card-wrapper:nth-child(4) {
	animation-delay: 0.15s;
}

@keyframes archCardIn {
	from {
		opacity: 0;
		transform: translateY(18px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.arch-grid .program-card,
.arch-grid .news-card {
	background: #fff;
	border-radius: 16px;
	overflow: hidden;
	border: 1px solid rgba(0, 0, 0, 0.06);
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
	transition: transform 0.3s, box-shadow 0.3s;
	height: 100%;
	display: flex;
	flex-direction: column;
}

.arch-grid .program-card:hover,
.arch-grid .news-card:hover {
	transform: translateY(-6px);
	box-shadow: 0 12px 36px rgba(0, 0, 0, 0.1);
}

.arch-grid .program-card-image,
.arch-grid .news-card-image {
	position: relative;
	aspect-ratio: 16 / 10;
	overflow: hidden;
	background: color-mix(in srgb, var(--arch-primary) 8%, #eef2f5);
}

.arch-grid .program-card-image img,
.arch-grid .news-card-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.4s;
}

.arch-grid .program-card:hover .program-card-image img,
.arch-grid .news-card:hover .news-card-image img {
	transform: scale(1.06);
}

.arch-grid .program-card-image-overlay,
.arch-grid .news-card-image-overlay {
	position: absolute;
	inset: 0;
	background: linear-gradient(0deg, rgba(11, 23, 38, 0.4), transparent 60%);
	display: flex;
	align-items: flex-end;
	justify-content: flex-end;
	padding: 12px;
	opacity: 0;
	transition: opacity 0.3s;
}

.arch-grid .program-card:hover .program-card-image-overlay,
.arch-grid .news-card:hover .news-card-image-overlay {
	opacity: 1;
}

.arch-grid .program-card-image-overlay svg,
.arch-grid .news-card-image-overlay svg {
	color: #fff;
}

.arch-grid .news-card-meta {
	font-size: 0.78rem;
	font-weight: 600;
	color: var(--arch-primary);
	margin: 0 0 8px;
}

.arch-grid .program-card-content,
.arch-grid .news-card-content {
	padding: 20px;
	display: flex;
	flex-direction: column;
	flex: 1;
}

.arch-grid .program-card-title,
.arch-grid .news-card-title {
	font-size: 1.05rem;
	font-weight: 700;
	margin: 0 0 8px;
	font-family: var(--font-primary, 'Cairo', sans-serif);
}

.arch-grid .program-card-title a,
.arch-grid .news-card-title a {
	color: #1a1a2e;
	text-decoration: none;
	transition: color 0.15s;
}

.arch-grid .program-card-title a:hover,
.arch-grid .program-card-title a:focus-visible,
.arch-grid .news-card-title a:hover,
.arch-grid .news-card-title a:focus-visible {
	color: var(--arch-primary);
}

.arch-grid .program-card-desc,
.arch-grid .news-card-desc {
	font-size: 0.85rem;
	color: #666;
	line-height: 1.6;
	margin: 0 0 16px;
	flex: 1;
}

.arch-grid .program-card-footer,
.arch-grid .news-card-footer {
	margin-block-start: auto;
}

.arch-grid .ych-program-learn-btn,
.arch-grid .ych-news-learn-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 0.82rem;
	font-weight: 700;
	color: var(--arch-primary);
	text-decoration: none;
	transition: gap 0.2s;
}

.arch-grid .ych-program-learn-btn:hover,
.arch-grid .ych-program-learn-btn:focus-visible,
.arch-grid .ych-news-learn-btn:hover,
.arch-grid .ych-news-learn-btn:focus-visible {
	gap: 10px;
}

html[dir='rtl'] .arch-grid .ych-program-learn-btn svg,
html[dir='rtl'] .arch-grid .ych-news-learn-btn svg {
	transform: scaleX(-1);
}

.arch-empty {
	text-align: center;
	padding: 80px 20px;
	color: #aaa;
}

.arch-empty p {
	margin-block-start: 16px;
	font-size: 1.1rem;
}

.arch-pagination ul {
	display: flex;
	gap: 6px;
	justify-content: center;
	list-style: none;
	padding: 0;
	margin: 40px 0 0;
}

.arch-pagination li a,
.arch-pagination li span {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border-radius: 10px;
	font-weight: 600;
	font-size: 0.88rem;
	text-decoration: none;
	color: #555;
	background: #fff;
	border: 1px solid rgba(0, 0, 0, 0.06);
	transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.arch-pagination li a:hover,
.arch-pagination li a:focus-visible {
	color: var(--arch-primary);
	border-color: var(--arch-primary);
}

.arch-pagination li span.current {
	background: var(--arch-primary);
	color: #fff;
	border-color: transparent;
}

@media (max-width: 768px) {
	.arch-filter__nav {
		flex-wrap: nowrap;
		overflow-x: auto;
		justify-content: flex-start;
		-webkit-overflow-scrolling: touch;
		scrollbar-width: none;
		padding-block-end: 4px;
	}

	.arch-filter__nav::-webkit-scrollbar {
		display: none;
	}

	.arch-filter__btn {
		flex-shrink: 0;
	}

	.arch-grid {
		grid-template-columns: 1fr;
	}
}

@media (prefers-reduced-motion: reduce) {
	.arch-grid .program-card-wrapper,
	.arch-grid .news-card-wrapper,
	.arch-grid .program-card,
	.arch-grid .news-card,
	.arch-grid .program-card-image img,
	.arch-grid .news-card-image img,
	.arch-grid .ych-program-learn-btn,
	.arch-grid .ych-news-learn-btn {
		animation: none !important;
		transition: none !important;
	}

	.arch-hero {
		background-attachment: scroll;
	}
}

/* Astra full-bleed for archives */
body.post-type-archive-programs .ast-container,
body.post-type-archive-programs #primary,
body.post-type-archive-programs #content,
body.post-type-archive-re_news .ast-container,
body.post-type-archive-re_news #primary,
body.post-type-archive-re_news #content {
	max-width: 100% !important;
	padding: 0 !important;
	margin: 0 !important;
}

body.post-type-archive-programs article,
body.post-type-archive-re_news article {
	margin: 0 !important;
	padding: 0 !important;
}
