/* صفحهٔ ورود ماژول‌ها — فقط فایل و تصویر محلی؛ بدون CDN */
:root {
	--ink: #122219;
	--muted: #5c6a62;
	--panel: #f5f2eb;
	--panel-2: #ebe6dc;
	--line: rgba(18, 34, 25, 0.09);
	--forest: #0f3229;
	--forest-2: #1a5e4a;
	--gold: #c4a052;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
	height: 100%;
	margin: 0;
}

body {
	font-family: "primary-font", Tahoma, sans-serif;
	font-size: 15px;
	line-height: 1.45;
	color: var(--ink);
	background:
		radial-gradient(ellipse 120% 80% at 100% -30%, rgba(196, 160, 82, 0.14), transparent 50%),
		radial-gradient(ellipse 90% 70% at -10% 100%, rgba(26, 94, 74, 0.1), transparent 45%),
		linear-gradient(165deg, var(--panel) 0%, #faf8f3 48%, var(--panel-2) 100%);
	overflow: hidden;
	-webkit-font-smoothing: antialiased;
}

.page {
	height: 100%;
	max-height: 100dvh;
	display: flex;
	flex-direction: column;
}

.top {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	gap: 0.65rem 1rem;
	padding: 0.55rem 1rem 0.6rem;
	min-height: 3.25rem;
	background:
		linear-gradient(105deg, rgba(12, 38, 30, 0.92) 0%, rgba(18, 55, 44, 0.78) 45%, rgba(15, 50, 40, 0.85) 100%),
		url("hero.jpg") center / cover no-repeat;
	color: #fff;
	border-bottom: 1px solid rgba(255, 255, 255, 0.14);
	box-shadow: 0 6px 28px rgba(12, 35, 28, 0.22);
	position: relative;
}

.top::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 3px;
	background: linear-gradient(90deg, transparent, var(--gold), rgba(255, 255, 255, 0.35), var(--gold), transparent);
	opacity: 0.85;
	pointer-events: none;
}

.top-mark {
	flex: 0 0 auto;
	width: 2.35rem;
	height: 2.35rem;
	border-radius: 11px;
	display: grid;
	place-items: center;
	font-weight: 800;
	font-size: 1rem;
	letter-spacing: 0.02em;
	color: #fef6e0;
	background: linear-gradient(145deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.05));
	border: 1px solid rgba(255, 255, 255, 0.28);
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
	text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.top-titles {
	min-width: 0;
	flex: 1 1 auto;
}

.top h1 {
	margin: 0;
	font-size: clamp(0.98rem, 2.6vw, 1.28rem);
	font-weight: 800;
	letter-spacing: -0.02em;
	line-height: 1.2;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	text-shadow: 0 1px 18px rgba(0, 0, 0, 0.25);
}

span.sub {
	display: inline-block;
	margin-top: 0.15rem;
	font-size: 0.72rem;
	font-weight: 500;
	letter-spacing: 0.02em;
	color: rgba(255, 248, 235, 0.88);
}

