/**
 * Wedding celebration story — 9:16 luxury light theme | أفراح جنوب
 *
 * @package JanoobStoryGenerator
 */

.wedding-story-board,
#wp-story-export-container.wedding-story-board {
	/* تكبير خطوط متناسب داخل هامش الأمان — يُعدَّل من مكان واحد */
	--wedding-type-scale: 1;
	--wedding-hero-scale: 1;
	--wedding-hero-base-w: 200px;
	--wedding-hero-base-h: 168px;
	--wedding-hero-max-height: 168px;
	--wedding-photo-fill: 0.98;
	position: relative;
	width: 360px;
	height: 640px;
	border-radius: 16px;
	overflow: hidden;
	background-color: #fdfbf7;
	box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
	text-align: center;
	color: #2c3e50;
	font-family: "Cairo", "Segoe UI", Tahoma, sans-serif;
	direction: rtl;
	unicode-bidi: isolate;
	text-rendering: optimizeLegibility;
	-webkit-font-smoothing: antialiased;
	letter-spacing: 0;
	box-sizing: border-box;
}

.wedding-luxury-bg-image {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	opacity: 0.35;
	z-index: 1;
}

.wedding-light-overlay {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: linear-gradient(
		to bottom,
		rgba(253, 251, 247, 0.4) 0%,
		rgba(255, 240, 245, 0.75) 50%,
		rgba(253, 251, 247, 0.95) 100%
	);
	z-index: 3;
}

.wedding-luxury-pattern-bg {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-image: radial-gradient(rgba(170, 119, 28, 0.04) 1px, transparent 1px);
	background-size: 20px 20px;
	opacity: 0.8;
	z-index: 2;
}

.wedding-safe-zone {
	position: absolute;
	top: 25px;
	bottom: 30px;
	left: 15px;
	right: 15px;
	border: 2px solid #b38728;
	outline: 1px dashed rgba(170, 119, 28, 0.3);
	outline-offset: 3px;
	border-radius: 10px;
	z-index: 5;
	display: flex;
	flex-direction: column;
	justify-content: flex-start;
	padding: 8px 7px;
	box-sizing: border-box;
	background: rgba(255, 255, 255, 0.45);
	backdrop-filter: blur(2px);
	overflow: hidden;
	min-height: 0;
}

.wedding-layout-safe {
	justify-content: flex-start;
	gap: 0;
}

.wedding-layout-body {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	min-height: 0;
	overflow: hidden;
	gap: 1px;
	justify-content: flex-start;
}

.wedding-middle-stack {
	display: flex;
	flex-direction: column;
	flex-shrink: 0;
	gap: 1px;
	z-index: 8;
	width: 100%;
	margin-top: auto;
	position: relative;
	background: transparent;
}

.wedding-hero-grow {
	flex: 1 1 auto;
	min-height: 0;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	overflow: hidden;
	position: relative;
	z-index: 5;
}

.wedding-photo-zone-grow {
	flex: 1 1 auto;
	min-height: 0;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	max-height: calc(var(--wedding-hero-base-h, 168px) * var(--wedding-hero-scale, 1));
}

/* قالب 1 — منطقة الصور تملأ الفراغ؛ الدائرة = min(عرض، ارتفاع) المنطقة */
.wedding-story-board--template-1 .wedding-photo-row-container.wedding-photo-zone-grow {
	flex: 1 1 auto;
	min-height: 0;
	max-height: none;
	flex-shrink: 1;
	margin-top: 2px;
	margin-bottom: 0;
	container-type: size;
	container-name: wedding-t1-zone;
}

.wedding-story-board--template-1 .wedding-photo-zone-grow .wedding-photo-row {
	flex: 1 1 auto;
	align-items: center;
	justify-content: center;
	min-height: 0;
	height: 100%;
	width: 100%;
}

.wedding-photo-zone-grow .wedding-photo-row {
	flex: 0 0 auto;
	align-items: flex-end;
}

.wedding-photo-row-container.wedding-photo-zone-grow {
	max-height: none;
}

/* إطار مستطيل — scale موحّد (عرض + ارتفاع) منفصل عن typeScale */
.wedding-hero-frame--rect {
	overflow: hidden;
	box-sizing: border-box;
	width: calc(var(--wedding-hero-base-w, 200px) * var(--wedding-hero-scale, 1));
	max-width: 88%;
	height: calc(var(--wedding-hero-base-h, 168px) * var(--wedding-hero-scale, 1));
	max-height: calc(var(--wedding-hero-base-h, 168px) * var(--wedding-hero-scale, 1));
	margin: 0 auto;
	padding: 0;
	border: none;
	border-radius: 0;
	background: transparent;
	box-shadow: none;
	line-height: 0;
	flex-shrink: 0;
	isolation: isolate;
	position: relative;
	display: block;
}

