/**
 * ستوري التعازي الإسلامي — وفيات جنوب | 3:4 (360×480 → 1080×1440)
 * Cairo عبر janoob-fonts.css (woff2) | نص أسود واضح | آية كاملة | مساحات متناسبة
 *
 * @package JanoobStoryGenerator
 */

.obituary-story-board,
#wp-story-export-container.obituary-story-board {
	--obit-charcoal: #1a1a1a;
	--obit-ink: #000000;
	--obit-muted: #1a1a1a;
	--obit-gold: #c9a84c;
	--obit-gold-soft: #9a7428;
	--obit-ivory: #f7f4ef;
	--obit-details: #efe8dc;
	--sticker-red: #e3000f;
	position: relative;
	width: 360px;
	height: 480px;
	overflow: hidden;
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	align-items: stretch;
	background: var(--obit-ivory);
	color: var(--obit-ink);
	/* خط القالب المعتمد فقط */
	font-family: "Cairo", sans-serif !important;
	direction: rtl;
	unicode-bidi: isolate;
	text-align: center;
	text-rendering: optimizeLegibility;
	-webkit-font-smoothing: antialiased;
	letter-spacing: 0;
	border-radius: 0;
}

.obituary-story-board *,
#wp-story-export-container.obituary-story-board * {
	box-sizing: border-box;
	font-family: "Cairo", sans-serif !important;
}

/* Top bar charcoal + gold hairline */
.obituary-story-board .obituary-top-bar {
	flex: 0 0 auto;
	height: 3px;
	width: 100%;
	background: var(--obit-charcoal);
}

.obituary-story-board .obituary-gold-hairline {
	flex: 0 0 auto;
	height: 1.5px;
	width: 100%;
	background: var(--obit-gold);
}

/* Header: bismillah + full aya */
.obituary-story-board .obituary-header {
	flex: 0 0 auto;
	padding: 6px 12px 2px;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
}

.obituary-story-board .obituary-bismillah {
	font-size: 11px;
	font-weight: 800;
	color: #000000;
	line-height: 1.2;
	unicode-bidi: plaintext;
	/* سطر واحد — التفاف فقط إن ضاق العرض جداً عبر تصغير طفيف لاحقاً إن لزم */
	white-space: nowrap;
	max-width: 100%;
	overflow: hidden;
	text-overflow: clip;
}

.obituary-story-board .obituary-aya {
	font-size: 10px;
	font-weight: 700;
	font-style: italic;
	color: #000000;
	line-height: 1.4;
	padding: 0 6px;
	unicode-bidi: plaintext;
	/* آية طويلة: تلتف فقط عند الحاجة (عرض البطاقة) */
	white-space: normal;
	overflow-wrap: normal;
	word-break: normal;
}

/* Portrait wrap — sticker on photo/text seam */
.obituary-story-board .obituary-portrait-wrap {
	position: relative;
	flex: 0 0 auto;
	padding: 3px 36px 0;
	margin: 0;
	z-index: 3;
}

