:root {
  /* Palette: Burgundy, Blush, Hydrangea Green, Wine Fruit, Ivory */
  --burgundy: #641624;
  --blush: #d8a99e;
  --wine: #823843;
  --ivory: #e8dfd5;
  --ink: #3a1f22;
  --muted: #8a6f68;
  --sage: #7a7a4f;
  --poppy: #823843;
  --line: #e8dfd5;
  --bg: #f8f1e8;
  --card: #fdf8f2;
  --script: 'Bodoni Moda', Didot, 'Didot LT STD', 'Bodoni 72', Georgia, serif;
  --serif: 'EB Garamond', Georgia, serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.2rem;
  line-height: 1.6;
}
.script { font-family: var(--script); font-weight: 400; font-optical-sizing: auto; letter-spacing: .02em; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: rgba(248,241,232,.96);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
  display: flex; flex-direction: column; align-items: center;
  padding: .6rem 16px .4rem;
}
.brand {
  display: flex; align-items: center; gap: .6rem;
  color: var(--ink); text-decoration: none;
  font-size: clamp(1.6rem, 4.2vw, 2.2rem); line-height: 1; text-transform: uppercase; letter-spacing: .1em;
}
.brand-flower { width: 56px; height: 40px; }
.tabs { display: flex; flex-wrap: wrap; justify-content: center; gap: .2rem 2.4rem; margin-top: .3rem; }
.tabs a {
  color: var(--ink); text-decoration: none;
  letter-spacing: .14em; font-size: 1.15rem; font-weight: 500;
  padding: .3rem 0; border-bottom: 1px solid transparent;
  transition: color .2s;
}
.tabs a:hover { color: var(--sage); }
.tabs a.active { color: var(--sage); }

.tabs .short { display: none; }

/* Hamburger + slide-in menu (shown on phones only, see mobile media query) */
.menu-toggle {
  display: none; position: absolute; left: 8px; top: 10px; width: 44px; height: 44px;
  flex-direction: column; justify-content: center; align-items: center; gap: 5px;
  background: none; border: 0; padding: 0; cursor: pointer;
}
.menu-toggle span { display: block; width: 22px; height: 1.5px; background: var(--burgundy); }
.drawer {
  position: fixed; top: 0; bottom: 0; left: 0; z-index: 30; width: min(82vw, 320px);
  display: flex; flex-direction: column; padding: 1rem 1.5rem 1.5rem;
  background: var(--bg); box-shadow: 4px 0 30px rgba(58, 31, 34, .18);
  transform: translateX(-100%); visibility: hidden; transition: transform .28s ease, visibility .28s;
}
.drawer.open { transform: none; visibility: visible; }
.drawer-backdrop {
  position: fixed; inset: 0; z-index: 25; background: rgba(58, 31, 34, .35);
  opacity: 0; visibility: hidden; transition: opacity .28s, visibility .28s;
}
body.menu-open { overflow: hidden; }
body.menu-open .drawer-backdrop { opacity: 1; visibility: visible; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.drawer-brand { font-size: 1.35rem; color: var(--burgundy); text-transform: uppercase; letter-spacing: .1em; }
.drawer-close { background: none; border: 0; font-size: 2rem; line-height: 1; color: var(--burgundy); cursor: pointer; padding: .2rem .4rem; }
.drawer a {
  display: block; padding: .9rem 0; border-bottom: 1px solid var(--ivory);
  color: var(--ink); text-decoration: none; letter-spacing: .1em; font-size: 1.12rem;
}
.drawer a.active { color: var(--sage); }
.drawer-foot { margin-top: auto; color: var(--muted); font-size: .9rem; letter-spacing: .12em; }
@media (min-width: 641px) { .drawer, .drawer-backdrop { display: none; } }

/* Hero */
/* The opening fills exactly one screen below the sticky header (--header-h is set in app.js),
   so the next section never peeks in half-cut; a small arrow invites scrolling instead. */
.hero {
  position: relative; text-align: center; overflow: hidden;
  min-height: calc(100svh - var(--header-h, 140px));
  display: flex; flex-direction: column; padding-bottom: .6rem;
}
.garland { display: block; width: 100%; height: clamp(130px, min(26vw, 34svh), 330px); flex: none; }
.hero-body { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.scroll-cue {
  align-self: center; margin-top: .4rem; background: none; border: 0; padding: .4rem .8rem; cursor: pointer;
  color: var(--wine); opacity: .75; animation: cue-bob 2.4s ease-in-out infinite;
}
.scroll-cue:hover { opacity: 1; }
.scroll-cue svg { width: 30px; height: 30px; display: block; }
@keyframes cue-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(7px); } }
@media (prefers-reduced-motion: reduce) { .scroll-cue { animation: none; } }
.story { scroll-margin-top: var(--header-h, 140px); }
.hero-names {
  margin: -1rem 0 0; position: relative;
  display: flex; flex-direction: column; align-items: center; line-height: .95;
}
.hero-names .big { font-size: clamp(2.4rem, min(7.5vw, 9svh), 4.8rem); text-transform: uppercase; letter-spacing: .08em; color: var(--burgundy); }
.hero-names .and { font-size: clamp(1.1rem, 2vw, 1.5rem); font-style: italic; margin: .3rem 0 .5rem; color: var(--muted); }
.hero-date { letter-spacing: .18em; text-transform: uppercase; font-size: .95rem; margin-top: clamp(1rem, 3svh, 2rem); }
.countdown { color: var(--sage); font-style: italic; }

