:root {
  --ivory: #fbf7f0;
  --paper: #f4ecdf;
  --accent: #1f3d33;
  --accent-soft: #2f5547;
  --gold: #b08d57;
  --gold-light: #d8c19a;
  --ink: #2a2723;
  --muted: #6f675d;
  --line: #e4d8c5;
  --error: #9b2c2c;

  --serif: 'Cormorant Garamond', Georgia, serif;
  --sans: 'Jost', system-ui, sans-serif;
  --arabic: 'Amiri', serif;

  --card: #fffdf8;
  --radius: 4px;
  --max: 1040px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 72px; }

body {
  margin: 0;
  background: var(--ivory);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 300;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

[hidden] { display: none !important; }

.bismillah {
  font-family: var(--arabic);
  font-size: 1.35rem;
  color: var(--gold);
  margin: 0 0 1rem;
}

.btn {
  display: inline-block;
  font: 500 0.85rem/1 var(--sans);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ivory);
  background: var(--accent);
  border: 1px solid var(--accent);
  padding: 1rem 2.4rem;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.btn:hover { background: var(--accent-soft); }
.btn:disabled { opacity: 0.6; cursor: wait; }

.btn-ghost {
  color: var(--accent);
  background: transparent;
}
.btn-ghost:hover { background: var(--paper); }

.link-btn {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.event-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0 1.25rem;
  margin-top: 1rem;
  font-size: 0.85rem;
}
.event-actions a, .event-actions button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  cursor: pointer;
}

/* ---------- RSVP ---------- */


.rsvp-panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(1.5rem, 5vw, 2.5rem);
}
.rsvp-panel h3 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.8rem;
  color: var(--accent);
  margin: 0 0 0.25rem;
  text-align: center;
}
.rsvp-intro { text-align: center; color: var(--muted); margin: 0 0 1.75rem; }

.field { display: flex; flex-direction: column; gap: 0.4rem; margin-bottom: 1.25rem; }
.field label, .field-label {
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.field input, .field textarea {
  font: inherit;
  font-weight: 400;
  color: var(--ink);
  background: var(--ivory);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.8rem 0.9rem;
  width: 100%;
}
.field input:focus, .field textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(176, 141, 87, 0.18);
}
.field textarea { min-height: 96px; resize: vertical; }

.form-error {
  color: var(--error);
  font-size: 0.92rem;
  margin: 0 0 1rem;
}
.form-error:empty { display: none; }

.rsvp-event {
  border: 0;
  border-top: 1px solid var(--line);
  padding: 1.5rem 0 0.5rem;
  margin: 0 0 1rem;
}
.rsvp-event legend {
  font-family: var(--serif);
  font-size: 1.5rem;
  color: var(--accent);
  padding: 0;
}
.rsvp-event-date { color: var(--muted); font-size: 0.9rem; margin: 0 0 1rem; }
.field-count { margin: 1.25rem 0 0; }

.person {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.6rem 0;
  flex-wrap: wrap;
}
.person-name { font-weight: 400; }

/* Accept / decline: two buttons side by side, stacked full-width on narrow phones */
.choice {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice label {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0.5rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--ivory);
  font-size: 0.92rem;
  text-align: center;
  cursor: pointer;
  color: var(--muted);
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  user-select: none;
}
.choice input:focus-visible + label { outline: 2px solid var(--gold); outline-offset: 2px; }
.choice input[value='yes']:checked + label { background: var(--accent); border-color: var(--accent); color: var(--ivory); }
.choice input[value='no']:checked + label { background: var(--paper); border-color: var(--muted); color: var(--ink); }

@media (max-width: 420px) {
  .choice { grid-template-columns: 1fr; }
}

.rsvp-actions { text-align: center; margin-top: 1.75rem; }

.rsvp-done { text-align: center; }
.rsvp-summary {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0;
  text-align: left;
}
.rsvp-summary li {
  border-top: 1px solid var(--line);
  padding: 0.9rem 0;
}
.rsvp-summary strong {
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--accent);
  display: block;
}

/* ---------- Event extra link (e.g. visa) ---------- */

