/**
 * صفحه تکی افراد – طراحی حماسی، ریسپانسیو، انیمیشن‌های چشم‌نواز
 * پالت هماهنگ با صفحه اول: قرمز تیره، مشکی، طلایی/کهربایی برای تاکید
 */

.ms1404-people-single {
	--ps-primary: #8B0000;
	--ps-primary-dark: #5c0000;
	--ps-primary-light: rgba(139, 0, 0, 0.15);
	--ps-gold: #c9a227;
	--ps-gold-soft: rgba(201, 162, 39, 0.25);
	--ps-dark: #0d0d0d;
	--ps-dark-soft: #1a1a1a;
	--ps-text: #1a1a1a;
	--ps-text-muted: #555;
	--ps-bg: #fafafa;
	--ps-white: #fff;
	--ps-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
	--ps-radius: 12px;
	--ps-transition: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
	--ps-font-title: 'Georgia', 'Vazirmatn', 'Tahoma', serif;
	--ps-font-body: 'Vazirmatn', 'Tahoma', sans-serif;
	min-height: 100vh;
	direction: rtl;
	font-family: var(--ps-font-body);
	background: var(--ps-bg);
}

.ms1404-people-single *,
.ms1404-people-single *::before,
.ms1404-people-single *::after {
	box-sizing: border-box;
}

/* ========== هیرو ========== */
.ms1404-people-hero {
	position: relative;
	min-height: 85vh;
	display: flex;
	align-items: center;
	justify-content: center;
	text-align: center;
	padding: 4rem 1.5rem 5rem;
	overflow: hidden;
}

.ms1404-people-hero__bg {
	position: absolute;
	inset: 0;
	z-index: 0;
}

.ms1404-people-hero__img {
	position: absolute;
	inset: 0;
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
	transform: scale(1.05);
	animation: ps-hero-zoom 20s ease-out forwards;
}

@keyframes ps-hero-zoom {
	0% { transform: scale(1.15); }
	100% { transform: scale(1.05); }
}

.ms1404-people-hero__overlay {
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, rgba(13, 13, 13, 0.4) 0%, rgba(13, 13, 13, 0.75) 60%, rgba(13, 13, 13, 0.95) 100%);
	z-index: 1;
}

.ms1404-people-hero:not(.ms1404-people-hero--has-img) .ms1404-people-hero__overlay {
	background: linear-gradient(180deg, var(--ps-dark-soft) 0%, var(--ps-dark) 100%);
}

.ms1404-people-hero__gradient {
	position: absolute;
	inset: 0;
	background: linear-gradient(135deg, rgba(139, 0, 0, 0.2) 0%, transparent 50%, rgba(201, 162, 39, 0.08) 100%);
	z-index: 2;
	pointer-events: none;
}

.ms1404-people-hero:not(.ms1404-people-hero--has-img) .ms1404-people-hero__gradient {
	animation: ps-hero-glow 10s ease-in-out infinite alternate;
}

@keyframes ps-hero-glow {
	0% { opacity: 0.9; }
	100% { opacity: 1; }
}

.ms1404-people-hero__content {
	position: relative;
	z-index: 3;
	max-width: 900px;
	margin: 0 auto;
}

.ms1404-people-hero__category {
	font-size: 0.875rem;
	letter-spacing: 0.15em;
	text-transform: uppercase;
	color: var(--ps-gold);
	margin: 0 0 0.75rem;
	opacity: 0;
	animation: ps-fade-up 0.8s ease-out 0.2s forwards;
}

.ms1404-people-hero__title {
	font-family: var(--ps-font-title);
	font-size: clamp(2.25rem, 6vw, 4rem);
	font-weight: 700;
	line-height: 1.15;
	color: var(--ps-white);
	margin: 0 0 0.5rem;
	text-shadow: 0 2px 24px rgba(0, 0, 0, 0.4);
	opacity: 0;
	animation: ps-fade-up 0.9s ease-out 0.35s forwards;
}

.ms1404-people-hero__occupation {
	font-size: clamp(1rem, 2.5vw, 1.25rem);
	color: rgba(255, 255, 255, 0.9);
	margin: 0 0 1rem;
	opacity: 0;
	animation: ps-fade-up 0.9s ease-out 0.5s forwards;
}