/* Content */
.tab-panel[hidden] { display: none; }
.content { max-width: 1100px; margin: 0 auto; padding: 2rem 16px 4rem; }
.narrow { max-width: 620px; margin-left: auto; margin-right: auto; }
.narrow-text { max-width: 620px; margin: 0 auto 2rem; }
.center { text-align: center; }
.section-title { color: var(--burgundy); text-align: center; font-size: clamp(2.4rem, 6vw, 3.4rem); margin: .5rem 0 1.5rem; line-height: 1.1; }

.muted { color: var(--muted); }
a { color: var(--wine); }

/* Invitation */
.invitation {
  text-align: center; border: 1px solid var(--blush); outline: 1px solid var(--ivory); outline-offset: 6px;
  background: var(--card); padding: 2.5rem 1.5rem; margin: 1rem 0;
}
.invitation p { margin: 0; }
.invite-photo { margin: -2.5rem -1.5rem 2rem; aspect-ratio: 2.25 / 1; overflow: hidden; border-bottom: 1px solid var(--blush); }
.invite-photo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 35%; display: block; }
.invite-names { font-size: clamp(2rem, 5.5vw, 2.7rem); color: var(--burgundy); line-height: 1.2; }
.invite-amp { font-size: 1.6rem; font-style: italic; color: var(--muted); }
.invite-text { margin: 1.4rem 0 1rem !important; font-style: italic; }
.invite-venue { letter-spacing: .14em; text-transform: uppercase; font-weight: 600; color: var(--wine); }
.invite-address { color: var(--muted); font-size: 1.05rem; }
.invite-date { margin-top: 1.4rem !important; letter-spacing: .18em; text-transform: uppercase; font-size: 1rem; }
.invite-rsvp { margin-top: 1.4rem !important; font-style: italic; color: var(--sage); }

/* Itinerary */
.day {
  color: var(--wine); font-weight: 500; letter-spacing: .12em; text-transform: uppercase;
  font-size: 1.05rem; border-bottom: 1px solid var(--blush); padding-bottom: .4rem; margin: 2.2rem 0 1rem;
}
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 9.5rem 1fr; gap: 1rem; padding: .55rem 0; border-bottom: 1px dashed var(--ivory); }
.timeline .time { color: var(--sage); font-weight: 600; }
@media (max-width: 480px) {
  .timeline li { grid-template-columns: 1fr; gap: 0; }
}