.event-note {
  margin: 1.25rem 0 0;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  font-size: 0.92rem;
  color: var(--muted);
}
.event-note a { display: inline-block; padding: 0.6rem 0; color: var(--accent); font-weight: 400; text-underline-offset: 3px; }


/* RSVP form in the template's style: italic labels, grey full-width options, grey submit */
#view-rsvp .field label, #view-rsvp .field-label {
  font: italic 400 1.15rem var(--serif); letter-spacing: 0; text-transform: none; color: var(--ink);
}
#view-rsvp .field input, #view-rsvp .field textarea {
  font-family: var(--serif); font-size: 1.1rem; background: rgba(255, 255, 255, 0.35); border: 1px solid #4a4640; border-radius: 4px;
}
#view-rsvp .rsvp-event legend { font: italic 400 1.6rem var(--serif); }
#view-rsvp .rsvp-event-date { font: italic 400 1rem var(--serif); }
#view-rsvp .choice { grid-template-columns: 1fr; }
#view-rsvp .choice label {
  justify-content: flex-start; min-height: 52px; padding: 0.6rem 1rem; border: 0; border-radius: 4px;
  background: #dcd8d2; color: var(--ink); font: 400 1.15rem var(--serif);
}
#view-rsvp .choice input[value='yes']:checked + label { background: #3d3a35; color: #f6f3ed; }
#view-rsvp .choice input[value='no']:checked + label { background: #b9b4ab; color: var(--ink); }
#view-rsvp .rsvp-actions .btn {
  width: 100%; padding: 1.1rem; border: 0; border-radius: 8px; background: #94918b; color: #f6f3ed;
  font: italic 400 1.4rem var(--serif); letter-spacing: 0; text-transform: none;
}
#view-rsvp .rsvp-actions .btn:hover { background: #7d7a74; }
#view-rsvp .rsvp-done .btn { width: auto; }

/* ---------- Editorial ivory: linen paper, embossed frames, lace ---------- */

/* Fonts matching the template: Milton One Bold (script, free for personal use, by Youssef Habchi),
   Gilda Display (caps; closest free match to the template's Canva-only font), Cormorant Garamond (body) */
@font-face {
  font-family: 'Milton One';
  src: url('../assets/milton-one-bold.otf?v=0a80c30ae8') format('opentype');
  font-display: swap;
}

[data-theme='editorial'] {
  --ink: #1d1b18;
  --muted: #6f685e;
  --line: #ddd7cc;
  --ivory: #f3f0ea;
  --paper: #efebe3;
  --card: #f6f3ed;
  --accent: #1d1b18;
  --accent-soft: #3a3631;
  --gold: #b39a6b;
  --gold-light: #ddd2bc;
  --serif: 'Cormorant Garamond', Georgia, serif;
  --script: 'Milton One', 'Cormorant Garamond', cursive;
  --caps: 'Gilda Display', 'Cormorant Garamond', serif;
  /* Linen: fine horizontal and vertical threads plus grain (generated noise, no image files) */
  --linen: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='h' x='0' y='0' width='100%25' height='100%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.012 0.9' numOctaves='2' seed='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.45 0 0 0 0 0.42 0 0 0 0 0.36 0.32 0 0 0 -0.12'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23h)'/%3E%3C/svg%3E"), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='v' x='0' y='0' width='100%25' height='100%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9 0.012' numOctaves='2' seed='9' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.45 0 0 0 0 0.42 0 0 0 0 0.36 0.22 0 0 0 -0.09'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23v)'/%3E%3C/svg%3E"), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='g' x='0' y='0' width='100%25' height='100%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2' seed='4' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.4 0 0 0 0 0.37 0 0 0 0 0.32 0.18 0 0 0 -0.07'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
  --fine: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='g' x='0' y='0' width='100%25' height='100%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2' seed='4' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.4 0 0 0 0 0.37 0 0 0 0 0.32 0.18 0 0 0 -0.07'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
  --wavy-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'%3E%3Cpath d='M10,4 C25,0 35,6 50,3 C65,0 75,6 90,4 C98,3 99,12 97,22 C95,35 100,42 97,55 C94,68 100,76 97,88 C95,97 90,97 85,97 C70,99 60,94 50,97 C40,100 28,95 15,97 C5,99 3,92 3,85 C5,72 0,64 3,50 C6,38 1,28 3,16 C4,8 6,5 10,4 Z' fill='black'/%3E%3C/svg%3E");
  --wavy-line: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'%3E%3Cpath d='M10,4 C25,0 35,6 50,3 C65,0 75,6 90,4 C98,3 99,12 97,22 C95,35 100,42 97,55 C94,68 100,76 97,88 C95,97 90,97 85,97 C70,99 60,94 50,97 C40,100 28,95 15,97 C5,99 3,92 3,85 C5,72 0,64 3,50 C6,38 1,28 3,16 C4,8 6,5 10,4 Z' fill='none' stroke='%23ddd8d6' stroke-width='1' vector-effect='non-scaling-stroke'/%3E%3Cpath d='M10,4 C25,0 35,6 50,3 C65,0 75,6 90,4 C98,3 99,12 97,22 C95,35 100,42 97,55 C94,68 100,76 97,88 C95,97 90,97 85,97 C70,99 60,94 50,97 C40,100 28,95 15,97 C5,99 3,92 3,85 C5,72 0,64 3,50 C6,38 1,28 3,16 C4,8 6,5 10,4 Z' transform='translate(2.5 2) scale(0.95 0.96)' fill='none' stroke='%23e8e4e2' stroke-width='1' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E");
}

