/* Shared structure across all four wedding-page themes (plan.md Rule 2:
   content/behaviour stays theme-agnostic — only presentation varies per
   theme, defined in themes/*.css). This file covers the RSVP form and
   footer, which are the same partial (wedding/partials/rsvpForm.ejs,
   wedding/partials/footer.ejs) on every theme, plus the one breakpoint
   every theme layout shares: 768px, per plan.md's locked responsive rule. */

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body.wedding-page { margin: 0; color: #1a1a1a; -webkit-font-smoothing: antialiased; }
.wedding-page img { max-width: 100%; display: block; }
.wedding-container { max-width: 900px; margin: 0 auto; padding: 0 24px; }

.wedding-section { padding: 64px 0; }
.wedding-section h2 { margin: 0 0 24px; }

/* RSVP */
.rsvp-section { padding: 64px 0; }
.rsvp-card { max-width: 480px; margin: 0 auto; padding: 32px; border-radius: 12px; }
.rsvp-card .field { margin-bottom: 16px; }
.rsvp-card label { display: block; margin-bottom: 6px; font-size: 0.85rem; font-weight: 600; }
.rsvp-card input, .rsvp-card select, .rsvp-card textarea {
  width: 100%; padding: 12px; border-radius: 8px; border: 1px solid rgba(0, 0, 0, 0.15); font: inherit;
}
.rsvp-typeahead { position: relative; }
.rsvp-typeahead-results {
  position: absolute; left: 0; right: 0; top: 100%; z-index: 5; background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.15); border-top: none; border-radius: 0 0 8px 8px; max-height: 220px; overflow-y: auto;
}
.rsvp-typeahead-results button {
  display: block; width: 100%; text-align: left; padding: 10px 12px; background: none; border: none; cursor: pointer; font: inherit;
}
.rsvp-typeahead-results button:hover { background: rgba(0, 0, 0, 0.05); }
.rsvp-privacy-notice { font-size: 0.75rem; opacity: 0.75; margin-top: 12px; }
.rsvp-message { font-size: 0.9rem; margin-top: 12px; }
.rsvp-message.rsvp-message-error { color: #d1364a; }

/* Footer */
.wedding-brand-footer { padding: 48px 24px; text-align: center; }
.wedding-brand-footer img { margin: 0 auto 16px; max-height: 28px; }
.wedding-brand-footer a { text-decoration: underline; }

@media (max-width: 768px) {
  .wedding-section { padding: 40px 0; }
  .rsvp-card { padding: 24px; margin: 0 16px; }
}

/* Scroll-reveal: shared base for any theme's redesign (wedding-motion.js
   toggles .is-visible via IntersectionObserver). A theme opts an element
   in just by adding data-reveal — no per-theme CSS needed for the
   mechanism itself, only the transform-origin/timing choices belong in
   theme files if they want to diverge. Starts revealed (no [data-reveal]
   selector matches) until JS runs, so content is never hidden if the
   script fails to load. */
[data-reveal] { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s ease; }
[data-reveal].is-visible { opacity: 1; transform: translateY(0); }
[data-reveal-delay="1"] { transition-delay: .1s; }
[data-reveal-delay="2"] { transition-delay: .2s; }
[data-reveal-delay="3"] { transition-delay: .3s; }
[data-reveal-delay="4"] { transition-delay: .4s; }

@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1; transform: none; transition: none; }
  * { scroll-behavior: auto !important; }
}

/* Responsive section-nav hamburger toggle — shared mechanics
   (wedding-motion.js's initNavToggle flips .is-open on the sibling
   [data-nav-links]); each theme only has to give this a color and decide,
   in its own mobile breakpoint, how [data-nav-links] behaves once
   .is-open is toggled (see themes/*.css's own "@media (max-width: ...)"
   nav rules). Hidden by default — every theme's own breakpoint switches
   it to display:flex once the inline link row no longer fits. */
.wedding-nav-toggle {
  display: none; flex-direction: column; justify-content: center; align-items: center; gap: 5px;
  width: 34px; height: 34px; padding: 0; border: none; background: none; cursor: pointer; flex-shrink: 0;
}
.wedding-nav-toggle span { display: block; width: 100%; height: 2px; background: currentColor; transition: transform .25s ease, opacity .25s ease; }
.wedding-nav-toggle.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.wedding-nav-toggle.is-open span:nth-child(2) { opacity: 0; }
.wedding-nav-toggle.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Gallery lightbox overlay — chrome only; wedding-motion.js creates and
   toggles this on any [data-lightbox] gallery, so it's shared rather than
   duplicated per theme. */
