/**
 * Compact professional site footer — BackVersion / Master UI identity.
 * Source of truth. Bundled copies: rebuild stacks via tools/build-css-stacks.php
 * and sync home-deferred / edu-pages footer blocks when needed.
 */

.site-footer {
	--footer-bg: #0b1220;
	--footer-bg-soft: #111827;
	--footer-line: rgba(148, 163, 184, .16);
	--footer-text: #cbd5e1;
	--footer-text-muted: #94a3b8;
	--footer-text-hover: #f8fafc;
	--footer-accent: #3b82f6;

	margin-top: 1rem;
	padding: 0;
	background:
		linear-gradient(180deg, rgba(59, 130, 246, .08) 0%, transparent 42%),
		linear-gradient(135deg, var(--footer-bg) 0%, var(--footer-bg-soft) 100%);
	color: var(--footer-text);
	border-top: 1px solid var(--footer-line);
	font-family: Tajawal, Inter, system-ui, sans-serif;
}

.site-footer-inner {
	width: 100%;
	max-width: 1150px;
	margin: 0 auto;
	padding: 28px 20px 22px;
	display: flex;
	flex-direction: column;
	gap: 22px;
}

/* Brand + platform tiles — clear two-zone row */
.site-footer-top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px 32px;
	flex-wrap: wrap;
}

.site-footer-brand {
	display: inline-flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 8px;
	min-width: 0;
	max-width: 340px;
	flex: 0 1 340px;
	text-decoration: none;
	color: inherit;
}

.site-footer-brand__logo {
	display: block;
	height: 32px;
	width: auto;
	max-width: 148px;
	object-fit: contain;
}

.site-footer-brand__name {
	font-size: 17px;
	font-weight: 800;
	letter-spacing: .01em;
	color: #fff;
	line-height: 1.25;
}

.site-footer-brand__tag {
	font-size: 12px;
	font-weight: 500;
	color: var(--footer-text-muted);
	line-height: 1.55;
	max-width: 300px;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.site-footer-platforms {
	display: flex;
	flex-wrap: wrap;
	align-items: stretch;
	justify-content: flex-end;
	gap: 6px;
	flex: 0 1 auto;
	margin-inline-start: auto;
}

.site-footer-plat {
	display: inline-flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 6px;
	min-width: 64px;
	padding: 10px 11px;
	border-radius: 12px;
	border: 1px solid transparent;
	background: transparent;
	color: var(--footer-text);
	text-decoration: none;
	line-height: 1;
	transition: background .15s ease, border-color .15s ease, color .15s ease, transform .15s ease;
}

.site-footer-plat__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border-radius: 10px;
	background: rgba(255, 255, 255, .06);
	color: #e2e8f0;
	transition: background .15s ease, color .15s ease;
}

.site-footer-plat__label {
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .01em;
	color: var(--footer-text-muted);
	transition: color .15s ease;
}

.site-footer-plat:hover {
	color: #fff;
	background: rgba(255, 255, 255, .04);
	border-color: rgba(148, 163, 184, .18);
	text-decoration: none;
	transform: translateY(-1px);
}

.site-footer-plat:hover .site-footer-plat__label {
	color: #f8fafc;
}

.site-footer-plat--android .site-footer-plat__icon {
	color: #4ade80;
	background: rgba(34, 197, 94, .12);
}

.site-footer-plat--android:hover {
	border-color: rgba(34, 197, 94, .35);
	background: rgba(34, 197, 94, .08);
}

.site-footer-plat--windows .site-footer-plat__icon {
	color: #60a5fa;
	background: rgba(59, 130, 246, .14);
}

.site-footer-plat--windows:hover {
	border-color: rgba(59, 130, 246, .35);
	background: rgba(59, 130, 246, .08);
}

.site-footer-plat--ios .site-footer-plat__icon {
	color: #cbd5e1;
	background: rgba(148, 163, 184, .14);
}

.site-footer-plat--linux .site-footer-plat__icon {
	color: #fbbf24;
	background: rgba(245, 158, 11, .12);
}

