/* Shared mechanics reused by every public invitation template — the parts
   tied to shared JS behavior (public-invite.js) or accessibility/legal
   requirements, not visual style. Each template's own CSS file supplies the
   actual look (typography, color, spacing, decoration) on top of this. */

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  --accent: #c98a6b;
  --ink: #2b2420;
  --muted: #7a6f63;
  --bg: #fdfbf8;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--accent); }

.draft-banner {
  background: #2b2420; color: #fff; text-align: center; font-size: .82rem;
  padding: .5rem 1rem; position: sticky; top: 0; z-index: 20;
}
.draft-banner a { color: #f0d9bd; margin-left: .6rem; }

.locale-float { position: fixed; top: .75rem; right: .75rem; z-index: 15; }
.locale-float-btn { background: rgba(255,255,255,.85); border: 1px solid rgba(0,0,0,.08); border-radius: 999px; padding: .35rem .7rem; font-size: .78rem; cursor: pointer; backdrop-filter: blur(4px); }

/* Hero photo is always a plain <img> banner, never a background with text
   overlaid on top — contrast against arbitrary guest-uploaded photos proved
   unreliable, so names/date/RSVP always render as normal HTML text below it. */
.hero-photo { width: 100%; overflow: hidden; }
.hero-photo img { width: 100%; height: 100%; object-fit: cover; }

/* Cover / opening gate — fixed full-screen overlay, hidden via JS class
   toggle on the click-to-open button (also the audio-autoplay gesture). */
#cover {
  position: fixed; inset: 0; z-index: 40; background: var(--bg);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 2rem 1.5rem; transition: opacity .6s ease, visibility .6s ease;
}
#cover.cover-hidden { opacity: 0; visibility: hidden; pointer-events: none; }
#cover-open-btn { border: none; cursor: pointer; font-family: inherit; }

/* Scroll-in animation — toggled by IntersectionObserver in public-invite.js */
#invite-content > section {
  opacity: 0; transform: translateY(16px);
  transition: opacity .6s ease, transform .6s ease;
}
#invite-content > section.in-view { opacity: 1; transform: none; }

/* Floating music toggle, positioned identically across templates */
#music-toggle {
  position: fixed; bottom: 1rem; right: .75rem; z-index: 15;
  width: 2.5rem; height: 2.5rem; border-radius: 999px; border: 1px solid rgba(0,0,0,.08);
  background: rgba(255,255,255,.9); color: var(--accent); font-size: 1.1rem; cursor: pointer;
  backdrop-filter: blur(4px); box-shadow: 0 2px 10px rgba(0,0,0,.08);
}

/* Countdown tiles — layout is shared, look is templated */
.countdown-tiles { display: flex; justify-content: center; gap: .75rem; flex-wrap: wrap; width: 100%; margin: 0 auto; }
.countdown-tile { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 4.2rem; padding: .85rem .5rem; }
.countdown-value { font-size: 1.6rem; font-weight: 700; color: var(--accent); line-height: 1; }
.countdown-label { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-top: .35rem; }
.countdown-arrived { text-align: center; font-size: 1.15rem; color: var(--accent); font-weight: 600; }

/* RSVP form field base — inputs stay consistent, the card chrome is templated */
.rsvp-card label { display: block; font-size: .85rem; font-weight: 600; margin: 1rem 0 .35rem; }
.rsvp-card label:first-child { margin-top: 0; }
.rsvp-card input, .rsvp-card select, .rsvp-card textarea {
  width: 100%; padding: .65rem .75rem; border: 1px solid #e6e0d8; border-radius: 8px; font-size: 1rem; font-family: inherit;
}
.rsvp-card textarea { min-height: 5rem; resize: vertical; }
.rsvp-social-proof { text-align: center; font-size: .88rem; color: var(--accent); font-weight: 600; margin: 0 0 1rem; }
.radio-row { display: flex; gap: 1rem; flex-wrap: wrap; margin-top: .35rem; }
.radio-row label { display: flex; align-items: center; gap: .4rem; margin: 0; font-weight: 500; }
.radio-row input { width: auto; }
.rsvp-btn { border: none; cursor: pointer; font-family: inherit; font-weight: 600; color: #fff; background: var(--accent); }
.thanks-msg { text-align: center; background: #f0f6ee; color: #3e6b3e; border-radius: 10px; padding: 1.25rem; font-size: .95rem; }
.rsvp-error { background: #fdf1ee; color: #a8402a; border-radius: 8px; padding: .75rem 1rem; font-size: .85rem; margin-bottom: 1rem; }

.wish-attending-yes { color: #3e6b3e; }
.wish-attending-no { color: #a8402a; }

.field-hint { font-size: .85rem; color: var(--muted); }

footer { text-align: center; padding: 2.5rem 1rem 3rem; color: var(--muted); font-size: .8rem; }

/* Photo lightbox (public-invite.js) — dark overlay + centered image, opt-in
   per template by adding `.lightbox-gallery` to a gallery's wrapper. */
.lightbox-overlay {
  position: fixed; inset: 0; z-index: 60; display: none;
  align-items: center; justify-content: center;
  background: rgba(10, 8, 14, .92); padding: 2.5rem 1rem;
}
.lightbox-overlay.open { display: flex; }
.lightbox-img { max-width: 92vw; max-height: 86vh; object-fit: contain; border-radius: 6px; }
.lightbox-close, .lightbox-prev, .lightbox-next {
  position: fixed; border: none; background: rgba(255,255,255,.12); color: #fff;
  width: 44px; height: 44px; border-radius: 50%; font-size: 1.6rem; line-height: 1;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background .2s ease;
}
.lightbox-close:hover, .lightbox-prev:hover, .lightbox-next:hover { background: rgba(255,255,255,.24); }
.lightbox-close { top: 1rem; right: 1rem; }
.lightbox-prev { left: 1rem; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 1rem; top: 50%; transform: translateY(-50%); }
@media (max-width: 480px) {
  .lightbox-prev, .lightbox-next { width: 38px; height: 38px; font-size: 1.3rem; }
}