.wedding-lightbox {
  position: fixed; inset: 0; z-index: 2000; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 16px; padding: 40px 24px; background: rgba(10, 10, 10, 0.92);
  opacity: 0; visibility: hidden; transition: opacity .25s ease;
}
.wedding-lightbox.is-open { opacity: 1; visibility: visible; }
.wedding-lightbox img { max-width: min(92vw, 1100px); max-height: 80vh; width: auto; object-fit: contain; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5); }
.wedding-lightbox-caption { color: #f2f2f2; font-size: 0.85rem; text-align: center; max-width: 600px; }
.wedding-lightbox-caption[hidden] { display: none; }
.wedding-lightbox-close {
  position: absolute; top: 20px; right: 24px; width: 40px; height: 40px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.08); color: #fff; font-size: 1.4rem; line-height: 1; cursor: pointer;
}
.wedding-lightbox-close:hover { background: rgba(255, 255, 255, 0.18); }

/* Hero video modal — same overlay chrome as the gallery lightbox above,
   just holding a 16:9 iframe frame instead of an <img>. wedding-motion.js
   creates/toggles this on any [data-video-play] trigger. */
.wedding-video-modal {
  position: fixed; inset: 0; z-index: 2000; display: flex; align-items: center; justify-content: center;
  padding: 40px 24px; background: rgba(10, 10, 10, 0.92);
  opacity: 0; visibility: hidden; transition: opacity .25s ease;
}
.wedding-video-modal.is-open { opacity: 1; visibility: visible; }
.wedding-video-modal-frame { width: min(92vw, 1100px); aspect-ratio: 16 / 9; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5); }
.wedding-video-modal-frame iframe { width: 100%; height: 100%; border: 0; }
.wedding-video-modal-close {
  position: absolute; top: 20px; right: 24px; width: 40px; height: 40px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.08); color: #fff; font-size: 1.4rem; line-height: 1; cursor: pointer;
}
.wedding-video-modal-close:hover { background: rgba(255, 255, 255, 0.18); }

/* Hero "watch our video" trigger — a circular play button; each theme
   only needs to position it (its own .X-hero-play rule) and can restyle
   color/size, the play-triangle icon and hover lift are shared. */
.wedding-hero-play {
  display: inline-flex; align-items: center; justify-content: center; width: 64px; height: 64px; border-radius: 50%;
  border: none; background: rgba(255, 255, 255, 0.92); color: #16181c; cursor: pointer; margin: 16px 8px 0; vertical-align: middle;
  transition: transform .25s ease, background .25s ease;
}
.wedding-hero-play:hover, .wedding-hero-play:focus-visible { background: #fff; transform: scale(1.06); }
.wedding-hero-play svg { width: 22px; height: 22px; margin-left: 3px; }

/* Wedding hashtag — plain inherited color/font by design, so it always
   matches whatever text color each theme's hero already sets. */
.wedding-hero-hashtag { font-size: .78rem; letter-spacing: .06em; opacity: .82; margin: 0 0 16px; }

/* Slice 2b: canvas editing affordances — only ever present when
   body[data-edit-mode="true"] (routes/builderPreview.js), never on a real
   guest's view of /wedding/:slug. Scoped under that attribute rather than
   relying solely on contenteditable/data-swap-image being absent, so
   nothing here can visually leak even if that ever changed. */
body[data-edit-mode="true"] [contenteditable] {
  /* Visible at rest, not just on hover — a couple scanning the canvas
     should be able to tell what's editable without having to sweep their
     mouse over everything first. */
  outline: 1px dashed rgba(60, 120, 255, 0.28);
  border-radius: 2px;
  cursor: text;
}
body[data-edit-mode="true"] [contenteditable]:hover {
  outline-color: rgba(60, 120, 255, 0.65);
}
body[data-edit-mode="true"] [contenteditable]:focus {
  outline: 2px solid rgba(60, 120, 255, 0.8);
  outline-offset: 2px;
}
body[data-edit-mode="true"] [data-swap-image] {
  cursor: pointer;
  position: relative;
  min-height: 48px;
  outline: 1px dashed rgba(60, 120, 255, 0.28);
}
body[data-edit-mode="true"] [data-swap-image]:hover {
  outline-color: rgba(60, 120, 255, 0.65);
}
body[data-edit-mode="true"] [data-swap-image]:hover::after {
  content: "Click to change photo";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  text-align: center;
  padding: 8px;
}
body[data-edit-mode="true"] .canvas-save-badge {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 1000;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(20, 20, 24, 0.85);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
}