[data-theme='editorial'] body { background: var(--linen), var(--ivory); font-family: var(--serif); font-weight: 400; font-size: 18px; }

/* ---------- Shared pieces ---------- */

.script { margin: 0 0 1.25rem; font: 400 clamp(3rem, 13vw, 4.2rem)/1.15 var(--script); text-align: center; color: var(--ink); }
.kicker-script { margin: 1.75rem 0 0; font: 400 clamp(1.5rem, 6vw, 1.9rem) var(--serif); text-align: center; }
.caps { margin: 0 0 0.35rem; font: 400 0.95rem var(--caps); letter-spacing: 0.12em; text-transform: uppercase; }
.line { margin: 0; font: italic 400 1.2rem/1.55 var(--serif); }
.soon { margin: 0.75rem 0 0; font: italic 400 1.15rem/1.6 var(--serif); color: var(--muted); text-align: center; }
.amp { font-size: 0.85em; }


.go-back {
  display: block;
  width: fit-content;
  margin: 2.5rem auto;
  padding: 0.75rem 1rem;
  font: 400 1.25rem var(--caps);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink);
  text-underline-offset: 5px;
}

/* ---------- Monogram: script letters pressed into the paper inside an embossed oval ---------- */

.band-emblem { padding: clamp(2.5rem, 9vw, 5.5rem) 16px; }
.monogram { position: relative; width: clamp(150px, 46vw, 280px); aspect-ratio: 200 / 260; margin: 0 auto; }
.monogram svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.monogram .mono-a, .monogram .mono-s {
  position: absolute;
  font: 400 1em/1 var(--script);
  color: #ece8e0;
  text-shadow: -1px -1px 0 #ffffff, 1px 1px 1px rgba(110, 100, 85, 0.45);
}
.monogram { font-size: clamp(79px, 24.2vw, 147px); }  /* keeps the letters in proportion to the oval */
.monogram .mono-a { left: 22%; top: 24%; }
.monogram .mono-s { left: 44%; top: 40%; }

/* ---------- 1. Opening ---------- */

.opening { min-height: 100dvh; padding: 0 16px 2.5rem; text-align: center; display: flex; flex-direction: column; align-items: center; }
.opening .band-emblem { padding-bottom: clamp(1rem, 4vw, 2rem); }
.names { margin: 0.1rem 0 0; font: 400 clamp(3.1rem, 14.5vw, 5.6rem)/1.15 var(--script); white-space: nowrap; }
.envelope-link { position: relative; display: block; width: min(88vw, 480px); margin: 1.75rem auto 0; -webkit-tap-highlight-color: transparent; }
.env-photo { display: block; width: 100%; height: auto; filter: drop-shadow(0 14px 18px rgba(50, 40, 25, 0.22)); transition: transform 0.3s ease; }
.envelope-link:hover .env-photo { transform: translateY(-3px); }
.envelope-link:focus-visible, .open-envelope:focus-visible { outline: 2px solid var(--gold); outline-offset: 6px; }
.caps-link { margin-top: 1.75rem; padding: 0.6rem 1rem; font: 400 clamp(1.15rem, 4.6vw, 1.5rem) var(--caps); letter-spacing: 0.02em; text-transform: uppercase; color: var(--ink); text-decoration: none; }