.sub-pill {
	margin-right: auto;
	padding: 0.28rem 0.75rem;
	font-size: 0.72rem;
	font-weight: 600;
	white-space: nowrap;
	color: rgba(255, 255, 255, 0.95);
	background: rgba(255, 255, 255, 0.12);
	border: 1px solid rgba(255, 255, 255, 0.22);
	border-radius: 999px;
	backdrop-filter: blur(8px);
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.main {
	flex: 1 1 0;
	min-height: 0;
	padding: 0.55rem 0.65rem 0.42rem;
	display: flex;
	flex-direction: column;
}

.grid {
	flex: 1 1 0;
	min-height: 0;
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	grid-template-rows: repeat(2, minmax(0, 1fr));
	gap: 0.55rem;
}

.card {
	--tile: var(--forest-2);
	display: flex;
	flex-direction: column;
	min-height: 0;
	text-decoration: none;
	color: inherit;
	cursor: pointer;
	background: linear-gradient(180deg, #ffffff 0%, #fcfbfa 100%);
	border-radius: 14px;
	overflow: hidden;
	border: 1px solid var(--line);
	box-shadow:
		0 2px 4px rgba(18, 34, 25, 0.04),
		0 12px 28px rgba(18, 34, 25, 0.07);
	transition:
		transform 0.28s cubic-bezier(0.22, 1, 0.36, 1),
		box-shadow 0.28s ease,
		border-color 0.22s ease,
		background 0.3s ease;
	position: relative;
}

.card::before {
	content: "";
	position: absolute;
	top: 0;
	right: 0;
	left: 0;
	height: 4px;
	background: linear-gradient(90deg, var(--tile), color-mix(in srgb, var(--tile) 55%, var(--gold)));
	opacity: 0.92;
	z-index: 2;
	pointer-events: none;
	transform: scaleX(0.42);
	transform-origin: right center;
	transition:
		transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
		height 0.28s ease,
		box-shadow 0.28s ease;
}

.card:nth-child(1) { --tile: #1a5e4a; }
.card:nth-child(2) { --tile: #2563a8; }
.card:nth-child(3) { --tile: #7d5a2e; }
.card:nth-child(4) { --tile: #6b3d6b; }
.card:nth-child(5) { --tile: #b45309; }
.card:nth-child(6) { --tile: #0f766e; }

.card:hover::before,
.card:focus-visible::before {
	transform: scaleX(1);
	height: 6px;
	box-shadow: 0 3px 14px color-mix(in srgb, var(--tile) 65%, transparent);
}

.card:hover,
.card:focus-visible {
	transform: translateY(-4px);
	border-color: color-mix(in srgb, var(--tile) 72%, #ccc);
	box-shadow:
		0 0 0 2px color-mix(in srgb, var(--tile) 88%, #fff),
		0 0 0 4px color-mix(in srgb, var(--tile) 28%, transparent),
		0 14px 36px color-mix(in srgb, var(--tile) 22%, transparent),
		0 8px 24px rgba(18, 34, 25, 0.08);
	background: linear-gradient(
		180deg,
		color-mix(in srgb, var(--tile) 12%, #fff) 0%,
		#fff 42%,
		color-mix(in srgb, var(--tile) 8%, #fcfbfa) 100%
	);
	outline: none;
}

.card:focus-visible {
	outline: 2px solid var(--tile);
	outline-offset: 3px;
}

.card-media {
	flex: 0 0 38%;
	min-height: 0;
	position: relative;
	background: var(--forest);
}

.card-media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.card:hover .card-media img,
.card:focus-visible .card-media img {
	transform: scale(1.06);
}

.card-media::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, transparent 38%, rgba(0, 0, 0, 0.22) 100%);
	pointer-events: none;
	transition: background 0.35s ease, opacity 0.35s ease;
}

.card:hover .card-media::after,
.card:focus-visible .card-media::after {
	background: linear-gradient(
		165deg,
		color-mix(in srgb, var(--tile) 35%, transparent) 0%,
		transparent 45%,
		color-mix(in srgb, var(--tile) 55%, rgba(0, 0, 0, 0.5)) 100%
	);
	opacity: 1;
}

.card-body {
	flex: 1 1 auto;
	min-height: 0;
	padding: 0.45rem 0.65rem 0.48rem;
	display: flex;
	flex-direction: column;
	justify-content: center;
}

.card-body h2 {
	margin: 0 0 0.12rem;
	font-size: clamp(0.84rem, 1.65vw, 0.97rem);
	font-weight: 800;
	color: var(--forest);
	line-height: 1.28;
	letter-spacing: -0.02em;
	transition: color 0.25s ease;
}

.card:hover .card-body h2,
.card:focus-visible .card-body h2 {
	color: var(--tile);
}

.card-body p {
	margin: 0;
	font-size: clamp(0.68rem, 1.28vw, 0.78rem);
	color: var(--muted);
	line-height: 1.4;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.card-cta {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	margin-top: 0.38rem;
	padding: 0.22rem 0.55rem;
	font-size: 0.72rem;
	font-weight: 700;
	color: var(--tile);
	letter-spacing: 0.02em;
	align-self: flex-start;
	border-radius: 999px;
	background: color-mix(in srgb, var(--tile) 11%, transparent);
	border: 1px solid color-mix(in srgb, var(--tile) 28%, transparent);
	transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.card:hover .card-cta,
.card:focus-visible .card-cta {
	background: var(--tile);
	color: #fff;
	border-color: var(--tile);
	box-shadow: 0 4px 14px color-mix(in srgb, var(--tile) 45%, transparent);
}

.card-cta .arr {
	display: inline-flex;
	transition: transform 0.25s ease;
	opacity: 0.95;
}

.card:hover .card-cta .arr,
.card:focus-visible .card-cta .arr {
	transform: translateX(-4px);
}

.card--muted {
	cursor: default;
	opacity: 0.92;
}

.card--muted:hover,
.card--muted:focus-visible {
	transform: none;
	box-shadow:
		0 2px 4px rgba(18, 34, 25, 0.04),
		0 12px 28px rgba(18, 34, 25, 0.07);
}

.bottom {
	flex: 0 0 auto;
	text-align: center;
	padding: 0.28rem 0.5rem;
	font-size: 0.7rem;
	color: var(--muted);
	border-top: 1px solid var(--line);
	background: rgba(255, 255, 255, 0.72);
	backdrop-filter: blur(10px);
}

.bottom a {
	color: var(--forest-2);
	text-decoration: none;
	font-weight: 700;
	padding: 0.12rem 0.45rem;
	border-radius: 6px;
	border-bottom: 1px solid transparent;
	transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.bottom a:hover {
	color: #fff;
	background: var(--forest-2);
	border-bottom-color: transparent;
}

@media (max-width: 720px) {
	body {
		overflow: auto;
	}
	.page {
		max-height: none;
		min-height: 100dvh;
	}
	.grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		grid-template-rows: repeat(3, minmax(140px, 1fr));
		flex: none;
		min-height: calc(100dvh - 5.5rem);
	}
	.top-titles .sub {
		display: none;
	}
	.sub-pill {
		display: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.card,
	.card-media img,
	.card::before,
	.card-body h2,
	.card-cta,
	.card-media::after {
		transition: none !important;
	}
	.card:hover,
	.card:focus-visible {
		transform: none;
	}
	.card:hover .card-media img,
	.card:focus-visible .card-media img {
		transform: none;
	}
}