.site-footer-plat--linux:hover {
	border-color: rgba(245, 158, 11, .35);
	background: rgba(245, 158, 11, .08);
}

.site-footer-plat--drivers .site-footer-plat__icon {
	color: #a5b4fc;
	background: rgba(99, 102, 241, .14);
}

.site-footer-plat--drivers:hover {
	border-color: rgba(99, 102, 241, .35);
	background: rgba(99, 102, 241, .08);
}

/* Bottom: links row, then social + copyright — no crowding */
.site-footer-bottom {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: 16px;
	padding-top: 18px;
	border-top: 1px solid var(--footer-line);
}

.site-footer-links {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-wrap: wrap;
	gap: 6px 2px;
	width: 100%;
	min-width: 0;
}

.site-footer-link {
	color: var(--footer-text-muted);
	font-size: 12px;
	font-weight: 600;
	text-decoration: none;
	transition: color .12s ease;
	white-space: nowrap;
	padding: 4px 10px;
}

.site-footer-link:hover {
	color: var(--footer-text-hover);
}

.site-footer-sep {
	color: rgba(148, 163, 184, .35);
	font-size: 12px;
	line-height: 1;
	user-select: none;
	padding: 0 2px;
}

.site-footer-end {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 14px 20px;
	flex-wrap: nowrap;
	width: 100%;
	/* Physical LTR bar: social left, copyright right (even on RTL pages). */
	direction: ltr;
}

.site-social-links {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-shrink: 0;
	order: 1;
	margin-inline-start: 0;
}

.site-social-link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	min-width: 44px;
	min-height: 44px;
	box-sizing: border-box;
	border-radius: 10px;
	color: var(--footer-text);
	background: rgba(255, 255, 255, .06);
	border: 1px solid rgba(148, 163, 184, .14);
	transition: color .12s ease, background .12s ease, border-color .12s ease;
}

.site-social-link:hover {
	color: #fff;
	background: rgba(59, 130, 246, .2);
	border-color: rgba(59, 130, 246, .35);
}

.site-social-link--facebook:hover { background: rgba(59, 89, 152, .28); border-color: rgba(59, 89, 152, .45); }
.site-social-link--twitter:hover { background: rgba(15, 23, 42, .55); border-color: rgba(148, 163, 184, .4); }
.site-social-link--youtube:hover { background: rgba(220, 38, 38, .22); border-color: rgba(220, 38, 38, .4); }
.site-social-link--telegram:hover { background: rgba(14, 165, 233, .22); border-color: rgba(14, 165, 233, .4); }
.site-social-link--instagram:hover { background: rgba(219, 39, 119, .2); border-color: rgba(219, 39, 119, .4); }
.site-social-link--whatsapp:hover { background: rgba(34, 197, 94, .2); border-color: rgba(34, 197, 94, .4); }

.site-footer-copy {
	order: 2;
	margin: 0;
	margin-left: auto;
	font-size: 12px;
	font-weight: 500;
	color: var(--footer-text-muted);
	line-height: 1.45;
	white-space: nowrap;
	direction: rtl;
	unicode-bidi: plaintext;
}

@media (max-width: 900px) {
	.site-footer-inner {
		padding: 22px 16px 18px;
		gap: 16px;
	}

	.site-footer-top {
		flex-direction: column;
		align-items: center;
		text-align: center;
		gap: 14px;
	}

	.site-footer-brand {
		align-items: center;
		max-width: 22rem;
		flex: 0 1 auto;
	}

	.site-footer-brand__tag {
		max-width: 22rem;
	}

	.site-footer-platforms {
		justify-content: center;
		margin-inline-start: 0;
		gap: 6px;
		width: 100%;
	}

	.site-footer-plat {
		min-width: 58px;
		padding: 8px 9px;
	}

	.site-footer-bottom {
		gap: 14px;
		padding-top: 16px;
	}

	.site-footer-end {
		justify-content: space-between;
		flex-direction: row;
		flex-wrap: wrap;
		gap: 12px 16px;
	}

	.site-footer-links {
		justify-content: center;
		gap: 4px 0;
	}

	.site-footer-copy {
		white-space: normal;
		text-align: start;
		max-width: none;
	}
}