.ms1404-people-hero__dates {
	font-size: clamp(0.9rem, 2vw, 1.1rem);
	color: rgba(255, 255, 255, 0.85);
	margin: 0 0 1.5rem;
	opacity: 0;
	animation: ps-fade-up 0.9s ease-out 0.6s forwards;
}

.ms1404-people-hero__sep {
	opacity: 0.7;
	margin: 0 0.25rem;
}

.ms1404-people-hero__place {
	display: inline-block;
	margin-right: 0.5rem;
	opacity: 0.9;
}

.ms1404-people-hero__badge {
	display: inline-block;
	padding: 0.5rem 1.25rem;
	background: linear-gradient(135deg, var(--ps-primary), var(--ps-primary-dark));
	border: 1px solid var(--ps-gold-soft);
	border-radius: 999px;
	box-shadow: 0 4px 20px rgba(139, 0, 0, 0.4);
	opacity: 0;
	animation: ps-scale-in 0.6s ease-out 0.8s forwards;
}

.ms1404-people-hero__badge-text {
	font-size: 0.9rem;
	font-weight: 600;
	color: var(--ps-white);
	letter-spacing: 0.05em;
}

.ms1404-people-hero__scroll-hint {
	position: absolute;
	bottom: 1.5rem;
	left: 50%;
	transform: translateX(-50%);
	z-index: 3;
	opacity: 0;
	animation: ps-fade-in 1s ease-out 1.2s forwards;
}

.ms1404-people-hero__scroll-icon {
	display: block;
	width: 24px;
	height: 40px;
	border: 2px solid rgba(255, 255, 255, 0.5);
	border-radius: 12px;
	position: relative;
}

.ms1404-people-hero__scroll-icon::after {
	content: '';
	position: absolute;
	top: 8px;
	left: 50%;
	transform: translateX(-50%);
	width: 4px;
	height: 8px;
	background: var(--ps-gold);
	border-radius: 2px;
	animation: ps-scroll-dot 2s ease-in-out infinite;
}