/* ---------- Photo page: blurred B&W couple photo, lace frame, paper card with a small print ---------- */

.photo-band {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: clamp(3rem, 12vw, 6rem) 16px;
  background: #4a4743;
}
.photo-band::before {
  content: '';
  position: absolute;
  inset: -40px;
  z-index: -1;
  background: var(--photo-bg, url('../assets/couple.webp?v=9ad8e91cfc')) var(--photo-bg-pos, center 62%) / cover no-repeat;
  filter: grayscale(1) blur(10px) brightness(0.72) contrast(1.05);
}
.lace-photo { position: relative; width: min(92vw, 680px); aspect-ratio: 900 / 1052; margin: 0 auto; container-type: inline-size; }
.lace-overlay { position: absolute; inset: 0; width: 100%; height: 100%; filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.35)); pointer-events: none; }
.lace-paper {
  position: absolute;
  left: 14.5%;
  right: 14.5%;
  top: 12%;
  bottom: 12%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5cqw;
  padding: 6cqw 5cqw;
  background: var(--fine), #ebe8e2;
  text-align: center;
}
.paper-caps { margin: 0; font: 400 2.6cqw/1.3 var(--caps); letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink); }
.paper-photo { display: block; width: 80%; height: auto; aspect-ratio: 4 / 5; flex: none; object-fit: cover; object-position: center; filter: grayscale(1) contrast(1.08); }

/* ---------- 2. Forever begins here ---------- */

.band { padding: clamp(3.5rem, 12vw, 6rem) 16px; text-align: center; }
.frame-card { position: relative; width: min(100%, 560px); margin: 0 auto; }
.frame-art { position: absolute; inset: 0; width: 100%; height: 100%; }
.frame-inner { position: relative; padding: clamp(3.2rem, 12vw, 4.5rem) clamp(2rem, 9vw, 3.5rem); }
.frame-inner .script { outline: none; }
.frame-inner p { margin: 0 0 1.1rem; font: italic 400 1.22rem/1.5 var(--serif); }
.frame-inner .sign { margin: 1.4rem 0 0; }
.frame-inner .sign + .sign { margin-top: 0.9rem; }

/* ---------- 3. Venue ---------- */

.venue-hero { display: block; width: 100%; height: auto; aspect-ratio: 1600 / 635; min-height: 240px; max-height: 720px; object-fit: cover; object-position: center 60%; }
.venue-text { padding-top: clamp(3rem, 10vw, 5rem); }
.venue-note { max-width: 32rem; margin: 0 auto 1.1rem; font: italic 400 1.25rem/1.5 var(--serif); }
.venue-place { margin: 1.6rem 0 0; font: 400 0.95rem var(--caps); letter-spacing: 0.12em; text-transform: uppercase; }
.btn-frame {
  display: inline-block;
  margin: 2.25rem auto 0;
  padding: 0.7rem 2.6rem;
  border: 2px solid var(--ink);
  outline: 1px solid var(--ink);
  outline-offset: -6px;
  border-radius: 14px;
  font: italic 600 1.2rem var(--serif);
  color: var(--ink);
  text-decoration: none;
}
.btn-frame:hover { background: rgba(29, 27, 24, 0.05); }

/* ---------- 4. Kindly Reply: an open lace envelope on a sepia calla lily ---------- */

.reply-band {
  padding: clamp(3.5rem, 12vw, 6.5rem) 16px;
  background: #ece5d8 url('../assets/reply-bg.webp?v=9efc9d2c1b') center / cover no-repeat;
}
.open-envelope { position: relative; display: block; width: min(74vw, 440px); margin: 0 auto; color: var(--ink); text-decoration: none; container-type: inline-size; -webkit-tap-highlight-color: transparent; }
.open-envelope .env-photo { filter: drop-shadow(0 14px 22px rgba(90, 70, 40, 0.28)); }
.open-envelope:hover .env-photo { transform: translateY(-3px); }
/* Text printed on the blank card in the photo */
.reply-text-block {
  position: absolute;
  left: 18%;
  right: 18%;
  top: 29%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: transform 0.3s ease;
}
.open-envelope:hover .reply-text-block { transform: translateY(-3px); }
.reply-title { font: 400 11cqw/1.05 var(--script); }
.reply-text { margin-top: 2.5cqw; max-width: 54cqw; font: italic 400 4.3cqw/1.28 var(--serif); }

