/**
 * Haam site footer — LOCKED geometry (match home on every page).
 *
 * Rules:
 * - Edit ONLY this file for footer size/spacing/typography/layout.
 * - Do NOT override --footer-shell-*, --footer-brand-h, padding, or brand height
 *   from page CSS (about/cheshm/mag/etc).
 * - Page CSS may change COLORS only (ink/muted/ground on dark pages like چشم).
 * - Atmosphere stays display:none everywhere; light pages use transparent ground.
 */

/* Atmosphere always off (site/page ground carries continuity). */
.haam-site-footer__atmosphere {
	display: none !important;
}

footer.wp-block-template-part {
	margin-block-end: 0;
	padding: 0;
	background: transparent;
}

/* Haam site footer (Mantis-style, RTL) — geometry locked to home */
.haam-site-footer {
	--footer-ground: #e9e9eb;
	--footer-ink: #141218;
	--footer-muted: #6a6674;
	--footer-line: rgba(20, 18, 24, 0.28);
	--footer-shell-w: min(1120px, calc(100% - 48px));
	--footer-shell-pad: 72px 0 28px;
	--footer-top-mb: 64px;
	--footer-brand-h: clamp(120px, 18vw, 200px);
	--footer-headline: clamp(34px, 5.2vw, 58px);
	position: relative;
	isolation: isolate;
	overflow: hidden;
	direction: rtl;
	text-align: right;
	/* Transparent so site ground + glow continue from the section above (e.g. مشاوره). */
	background: transparent !important;
	background-color: transparent !important;
	background-image: none !important;
	color: var(--footer-ink);
	margin: 0;
	padding: 0;
	min-height: 0;
	width: 100%;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	font-family: inherit;
	border-top: none;
}

footer.wp-block-template-part:has(.haam-site-footer) {
	background: transparent !important;
	background-color: transparent !important;
	background-image: none !important;
	width: 100%;
	max-width: none;
	margin: 0;
	padding: 0;
}

.haam-site-footer::before {
	content: "";
	position: absolute;
	inset-inline: 0;
	inset-block-start: 0;
	height: 2px;
	pointer-events: none;
	z-index: 3;
	background: linear-gradient(
		90deg,
		transparent 0%,
		rgba(235, 209, 26, 0.15) 18%,
		#ebd11a 50%,
		rgba(235, 209, 26, 0.15) 82%,
		transparent 100%
	);
	background-size: 42% 100%;
	background-repeat: no-repeat;
	animation: haam-header-line 3.8s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
	.haam-site-footer::before {
		animation: none;
		background-position: 50% 0;
		background-size: 100% 100%;
		opacity: 0.85;
	}
}

.haam-site-footer__atmosphere {
	position: absolute;
	inset: 0;
	pointer-events: none;
	z-index: 0;
	overflow: hidden;
}

.haam-site-footer__glow {
	position: absolute;
	inset-inline-start: -8%;
	inset-block-start: 8%;
	width: min(620px, 70vw);
	height: min(620px, 70vw);
	border-radius: 50%;
	background: radial-gradient(
		circle,
		rgba(235, 209, 26, 0.48) 0%,
		rgba(235, 209, 26, 0.22) 36%,
		rgba(244, 222, 58, 0.08) 55%,
		transparent 72%
	);
	filter: blur(10px);
}

.haam-site-footer__noise {
	position: absolute;
	inset: 0;
	opacity: 0.55;
	background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.95' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.7'/%3E%3C/svg%3E");
	background-size: 140px 140px;
	mix-blend-mode: multiply;
	pointer-events: none;
}

.haam-site-footer__shell {
	position: relative;
	z-index: 2;
	width: var(--footer-shell-w);
	margin: 0 auto;
	padding: var(--footer-shell-pad);
	box-sizing: border-box;
}

.haam-site-footer__top {
	display: block;
	margin-bottom: var(--footer-top-mb);
}

.haam-site-footer__headline {
	margin: 0;
	max-width: 11em;
	font-size: var(--footer-headline);
	font-weight: 800;
	line-height: 1.12;
	letter-spacing: -0.035em;
	color: var(--footer-ink);
}

.haam-site-footer__grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 28px 32px;
	margin-bottom: 36px;
}

.haam-site-footer__label {
	margin: 0 0 10px;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: none;
	color: var(--footer-muted);
	padding-bottom: 10px;
	border-bottom: 1px dotted var(--footer-line);
}

