/* ══════════════════════════════════════════
   شادي & سارة — دعوة زفاف
   بناء يطابق عرض القالب الأصلي minimalism-dark-red
   ══════════════════════════════════════════ */

:root {
  --cream:      #fff7eb;   /* خلفية الصفحة */
  --wine:       #511419;   /* البرغندي الأساسي */
  --wine-deep:  #590310;   /* عنوان Save The Date */
  --oncard:     #ece4d8;   /* نص داخل البطاقات البرغندية */
  --oncard-dim: rgba(236, 228, 216, .7);
  --line:       rgba(81, 20, 25, .18);

  /* خطوط عربية أصيلة — لا يُسنَد نص عربي إلى خط لاتيني أبداً */
  --f-display: 'Aref Ruqaa', 'Amiri', 'Traditional Arabic', serif;  /* الأسماء الكبيرة — رقعة */
  --f-body:    'Amiri', 'Traditional Arabic', serif;                /* النصوص — نسخ */
  --f-head:    'Reem Kufi', 'Amiri', sans-serif;                    /* العناوين — كوفي */

  /* لاتيني بحت: Save The Date، اسم القاعة، الأرقام */
  --f-latin:   'Cormorant Garamond', 'Times New Roman', serif;
  --f-num:     'EB Garamond', Georgia, serif;

  /* أسماء قديمة للتوافق */
  --f-ar:     var(--f-body);
  --f-serif:  var(--f-body);
  --f-script: var(--f-display);

  --ease: cubic-bezier(.22, .61, .36, 1);
}

*, *::before, *::after { box-sizing: border-box; }

[hidden] { display: none !important; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: #f3ece1;
  color: var(--wine);
  font-family: var(--f-body);
  /* العربية تحتاج سطراً أوسع من اللاتينية */
  line-height: 2;
  overflow-x: hidden;
  /* تفعيل الوصلات والأشكال العربية وتنعيم الحواف */
  font-feature-settings: 'liga' 1, 'calt' 1, 'kern' 1;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body.is-locked { overflow: hidden; }

img { max-width: 100%; display: block; }


/* ══════════ شاشة الفتح ══════════ */

.gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  text-align: center;
  overflow: hidden;
  background:
    linear-gradient(rgba(255,247,235,.9), rgba(246,233,216,.94)),
    url('../img/theme/paper.webp') center top/100%,
    var(--cream);
  transition: opacity .9s var(--ease), visibility .9s;
}

.gate.is-open { opacity: 0; visibility: hidden; pointer-events: none; }

.gate__inner { max-width: 380px; animation: rise 1s var(--ease) both; }

.gate__eyebrow {
  font-family: var(--f-latin);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--wine-deep);
  margin: 0 0 6px;
}

.gate__names {
  font-family: var(--f-display);
  font-size: clamp(34px, 11vw, 44px);
  font-weight: 700;
  line-height: 1.6;
  color: var(--wine);
  margin: 0 0 8px;
}

.gate__names span { opacity: .4; }

.gate__env {
  position: relative;
  display: block;
  /* مظروف أكبر عند البداية */
  width: min(400px, 88vw);
  margin: 40px auto 34px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  aspect-ratio: 1013 / 668;
  transition: transform .45s var(--ease);
  animation: drFloat 5s ease-in-out infinite;
}

.gate__env:hover  { transform: translateY(-6px) scale(1.03); }
.gate__env:active { transform: scale(.98); }

.gate__env-cover {
  position: absolute;
  inset: 0;
  z-index: 3;
  width: 100%; height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 18px 34px rgba(81, 20, 25, .32));
  pointer-events: none;
}