/* صور العرسان — cover (معامل scale واحد) + تمركز؛ بدون stretch */
.wedding-story-board .wedding-photo-frame,
.wedding-story-board .wedding-tpl2-photo-frame,
.wedding-story-board .wedding-tpl3-stack__frame,
.wedding-story-board .wedding-hero-frame--rect {
	position: relative;
}

.wedding-story-board .wedding-portrait-img,
.wedding-story-board .wedding-photo-frame img,
.wedding-story-board .wedding-hero-frame--rect img,
.wedding-story-board .wedding-tpl2-photo-frame img,
.wedding-story-board .wedding-tpl3-stack__frame img {
	position: absolute;
	inset: 0;
	width: 100% !important;
	height: 100% !important;
	max-width: none !important;
	max-height: none !important;
	margin: 0;
	padding: 0;
	display: block;
	object-fit: cover !important;
	object-position: center center !important;
	transform: scale(var(--wedding-portrait-zoom, 1));
	transform-origin: center center;
	filter: none !important;
	-webkit-mask-image: none !important;
	mask-image: none !important;
	mix-blend-mode: normal;
	border: none;
	border-radius: 0;
	box-shadow: none;
	background: transparent;
}

.wedding-layout-foot {
	flex: 0 0 auto;
	flex-shrink: 0;
	width: 100%;
	margin-top: auto;
	padding-top: 2px;
	z-index: 7;
}

.wedding-layout-foot .wedding-details-bar {
	margin-bottom: 0;
}

.wedding-layout-foot .wedding-footer {
	margin-top: 2px;
}

.wedding-top-content {
	display: flex;
	flex-direction: column;
	gap: 1px;
	z-index: 6;
	flex-shrink: 0;
}

.bismillah {
	color: #8a6d3b;
	font-size: calc(11.5px * var(--wedding-type-scale, 1));
	font-weight: 700;
	line-height: 1.3;
}

.invitation-type {
	background: linear-gradient(90deg, transparent, rgba(179, 135, 40, 0.1), transparent);
	color: #aa771c;
	font-size: calc(20px * var(--wedding-type-scale, 1));
	font-weight: 900;
	letter-spacing: calc(4px * var(--wedding-type-scale, 1));
	padding: 2px 0;
	margin: 3px 0;
	border-top: 1px solid rgba(179, 135, 40, 0.25);
	border-bottom: 1px solid rgba(179, 135, 40, 0.25);
}

.family-joy {
	font-size: calc(14px * var(--wedding-type-scale, 1));
	font-weight: 700;
	color: #34495e;
	line-height: 1.2;
}

.family-joy span {
	color: #b38728;
	font-weight: 900;
	font-size: calc(23px * var(--wedding-type-scale, 1));
	display: block;
	line-height: 1.08;
	margin-top: 1px;
}

.aya-text {
	color: #566573;
	font-weight: 600;
	font-size: calc(10.5px * var(--wedding-type-scale, 1));
	line-height: 1.45;
	padding: 0 6px;
	margin: 1px 0 3px;
	text-align: center;
}

.wedding-photo-row-container {
	width: 100%;
	max-width: 300px;
	margin: 5px auto 2px;
	box-sizing: border-box;
	z-index: 6;
	flex-shrink: 0;
}

.wedding-photo-row {
	--wedding-photo-base: 72px;
	--wedding-photo-w: calc(var(--wedding-photo-base, 72px) * var(--wedding-hero-scale, 1));
	--wedding-photo-ratio: 4 / 5;
	display: flex;
	flex-direction: row;
	justify-content: center;
	align-items: flex-end;
	gap: 7px;
	flex-wrap: nowrap;
	width: 100%;
}

.wedding-photo-row.wedding-portraits-1 {
	--wedding-photo-base: 108px;
}

.wedding-photo-row.wedding-portraits-2 {
	--wedding-photo-base: 82px;
	gap: 3px;
}

.wedding-photo-row.wedding-portraits-3 {
	--wedding-photo-base: 68px;
	gap: 5px;
}

.wedding-photo-row.wedding-portraits-4 {
	--wedding-photo-base: 58px;
	gap: 4px;
}

.wedding-photo-cell {
	flex: 0 0 var(--wedding-photo-w);
	max-width: min(var(--wedding-photo-w), 88%);
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 2px;
}

/* قالب 1 — قطر الدائرة = 98% من min(عرض، ارتفاع) المنطقة */
.wedding-story-board--template-1 .wedding-photo-cell {
	flex: 0 0 var(--wedding-photo-d);
	width: var(--wedding-photo-d);
	max-width: min(var(--wedding-photo-d), calc(98cqw * var(--wedding-photo-fill, 0.98)));
}