/* ---------- Details and RSVP pages ---------- */

.page-title { margin: 0 0 1.5rem; padding: 0 16px; font: 400 clamp(3rem, 13vw, 4.4rem)/1.15 var(--script); text-align: center; outline: none; }
.details { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4.5rem; max-width: 40rem; margin: 0 auto; padding: 0 16px; }
.event { text-align: center; min-width: 0; }
/* Full-bleed, edge to edge like the template, breaking out of the centred column */
.venue-photo { display: block; width: 100vw; max-width: none; height: auto; margin: 0 0 2.5rem calc(50% - 50vw); }
#view-details { overflow-x: clip; }
.venue-name { margin: 0.25rem 0 0.5rem; }
.schedule-card { margin-top: 2.5rem; }
.schedule-card .script { font-size: 2.8rem; margin-bottom: 1rem; }
.schedule { list-style: none; margin: 0 auto; padding: 0; max-width: 20rem; }
.schedule li { display: grid; grid-template-columns: 6.5rem 1fr; gap: 0.75rem; padding: 0.6rem 0; border-bottom: 1px solid #9a948a; text-align: left; }
.schedule .time { font: 600 0.95rem var(--serif); }
.schedule .what { font: italic 400 1.1rem var(--serif); }
.event .event-actions { margin-top: 1.5rem; }

.lede { max-width: 34rem; margin: 0 auto 2rem; padding: 0 16px; text-align: center; font: italic 400 1.2rem/1.55 var(--serif); color: var(--muted); }
#view-rsvp .rsvp { max-width: 36rem; margin: 0 auto; padding: 0 16px; }
#view-rsvp .rsvp-panel { padding: 0; border: 0; background: none; }

/* ---------- Venue story ---------- */

.event-about {
  margin: 0.6rem 0 0;
  min-height: 44px;
  padding: 0 0.25rem;
  background: none;
  border: 0;
  font: italic 400 1.1rem var(--serif);
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: var(--gold-light);
  text-underline-offset: 4px;
  cursor: pointer;
}
.event-about::after { content: ' →'; font-style: normal; color: var(--gold); }

.about-dialog {
  width: min(560px, calc(100% - 32px));
  max-height: calc(100dvh - 32px);
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: var(--fine, none), var(--card);
  color: var(--ink);
  box-shadow: 0 24px 60px rgba(40, 30, 15, 0.35);
  overflow: auto;
}
.about-dialog::backdrop { background: rgba(40, 32, 22, 0.55); backdrop-filter: blur(2px); }
.about-dialog[open] { animation: about-in 0.25s ease both; }
@keyframes about-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

.about-card { position: relative; outline: none; }
.about-close:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.about-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 253, 249, 0.92);
  color: var(--ink);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}
.about-figure { margin: 0; }
.about-figure img { display: block; width: 100%; height: auto; }
.about-figure figcaption { padding: 0.4rem 1rem 0; font-size: 0.7rem; text-align: right; }
.about-figure figcaption a { color: var(--muted); text-decoration: none; }
.about-body { padding: 0.75rem clamp(1.25rem, 5vw, 2rem) clamp(1.5rem, 5vw, 2rem); }
.about-body h3 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 2rem;
  color: var(--accent);
  margin: 0 0 0.75rem;
  text-align: center;
}
.about-body p { margin: 0 0 1rem; }
.about-place { font: 400 0.9rem var(--caps); letter-spacing: 0.12em; text-transform: uppercase; text-align: center; margin: 1.25rem 0 0 !important; font-style: normal !important; color: var(--ink) !important; }
.about-body p:nth-last-child(2), .about-body p:last-child:not(.about-place) {
  margin: 1.5rem 0 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.2rem;
  text-align: center;
  color: var(--accent);
}