/* اللوح الساد: يظهر فقط عبر فتحة الـ V فيبدو المظروف مغلقاً */
.gate__env-seal {
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: 2px;
  background: linear-gradient(150deg, #743136 0%, #5e2228 42%, #4c1419 100%);
  pointer-events: none;
}

/* البطاقة مخفية تماماً في البداية */
.gate__env-card {
  position: absolute;
  z-index: 2;
  left: 15%;
  bottom: 8%;
  width: 70%;
  max-height: 92%;
  object-fit: cover;
  object-position: top center;
  border-radius: 3px 3px 0 0;
  box-shadow: 0 -6px 18px rgba(0, 0, 0, .28);
  opacity: 0;
  transform: translateY(14%);
  pointer-events: none;
}

/* عند الفتح: البطاقة تظهر بالتدريج وترتفع خارج المظروف */
.gate.is-opening .gate__env      { animation: none; }
.gate.is-opening .gate__env-card { animation: cardReveal 1.9s var(--ease) .15s both; }

@keyframes cardReveal {
  0%   { opacity: 0; transform: translateY(14%)  scale(.97); }
  22%  { opacity: 1; transform: translateY(4%)   scale(.99); }
  100% { opacity: 1; transform: translateY(-48%) scale(1.06); }
}

.gate__to {
  font-family: var(--f-body);
  font-size: 15px;
  color: var(--wine);
  margin: 0 0 4px;
}

.gate__to span { font-weight: 700; }

.gate__hint {
  font-family: var(--f-head);
  font-size: 13px;
  letter-spacing: normal;
  color: rgba(81, 20, 25, .6);
  margin: 0;
  animation: hintPulse 2.4s ease-in-out infinite;
}


/* ══════════ زر الموسيقى ══════════ */

.music-toggle {
  position: fixed;
  top: 14px; right: 14px;
  z-index: 60;
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(255, 247, 235, .85);
  color: var(--wine);
  cursor: pointer;
}

.music-toggle.is-playing .music-toggle__icon { animation: spin 4s linear infinite; }


/* ══════════ لوح الدعوة ══════════ */

.invite {
  position: relative;
  width: 100%;
  max-width: 480px;
  margin-inline: auto;
  background: var(--cream);
  color: var(--wine);
  overflow: hidden;
  isolation: isolate;
  opacity: 0;
  transition: opacity 1s var(--ease);
}

.invite.is-visible { opacity: 1; }

@media (min-width: 900px) {
  .invite { max-width: 900px; border-inline: 1px solid rgba(81, 20, 25, .13); }
}

/* نسيج الورق فوق اللوح كله */
.invite__paper {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: url('../img/theme/paper.webp') center top/100%;
  mix-blend-mode: multiply;
  opacity: .5;
}


/* ══════════ الغلاف ══════════ */

.hero {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 60px 36px 56px;
  text-align: center;
  overflow-x: clip;
}

.hero__castle {
  position: absolute;
  left: 50%;
  top: 26%;
  width: 170%;
  max-width: none;
  transform: translateX(-50%);
  opacity: .1;
  pointer-events: none;
}

.hero__eyebrow {
  position: relative;
  z-index: 1;
  font-family: var(--f-latin);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--wine-deep);
  margin: 0;
}

@media (min-width: 768px) {
  .hero__eyebrow { font-size: 18px; }
}


/* ── تركيبة المظروف ── */

.scene {
  position: relative;
  z-index: 1;
  width: 82%;
  max-width: 330px;
  margin-top: 96px;
  aspect-ratio: 333 / 384;
}

@media (min-width: 768px) {
  .scene { max-width: 420px; margin-top: 112px; }
}

.scene__open {
  position: absolute;
  inset: 0;
  z-index: 10;
  width: 100%;
  max-width: none;
}

/* الصورة المائلة داخل المظروف */
.scene__photo {
  position: absolute;
  left: 33%;
  top: -2%;
  z-index: 20;
  width: 64%;
}

.scene__photo-frame {
  aspect-ratio: 221 / 309;
  transform: rotate(12deg);
  border: 7px solid #fff;
  background: #fff;
  box-shadow: 2px 2px 4px rgba(0, 0, 0, .25);
}

.scene__photo-frame img { width: 100%; height: 100%; object-fit: cover; }

.scene__flower {
  position: absolute;
  left: -2%;
  top: -12%;
  z-index: 25;
  display: block;
  width: 42%;
  pointer-events: none;
}

.scene__flower img {
  width: 100%;
  max-width: none;
  transform: rotate(-17deg);
  filter: drop-shadow(3px 4px 3px rgba(0, 0, 0, .3));
}

.scene__cover {
  position: absolute;
  bottom: 0; left: 0;
  z-index: 30;
  width: 100%;
  max-width: none;
}


/* ── الأسماء ── */