/* Gift registry intro: photo beside text (stacked on phones, photo first) */
.registry-intro {
  display: grid; grid-template-columns: 1fr 1fr; gap: clamp(1.5rem, 5vw, 3.5rem); align-items: center;
  max-width: 1000px; margin: 0 auto 3rem;
}
.registry-photo { aspect-ratio: 4 / 3; border: 0; box-shadow: 0 0 0 1px var(--blush), 0 0 0 8px var(--bg), 0 0 0 9px var(--ivory); }
.registry-text p { margin: 0 0 1rem; }
@media (max-width: 820px) {
  .registry-intro { grid-template-columns: 1fr; max-width: 520px; }
  .registry-text { text-align: center; }
}

/* Thank-you pages (after RSVP and after a gift) */
.thanks { max-width: 640px; margin: 0 auto; padding: 2rem 16px 4rem; text-align: center; }
.thanks-brand { display: inline-block; color: var(--burgundy); text-decoration: none; text-transform: uppercase; letter-spacing: .12em; font-size: 1.4rem; margin-bottom: 1.5rem; }
.thanks-photo { aspect-ratio: 16 / 9; overflow: hidden; margin-bottom: 2rem; box-shadow: 0 0 0 1px var(--blush), 0 0 0 8px var(--bg), 0 0 0 9px var(--ivory); }
.thanks-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thanks-lead { font-size: 1.35rem; font-style: italic; color: var(--wine); margin-bottom: .6rem; }
.thanks-date { letter-spacing: .14em; text-transform: uppercase; font-size: .9rem; color: var(--sage); margin-top: 1.4rem; }
.thanks-actions { display: flex; gap: .8rem; justify-content: center; flex-wrap: wrap; margin-top: 2rem; }
.thanks-actions .btn { text-decoration: none; display: inline-block; }
.btn.btn-outline { background: transparent; color: var(--burgundy); box-shadow: inset 0 0 0 1px var(--burgundy); }
.btn.btn-outline:hover { background: var(--burgundy); color: #fdf8f2; }
.thanks-sign { font-size: 1.6rem; font-style: italic; color: var(--burgundy); margin-top: 2.5rem; }

/* Stationery */
/* Video on top, then photos two per row (one per row on phones) */
.stationery-wrap { max-width: 980px; margin: 0 auto; }
.stationery-wrap figure { margin: 0; }
.stationery-video { margin-bottom: clamp(2.5rem, 6vw, 4rem) !important; }
.stationery-video[hidden] { display: none; }
.stationery-video video {
  display: block; margin: 0 auto; max-width: 100%; max-height: 78svh; background: var(--ivory);
  box-shadow: 0 0 0 1px var(--blush), 0 0 0 10px var(--card), 0 0 0 11px var(--ivory), 0 18px 40px rgba(100, 22, 36, .12);
}
.stationery-video video.cropped { width: min(100%, 640px); object-fit: cover; }
.stationery-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 3.5rem) clamp(1.5rem, 4vw, 3rem); align-items: center; }
.stationery-grid img {
  width: 100%; height: auto; display: block; cursor: zoom-in;
  box-shadow: 0 0 0 1px var(--blush), 0 0 0 10px var(--card), 0 0 0 11px var(--ivory), 0 18px 40px rgba(100, 22, 36, .12);
  transition: transform .25s ease;
}
.stationery-grid a:hover img { transform: translateY(-3px); }
.stationery-wrap .photo-caption { min-height: 0; margin-top: 1.4rem; font-size: 1.05rem; }
@media (max-width: 640px) {
  .stationery-grid { grid-template-columns: 1fr; }
}

