/* ==========================================================================
   Homepage Academy - Dynamic Grid & Luxe Adaptive Styles
   ========================================================================== */

.homepage-academy {
	position: relative;
	background: var(--academy-bg, #0d0d0d);
	padding: 90px 4% 100px;
	border-radius: 24px;
	border: 1px solid var(--academy-border, rgba(255, 255, 255, 0.05));
	margin: 40px auto;
	max-width: 95%;
	box-shadow: var(--academy-shadow, 0 20px 50px rgba(0, 0, 0, 0.5));
	overflow: hidden;
}

/* افکت‌ها و لایه‌های پترن پس‌زمینه (کاملاً مشابه سکشن سالن‌ها) */
.homepage-academy::before {
	content: "";
	position: absolute;
	inset: 0;
	background: var(--academy-pattern-bg, transparent);
	opacity: 1;
	pointer-events: none;
	z-index: 0;
}

.homepage-academy.is-pattern-grid::after,
.homepage-academy.is-pattern-lines::after {
	content: "";
	position: absolute;
	inset: 0;
	pointer-events: none;
	z-index: 0;
	opacity: 1;
}

/* Grid preset */
.homepage-academy.is-pattern-grid::after {
	background-image:
		linear-gradient(to right, var(--academy-pattern-color, rgba(255,255,255,0.06)) 1px, transparent 1px),
		linear-gradient(to bottom, var(--academy-pattern-color, rgba(255,255,255,0.06)) 1px, transparent 1px);
	background-size: 44px 44px;
	background-position: center;
}

/* Lines preset */
.homepage-academy.is-pattern-lines::after {
	background-image: linear-gradient(
		135deg,
		transparent 0%,
		transparent 48%,
		var(--academy-pattern-color, rgba(255,255,255,0.06)) 50%,
		transparent 52%,
		transparent 100%
	);
	background-size: 70px 70px;
	background-position: center;
}

/* اولویت لایه‌ها برای خارج نشدن از کادر و عدم تداخل با پترن */
.homepage-academy > * {
	position: relative;
	z-index: 1;
}

/* کانتینر داخلی گرید */
.homepage-academy__container-grid {
	width: 100%;
	max-width: 100%;
	margin: 0 auto;
	padding: 0;
}

/* گرید آکادمی */
.homepage-academy__grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
	gap: 30px;
	margin-top: 50px;
	margin-bottom: 50px;
}

