/* Q Moment — أساس صفحة الدعوة والأجزاء المشتركة. كل قالب يضبط المتغيرات في tpl/<id>.css */
:root {
  --q-bg: #FDFBF7;
  --q-soft: #F8F4EE;
  --q-ink: #2D2824;
  --q-muted: #665C54;
  --q-accent: #8F6E1C;
  --q-line: #E8D9A8;
  --q-btn: #2D2824;
  --q-btn-ink: #FDFBF7;
  --q-display: 'Aref Ruqaa', 'Amiri', serif;
  --q-body: 'Plex Arabic', system-ui, sans-serif;
  --q-radius: 18px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body.inv { margin: 0; min-height: 100svh; background: var(--q-bg); color: var(--q-ink); font: 400 15px/1.85 var(--q-body); }
h1, h2, p { margin: 0; }
a { color: var(--q-accent); }
button, input, textarea, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--q-accent); outline-offset: 3px; border-radius: 6px; }

/* الحالات: الغلاف ثم المتن */
.inv-cover { position: fixed; inset: 0; z-index: 5; overflow: hidden; }
.inv-body { display: none; max-width: 560px; margin-inline: auto; }
.is-open .inv-cover { display: none; }
.is-open .inv-body { display: block; animation: q-fade .9s ease both; }
@keyframes q-fade { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

.inv-banner { position: fixed; top: 0; inset-inline: 0; z-index: 10; background: #1E1426; color: #F7F1E8; font: 600 12px/1.6 'Plex Arabic', sans-serif; text-align: center; padding: 7px 14px; box-shadow: 0 2px 10px rgba(0,0,0,.35); display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; }
.inv-banner ~ .inv-body { padding-top: 42px; }
.inv-demo-tag { background: #D8B98A; color: #1E1426; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; letter-spacing: .02em; }
.inv-demo-btn { background: rgba(255,255,255,.15); color: #F7F1E8; text-decoration: none; font-size: 11px; font-weight: 600; padding: 3px 10px; border-radius: 6px; border: 1px solid rgba(255,255,255,.25); transition: background .2s; }
.inv-demo-btn:hover { background: rgba(255,255,255,.25); }


/* الأجزاء المشتركة */
.q-sec { padding: 36px 22px; display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; }
.q-h { font-family: var(--q-display); font-size: 28px; font-weight: 700; line-height: 1.5; }
.q-note { font-size: 13px; color: var(--q-muted); }
.q-verse { display: flex; flex-direction: column; align-items: center; gap: 8px; font-family: 'Amiri', serif; }
.q-verse p { font-size: 19px; line-height: 2; max-width: 32ch; }
.q-basmala, .q-ref { font-size: 14px; color: var(--q-muted); }

.q-cd { display: flex; gap: 8px; justify-content: center; }
.q-cd-box { width: 70px; padding: 10px 0; display: flex; flex-direction: column; align-items: center; border: 1px solid var(--q-line); border-radius: 14px; background: rgba(255,255,255,.55); }
.q-cd-box strong { font-size: 22px; color: var(--q-accent); line-height: 1.4; }
.q-cd-box span { font-size: 11px; color: var(--q-muted); }
.q-cd-done { font-family: var(--q-display); font-size: 24px; color: var(--q-accent); }

.q-place { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 18px; border: 1px solid var(--q-line); border-radius: var(--q-radius); background: rgba(255,255,255,.6); }
.q-place strong { font-size: 17px; }
.q-place span { font-size: 14px; color: var(--q-muted); }
.q-place .q-btn { margin-top: 10px; }
.q-halls { width: 100%; display: flex; flex-direction: column; gap: 12px; }
.q-tabs { display: flex; gap: 6px; padding: 4px; border-radius: 999px; background: rgba(0,0,0,.06); }
.q-tabs button { flex: 1; min-height: 46px; border: 0; border-radius: 999px; background: transparent; font-weight: 600; cursor: pointer; }
.q-tabs button[aria-selected=true] { background: var(--q-btn); color: var(--q-btn-ink); }

.q-story ol { list-style: none; margin: 0; padding: 0; width: 100%; text-align: start; }
.q-story li { position: relative; padding: 0 30px 20px 0; }
.q-story li::before { content: ''; position: absolute; right: 6px; top: 8px; width: 14px; height: 14px; border-radius: 50%; border: 3px solid var(--q-accent); background: var(--q-bg); box-sizing: border-box; }
.q-story li::after { content: ''; position: absolute; right: 12px; top: 26px; bottom: 0; width: 2px; background: var(--q-line); }
.q-story li:last-child::after { display: none; }
.q-story strong { color: var(--q-accent); }
.q-story p { font-size: 14px; color: var(--q-muted); }

.q-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 22px; border-radius: 999px; text-decoration: none; font-weight: 600; font-size: 15px; cursor: pointer; border: 1px solid transparent; }
.q-btn-main { background: var(--q-btn); color: var(--q-btn-ink); border: 0; width: 100%; }
.q-btn-main:disabled { opacity: .6; }
.q-btn-line { border-color: var(--q-ink); color: var(--q-ink); background: transparent; }
.q-link { background: none; border: 0; color: var(--q-muted); text-decoration: underline; min-height: 44px; cursor: pointer; }

.q-form { width: 100%; display: flex; flex-direction: column; gap: 14px; text-align: start; padding: 18px; border: 1px solid var(--q-line); border-radius: var(--q-radius); background: rgba(255,255,255,.7); }
.q-field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; }
.q-field small { font-weight: 400; color: var(--q-muted); }
.q-field input, .q-field textarea { min-height: 48px; border: 1px solid var(--q-line); border-radius: 14px; padding: 10px 14px; background: #fff; font-weight: 400; width: 100%; }
.q-field input:focus, .q-field textarea:focus { outline: none; border-color: var(--q-accent); box-shadow: 0 0 0 3px rgba(0,0,0,.06); }
.q-choice { border: 0; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.q-choice legend { font-size: 14px; font-weight: 600; margin-bottom: 6px; padding: 0; }
.q-choice label { cursor: pointer; }
.q-choice input { position: absolute; opacity: 0; pointer-events: none; }
.q-choice span { display: flex; align-items: center; justify-content: center; min-height: 48px; padding: 6px 10px; border: 1px solid var(--q-line); border-radius: 14px; background: #fff; font-size: 14px; font-weight: 500; text-align: center; }
.q-choice input:checked + span { border: 1.5px solid var(--q-accent); background: var(--q-soft); font-weight: 700; }
.q-choice input:focus-visible + span { outline: 3px solid var(--q-accent); outline-offset: 2px; }
.q-err { color: #9B2C2C; font-size: 13px; font-weight: 600; }
.q-thanks { font-family: var(--q-display); font-size: 21px; color: var(--q-accent); }
.q-rsvp-done { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.q-hp { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.q-guest { display: flex; flex-direction: column; align-items: center; text-align: center; }
.q-made { font-size: 12px; color: var(--q-muted); text-align: center; padding: 18px 0 26px; }
.q-made a { color: inherit; }

@media (prefers-reduced-motion: reduce) {
  .is-open .inv-body { animation: none; }
}

/* ——— أقسام الدعوة الطويلة ——— */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.q-row { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.q-quick { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 6px; }
.q-quick .q-btn { width: auto; min-width: 140px; }
.q-prose { max-width: 34ch; display: flex; flex-direction: column; gap: 12px; color: var(--q-muted); font-size: 15px; }
.q-message .q-h, .q-custom .q-h { font-size: 26px; }

/* الأحرف المزخرفة */
.q-mono { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 2px; color: var(--q-accent); font-family: var(--q-display); padding: 26px 46px; }
.q-mono-frame { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .55; }
.q-mono-l { font-size: 64px; line-height: 1; font-weight: 700; color: var(--q-ink); }
.q-mono-orn { width: 22px; height: 46px; margin: 0 6px; }
.q-mono-sm { padding: 16px 30px; }
.q-mono-sm .q-mono-l { font-size: 40px; }
.q-mono-sm .q-mono-orn { width: 16px; height: 32px; }
h1.is-mono { display: flex; justify-content: center; }
h1.is-headline, .is-headline { font-family: var(--q-display); }

/* العائلتان */
.q-fam { display: flex; flex-direction: column; align-items: center; gap: 10px; font-family: 'Amiri', serif; font-size: 18px; }
.q-orn { width: 10px; height: 10px; background: var(--q-accent); transform: rotate(45deg); opacity: .6; }

/* الألبوم */
.q-photos { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.q-photos.n1 { grid-template-columns: 1fr; }
.q-photos figure { margin: 0; display: flex; flex-direction: column; gap: 6px; }
.q-photos figure:first-child:nth-last-child(odd) { grid-column: 1 / -1; }
.q-photos img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 14px; display: block; background: var(--q-soft); }
.q-photos.n1 img, .q-photos figure:first-child:nth-last-child(odd) img { aspect-ratio: 4 / 3; }
.q-photos figcaption { font-size: 13px; color: var(--q-muted); }

/* التفاصيل والفقرات والملاحظات */
.q-facts { width: 100%; margin: 0; display: flex; flex-direction: column; border: 1px solid var(--q-line); border-radius: var(--q-radius); overflow: hidden; }
.q-facts > div { display: flex; justify-content: space-between; gap: 12px; padding: 12px 16px; background: rgba(255,255,255,.55); text-align: start; }
.q-facts > div + div { border-top: 1px solid var(--q-line); }
.q-facts dt { color: var(--q-muted); font-size: 13px; }
.q-facts dd { margin: 0; font-weight: 600; font-size: 14px; text-align: end; }
.q-prog { list-style: none; margin: 0; padding: 0; width: 100%; max-width: 320px; }
.q-prog li { display: flex; justify-content: space-between; gap: 12px; padding: 11px 4px; border-bottom: 1px dashed var(--q-line); }
.q-prog li:last-child { border-bottom: 0; }
.q-prog strong { color: var(--q-accent); font-weight: 600; white-space: nowrap; }
.q-notes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; width: 100%; }
.q-notes li { padding: 10px 14px; border-radius: 12px; background: rgba(255,255,255,.55); border: 1px solid var(--q-line); font-size: 14px; }
.q-phone { font-size: 20px; font-weight: 600; letter-spacing: .02em; }
.q-closing { font-family: var(--q-display); font-size: 24px; color: var(--q-accent); line-height: 1.6; }

/* بطاقة الحضور بعد التأكيد */
.q-card { width: 100%; padding: 22px 18px; border-radius: 20px; background: var(--q-btn); color: var(--q-btn-ink); display: flex; flex-direction: column; align-items: center; gap: 6px; box-shadow: 0 16px 36px rgba(0,0,0,.18); }
.q-card-k { font-size: 11px; letter-spacing: .2em; opacity: .8; }
.q-card-name { font-family: var(--q-display); font-size: 26px; }
.q-card-name:empty { display: none; }
.q-card p { font-size: 14px; }
.q-card-d { font-size: 12px; opacity: .8; }
.q-seats { display: block; font-size: 13px; opacity: .85; margin-top: 4px; }

/* ألبوم الضيوف */
.q-album-up { width: 100%; display: flex; flex-direction: column; gap: 10px; align-items: stretch; }
.q-upload { position: relative; cursor: pointer; }
.q-upload input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.q-upload:focus-within { outline: 3px solid var(--q-accent); outline-offset: 3px; }
.q-album-grid { width: 100%; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.q-album-grid img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; background: var(--q-soft); }

/* زر الموسيقى العائم */
.q-music { position: fixed; bottom: 18px; left: 18px; z-index: 8; width: 52px; height: 52px; border-radius: 50%; border: 0; background: var(--q-btn); color: var(--q-btn-ink); display: flex; align-items: center; justify-content: center; box-shadow: 0 8px 24px rgba(0,0,0,.25); cursor: pointer; }
.q-music .on { display: none; }
.q-music.playing .on { display: block; animation: q-spin 6s linear infinite; }
.q-music.playing .off { display: none; }
@keyframes q-spin { to { transform: rotate(360deg); } }
.is-closed .q-music { display: none; }
@media (prefers-reduced-motion: reduce) { .q-music.playing .on { animation: none; } }

/* ——— المتون الداكنة (ليلة الفوانيس، حبر الذهب، مخمل، المشهد الأول) ——— */
.inv-dark .q-place, .inv-dark .q-form, .inv-dark .q-cd-box, .inv-dark .q-facts > div, .inv-dark .q-notes li { background: rgba(255,255,255,.06); }
.inv-dark .q-field input, .inv-dark .q-field textarea, .inv-dark .q-choice span { background: rgba(255,255,255,.08); color: var(--q-ink); }
.inv-dark .q-field input::placeholder, .inv-dark .q-field textarea::placeholder { color: var(--q-muted); }
.inv-dark .q-choice input:checked + span { background: rgba(255,255,255,.16); }
.inv-dark .q-tabs { background: rgba(255,255,255,.08); }
.inv-dark .q-story li::before { background: var(--q-bg); }
.inv-dark .q-card { box-shadow: 0 16px 36px rgba(0,0,0,.45); }

/* مشغّل يوتيوب كمصدر موسيقى خلفية غير ظاهر */
.q-yt { position: fixed; top: -9999px; left: -9999px; width: 1px; height: 1px; opacity: 0.001; pointer-events: none; overflow: hidden; z-index: -1; clip: rect(0,0,0,0); border: 0; }
.q-yt iframe { width: 1px; height: 1px; border: 0; display: block; }
.q-yt-close { display: none !important; }
.is-closed .q-yt { display: none; }