/* Sofreh Aghd and Menu pages: card photo beside its text, then a list of names and meanings */
.card-shot { display: block; cursor: zoom-in; max-width: 400px; margin: 0 auto; }
.tables-shot .card-shot { max-width: none; }
.card-shot img {
  width: 100%; height: auto; display: block;
  box-shadow: 0 0 0 1px var(--blush), 0 0 0 10px var(--card), 0 0 0 11px var(--ivory), 0 18px 40px rgba(100, 22, 36, .12);
  transition: transform .25s ease;
}
.card-shot:hover img { transform: translateY(-3px); }
.story-text h3 { color: var(--burgundy); font-size: clamp(1.9rem, 4vw, 2.5rem); font-weight: 400; margin: 0 0 1.2rem; line-height: 1.15; }
.course-list { margin: 0 0 1.2rem; }
.course-list dt { color: var(--wine); font-weight: 600; letter-spacing: .14em; text-transform: uppercase; font-size: .88rem; margin-top: 1rem; }
.course-list dt:first-child { margin-top: 0; }
.course-list dd { margin: .15rem 0 0; }
.persian-line { color: var(--sage); font-style: italic; }
.persian-line [lang="fa"] { font-family: 'Noto Naskh Arabic', serif; font-style: normal; font-size: 1.5rem; color: var(--burgundy); margin-right: .4rem; }
.day.center { border-bottom: 0; margin-top: 1rem; }
.symbol-list {
  list-style: none; margin: 0 auto clamp(2.5rem, 6vw, 4rem); padding: 0; max-width: 1000px;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem;
}
.symbol-list li {
  background: var(--card); border: 1px solid var(--line); border-radius: 4px; padding: 1rem 1.1rem;
  display: flex; flex-direction: column; gap: .15rem; text-align: center;
}
.symbol-name { color: var(--burgundy); font-size: 1.2rem; font-weight: 500; letter-spacing: .04em; }
.symbol-fa { color: var(--sage); font-size: .85rem; letter-spacing: .14em; text-transform: uppercase; }
.symbol-meaning { color: var(--muted); font-style: italic; }
.tables-shot { max-width: 760px; margin: 0 auto 2.5rem; }
@media (max-width: 640px) {
  .symbol-list { grid-template-columns: 1fr 1fr; gap: .6rem; }
  .symbol-list li { padding: .8rem .5rem; }
  .symbol-name { font-size: 1.08rem; }
  .symbol-meaning { font-size: .95rem; line-height: 1.35; }
}
.timeline a { color: inherit; text-decoration-color: var(--blush); text-underline-offset: 3px; }
.timeline a:hover { color: var(--sage); }