/* Mobile footer: denser, cleaner, less visual noise */
@media (max-width: 640px) {
	.site-footer {
		margin-top: 0.75rem;
	}

	.site-footer-inner {
		padding: 16px 14px 14px;
		gap: 12px;
	}

	.site-footer-top {
		gap: 12px;
	}

	.site-footer-brand {
		gap: 6px;
		max-width: 18rem;
	}

	.site-footer-brand__logo {
		height: 26px;
		max-width: 120px;
	}

	.site-footer-brand__tag {
		font-size: 11px;
		line-height: 1.45;
		max-width: 17rem;
		-webkit-line-clamp: 2;
	}

	.site-footer-platforms {
		display: grid;
		grid-template-columns: repeat(5, minmax(0, 1fr));
		gap: 4px;
		width: 100%;
	}

	.site-footer-plat {
		min-width: 0;
		width: 100%;
		padding: 6px 2px;
		gap: 4px;
		border-radius: 10px;
	}

	.site-footer-plat__icon {
		width: 30px;
		height: 30px;
		border-radius: 8px;
	}

	.site-footer-plat__icon svg {
		width: 14px;
		height: 14px;
	}

	.site-footer-plat__label {
		font-size: 9.5px;
		font-weight: 700;
		letter-spacing: 0;
	}

	.site-footer-bottom {
		gap: 12px;
		padding-top: 12px;
	}

	.site-footer-sep {
		display: none;
	}

	.site-footer-links {
		display: grid;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 2px 8px;
		width: 100%;
	}

	.site-footer-link {
		padding: 8px 6px;
		font-size: 11.5px;
		font-weight: 600;
		white-space: normal;
		line-height: 1.3;
		text-align: center;
		border-radius: 8px;
	}

	.site-footer-link:hover {
		background: rgba(255, 255, 255, .04);
	}

	.site-footer-end {
		flex-direction: column;
		align-items: center;
		justify-content: center;
		gap: 10px;
		direction: ltr;
	}

	.site-social-links {
		order: 0;
		justify-content: center;
		gap: 6px;
		flex-wrap: wrap;
	}

	.site-social-link {
		width: 34px;
		height: 34px;
		min-width: 34px;
		min-height: 34px;
		border-radius: 9px;
	}

	.site-footer-copy {
		order: 1;
		margin: 0;
		margin-left: 0;
		text-align: center;
		font-size: 11px;
		line-height: 1.4;
		max-width: 20rem;
	}
}

/* Search suggest (shared chrome — kept with footer sheet historically) */
.site-search-field {
	position: relative;
	width: 100%;
}

.site-search-suggest {
	position: absolute;
	top: calc(100% + 6px);
	inset-inline-end: 0;
	inset-inline-start: 0;
	z-index: 200;
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: 12px;
	box-shadow: 0 8px 24px rgba(15, 23, 42, .12);
	max-height: 320px;
	overflow-y: auto;
	padding: 6px;
}

.site-search-suggest-item {
	display: flex;
	flex-direction: column;
	gap: 2px;
	padding: 9px 10px;
	border-radius: 8px;
	text-decoration: none;
	color: inherit;
	transition: background-color .12s ease;
}

.site-search-suggest-item:hover,
.site-search-suggest-item.is-active {
	background: #eff6ff;
}

.site-search-suggest-label {
	font-size: 13px;
	font-weight: 600;
	color: #0f172a;
	line-height: 1.4;
}

.site-search-suggest-meta {
	font-size: 11px;
	color: #64748b;
}

.site-search-suggest-empty {
	padding: 10px 12px;
	font-size: 12px;
	color: #64748b;
	text-align: center;
}

.header-search-container {
	position: relative;
}

.header-search-container .site-search-suggest {
	top: calc(100% + 8px);
}

.hero-search-form .site-search-field {
	flex: 1;
	min-width: 0;
}