/* ---------- Admin page ---------- */

.admin-bar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.5rem 16px;
  background: rgba(243, 240, 234, 0.94);
  border-bottom: 1px solid var(--line);
}
.admin-bar .nav-mark { font: 400 1.6rem var(--script); color: var(--ink); text-decoration: none; }
.admin-user { display: flex; align-items: center; gap: 1rem; min-width: 0; font-size: 0.85rem; }
.admin-email { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-user .link-btn { min-height: 44px; flex: none; }

.admin-main {
  max-width: 1120px;
  margin: 0 auto;
  padding: clamp(2rem, 6vw, 3.5rem) 16px 4rem;
}
.admin-loading, .admin-empty { text-align: center; color: var(--muted); }
.admin-signin { max-width: 480px; margin: 2rem auto 0; text-align: center; }

.admin-head { text-align: center; margin-bottom: 1.75rem; }
.admin-head .section-title { margin-bottom: 0.25rem; }
.admin-updated { margin: 0; color: var(--muted); font-size: 0.85rem; }

.admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
  gap: 1rem;
  margin-bottom: 1.75rem;
}
.admin-stat {
  background: var(--fine, none), var(--card);
  border: 1px solid var(--line);
  border-top: 3px solid var(--gold-light);
  border-radius: var(--radius);
  padding: 1.25rem;
  text-align: center;
}
.admin-stat p { margin: 0; }
.admin-stat-label {
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}
.admin-stat-num {
  font-family: var(--serif);
  font-size: 3rem;
  line-height: 1.1;
  color: var(--accent);
}
.admin-stat-sub { font-size: 0.85rem; color: var(--muted); }

.admin-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}
.admin-toolbar input,
.admin-toolbar select {
  font: inherit;
  font-weight: 400;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 0.9rem;
  min-height: 46px;
}
.admin-toolbar input { flex: 1 1 220px; min-width: 0; }
.admin-toolbar .btn { padding: 0 1.4rem; min-height: 46px; }