.haam-site-footer__list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.haam-site-footer__list a {
	font-size: 18px;
	font-weight: 600;
	line-height: 1.35;
	color: var(--footer-ink) !important;
	text-decoration: none !important;
	transition: opacity 0.15s ease;
}

.haam-site-footer__list a:hover {
	opacity: 0.55;
}

.haam-site-footer__meta {
	display: grid;
	grid-template-columns: 1.2fr 0.9fr 1.1fr;
	gap: 12px 20px;
	align-items: start;
	padding-top: 16px;
	border-top: 1px dotted var(--footer-line);
	font-size: 16px !important;
	font-weight: 600;
	letter-spacing: 0.04em;
	color: var(--footer-muted);
}

.haam-site-footer__copy,
.haam-site-footer__place,
.haam-site-footer__tag {
	margin: 0;
	line-height: 1.6 !important;
	font-size: 16px !important;
}

.haam-site-footer__place {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 12px;
	justify-content: center;
	text-align: center;
}

.haam-site-footer__clock {
	font-variant-numeric: tabular-nums;
	color: var(--footer-ink);
	opacity: 0.75;
}

.haam-site-footer__tag {
	text-align: start;
}

.haam-site-footer__copy {
	text-align: end;
}

.haam-site-footer__brand {
	position: relative;
	z-index: 1;
	width: 100%;
	margin-top: 8px;
	height: var(--footer-brand-h);
	min-height: var(--footer-brand-h);
	max-height: var(--footer-brand-h);
	flex: 0 0 auto;
	overflow: hidden;
	display: flex;
	align-items: flex-start;
	justify-content: center;
	pointer-events: none;
}

.haam-site-footer__wordmark {
	display: block;
	width: min(96vw, 1200px);
	height: auto;
	max-width: none;
	margin: 0;
	padding: 0;
	object-fit: contain;
	object-position: center top;
	user-select: none;
	pointer-events: none;
}

@media (max-width: 900px) {
	.haam-site-footer {
		--footer-shell-w: calc(100% - 40px);
		--footer-shell-pad: 48px 0 20px;
		--footer-top-mb: 48px;
		--footer-headline: clamp(30px, 7.5vw, 42px);
		--footer-brand-h: 17.7vw;
		min-height: 0;
	}

	.haam-site-footer__shell {
		width: var(--footer-shell-w);
		padding: var(--footer-shell-pad);
	}

	.haam-site-footer__top {
		margin-bottom: var(--footer-top-mb);
	}

	.haam-site-footer__headline {
		max-width: 12em;
		font-size: var(--footer-headline);
		line-height: 1.1;
	}

	/* Mantis mobile: always 2 link blocks per row */
	.haam-site-footer__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 36px 20px;
		margin-bottom: 40px;
		align-items: start;
	}

	.haam-site-footer__label {
		margin-bottom: 12px;
		padding-bottom: 10px;
		font-size: 10px;
		letter-spacing: 0.1em;
	}

	.haam-site-footer__list {
		gap: 8px;
	}

	.haam-site-footer__list a {
		font-size: 16px;
		font-weight: 600;
	}

	.haam-site-footer__meta {
		display: flex;
		flex-direction: column;
		align-items: stretch;
		gap: 4px;
		padding-top: 12px;
		text-align: start;
	}

	.haam-site-footer__place,
	.haam-site-footer__tag,
	.haam-site-footer__copy {
		text-align: start;
		justify-content: flex-start;
		line-height: 1.35;
	}

	.haam-site-footer__brand {
		margin-top: 12px;
	}

	.haam-site-footer__wordmark {
		width: min(94vw, 920px);
	}
}

@media (max-width: 560px) {
	.haam-site-footer {
		--footer-shell-w: calc(100% - 28px);
		--footer-shell-pad: 40px 0 20px;
		--footer-top-mb: 36px;
		--footer-headline: clamp(26px, 8.2vw, 34px);
	}

	.haam-site-footer__shell {
		width: var(--footer-shell-w);
		padding: var(--footer-shell-pad);
	}

	.haam-site-footer__top {
		margin-bottom: var(--footer-top-mb);
	}

	.haam-site-footer__headline {
		font-size: var(--footer-headline);
	}

	.haam-site-footer__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 32px 14px;
		margin-bottom: 32px;
	}

	.haam-site-footer__list a {
		font-size: 15px;
	}

	.haam-site-footer__meta {
		font-size: 10px;
		gap: 2px;
		padding-top: 10px;
	}
}