.wedding-story-board--template-1 .wedding-portraits-1 .wedding-photo-cell {
	--wedding-photo-d: var(
		--wedding-photo-d-fit,
		min(
			calc(98cqw * var(--wedding-photo-fill, 0.98)),
			calc(98cqh * var(--wedding-photo-fill, 0.98))
		)
	);
}

.wedding-story-board--template-1 .wedding-portraits-2 .wedding-photo-cell {
	--wedding-photo-d: var(
		--wedding-photo-d-fit,
		min(
			calc(49cqw * var(--wedding-photo-fill, 0.98)),
			calc(98cqh * var(--wedding-photo-fill, 0.98))
		)
	);
}

.wedding-story-board--template-1 .wedding-portraits-3 .wedding-photo-cell {
	--wedding-photo-d: var(
		--wedding-photo-d-fit,
		min(
			calc(32.67cqw * var(--wedding-photo-fill, 0.98)),
			calc(98cqh * var(--wedding-photo-fill, 0.98))
		)
	);
}

.wedding-story-board--template-1 .wedding-portraits-4 .wedding-photo-cell {
	--wedding-photo-d: var(
		--wedding-photo-d-fit,
		min(
			calc(24.5cqw * var(--wedding-photo-fill, 0.98)),
			calc(98cqh * var(--wedding-photo-fill, 0.98))
		)
	);
}

.wedding-photo-frame {
	width: 100%;
	aspect-ratio: 1;
	border: 2px solid #b38728;
	border-radius: 50%;
	overflow: hidden;
	box-shadow: 0 4px 12px rgba(170, 119, 28, 0.22);
	background: #fff;
	display: block;
	position: relative;
	--wedding-portrait-zoom: 1;
}

.wedding-story-board [data-jsg-portrait-cover='1'] {
	background-repeat: no-repeat;
	background-position: center center;
}

/* PNG شفاف حقيقي — بدون multiply تقريبي */
.wedding-photo-frame.has-nobg-png img {
	mix-blend-mode: normal;
	filter: none;
}