.admin-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  border: 1px solid var(--line);
  font-size: 0.92rem;
}
.admin-table th {
  text-align: left;
  font-weight: 500;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0.8rem;
  border-bottom: 1px solid var(--line);
}
.admin-table td { padding: 0.8rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.admin-table .admin-name { font-weight: 500; }
.admin-table .admin-note { max-width: 280px; white-space: pre-wrap; overflow-wrap: anywhere; }
.admin-table .is-yes { color: var(--accent); font-weight: 500; }
.admin-table .is-no { color: var(--muted); }
.admin-table .is-na { color: var(--line); }

/* Phones: one card per RSVP */
@media (max-width: 760px) {
  .admin-table, .admin-table tbody, .admin-table tr, .admin-table td { display: block; }
  .admin-table { border: 0; background: none; }
  .admin-table thead { display: none; }
  .admin-table tr {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 0.5rem 1rem;
    margin-bottom: 0.75rem;
  }
  .admin-table td {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.45rem 0;
    border-bottom: 1px solid var(--line);
    text-align: right;
  }
  .admin-table td:last-child { border-bottom: 0; }
  .admin-table td::before {
    content: attr(data-label);
    flex: none;
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
    text-align: left;
    padding-top: 0.15rem;
  }
  .admin-table td::before { font-weight: 400; }
  .admin-table .admin-name { font-family: var(--serif); font-size: 1.25rem; }
  .admin-stats { grid-template-columns: repeat(2, 1fr); gap: 0.5rem; }
  .admin-stat { padding: 0.75rem 0.4rem; }
  .admin-stat-label { font-size: 0.65rem; letter-spacing: 0.12em; }
  .admin-stat-num { font-size: 2.2rem; }
  .admin-stat-sub { font-size: 0.72rem; line-height: 1.4; }
  .admin-table .admin-note { max-width: none; }
  .admin-toolbar .btn { flex: 1 1 auto; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
  }
  html { scroll-behavior: auto; }
}

/* ---------- Photo editor (private edit link only) ---------- */

.pe-dialog {
  width: min(440px, calc(100% - 24px));
  max-height: calc(100dvh - 24px);
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: var(--fine), var(--ivory);
  color: var(--ink);
  box-shadow: 0 24px 60px rgba(30, 24, 14, 0.4);
  overflow: auto;
}
.pe-dialog::backdrop { background: rgba(30, 26, 20, 0.5); }
.pe-body { display: flex; flex-direction: column; align-items: center; gap: 0.9rem; padding: 1.75rem 1.25rem 1.25rem; text-align: center; }
.pe-title { margin: 0; font: 400 2.4rem/1.1 var(--script); }
.pe-help { margin: 0; font: italic 400 1.1rem/1.4 var(--serif); color: var(--muted); }
.pe-choose { cursor: pointer; }
.pe-stage {
  display: block;
  width: min(100%, 240px);
  height: auto;
  aspect-ratio: 4 / 5;
  margin: 0.25rem auto 0;
  background: #d9d5ce;
  filter: grayscale(1) contrast(1.08);
  touch-action: none;
  cursor: grab;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
}
.pe-zoom { display: flex; align-items: center; gap: 0.75rem; margin-top: 0.75rem; font: italic 400 1.05rem var(--serif); }
.pe-zoom input { width: 170px; }
.pe-status { min-height: 1.4em; margin: 0; font: italic 400 1rem/1.4 var(--serif); }
.pe-status.is-error { color: var(--error); }
.pe-actions { display: flex; flex-direction: column; align-items: center; gap: 0.4rem; }
.pe-actions .link-btn { min-height: 44px; font: italic 400 1.05rem var(--serif); }
.pe-code { width: min(100%, 260px); margin: 0.25rem 0 0; text-align: left; }
.pe-code span { font: italic 400 1.05rem var(--serif); }

/* Lace frame settles in a moment after the photo backdrop, like the template.
   Replays whenever the welcome page is shown (it goes from hidden to visible). */
.lace-photo { animation: lace-in 1.1s cubic-bezier(0.22, 0.7, 0.2, 1) 0.3s both; }
@keyframes lace-in {
  from { opacity: 0; transform: scale(0.975); filter: blur(3px); }
  to { opacity: 1; transform: none; filter: none; }
}
/* Keep "NIKKAH · SATURDAY, 19 DECEMBER 2026" on one line on phones */
.event > .caps { font-size: clamp(0.66rem, 3vw, 0.95rem); letter-spacing: clamp(0.06em, 0.8vw, 0.12em); white-space: nowrap; }

/* Admin: couple-photo preview (same markup as the invitation, smaller) */
.admin-photo { margin-top: 3.5rem; text-align: center; }
.admin-photo .section-title { margin-bottom: 0.25rem; }
.admin-photo .admin-updated { margin-bottom: 1.25rem; }
.admin-photo-band { padding: 2rem 16px; border-radius: var(--radius); }
.admin-photo-band .lace-photo { width: min(78vw, 340px); }
.admin-photo .btn { margin-top: 1.25rem; }
.admin-tabs { display: flex; justify-content: center; gap: 1.5rem; margin: 0 0 2rem; }
.admin-tabs a { padding: 0.5rem 0.25rem; font: italic 400 1.15rem var(--serif); color: var(--ink); text-underline-offset: 5px; }

/* Admin: schedule editor */
.admin-schedule { max-width: 34rem; margin-left: auto; margin-right: auto; text-align: left; }
.admin-schedule .section-title, .admin-schedule .admin-updated { text-align: center; }
.sched-rows { display: grid; gap: 0.5rem; margin: 0.5rem 0 0.75rem; }
.sched-row { display: grid; grid-template-columns: 6.5rem 1fr 44px; gap: 0.5rem; }
.sched-row input { min-width: 0; font: 400 1.05rem var(--serif); padding: 0.6rem 0.7rem; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(255,255,255,0.6); color: var(--ink); }
.sched-remove { border: 0; background: none; font-size: 1.5rem; color: var(--muted); cursor: pointer; }
.admin-schedule .link-btn { min-height: 44px; font: italic 400 1.05rem var(--serif); }
.sched-actions { display: flex; flex-direction: column; align-items: center; gap: 0.25rem; margin-top: 1rem; }

/* Welcome venue block: where and when, with the venue story behind a small link */
.venue-where { margin: 0.25rem 0 0.4rem; font: 400 clamp(0.9rem, 3.6vw, 1.05rem) var(--caps); letter-spacing: 0.14em; text-transform: uppercase; }
.venue-date { margin: 0; font: italic 400 1.2rem var(--serif); color: var(--muted); }
.venue-text .event-about { display: block; margin: 0.9rem auto 0; }
.venue-text .btn-frame { margin-top: 1.25rem; }

/* Admin: open the live invitation in a new tab */
.admin-preview { padding: 0.65rem 1rem; font-size: 0.72rem; letter-spacing: 0.14em; white-space: nowrap; }

/* Published photos carry their own black-and-white amount (set in /admin), so no extra greying */
.paper-photo.is-custom { filter: none; }
.photo-band.is-custom::before { filter: blur(10px) brightness(0.72) contrast(1.05); }
.pe-zoom output { min-width: 2.6em; font: 400 0.95rem var(--serif); color: var(--muted); }

.sched-times { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.admin-schedule textarea { min-height: 9rem; font: 400 1.05rem/1.5 var(--serif); }
.event-time { margin-bottom: 0.25rem; }

/* Kindly Reply: make the envelope read as tappable (lift + glow, hand cursor, pulsing tap lines) */
.open-envelope { cursor: pointer; transition: transform 0.35s ease; }
.open-envelope .env-photo { transition: transform 0.35s ease, filter 0.35s ease; }
.open-envelope:hover, .open-envelope:focus-visible { transform: translateY(-6px); }
.open-envelope:hover .env-photo, .open-envelope:focus-visible .env-photo {
  filter: drop-shadow(0 22px 30px rgba(30, 24, 14, 0.38)) drop-shadow(0 0 18px rgba(255, 250, 238, 0.85));
}
.open-envelope:active { transform: translateY(-2px) scale(0.985); }
.tap-hint {
  position: absolute;
  top: 26%;
  width: 11%;
  color: #7d6e58;
  animation: tap-pulse 2.4s ease-in-out infinite;
  pointer-events: none;
}
.tap-hint svg { display: block; width: 100%; height: auto; }
.tap-hint-l { left: -14%; }
.tap-hint-r { right: -14%; transform: scaleX(-1); }
@keyframes tap-pulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}
.reply-text { font-size: 5.2cqw; }
.reply-band { overflow-x: clip; }


/* RSVP: one identical row per guest */
.guests { border: 0; padding: 0; margin: 0 0 1.5rem; }
.guests legend { padding: 0; font: italic 400 1.6rem var(--serif); }
.guests .field-hint { margin: 0.2rem 0 0.9rem; }
.field-hint { font: italic 400 1rem var(--serif); color: var(--muted); }
.guest-row { padding: 0.75rem 0; border-bottom: 1px solid var(--line); }
.guest-row:first-child { border-top: 1px solid var(--line); }
.guest-name {
  width: 100%; font: 400 1.15rem var(--serif); color: var(--ink);
  padding: 0.75rem 0.9rem; border: 1px solid #4a4640; border-radius: 4px; background: rgba(255,255,255,0.35);
}
.guest-meta { display: flex; align-items: center; justify-content: space-between; margin-top: 0.5rem; }
.age-toggle { display: inline-flex; border: 1px solid #b9b3a9; border-radius: 999px; overflow: hidden; }
.age-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.age-toggle label {
  min-width: 4.6rem; padding: 0.55rem 1rem; text-align: center; cursor: pointer;
  font: 400 1rem var(--serif); color: var(--muted);
  touch-action: manipulation; -webkit-tap-highlight-color: transparent; user-select: none;
}
.age-toggle input:checked + label { background: #3d3a35; color: #f6f3ed; }
.age-toggle input:focus-visible + label { outline: 2px solid var(--gold); outline-offset: -2px; }
.guest-remove, .add-guest {
  min-height: 44px; border: 0; background: none; cursor: pointer;
  font: italic 400 1.05rem var(--serif); color: var(--ink); text-decoration: underline; text-underline-offset: 3px;
}
.guest-remove { color: var(--muted); }
.add-guest { margin-top: 0.4rem; padding: 0; }
.rsvp-delete { min-height: 44px; color: var(--error); font: italic 400 1rem var(--serif); }