.obituary-story-board .obituary-portrait-frame {
	position: relative;
	width: 100%;
	height: 100px;
	border: 1.5px solid var(--obit-gold);
	border-radius: 4px;
	overflow: hidden;
	background: linear-gradient(160deg, #ebe4d8 0%, #ddd4c4 100%);
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 3px 10px rgba(13, 13, 13, 0.12);
}

.obituary-story-board .obituary-portrait-img {
	display: block;
	width: auto !important;
	height: auto !important;
	max-width: 100% !important;
	max-height: 100% !important;
	object-fit: contain !important;
	object-position: center center !important;
	transform: none !important;
}

.obituary-story-board .obituary-portrait-fallback {
	width: 100%;
	height: 100%;
	background: linear-gradient(160deg, #ebe4d8 0%, #ddd4c4 100%);
}

.obituary-story-board .obituary-badge {
	position: absolute;
	top: 5px;
	left: 5px;
	z-index: 4;
	padding: 2px 7px;
	border-radius: 999px;
	background: var(--obit-charcoal);
	border: 1px solid var(--obit-gold);
	color: #ffffff;
	font-size: 8px;
	font-weight: 800;
	line-height: 1.2;
	pointer-events: none;
}

/* Brand sticker — news-style seam */
.obituary-story-board .obituary-brand-sticker {
	--sticker-red: #e3000f;
	position: absolute;
	left: 50%;
	bottom: 0;
	transform: translate(-50%, 50%);
	z-index: 14;
	width: auto;
	min-width: 104px;
	max-width: 120px;
	padding: 5px 11px 6px;
	margin: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 3px;
	background: var(--sticker-red);
	border: 0;
	border-radius: 8px;
	box-shadow:
		0 2px 0 rgba(0, 0, 0, 0.06),
		0 6px 16px rgba(13, 13, 13, 0.28);
	pointer-events: none;
	line-height: 1;
}

.obituary-story-board .obituary-brand-sticker-net {
	display: block;
	color: #ffffff;
	font-size: 10px;
	font-weight: 800;
	letter-spacing: 0.06em;
	line-height: 1.1;
	direction: ltr;
	unicode-bidi: embed;
	white-space: nowrap;
	text-align: center;
}

.obituary-story-board .obituary-brand-sticker-rule {
	display: block;
	width: 78%;
	height: 1px;
	background: rgba(255, 255, 255, 0.95);
	flex: 0 0 auto;
	border-radius: 1px;
}

.obituary-story-board .obituary-brand-sticker-ar {
	display: block;
	color: #ffffff;
	font-size: 8px;
	font-weight: 700;
	line-height: 1.2;
	direction: rtl;
	unicode-bidi: plaintext;
	text-align: center;
	white-space: nowrap;
}

/* Body — proportional type hierarchy */
.obituary-story-board .obituary-body {
	flex: 1 1 auto;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 5px;
	padding: 20px 14px 6px;
	min-height: 0;
}

.obituary-story-board .obituary-family-line {
	margin: 0;
	font-size: 11.5px;
	font-weight: 700;
	color: #000000;
	line-height: 1.4;
	unicode-bidi: plaintext;
	/* جملة طويلة: تلتف عند الحاجة فقط */
	white-space: normal;
	word-break: normal;
	overflow-wrap: break-word;
}

.obituary-story-board .obituary-deceased-name {
	margin: 0;
	font-size: 18px;
	font-weight: 900;
	color: #000000;
	line-height: 1.2;
	unicode-bidi: plaintext;
	white-space: normal;
	word-break: normal;
	overflow-wrap: break-word;
}

.obituary-story-board .obituary-nickname {
	margin: 0;
	font-size: 12px;
	font-weight: 700;
	font-style: italic;
	color: #000000;
	line-height: 1.3;
	unicode-bidi: plaintext;
	white-space: nowrap;
}

.obituary-story-board .obituary-details-box {
	width: 100%;
	margin-top: 1px;
	padding: 6px 9px;
	background: var(--obit-details);
	border: 1px solid rgba(201, 168, 76, 0.4);
	border-radius: 6px;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 3px;
}

.obituary-story-board .obituary-burial-text,
.obituary-story-board .obituary-place-line,
.obituary-story-board .obituary-condolence-line {
	margin: 0;
	width: 100%;
	font-size: 11px;
	font-weight: 700;
	color: #000000;
	line-height: 1.35;
	text-align: center;
	unicode-bidi: plaintext;
}

.obituary-story-board .obituary-condolence-line {
	font-size: 10.5px;
}

.obituary-story-board .obituary-closing-prayer {
	margin: 1px 0 0;
	font-size: 11px;
	font-weight: 700;
	font-style: italic;
	color: #000000;
	line-height: 1.4;
	unicode-bidi: plaintext;
}

.obituary-story-board .obituary-inna {
	margin: 1px 0 0;
	font-size: 12.5px;
	font-weight: 900;
	color: #000000;
	line-height: 1.35;
	unicode-bidi: plaintext;
	white-space: nowrap;
}

/* Footer — agency CTA */
.obituary-story-board .obituary-footer {
	flex: 0 0 auto;
	padding: 7px 12px 8px;
	background: var(--obit-charcoal);
	border-top: 1.5px solid var(--obit-gold);
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 2px;
}

.obituary-story-board .obituary-footer-cta {
	color: #ffffff;
	font-size: 8.5px;
	font-weight: 700;
	line-height: 1.3;
	unicode-bidi: plaintext;
	text-align: center;
	white-space: nowrap;
	max-width: 100%;
	overflow: hidden;
}

.obituary-story-board .obituary-footer-net {
	color: var(--obit-gold);
	font-size: 9.5px;
	font-weight: 800;
	letter-spacing: 0.04em;
	line-height: 1.2;
	direction: ltr;
	unicode-bidi: embed;
	white-space: nowrap;
}

.obituary-story-board--no-photo .obituary-portrait-frame {
	height: 64px;
}

.obituary-story-board--no-photo .obituary-body {
	padding-top: 18px;
}

.dynamic-field.is-empty {
	display: none !important;
}