/* Travel */
.venue { font-style: normal; text-align: center; line-height: 1.7; }
.map-btn { display: inline-block; margin-top: 1rem; text-decoration: none; }
.sign-off { font-size: 1.5rem; font-style: italic; color: var(--burgundy); line-height: 1.3; margin-top: 2.5rem; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.5rem; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 4px;
  padding: 1.6rem; text-align: center; font: inherit; color: inherit;
}
.card h3 { margin: 0 0 .4rem; font-weight: 500; letter-spacing: .08em; font-size: 1.4rem; }
.card .when { color: var(--sage); margin: 0; }
.card .where { color: var(--muted); }
.fund {
  text-decoration: none; cursor: pointer; transition: border-color .2s, transform .2s;
  display: flex; flex-direction: column; align-items: center; gap: .35rem; overflow: hidden;
}
/* Photo frames: show the image, or a soft placeholder until the file is added */
.photo-frame { position: relative; display: block; overflow: hidden; background: var(--ivory); border: 1px solid var(--blush); }
.photo-frame img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-frame.missing { background: repeating-linear-gradient(45deg, #f3e9df 0 12px, #eee2d6 12px 24px); }
.photo-frame.missing img { display: none; }
.photo-frame.missing[data-label]::after {
  content: attr(data-label); position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-style: italic; padding: 1rem; text-align: center;
}
/* About: alternating photo / text rows (stacked on phones, photo first) */
.story { max-width: 1000px; padding-bottom: 1rem; }
.story-row { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(1.5rem, 5vw, 4rem); align-items: center; margin-bottom: clamp(2.5rem, 7vw, 5rem); }
.story-row.reverse .story-figure { order: 2; }
.story-figure { margin: 0; }
.photo-caption {
  margin-top: 1.1rem; text-align: center; color: var(--muted); font-style: italic; font-size: .98rem;
  line-height: 1.4; min-height: 2.8em; transition: opacity .6s ease;
}
.photo-caption.fading { opacity: 0; }
.story-photo { aspect-ratio: 4 / 5; border: 0; box-shadow: 0 0 0 1px var(--blush), 0 0 0 8px var(--bg), 0 0 0 9px var(--ivory); }
.slideshow .slide { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 1.2s ease; }
.slideshow .slide.active { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .slideshow .slide { transition: none; } }
.story-text h2 { color: var(--burgundy); font-size: clamp(2rem, 4.5vw, 2.8rem); margin: 0 0 1rem; line-height: 1.15; }
.story-text p { margin: 0 0 1rem; }
.story-links { color: var(--sage); font-style: italic; }
@media (max-width: 820px) {
  .story-row { grid-template-columns: 1fr; max-width: 520px; margin-left: auto; margin-right: auto; }
  .story-row.reverse .story-figure { order: 0; }
  .story-text { text-align: center; }
}
.fund-photo { aspect-ratio: 3 / 2; align-self: stretch; margin: -1.6rem -1.6rem .6rem; border: 0; border-bottom: 1px solid var(--ivory); }
.fund-photo .fund-icon { display: none; }
.fund-photo.missing .fund-icon { display: block; position: absolute; inset: 0; margin: auto; width: 64px; height: 64px; }
.fund-icon { width: 52px; height: 52px; fill: none; stroke: var(--wine); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.fund-day { color: var(--sage); letter-spacing: .14em; text-transform: uppercase; font-size: .8rem; }
.fund-title { font-weight: 500; font-size: 1.3rem; letter-spacing: .04em; color: var(--burgundy); line-height: 1.25; }
.fund-desc { color: var(--muted); font-size: 1rem; line-height: 1.45; flex: 1; }
.progress { width: 100%; height: 6px; background: var(--ivory); border-radius: 3px; overflow: hidden; margin-top: .4rem; }
.progress span { display: block; height: 100%; background: var(--sage); }
.fund-meta { font-size: .9rem; color: var(--muted); }
.fund-cta { margin-top: .3rem; font-size: .85rem; letter-spacing: .12em; text-transform: uppercase; color: var(--wine); }
/* Page for one gift (#gift/<id>): the card on the left, the payment form on the right */
.back-link { display: inline-block; margin-bottom: 1.5rem; color: var(--wine); text-decoration: none; letter-spacing: .08em; }
.back-link:hover { text-decoration: underline; }
.gift-page { display: grid; grid-template-columns: 1fr 1.1fr; gap: 3rem; align-items: start; max-width: 1000px; margin: 0 auto; }
.gift-detail { display: flex; flex-direction: column; gap: .5rem; text-align: center; }
.gift-detail .fund-photo { margin: 0 0 .6rem; border: 1px solid var(--blush); }
.gift-detail .fund-title { margin: 0; font-size: 1.7rem; }
.gift-detail .fund-desc { margin: 0; font-size: 1.1rem; }
.gift-secure { margin: .5rem 0 0; font-size: .95rem; }
@media (max-width: 820px) {
  .gift-page { grid-template-columns: 1fr; gap: 2rem; max-width: 560px; }
}
.funds-heading { margin-top: 3rem; border-bottom: 0; }
.funds { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.fund:hover, .fund.selected { border-color: var(--sage); transform: translateY(-2px); }
.fund.selected { box-shadow: 0 0 0 1px var(--sage); }

/* Forms */
.form { display: flex; flex-direction: column; gap: 1rem; margin-top: 2rem; }
.form[hidden] { display: none; }
.form label { display: flex; flex-direction: column; gap: .3rem; font-size: 1.05rem; }
.form label.inline { flex-direction: row; align-items: center; gap: .5rem; }
.form fieldset { border: 1px solid var(--line); padding: .8rem 1rem; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: .3rem 1rem; }
.form input, .form textarea {
  font: inherit; color: inherit; padding: .55rem .7rem; border: 1px solid var(--blush); border-radius: 3px; background: #fffaf4;
}
.form input:focus, .form textarea:focus { outline: 2px solid var(--sage); outline-offset: 1px; }
.btn {
  font: inherit; letter-spacing: .12em; text-transform: uppercase; font-size: .95rem;
  background: var(--burgundy); color: #fdf8f2; border: 0; padding: .85rem 1.2rem; cursor: pointer; border-radius: 3px;
}
.btn:hover { background: var(--sage); }
.btn:disabled { opacity: .6; cursor: wait; }
.amounts { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; }
.amounts button {
  font: inherit; color: inherit; padding: .5rem; background: #fffaf4; border: 1px solid var(--blush); cursor: pointer; border-radius: 3px;
}
.amounts button:hover, .amounts button.selected { border-color: var(--sage); color: var(--sage); }
.req { color: var(--wine); font-weight: 600; }
.req-note { margin: 0; text-align: center; font-size: .95rem; color: var(--wine); }
.req-note[hidden] { display: none; }
#gift-form .btn:disabled { cursor: not-allowed; }
.form-status { min-height: 1.5em; text-align: center; margin: 0; }
.form-status.error { color: var(--poppy); }
.form-status.ok { color: var(--sage); }

.site-footer { text-align: center; padding: 2rem 16px 3rem; border-top: 1px solid var(--line); color: var(--muted); }
.site-footer .script { font-size: 1.6rem; text-transform: uppercase; letter-spacing: .1em; color: var(--burgundy); }
.site-footer p { margin: 0; letter-spacing: .15em; font-size: .9rem; }

/* ---------- Mobile: everything in one column ---------- */
@media (max-width: 640px) {
  body { font-size: 1.1rem; }
  .site-header { padding: .5rem 0 0; }
  /* only the three quick links on top; everything else lives in the hamburger menu */
  .menu-toggle { display: flex; }
  .brand { padding: 0 52px; }
  .tabs { flex-wrap: nowrap; gap: 1.8rem; margin-top: .25rem; padding-bottom: .2rem; }
  .tabs a:not(.quick) { display: none; }
  .tabs a { white-space: nowrap; font-size: 1.02rem; letter-spacing: .08em; }
  .tabs .long { display: none; }
  .tabs .short { display: inline; }
  .brand-flower { width: 44px; height: 32px; }

  .content { padding: 1.5rem 16px 3rem; }
  .cards, .funds { grid-template-columns: 1fr; gap: 1.2rem; }
  .card { padding: 1.3rem; }
  .fund-photo { aspect-ratio: 16 / 9; margin: -1.3rem -1.3rem .5rem; }
  .amounts { gap: .35rem; }
  .amounts button { padding: .5rem .2rem; font-size: .95rem; white-space: nowrap; }
  .checks { grid-template-columns: 1fr; }
  .invitation { padding: 2rem 1rem; }
  .invite-photo { margin: -2rem -1rem 1.6rem; aspect-ratio: 16 / 9; }
  .hero { padding-bottom: 1rem; }
  /* phones are tall and narrow: a taller garland (cropped at the sides) and larger names fill the screen */
  .garland { height: clamp(170px, 30svh, 280px); }
  .hero-names .big { font-size: clamp(3rem, 15vw, 4.2rem); }
  .hero-names .and { font-size: 1.4rem; }
  .hero-date { letter-spacing: .12em; font-size: .85rem; padding: 0 16px; }
  .narrow-text { margin-bottom: 1.5rem; }
}
