/* ============================================================
   قالب rosegold — وردي ذهبي فاخر + مظروف وختم شمع
   ============================================================ */

:root {
  --blush-0: #f3ddd6;   /* خلفية الصفحة */
  --blush-1: #f8e7e1;   /* أفتح */
  --blush-2: #efd0c7;   /* أغمق قليلاً */
  --rose:    #b98a7e;   /* وردي ذهبي */
  --rose-dp: #9c6b5e;
  --gold:    #c2a25c;   /* ذهبي */
  --gold-sf: #d8bd83;   /* ذهبي فاتح */
  --gold-dp: #9a7c3f;
  --ink:     #6e4a44;   /* نص بني دافئ */
  --ink-sf:  #8a635b;   /* نص ثانوي */
  --line:    rgba(194, 162, 92, 0.45);

  --font-display: "Aref Ruqaa", serif;
  --font-script:  "Amiri", serif;
  --font-body:    "Tajawal", system-ui, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  color: var(--ink);
  background-color: var(--blush-0);
  background-image:
    radial-gradient(circle at 50% 0%, var(--blush-1), transparent 55%),
    radial-gradient(circle at 100% 100%, #f6ddd4, transparent 45%),
    radial-gradient(circle at 0% 80%, #f1d3ca, transparent 40%);
  line-height: 1.85;
  overflow-x: hidden;
}

/* ====================== المظروف + ختم الشمع ====================== */
.envelope {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(ellipse at 50% 40%, #fbeee9, var(--blush-0) 95%);
  transition: opacity 1s ease, visibility 1s ease;
}
.envelope { transition: opacity 0.8s ease 0.7s, visibility 0s linear 1.5s; }
.envelope.is-open { opacity: 0; visibility: hidden; pointer-events: none; }

.envelope__paper {
  position: relative;
  width: min(440px, 92vw);
  aspect-ratio: 3 / 4;
  border: 1px solid var(--line);
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.35), transparent 40%),
    var(--blush-1);
  box-shadow: 0 30px 80px rgba(156, 107, 94, 0.28), 0 0 0 8px rgba(194,162,92,0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 900px;
}
/* طيّة المظروف (مثلث من الأعلى) — تنفتح للأعلى عند الفتح */
.envelope__flap {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 56%;
  background: linear-gradient(180deg, var(--blush-2), var(--blush-1));
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  border-bottom: 1px solid var(--line);
  transform-origin: top center;
  transform-style: preserve-3d;
  transition: transform 0.8s cubic-bezier(.45,.05,.3,1);
  z-index: 4;
  backface-visibility: hidden;
}
.envelope.is-open .envelope__flap { transform: rotateX(-172deg); }

.envelope__center {
  position: relative;
  z-index: 6;            /* الختم فوق الطيّة (يمسكها مغلقة كالشمع الحقيقي) */
  text-align: center;
  margin-top: 8%;
}
.envelope__hint { color: var(--ink-sf); font-size: 14px; margin-top: 14px; letter-spacing: normal; }
.envelope__names { font-family: var(--font-display); font-size: clamp(26px, 7vw, 42px); color: var(--gold-dp); line-height: 1.25; margin-top: 18px; text-align: center; padding: 0 16px; }

/* الختم */
.seal {
  background: none; border: none; cursor: pointer; padding: 0;
  width: clamp(130px, 38vw, 170px);
  filter: drop-shadow(0 10px 18px rgba(154, 124, 63, 0.35));
  transition: transform 0.4s ease, filter 0.4s ease;
  animation: sealPulse 2.6s ease-in-out infinite;
}
.seal:hover { transform: scale(1.05); }
.seal:active { transform: scale(0.97); }
.envelope.is-open .seal { transform: translateY(-28px) scale(1.5) rotate(10deg); opacity: 0; transition: transform 0.7s ease 0.1s, opacity 0.6s ease 0.2s; }
.envelope.is-open .envelope__hint { opacity: 0; transition: opacity 0.3s ease; }

.seal__svg { width: 100%; height: auto; display: block; }
.seal__bg   { fill: var(--gold); }
.seal__ring { fill: none; stroke: var(--gold-dp); stroke-width: 1.5; opacity: 0.7; }
.seal__ring2{ fill: none; stroke: var(--blush-1); stroke-width: 1; stroke-dasharray: 2 4; opacity: 0.8; }
.seal__mono { fill: var(--blush-1); font-family: var(--font-display); font-size: 60px; letter-spacing: normal; }
.seal__star { fill: var(--blush-1); opacity: 0.85; }
.seal__star--top { font-size: 22px; }
.seal__star--bot { font-size: 18px; }

@keyframes sealPulse {
  0%, 100% { filter: drop-shadow(0 10px 18px rgba(154,124,63,0.30)); }
  50%      { filter: drop-shadow(0 12px 26px rgba(194,162,92,0.55)); }
}

/* ====================== خلفية مخصّصة بحواف متلاشية (اختياري) ====================== */
/* تظهر خلف محتوى المظروف والواجهة، وتتلاشى أطرافها لتندمج مع خلفية القالب.
   تبقى مخفية تماماً (opacity:0) حتى تُحمَّل الصورة بنجاح من script.js. */
.bg-photo {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 0.9s ease;
  pointer-events: none;
  -webkit-mask-image: radial-gradient(ellipse 80% 74% at 50% 42%, #000 48%, transparent 100%);
  mask-image: radial-gradient(ellipse 80% 74% at 50% 42%, #000 48%, transparent 100%);
}
.bg-photo.is-shown { opacity: 0.62; }

/* محتوى المظروف يبقى فوق الخلفية */
#coverBg { z-index: 0; }
.envelope__paper { position: relative; z-index: 1; }
/* خلفية الواجهة فوق المشهد المرسوم لكن تحت النص (z-index المحتوى = 2) */
#heroBg { z-index: -1; }

/* ====================== محتوى الدعوة ====================== */
.invite { position: relative; padding: 0 0 70px; }
.petals { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 1; }

/* ====================== الواجهة السينمائية (Stage) ====================== */
.stage {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  isolation: isolate;
}
.stage__bg, .stage__scene {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
}
.stage__scene { z-index: -3; }   /* المشهد المرسوم هو واجهة الـ Stage */
.stage__bg {
  z-index: -2;   /* لم تَعُد صورة العرسين تُستخدم كخلفية؛ تظهر مؤطّرة في المحتوى */
}
.stage__scene .scene { width: 100%; height: 100%; display: block; }

.stage__veil {
  position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(180deg, rgba(243,221,214,0.25) 0%, rgba(243,221,214,0.05) 35%, rgba(243,221,214,0.55) 100%),
    radial-gradient(circle at 50% 42%, rgba(255,247,240,0.35), transparent 60%);
}

.stage__content {
  position: relative; z-index: 2; padding: 54px 30px;
  background: radial-gradient(ellipse 85% 78% at 50% 50%, rgba(249,233,227,0.82), rgba(249,233,227,0.4) 60%, rgba(249,233,227,0) 78%);
}
/* صورة العرسين المؤطّرة في الواجهة */
.hero-photo {
  display: none;
  width: clamp(120px, 34vw, 180px);
  aspect-ratio: 1 / 1;
  margin: 18px auto 4px;
  border-radius: 50%;
  overflow: hidden;
  padding: 4px;
  background: linear-gradient(145deg, var(--gold-sf), var(--rose));
  box-shadow:
    0 0 0 1px rgba(194,162,92,0.5),
    0 14px 34px rgba(156,107,94,0.32);
}
.hero-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
  border: 2px solid var(--blush-1);
}
#heroPhoto.is-shown {
  display: block;
  animation: heroPhotoIn 0.9s ease both;
}
@keyframes heroPhotoIn {
  from { opacity: 0; transform: scale(0.88); }
  to   { opacity: 1; transform: scale(1); }
}

.stage__content .bismillah { color: var(--gold-dp); text-shadow: 0 1px 12px rgba(255,252,248,0.95); }
.stage__content .hero__kicker { color: var(--rose-dp); letter-spacing: normal; font-size: 13px; margin: 14px 0 6px; text-shadow: 0 1px 10px rgba(255,252,248,0.9); }
.stage__content .couple { color: #5a3a34; text-shadow: 0 2px 16px rgba(255,252,248,0.98), 0 1px 3px rgba(255,252,248,0.95); }
.stage__content .hero__date {
  margin-top: 16px; font-family: var(--font-display);
  color: var(--rose-dp); font-size: clamp(15px, 4.2vw, 20px);
  text-shadow: 0 1px 10px rgba(255,252,248,0.95);
}
.scroll-cue {
  display: inline-flex; flex-direction: column; align-items: center; gap: 4px;
  margin-top: 30px; color: var(--gold-dp);
  text-shadow: 0 1px 8px rgba(0,0,0,0.45), 0 1px 10px rgba(255,252,248,0.6);
}
.scroll-cue__text {
  font-family: var(--font-body); font-size: 0.88rem; font-weight: 500; letter-spacing: normal;
}
.scroll-cue__arrow {
  display: inline-block; font-size: 1.2rem; line-height: 1;
  animation: bob 1.8s ease-in-out infinite;
}

@keyframes kenburns { from { transform: scale(1); } to { transform: scale(1.12); } }
@keyframes bob { 0%,100% { transform: translateY(0); opacity: 0.85; } 50% { transform: translateY(7px); opacity: 1; } }

.card {
  position: relative;
  max-width: 640px;
  margin: -34px auto 0;
  padding: clamp(40px, 8vw, 70px) clamp(22px, 6vw, 54px);
  text-align: center;
  background: var(--blush-0);
  border-radius: 26px 26px 0 0;
  box-shadow: 0 -20px 50px rgba(156,107,94,0.18);
}

/* الإطار المقوّس */
.card__arch { position: absolute; inset: 10px; z-index: 0; pointer-events: none; }
.arch__svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.arch__path { fill: none; stroke: var(--gold); stroke-width: 2; opacity: 0.85; }
.arch__path--inner { stroke: var(--rose); stroke-width: 1; opacity: 0.55; }
.corner { position: absolute; color: var(--gold); font-size: 20px; opacity: 0.8; }
.corner--tr { top: 26px; right: 26px; }
.corner--tl { top: 26px; left: 26px; }
.corner--br { bottom: 26px; right: 26px; }
.corner--bl { bottom: 26px; left: 26px; }

.section { position: relative; z-index: 1; padding: clamp(14px, 3vw, 22px) 6px; }
.section__title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(24px, 6vw, 34px);
  color: var(--rose-dp);
  margin-bottom: 14px;
}
.flourish { color: var(--gold); font-size: 24px; display: inline-block; }

.divider {
  position: relative; z-index: 1;
  display: flex; align-items: center; justify-content: center; gap: 12px;
  color: var(--gold); max-width: 260px; margin: 6px auto;
}
.divider span { height: 1px; flex: 1; background: linear-gradient(90deg, transparent, var(--gold), transparent); }

/* الترويسة */
.hero { padding-top: clamp(20px, 5vw, 36px); }
.bismillah { font-family: var(--font-script); color: var(--gold-dp); font-size: clamp(17px, 4.5vw, 22px); margin-bottom: 10px; }
.hero__kicker { color: var(--ink-sf); letter-spacing: normal; font-size: 13px; margin: 12px 0 4px; }
.couple {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.4;
  font-size: clamp(36px, 11vw, 64px);
  color: var(--ink);
  margin: 6px 0 14px;
}
.couple__name { display: block; }
.couple__amp { display: block; color: var(--gold); font-size: 0.62em; margin: -2px 0; }
.hero__sub { color: var(--ink-sf); font-size: clamp(14px, 4vw, 17px); }

/* العدّاد */
.when__date { font-family: var(--font-display); font-size: clamp(20px, 5.5vw, 30px); color: var(--ink); }
.when__time { color: var(--ink-sf); margin-top: 2px; font-size: 15px; }
.countdown {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: clamp(7px, 2vw, 12px);
  max-width: 420px; margin: 24px auto 0;
}
.cd__cell {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 4px;
  background: rgba(255,255,255,0.4);
}
.cd__num {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(26px, 7.5vw, 40px);
  color: var(--rose-dp);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.cd__lbl { display: block; color: var(--ink-sf); font-size: 12px; margin-top: 2px; }
.when__arrived { font-family: var(--font-display); color: var(--rose-dp); font-size: clamp(22px, 6vw, 32px); margin-top: 20px; }

/* القاعة */
.venue__photo {
  height: 170px; margin: 0 auto 18px; max-width: 380px;
  border-radius: 16px; border: 1px solid var(--line);
  background:
    radial-gradient(circle at 50% 40%, #f7e6df, #ecd0c6),
    var(--blush-2);
  background-size: cover; background-position: center;
  display: flex; align-items: center; justify-content: center;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.3);
}
.venue__photo .venue__pin { color: var(--gold-dp); font-size: 30px; opacity: 0.55; }
.venue.has-photo .venue__photo { border: none; }
.venue.has-photo .venue__pin { display: none; }
.venue__name { font-family: var(--font-display); font-size: clamp(22px, 6vw, 32px); color: var(--ink); }
.venue__addr { color: var(--ink-sf); margin-top: 4px; font-size: 15px; }
.venue__btn {
  display: inline-flex; align-items: center; gap: 9px;
  margin-top: 22px; font-weight: 700; font-size: 15px;
  color: #5a3a34; text-decoration: none;
  background: linear-gradient(180deg, var(--gold-sf), var(--gold));
  border-radius: 999px; padding: 12px 28px;
  box-shadow: 0 8px 20px rgba(194,162,92,0.35);
  transition: transform 0.25s ease, filter 0.25s ease;
}
.venue__btn:hover { transform: translateY(-2px); filter: brightness(1.05); }

.hero__date { color: var(--rose-dp); font-family: var(--font-display); font-size: clamp(15px, 4vw, 19px); margin-top: 14px; }

/* دعاء افتتاحي */
.verse__text {
  font-family: var(--font-script);
  font-size: clamp(18px, 5vw, 25px);
  color: var(--rose-dp); line-height: 2; max-width: 30ch; margin: 0 auto;
}

/* نص الدعوة */
.invitation__text {
  font-size: clamp(15px, 4vw, 17px); color: var(--ink); line-height: 2.1;
  max-width: 42ch; margin: 0 auto;
}

/* عائلتا العروسين */
.families { display: flex; align-items: center; justify-content: center; gap: clamp(10px, 4vw, 26px); flex-wrap: wrap; }
.family { flex: 1; min-width: 130px; }
.family__label { display: block; color: var(--ink-sf); font-size: 13px; letter-spacing: normal; margin-bottom: 6px; }
.family__names { font-family: var(--font-display); color: var(--ink); font-size: clamp(16px, 4.4vw, 20px); }
.families__heart { color: var(--gold); font-size: 20px; }

/* برنامج الحفل */
.timeline { list-style: none; max-width: 360px; margin: 6px auto 0; text-align: start; }
.timeline__item {
  position: relative; display: grid; grid-template-columns: auto 1fr; align-items: baseline;
  gap: 12px; padding: 12px 18px 12px 0; border-inline-start: 2px solid var(--line); margin-inline-start: 6px;
}
.timeline__dot { position: absolute; inset-inline-start: -7px; top: 17px; width: 11px; height: 11px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 3px var(--blush-1); }
.timeline__time { font-family: var(--font-display); color: var(--rose-dp); font-size: 15px; min-width: 86px; }
.timeline__title { color: var(--ink); font-size: 15px; }

/* ملاحظات */
.notes__list { list-style: none; max-width: 400px; margin: 4px auto 0; text-align: start; }
.notes__item { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; color: var(--ink); font-size: 15px; line-height: 1.7; }
.notes__mark { color: var(--gold); font-size: 13px; margin-top: 4px; flex-shrink: 0; }

/* الخاتمة */
.closing__note { font-family: var(--font-script); font-size: clamp(18px, 5vw, 26px); color: var(--ink); margin-bottom: 8px; }
.closing__hashtag { color: var(--rose-dp); font-weight: 700; font-size: 15px; letter-spacing: normal; margin-bottom: 18px; }
.contact { margin: 0 auto 18px; padding: 14px 18px; border: 1px solid var(--line); border-radius: 14px; max-width: 280px; background: rgba(255,255,255,0.4); }
.contact__label { display: block; color: var(--ink-sf); font-size: 13px; margin-bottom: 4px; }
.contact__link { color: var(--rose-dp); font-weight: 700; font-size: 17px; text-decoration: none; }
.contact__link:hover { text-decoration: underline; }
.closing__families { color: var(--ink-sf); font-size: 15px; margin-bottom: 16px; }

/* حركة الظهور */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.9s ease, transform 0.9s ease; }
.reveal.is-visible { opacity: 1; transform: translateY(0); }

/* بتلات وردية متساقطة */
.petal { position: absolute; top: -24px; opacity: 0; animation: fall linear forwards; }
@keyframes fall {
  0%   { opacity: 0; transform: translateY(0) rotate(0deg); }
  12%  { opacity: 0.85; }
  100% { opacity: 0; transform: translateY(105vh) rotate(300deg); }
}

@media (prefers-reduced-motion: reduce) {
  *, .reveal { transition: none !important; animation: none !important; }
  .reveal, .stage__content.reveal { opacity: 1; transform: none; }
  .stage__bg, .scroll-cue, .scroll-cue__arrow { animation: none !important; }
  .bg-photo { transition: none !important; }
}

/* ============================================================
   الصور: تُحمّل تلقائياً من script.js (كائن images).
   ضع صورك في مجلد assets/ بالأسماء: hero.jpg و venue.jpg
   وتظهر تلقائياً بدون أي تعديل على الكود.
   ============================================================ */

/* أسطر Enter في حقل «الدعاء/العبارة» تُعرض كما كتبها الزبون (بسملة فوق والآية تحتها) */
.verse__text { white-space: pre-line; }