.wedding-photo-caption {
	font-size: 8px;
	font-weight: 700;
	color: #5d4037;
	line-height: 1.2;
	text-align: center;
	max-width: 100%;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.wedding-photo-placeholder {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: var(--wedding-photo-d, var(--wedding-photo-w, 108px));
	aspect-ratio: 1;
	padding: 0.5rem;
	border: 2px dashed rgba(198, 0, 13, 0.45);
	border-radius: 50%;
	color: rgba(198, 0, 13, 0.75);
	font-size: calc(11.5px * var(--wedding-type-scale, 1));
	font-weight: 800;
	text-align: center;
	background: rgba(255, 255, 255, 0.35);
}

.wedding-date-hero {
	margin: 4px 0 2px;
	padding: 8px 10px 7px;
	border-radius: 10px;
	background: linear-gradient(
		135deg,
		rgba(227, 0, 15, 0.08) 0%,
		rgba(179, 135, 40, 0.12) 50%,
		rgba(227, 0, 15, 0.06) 100%
	);
	border: 1.5px solid rgba(179, 135, 40, 0.45);
	box-shadow: 0 2px 8px rgba(170, 119, 28, 0.12);
	z-index: 6;
	flex-shrink: 0;
}

.wedding-date-hero__day {
	font-size: calc(11px * var(--wedding-type-scale, 1));
	font-weight: 700;
	color: #566573;
	line-height: 1.2;
	margin-bottom: 2px;
}

.wedding-date-hero__date {
	font-size: calc(22px * var(--wedding-type-scale, 1));
	font-weight: 900;
	color: #c6000f;
	line-height: 1.08;
	letter-spacing: 0.02em;
	direction: ltr;
	unicode-bidi: isolate;
}

.wedding-date-hero__time {
	margin-top: 2px;
	font-size: calc(12px * var(--wedding-type-scale, 1));
	font-weight: 800;
	color: #aa771c;
	line-height: 1.15;
}

.wedding-middle-content {
	display: flex;
	flex-direction: column;
	gap: 1px;
	z-index: 6;
}

.invitation-main-text {
	font-size: calc(10.5px * var(--wedding-type-scale, 1));
	color: #4d5656;
	line-height: 1.35;
}

.father-name {
	color: #aa771c;
	font-weight: 900;
	font-size: calc(14.5px * var(--wedding-type-scale, 1));
	display: inline-block;
}

.grooms-names {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
	margin: 4px 0 6px;
}

.groom-name--hero {
	margin: 0;
	font-size: calc(19px * var(--wedding-type-scale, 1));
	font-weight: 800;
	color: #aa771c;
	line-height: 1.22;
	letter-spacing: 0;
}

.grooms-names--pair .groom-name--hero,
.grooms-names--many .groom-name--inline {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 0.2em 0.42em;
}

.groom-name__part {
	display: inline-block;
}

.groom-name__sep {
	font-size: 0.68em;
	font-weight: 700;
	color: rgb(170 119 28 / 0.58);
	line-height: 1;
	padding-inline: 0.08em;
}

.grooms-names--many .groom-name--inline {
	font-size: calc(16.5px * var(--wedding-type-scale, 1));
	line-height: 1.35;
	max-width: 100%;
}

.groom-name {
	font-size: calc(19px * var(--wedding-type-scale, 1));
	font-weight: 800;
	color: #aa771c;
	line-height: 1.22;
}

.wedding-details-bar {
	background: rgba(179, 135, 40, 0.03);
	border: 1px solid rgba(179, 135, 40, 0.2);
	border-radius: 8px;
	padding: calc(5px * var(--wedding-type-scale, 1));
	margin: 1px 0;
	display: flex;
	flex-direction: column;
	gap: 2px;
	z-index: 6;
	flex-shrink: 0;
}

.wedding-details-bar::before {
	content: "🪷";
	display: block;
	font-size: calc(24px * var(--wedding-type-scale, 1));
	line-height: 1;
	margin: 0 auto 2px;
	opacity: 0.35;
}

.details-icons-grid {
	display: flex;
	flex-direction: column;
	gap: 3px;
	text-align: right;
	padding-right: 2px;
}

.icon-detail-item {
	font-size: calc(10.5px * var(--wedding-type-scale, 1));
	line-height: 1.28;
	display: flex;
	gap: 5px;
	align-items: flex-start;
	color: #2c3e50;
}

.icon-detail-item.align-top {
	align-items: flex-start;
}

.detail-icon {
	font-size: 11px;
	color: #aa771c;
	min-width: 15px;
	text-align: center;
	flex-shrink: 0;
	margin-top: 0.12em;
}

.detail-label {
	color: #826121;
	font-weight: 700;
	min-width: calc(58px * var(--wedding-type-scale, 1));
	flex-shrink: 0;
}

.detail-value {
	color: #2c3e50;
	font-weight: 600;
	flex: 1;
	text-align: right;
}

.icon-detail-item--place .detail-value--solo {
	flex: 1;
	min-width: 0;
}

.icon-detail-item--place .detail-label {
	display: none;
}

.sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.date-numbers-highlight {
	color: #b38728;
	font-weight: 900;
	font-size: calc(11.5px * var(--wedding-type-scale, 1));
	letter-spacing: 0.5px;
	background: rgba(179, 135, 40, 0.08);
	padding: 0 5px;
	border-radius: 4px;
	margin: 0 2px;
	display: inline-block;
	direction: ltr;
	unicode-bidi: isolate;
}

.time-text {
	font-size: calc(9.5px * var(--wedding-type-scale, 1));
	color: #aa771c;
	font-weight: 700;
	display: inline-block;
	margin-top: 2px;
}

.location-highlight {
	margin-top: 1px;
	background: rgba(179, 135, 40, 0.06);
	padding: 2px 4px;
	border-radius: 4px;
	border-right: 3px solid #b38728;
}

.location-highlight .detail-value {
	font-weight: 700;
	color: #111;
}

.women-location {
	background: rgba(219, 112, 147, 0.06);
	border-right: 3px solid #db7093;
}

.women-location .detail-label {
	color: #b03a2e;
}

.wedding-story-board .jsg-arabic-line,
.wedding-footer {
	font-size: calc(11px * var(--wedding-type-scale, 1));
	font-weight: 900;
	color: #aa771c;
	margin-top: 0;
	z-index: 6;
	letter-spacing: 0;
	word-spacing: normal;
	font-kerning: normal;
	font-variant-ligatures: common-ligatures contextual;
	font-feature-settings: "liga" 1, "calt" 1, "mark" 1;
	unicode-bidi: embed;
	white-space: normal;
	flex-shrink: 0;
}

.wedding-watermark {
	position: absolute;
	bottom: 8px;
	left: 50%;
	transform: translateX(-50%);
	color: rgba(170, 119, 28, 0.25);
	font-size: calc(11px * var(--wedding-type-scale, 1));
	font-weight: 900;
	letter-spacing: 1.5px;
	z-index: 10;
	pointer-events: none;
	font-family: Arial, sans-serif;
	direction: ltr;
	unicode-bidi: isolate;
}