.hero__names {
  position: relative;   /* مرجع تموضع علامة & */
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  margin-top: 64px;
  isolation: isolate;
}

.hero__name {
  font-family: var(--f-display);
  font-size: clamp(38px, 11vw, 46px);
  font-weight: 700;
  /* الرقعة تمتد تحت خط الأساس — نمنع القصّ */
  line-height: 1.5;
  color: var(--wine);
  margin: 0;
}

@media (min-width: 768px) {
  .hero__name  { font-size: 58px; }
  .hero__names { margin-top: 80px; }
}

.hero__amp {
  position: absolute;
  top: 37%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--f-latin);
  font-size: 92px;
  line-height: 1;
  color: rgba(81, 20, 25, .15);
  pointer-events: none;
}

@media (min-width: 768px) {
  .hero__amp { font-size: 120px; }
}


/* ══════════ البطاقات البرغندية ══════════ */

.block {
  position: relative;
  z-index: 1;
  width: 88%;
  max-width: 420px;
  margin: 0 auto 40px;
}

@media (min-width: 768px) {
  .block { max-width: 560px; margin-bottom: 64px; }
}

.card {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  padding: 36px 20px 40px;
  text-align: center;
  color: var(--oncard);
  background: var(--wine);
  box-shadow: 4px 4px 10px rgba(0, 0, 0, .25);
}

/* نسيج ورقي داخل البطاقة */
.card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: url('../img/theme/paper.webp') center/cover;
  mix-blend-mode: multiply;
  opacity: .4;
  pointer-events: none;
}

.card > * { position: relative; z-index: 1; }

.card__title {
  font-family: var(--f-head);
  font-size: 21px;
  font-weight: 600;
  /* العربية متصلة — أي تباعد يفصل حروفها */
  letter-spacing: normal;
  line-height: 1.7;
  color: var(--oncard);
  margin: 0 0 26px;
}

.card__lede {
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 2.05;
  color: var(--oncard);
  margin: 24px 0;
}


/* ── الوالدان ── */

.parents {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 26px;
}

.parents__side { display: flex; flex-direction: column; gap: 2px; min-width: 0; }

.parents__label {
  font-family: var(--f-body);
  font-size: 13px;
  color: var(--oncard-dim);
}

.parents__name {
  font-family: var(--f-body);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.75;
  color: var(--oncard);
  overflow-wrap: anywhere;
}

.parents__rule {
  width: 1px;
  height: 50px;
  flex-shrink: 0;
  background: rgba(236, 228, 216, .4);
}


/* ── العروسان ── */

.couple { display: flex; flex-direction: column; align-items: center; gap: 6px; }

.couple__name {
  font-family: var(--f-display);
  font-size: clamp(28px, 8.4vw, 40px);
  font-weight: 700;
  /* خط الرقعة يحتاج سطراً أوسع لامتداد الحروف تحت الخط */
  line-height: 1.75;
  letter-spacing: normal;
  color: var(--oncard);
  margin: 0;
}

.couple__role {
  font-family: var(--f-head);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: normal;
  color: var(--oncard-dim);
  margin: 0 0 10px;
}

.couple__amp {
  font-family: var(--f-latin);
  font-size: 35px;
  line-height: 1;
  color: var(--oncard);
  margin: 4px 0;
}


/* ── الاستقبال ── */

.reception__lede {
  font-family: var(--f-head);
  font-size: 19px;
  font-weight: 500;
  letter-spacing: normal;
  color: var(--oncard);
  margin: 0 0 24px;
}

.reception {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
}

.reception__col { display: flex; flex-direction: column; align-items: center; gap: 5px; }

/* عربي: بلا تباعد */
.reception__day {
  font-family: var(--f-body);
  font-size: 15px;
  color: var(--oncard-dim);
}

/* لاتيني: التباعد هنا مناسب */
.reception__time {
  font-family: var(--f-num);
  font-size: 14px;
  letter-spacing: .06em;
  color: var(--oncard-dim);
}

.reception__rule { width: 1px; height: 46px; background: rgba(236, 228, 216, .45); }

.reception__num  { font-family: var(--f-num);  font-size: 42px; line-height: 1; color: var(--oncard); }
.reception__mon  { font-family: var(--f-body); font-size: 16px; color: var(--oncard); }
.reception__year { font-family: var(--f-num);  font-size: 13px; color: var(--oncard-dim); }