@keyframes ps-fade-up {
	from {
		opacity: 0;
		transform: translateY(28px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@keyframes ps-fade-in {
	to { opacity: 1; }
}

@keyframes ps-scale-in {
	from {
		opacity: 0;
		transform: scale(0.85);
	}
	to {
		opacity: 1;
		transform: scale(1);
	}
}

@keyframes ps-scroll-dot {
	0%, 100% { opacity: 1; transform: translateX(-50%) translateY(0); }
	50% { opacity: 0.4; transform: translateX(-50%) translateY(10px); }
}

/* ========== بدنه و سکشن‌ها ========== */
.ms1404-people-body {
	padding: 3rem 1.5rem 4rem;
}

.ms1404-people-container {
	max-width: 800px;
	margin: 0 auto;
}

/* ========== بلوک دیتابیس (پرونده فرد) ========== */
.ms1404-db {
	margin-bottom: 3rem;
}

.ms1404-db__main-title {
	font-family: var(--ps-font-title);
	font-size: 1.75rem;
	font-weight: 700;
	color: var(--ps-dark);
	margin: 0 0 1.5rem;
	padding-bottom: 0.5rem;
	border-bottom: 3px solid var(--ps-primary);
	display: inline-block;
}

.ms1404-db-card {
	background: var(--ps-white);
	border-radius: var(--ps-radius);
	box-shadow: var(--ps-shadow);
	border: 1px solid rgba(0, 0, 0, 0.06);
	margin-bottom: 1.25rem;
	overflow: hidden;
	opacity: 0;
	transform: translateY(20px);
	transition: opacity 0.5s ease-out, transform 0.5s ease-out, box-shadow var(--ps-transition);
}

.ms1404-db-card.ms1404-anim-visible {
	opacity: 1;
	transform: translateY(0);
}

.ms1404-db-card:hover {
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.1);
}

.ms1404-db-card__title {
	font-size: 1rem;
	font-weight: 700;
	color: var(--ps-white);
	background: linear-gradient(135deg, var(--ps-primary), var(--ps-primary-dark));
	margin: 0;
	padding: 0.85rem 1.25rem;
	border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.ms1404-db-card__rows {
	display: flex;
	flex-direction: column;
}

.ms1404-db-row {
	display: grid;
	grid-template-columns: 1fr auto min-content;
	align-items: center;
	gap: 1rem 1.25rem;
	padding: 0.85rem 1.25rem;
	border-bottom: 1px solid #f0f0f0;
	transition: background 0.2s ease;
}

.ms1404-db-row:last-child {
	border-bottom: none;
}

.ms1404-db-row:hover {
	background: rgba(139, 0, 0, 0.03);
}

.ms1404-db-row--empty .ms1404-db-row__value {
	color: var(--ps-text-muted);
	font-style: italic;
}

.ms1404-db-row__label {
	font-size: 0.875rem;
	font-weight: 600;
	color: var(--ps-text-muted);
	min-width: 0;
}

.ms1404-db-row__value {
	font-size: 0.9375rem;
	color: var(--ps-text);
	text-align: left;
	word-break: break-word;
	min-width: 0;
}

.ms1404-db-row__copy {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 48px;
	height: 36px;
	padding: 0 0.75rem;
	border: 1px solid #e0e0e0;
	border-radius: 8px;
	background: var(--ps-white);
	cursor: pointer;
	transition: background var(--ps-transition), border-color var(--ps-transition), color var(--ps-transition);
	position: relative;
	flex-shrink: 0;
	font-size: 0.8125rem;
	font-weight: 600;
	color: var(--ps-text-muted);
	font-family: inherit;
}

.ms1404-db-row__copy:hover {
	background: var(--ps-primary-light);
	border-color: var(--ps-primary);
	color: var(--ps-primary);
}

.ms1404-db-row__copy:focus {
	outline: none;
	box-shadow: 0 0 0 2px var(--ps-primary-light);
}

.ms1404-db-row__copy-text,
.ms1404-db-row__copy-done {
	transition: opacity 0.2s ease;
}

.ms1404-db-row__copy-done {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	font-size: 0.75rem;
	font-weight: 600;
	color: var(--ps-primary);
	white-space: nowrap;
	opacity: 0;
	pointer-events: none;
}

.ms1404-db-row__copy.is-copied .ms1404-db-row__copy-text {
	opacity: 0;
}

.ms1404-db-row__copy.is-copied .ms1404-db-row__copy-done {
	opacity: 1;
}

/* انیمیشن ورود ردیف‌ها (اختیاری – با تأخیر پلکانی) */
.ms1404-db-card__rows .ms1404-db-row {
	animation: ps-db-row-in 0.4s ease-out backwards;
}

.ms1404-db-card__rows .ms1404-db-row:nth-child(1) { animation-delay: 0.05s; }
.ms1404-db-card__rows .ms1404-db-row:nth-child(2) { animation-delay: 0.1s; }
.ms1404-db-card__rows .ms1404-db-row:nth-child(3) { animation-delay: 0.15s; }
.ms1404-db-card__rows .ms1404-db-row:nth-child(4) { animation-delay: 0.2s; }
.ms1404-db-card__rows .ms1404-db-row:nth-child(5) { animation-delay: 0.25s; }
.ms1404-db-card__rows .ms1404-db-row:nth-child(6) { animation-delay: 0.3s; }
.ms1404-db-card__rows .ms1404-db-row:nth-child(7) { animation-delay: 0.35s; }
.ms1404-db-card__rows .ms1404-db-row:nth-child(8) { animation-delay: 0.4s; }
.ms1404-db-card__rows .ms1404-db-row:nth-child(9) { animation-delay: 0.45s; }
.ms1404-db-card__rows .ms1404-db-row:nth-child(n+10) { animation-delay: 0.5s; }

@keyframes ps-db-row-in {
	from {
		opacity: 0;
		transform: translateX(12px);
	}
	to {
		opacity: 1;
		transform: translateX(0);
	}
}

.ms1404-people-section {
	margin-bottom: 3rem;
	opacity: 0;
	transform: translateY(24px);
	transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}

.ms1404-people-section.ms1404-anim-visible {
	opacity: 1;
	transform: translateY(0);
}

.ms1404-people-section__title {
	font-family: var(--ps-font-title);
	font-size: 1.5rem;
	font-weight: 700;
	color: var(--ps-primary);
	margin: 0 0 1rem;
	padding-bottom: 0.5rem;
	border-bottom: 3px solid var(--ps-primary-light);
	display: inline-block;
}

.ms1404-people-section__content {
	font-size: 1.0625rem;
	line-height: 1.8;
	color: var(--ps-text);
	margin: 0;
}

.ms1404-people-prose p {
	margin: 0 0 1rem;
}

.ms1404-people-prose p:last-child {
	margin-bottom: 0;
}

.ms1404-people-prose a {
	color: var(--ps-primary);
	text-decoration: none;
	border-bottom: 1px solid var(--ps-primary-light);
	transition: color var(--ps-transition), border-color var(--ps-transition);
}

.ms1404-people-prose a:hover {
	color: var(--ps-primary-dark);
	border-bottom-color: var(--ps-primary);
}

/* لینک‌های خارجی */
.ms1404-people-links {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
}

.ms1404-people-link {
	display: inline-flex;
	align-items: center;
	padding: 0.6rem 1rem;
	background: var(--ps-white);
	border: 1px solid #e0e0e0;
	border-radius: var(--ps-radius);
	color: var(--ps-primary);
	text-decoration: none;
	font-size: 0.9375rem;
	transition: background var(--ps-transition), border-color var(--ps-transition), transform var(--ps-transition);
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.ms1404-people-link:hover {
	background: var(--ps-primary-light);
	border-color: var(--ps-primary);
	transform: translateY(-2px);
	box-shadow: var(--ps-shadow);
}

/* نقشه محل درگذشت / محل فعلی */
.ms1404-people-map-section .ms1404-people-section__title {
	margin-bottom: 1rem;
}
.ms1404-people-single-map {
	height: 360px;
	width: 100%;
	border-radius: var(--ps-radius);
	overflow: hidden;
	background: var(--ps-dark-soft);
	box-shadow: var(--ps-shadow);
}
.ms1404-people-single-map .leaflet-popup-content-wrapper {
	border-radius: 8px;
	box-shadow: var(--ps-shadow);
}
.ms1404-people-single-map .leaflet-container {
	font-family: var(--ps-font-body);
}

/* عناصر با انیمیشن ورودی (اجرای با JS) */
.ms1404-anim {
	opacity: 0;
}

.ms1404-anim.ms1404-anim-visible {
	opacity: 1;
}

/* ========== ریسپانسیو ========== */
@media (max-width: 768px) {
	.ms1404-people-hero {
		min-height: 75vh;
		padding: 3rem 1rem 4rem;
	}

	.ms1404-people-hero__title {
		font-size: 2rem;
	}

	.ms1404-people-body {
		padding: 2rem 1rem 3rem;
	}

	.ms1404-db-row {
		grid-template-columns: 1fr min-content;
		grid-template-rows: auto auto;
		gap: 0.35rem 0.75rem;
		padding: 0.75rem 1rem;
	}

	.ms1404-db-row__label {
		grid-column: 1;
		grid-row: 1;
	}

	.ms1404-db-row__value {
		grid-column: 1;
		grid-row: 2;
		padding-left: 0;
	}

	.ms1404-db-row__copy {
		grid-column: 2;
		grid-row: 1 / -1;
		align-self: center;
	}

	.ms1404-db-card__title {
		padding: 0.7rem 1rem;
	}

	.ms1404-people-section {
		margin-bottom: 2rem;
	}

	.ms1404-people-single-map {
		height: 280px;
	}

	.ms1404-people-section__title {
		font-size: 1.25rem;
	}
}

@media (min-width: 1024px) {
	.ms1404-people-hero__img {
		animation-duration: 25s;
	}
}

/* پشتیبانی کاهش حرکت */
@media (prefers-reduced-motion: reduce) {
	.ms1404-people-hero__img,
	.ms1404-people-hero__gradient,
	.ms1404-people-hero__category,
	.ms1404-people-hero__title,
	.ms1404-people-hero__occupation,
	.ms1404-people-hero__badge,
	.ms1404-people-hero__scroll-hint {
		animation: none;
	}

	.ms1404-people-hero__category,
	.ms1404-people-hero__title,
	.ms1404-people-hero__occupation,
	.ms1404-people-hero__badge,
	.ms1404-people-hero__scroll-hint {
		opacity: 1;
	}

	.ms1404-db-card,
	.ms1404-people-section {
		opacity: 1;
		transform: none;
	}

	.ms1404-db-card__rows .ms1404-db-row {
		animation: none;
	}

	.ms1404-people-link:hover {
		transform: none;
	}
}