/* استایل لوکس کارت‌ها */
.homepage-academy__card {
	min-width: 0;
	border-radius: 20px;
	overflow: hidden;
	background: var(--academy-card-bg, #121212);
	border: 1px solid var(--academy-card-border, rgba(185, 138, 67, 0.15));
	transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.homepage-academy__card:hover {
	transform: translateY(-8px);
	border-color: var(--academy-border-hover, rgba(185, 138, 67, 0.5));
	box-shadow: 0 15px 35px rgba(185, 138, 67, 0.15);
}

/* ساختار کارت (تصویر راست، متن چپ در دسکتاپ) */
.homepage-academy__link {
	display: flex;
	flex-direction: row;
	height: 100%;
	text-decoration: none !important;
}

/* قالب مورب تصویر */
.homepage-academy__media-wrap {
	position: relative;
	flex: 0 0 42%;
	overflow: hidden;
	clip-path: polygon(0 0, 100% 0, 86% 100%, 0% 100%);
	transition: clip-path 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

[dir="ltr"] .homepage-academy__media-wrap {
	clip-path: polygon(0 0, 100% 0, 100% 100%, 14% 100%);
}

.homepage-academy__img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.8s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.homepage-academy__img-overlay {
	position: absolute;
	inset: 0;
	background: linear-gradient(to left, rgba(0, 0, 0, 0) 40%, var(--academy-card-bg, #121212) 100%);
	pointer-events: none;
}

.homepage-academy__card:hover .homepage-academy__img {
	transform: scale(1.1);
}

/* بدنه محتوایی کارت */
.homepage-academy__body {
	flex: 1;
	padding: 30px 24px;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
}

.homepage-academy__meta {
	margin-bottom: 8px;
}

.homepage-academy__date {
	font-size: 0.82rem;
	color: var(--academy-date-color, #b98a43);
	font-weight: 600;
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.homepage-academy__title {
	margin: 0 0 10px 0;
	font-size: 1.15rem;
	line-height: 1.55;
	font-weight: 700;
	color: var(--academy-title-color, #ffffff);
	transition: color 0.3s ease;
}

.homepage-academy__card:hover .homepage-academy__title {
	color: var(--academy-title-hover, #f4d597);
}

.homepage-academy__excerpt {
	margin: 0 0 16px 0;
	font-size: 0.88rem;
	line-height: 1.75;
	color: var(--academy-excerpt-color, #a0a0a0);
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.homepage-academy__footer {
	border-top: 1px solid rgba(255, 255, 255, 0.04);
	padding-top: 12px;
	margin-top: auto;
}

.homepage-academy__more {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 0.85rem;
	font-weight: 600;
	color: var(--academy-title-color, #ffffff);
	transition: all 0.3s ease;
}

.homepage-academy__arrow {
	display: inline-block;
	transition: transform 0.3s ease;
}

.homepage-academy__card:hover .homepage-academy__arrow {
	transform: translateX(-4px);
}

/* دکمه آرشیو مرکزی سکشن */
.homepage-academy__actions {
	display: flex;
	justify-content: center;
	margin-top: 50px;
}

.homepage-academy__btn-archive {
	display: inline-block;
	padding: 14px 40px;
	border-radius: 50px;
	background: var(--academy-btn-bg, linear-gradient(135deg, #b98a43 0%, #f4d597 100%));
	color: var(--academy-btn-text, #0d0d0d) !important;
	font-weight: 800;
	font-size: 0.95rem;
	text-decoration: none !important;
	box-shadow: 0 10px 25px rgba(185, 138, 67, 0.25);
	transition: all 0.3s ease;
}

.homepage-academy__btn-archive:hover {
	background: var(--academy-btn-hover-bg, linear-gradient(135deg, #f4d597 0%, #b98a43 100%));
	color: var(--academy-btn-hover-txt, #0d0d0d) !important;
	transform: translateY(-3px);
	box-shadow: 0 15px 30px rgba(185, 138, 67, 0.4);
}

/* ==========================================================================
   Responsive & Luxury Mobile UI Optimization
   ========================================================================== */

@media (max-width: 1200px) {
	.homepage-academy__grid {
		gap: 20px;
	}
}

@media (max-width: 991px) {
	.homepage-academy__grid {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 767px) {
	.homepage-academy {
		padding: 60px 15px 70px;
		border-radius: 16px;
	}

	.homepage-academy__grid {
		grid-template-columns: 1fr !important;
		gap: 20px;
	}

	/* ساختار عمودی شکیل و لوکس در نسخه موبایل */
	.homepage-academy__link {
		flex-direction: column;
	}

	.homepage-academy__media-wrap {
		flex: none;
		width: 100%;
		aspect-ratio: 16 / 10;
		clip-path: polygon(0 0, 100% 0, 100% 92%, 0% 100%);
	}
	
	[dir="ltr"] .homepage-academy__media-wrap {
		clip-path: polygon(0 0, 100% 0, 100% 100%, 0% 92%);
	}

	.homepage-academy__img-overlay {
		background: linear-gradient(to top, rgba(15, 15, 15, 0.95) 0%, rgba(15, 15, 15, 0) 80%);
	}

	.homepage-academy__card {
		border-radius: 20px;
		background: linear-gradient(145deg, var(--academy-card-bg, #121212) 0%, rgba(10, 10, 10, 0.95) 100%);
		box-shadow: 0 15px 35px rgba(0, 0, 0, 0.35);
		border: 1px solid rgba(255, 255, 255, 0.05);
	}
	
	.homepage-academy__card:hover {
		transform: scale(0.99) translateY(-2px);
	}

	.homepage-academy__body {
		padding: 22px 20px;
	}

	.homepage-academy__title {
		font-size: 1.05rem;
		margin-bottom: 8px;
	}

	.homepage-academy__excerpt {
		font-size: 0.85rem;
		margin-bottom: 15px;
		line-height: 1.7;
	}
	
	.homepage-academy__actions {
		margin-top: 35px;
	}
}