/* ── العد التنازلي ── */

.clock {
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 2;
  color: var(--oncard);
  margin: 0 0 6px;
}

.clock span {
  font-family: var(--f-num);
  font-size: 19px;
  font-variant-numeric: tabular-nums;
}

.clock__done { font-family: var(--f-body); font-size: 17px; color: var(--oncard); }


/* ── التقويم ── */

.cal {
  width: fit-content;
  max-width: 100%;
  margin: 14px auto 22px;
  padding: 8px 16px 16px;
  border-radius: 10px;
  background: var(--oncard);
  overflow: hidden;
}

.cal__inner { width: 280px; max-width: 100%; color: var(--wine); }

@media (min-width: 768px) { .cal__inner { width: 330px; } }

.cal__month {
  font-family: var(--f-display);
  font-size: 24px;
  font-weight: 700;
  line-height: 1.7;
  text-align: center;
  padding: 8px 0 12px;
  margin: 0;
  border-bottom: 1px solid rgba(81, 20, 25, .27);
}

.cal__week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  border-bottom: 2px solid var(--wine);
}

.cal__week span {
  text-align: center;
  padding: 7px 0;
  font-family: var(--f-head);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: normal;
  opacity: .65;
}

.cal__days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px 0;
  padding: 8px 4px;
}

.cal__day {
  position: relative;
  height: 30px;
  display: grid;
  place-items: center;
  font-family: var(--f-num);
  font-size: 13px;
}

/* اليوم الموعود داخل قلب */
.cal__day--mark { color: #fff; font-weight: 700; }

.cal__day--mark::before {
  content: '';
  position: absolute;
  inset: 50% auto auto 50%;
  translate: -50% -50%;
  width: 26px; height: 24px;
  background: var(--wine);
  -webkit-mask: var(--heart) center/contain no-repeat;
  mask: var(--heart) center/contain no-repeat;
}

.cal__day--mark span { position: relative; z-index: 1; }

:root {
  --heart: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 22'%3E%3Cpath d='M12 21C12 21 1.5 13.5 1.5 7.5C1.5 4.46 3.96 2 7 2C8.76 2 10.35 2.81 11.4 4.09L12 4.8L12.6 4.09C13.65 2.81 15.24 2 17 2C20.04 2 22.5 4.46 22.5 7.5C22.5 13.5 12 21 12 21Z'/%3E%3C/svg%3E");
}


/* ── الأزرار ── */

.btn {
  display: inline-block;
  font-family: var(--f-head);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: normal;
  padding: 11px 28px;
  border: 1px solid rgba(236, 228, 216, .5);
  border-radius: 999px;
  background: transparent;
  color: var(--oncard);
  cursor: pointer;
  text-decoration: none;
  transition: background .25s, border-color .25s;
}

.btn:hover { background: rgba(236, 228, 216, .12); border-color: var(--oncard); }


/* ── المكان والخريطة ── */

/* اسم القاعة لاتيني */
.venue {
  font-family: var(--f-num);
  font-size: 24px;
  color: var(--oncard);
  margin: 0 0 4px;
}

.venue__sub {
  font-family: var(--f-body);
  font-size: 14px;
  color: var(--oncard-dim);
  margin: 0 0 20px;
}

.map {
  border-radius: 8px;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  margin-bottom: 18px;
  border: 1px solid rgba(236, 228, 216, .25);
}

.map iframe { width: 100%; height: 100%; border: 0; display: block; }


/* ── سجل التهاني ── */

.wish-form { display: grid; gap: 10px; text-align: start; }

.wish-form input,
.wish-form textarea {
  font-family: var(--f-body);
  font-size: 15px;
  line-height: 1.9;
  color: var(--wine);
  padding: 10px 12px;
  border: 1px solid rgba(236, 228, 216, .4);
  border-radius: 8px;
  background: rgba(255, 247, 235, .92);
  resize: vertical;
}

.wish-form input::placeholder,
.wish-form textarea::placeholder { color: rgba(81, 20, 25, .45); }

.wish-form input:focus,
.wish-form textarea:focus { outline: none; border-color: var(--oncard); }

.wish-form .btn { justify-self: center; margin-top: 4px; }

.wishes { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 10px; text-align: start; }

.wish {
  padding: 12px 14px;
  border: 1px solid rgba(236, 228, 216, .25);
  border-radius: 8px;
  background: rgba(236, 228, 216, .08);
  animation: rise .5s var(--ease) both;
}

.wish__name { font-family: var(--f-head);  font-size: 15px; font-weight: 600; color: var(--oncard); margin: 0 0 4px; }
.wish__text { font-family: var(--f-body);  font-size: 15px; line-height: 1.95; color: var(--oncard); margin: 0 0 6px; }
.wish__time { font-family: var(--f-num);   font-size: 11px; color: var(--oncard-dim); }

.wishes__empty { font-family: var(--f-body); font-size: 14px; color: var(--oncard-dim); margin: 18px 0 0; }


/* ══════════ الختام ══════════ */

.closing {
  position: relative;
  z-index: 1;
  padding: 20px 36px 80px;
  text-align: center;
}

.closing__text {
  font-family: var(--f-body);
  font-size: 17px;
  line-height: 2.15;
  color: var(--wine);
  margin: 0 0 24px;
}

.closing__names {
  font-family: var(--f-display);
  font-size: clamp(28px, 8.4vw, 38px);
  font-weight: 700;
  line-height: 1.8;
  color: var(--wine);
  margin: 0;
}


/* ══════════ الورود الطافية ══════════ */

.bloom {
  position: absolute;
  z-index: 20;
  display: block;
  pointer-events: none;
}

.bloom img {
  width: 100%;
  max-width: none;
  filter: drop-shadow(3px 4px 3px rgba(0, 0, 0, .3));
}

/* ── بطاقة الدعوة ── */

.block--showcard { overflow: visible; }

.showcard {
  position: relative;
  z-index: 10;
  margin: 0;
  padding: 9px;
  border-radius: 8px;
  background: #fffdf8;
  box-shadow: 0 14px 34px rgba(81, 20, 25, .22);
}

.showcard img {
  width: 100%;
  border-radius: 4px;
  display: block;
}

/* الوردة على يمين البطاقة — تُحاذيها ولا تحجب الآية */
.bloom--card {
  right: -30%;
  top: 30%;
  width: 36%;
  z-index: 20;
}

.bloom--card img { transform: rotate(14deg); animation: drFloat 6.2s ease-in-out .5s infinite; }

/* على الشاشات الضيقة تقترب قليلاً كي لا تُقصّ */
@media (max-width: 620px) {
  .bloom--card { right: -14%; top: 34%; width: 30%; }
}

.bloom--a { right: -20%; bottom: 45%; width: 40%; }
.bloom--a img { animation: drFloat 5.5s ease-in-out .6s infinite; }

.bloom--b { left: -16%; top: 10%; width: 32%; }
.bloom--b img { transform: rotate(-14deg); animation: drFloat 6s ease-in-out .3s infinite; }

.bloom--c { right: -18%; top: 6%; width: 34%; }
.bloom--c img { transform: rotate(166deg); animation: drFloat 6.4s ease-in-out .9s infinite; }

.bloom--d { left: -18%; bottom: 6%; width: 34%; }
.bloom--d img { transform: rotate(196deg); animation: drFloat 5.8s ease-in-out 1.2s infinite; }

.bloom--e { right: -6%; top: -10%; width: 30%; }
.bloom--e img { transform: rotate(18deg); animation: drFloat 6.8s ease-in-out .4s infinite; }

@media (max-width: 520px) {
  .bloom { opacity: .85; }
}


/* ══════════ الظهور عند التمرير ══════════ */

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .9s var(--ease), transform .9s var(--ease);
}

.reveal.is-in { opacity: 1; transform: none; }


/* ══════════ الحركات ══════════ */

@keyframes drFloat   { 0%, 100% { translate: 0 0; } 50% { translate: 0 -8px; } }
@keyframes rise      { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes spin      { to { rotate: 360deg; } }
@keyframes hintPulse { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { transition: opacity .4s ease !important; transform: none !important; }
  .gate__env, .bloom img, .scene__photo, .scene__flower { animation: none !important; }
}
