/* Davethane — invitation themes + invitation page */

/* ================= THEME VARIABLES ================= */
.theme-zarif {
  --inv-bg: #f6efe3;
  --inv-pattern: radial-gradient(circle at 1px 1px, rgba(176, 141, 87, .18) 1px, transparent 0) 0 0 / 22px 22px;
  --inv-card: #fffdf8; --inv-line: #e3d3b4; --inv-text: #3d3226; --inv-muted: #8a7a63;
  --inv-accent: #a8844e; --inv-on-accent: #fff;
  --inv-script: 'Great Vibes', cursive; --inv-body: 'Cormorant Garamond', Georgia, serif;
  --inv-orn: '❦'; --inv-body-size: 1.2rem;
}
.theme-bahar {
  --inv-bg: #fbeef0;
  --inv-pattern: radial-gradient(circle at 8% 12%, #f5d0d6 0, transparent 26%), radial-gradient(circle at 92% 88%, #f4dccf 0, transparent 30%), radial-gradient(circle at 90% 12%, #ebe0f3 0, transparent 22%), radial-gradient(circle at 10% 90%, #e3efe0 0, transparent 24%);
  --inv-card: rgba(255, 255, 255, .88); --inv-line: #f0c9cf; --inv-text: #4a3036; --inv-muted: #a07580;
  --inv-accent: #c0627a; --inv-on-accent: #fff;
  --inv-script: 'Dancing Script', cursive; --inv-script-weight: 700; --inv-body: 'Playfair Display', Georgia, serif;
  --inv-orn: '✿ ❀ ✿'; --inv-body-size: 1.05rem;
}
.theme-gece {
  --inv-bg: #0d1830;
  --inv-pattern: radial-gradient(1px 1px at 20px 30px, rgba(255,255,255,.9), transparent), radial-gradient(1px 1px at 120px 80px, rgba(255,255,255,.7), transparent), radial-gradient(1.5px 1.5px at 60px 150px, rgba(212,175,55,.9), transparent), radial-gradient(1px 1px at 170px 170px, rgba(255,255,255,.6), transparent), radial-gradient(1px 1px at 90px 10px, rgba(255,255,255,.5), transparent), linear-gradient(180deg, #0d1830, #16264a);
  --inv-pattern-size: 200px 200px, 200px 200px, 200px 200px, 200px 200px, 200px 200px, 100% 100%;
  --inv-card: rgba(19, 33, 61, .92); --inv-line: rgba(212, 175, 55, .45); --inv-text: #ece6d6; --inv-muted: #a9a28f;
  --inv-accent: #d9b453; --inv-on-accent: #0d1830;
  --inv-script: 'Great Vibes', cursive; --inv-body: 'Cinzel', Georgia, serif;
  --inv-orn: '✦ ✧ ✦'; --inv-body-size: 1rem;
}
.theme-kina {
  --inv-bg: #6a0e1e;
  --inv-pattern: linear-gradient(45deg, rgba(232,194,122,.07) 25%, transparent 25%, transparent 75%, rgba(232,194,122,.07) 75%), linear-gradient(45deg, rgba(232,194,122,.07) 25%, transparent 25%, transparent 75%, rgba(232,194,122,.07) 75%);
  --inv-pattern-size: 32px 32px; --inv-pattern-pos: 0 0, 16px 16px;
  --inv-card: #7b1426; --inv-line: rgba(232, 194, 122, .55); --inv-text: #f7e8d2; --inv-muted: #e0bfa0;
  --inv-accent: #e8c27a; --inv-on-accent: #5a0b18;
  --inv-script: 'Pinyon Script', cursive; --inv-body: 'Cormorant Garamond', Georgia, serif;
  --inv-orn: '❖'; --inv-body-size: 1.2rem;
}
.theme-gokyuzu {
  --inv-bg: #e4f0fb;
  --inv-pattern: radial-gradient(ellipse 120px 40px at 15% 10%, #fff 60%, transparent 62%), radial-gradient(ellipse 160px 50px at 85% 22%, #fff 60%, transparent 62%), radial-gradient(ellipse 140px 44px at 20% 80%, #fff 60%, transparent 62%), radial-gradient(ellipse 120px 40px at 80% 92%, #fff 60%, transparent 62%);
  --inv-card: rgba(255, 255, 255, .93); --inv-line: #bcd6ee; --inv-text: #1d3550; --inv-muted: #6b84a0;
  --inv-accent: #2d6ca3; --inv-on-accent: #fff;
  --inv-script: 'Dancing Script', cursive; --inv-script-weight: 600; --inv-body: 'Nunito', system-ui, sans-serif;
  --inv-orn: '☁ ★ ☁'; --inv-body-size: 1.05rem;
}
.theme-kutlama {
  --inv-bg: #fff7ea;
  --inv-pattern: radial-gradient(circle at 20px 20px, #f4a261 3px, transparent 4px), radial-gradient(circle at 80px 60px, #e85d75 3px, transparent 4px), radial-gradient(circle at 50px 100px, #2a9d8f 3px, transparent 4px), radial-gradient(circle at 110px 20px, #7b6cf6 3px, transparent 4px), radial-gradient(circle at 100px 110px, #f6c945 3px, transparent 4px);
  --inv-pattern-size: 130px 130px;
  --inv-card: #ffffff; --inv-line: #f6d9c4; --inv-text: #3a2a3a; --inv-muted: #8b7682;
  --inv-accent: #e4566f; --inv-on-accent: #fff;
  --inv-script: 'Pacifico', cursive; --inv-body: 'Fredoka', system-ui, sans-serif;
  --inv-orn: '★ ✦ ★'; --inv-body-size: 1.05rem;
}
.theme-minimal {
  --inv-bg: #f2f1ee;
  --inv-pattern: none;
  --inv-card: #ffffff; --inv-line: #dddcd8; --inv-text: #161616; --inv-muted: #6f6f6f;
  --inv-accent: #161616; --inv-on-accent: #fff;
  --inv-script: 'Playfair Display', Georgia, serif; --inv-script-style: italic; --inv-script-weight: 500;
  --inv-body: 'Inter', system-ui, sans-serif;
  --inv-orn: '—'; --inv-body-size: 1rem;
}

/* Theme swatches in pickers/thumbnails use the same pattern variables */
.theme-swatch, .inv-thumb, .hero-phone {
  background-color: var(--inv-bg);
  background-image: var(--inv-pattern, none);
  background-size: var(--inv-pattern-size, auto);
  background-position: var(--inv-pattern-pos, 0 0);
}
.inv-script { font-family: var(--inv-script); font-style: var(--inv-script-style, normal); font-weight: var(--inv-script-weight, 400); }
.inv-thumb-title { font-family: var(--inv-script); font-style: var(--inv-script-style, normal); color: var(--inv-accent); }

/* ================= INVITATION PAGE ================= */
body.inv-page {
  margin: 0; min-height: 100vh; color: var(--inv-text); background-color: var(--inv-bg);
  font-family: var(--inv-body); font-size: var(--inv-body-size, 1.1rem); line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
/* Fixed background layer (background-attachment: fixed is unreliable on iOS) */
body.inv-page::before {
  content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-color: var(--inv-bg); background-image: var(--inv-pattern, none);
  background-size: var(--inv-pattern-size, auto); background-position: var(--inv-pattern-pos, 0 0);
}
body.inv-page:not(.cover-opened) { overflow: hidden; }
.inv-page a { color: var(--inv-accent); }

/* ---------- Cover (opening screen) ---------- */
.inv-cover {
  position: fixed; inset: 0; z-index: 1500; display: grid; place-items: center; padding: 24px;
  background-color: var(--inv-bg); background-image: var(--inv-pattern, none);
  background-size: var(--inv-pattern-size, auto); background-position: var(--inv-pattern-pos, 0 0);
  transition: opacity .9s ease, transform .9s ease;
}
.inv-cover.opened { opacity: 0; transform: scale(1.06); pointer-events: none; }
.cover-inner { text-align: center; max-width: 420px; animation: fadeUp 1s ease both; }
.cover-seal {
  width: 92px; height: 92px; margin: 0 auto 22px; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--inv-accent) 70%, #fff), var(--inv-accent));
  color: var(--inv-on-accent); font-size: 2.2rem; box-shadow: 0 10px 30px rgba(0,0,0,.18), inset 0 0 0 4px rgba(255,255,255,.18);
  animation: pulse 2.4s ease-in-out infinite;
}
.cover-kicker { letter-spacing: .32em; text-transform: uppercase; font-size: .8rem; color: var(--inv-muted); margin: 0 0 6px; }
.cover-title { font-size: clamp(2.6rem, 11vw, 4rem); line-height: 1.1; color: var(--inv-accent); margin: 0 0 10px; overflow-wrap: anywhere; }
.cover-date { letter-spacing: .14em; margin: 0 0 28px; }
.cover-btn {
  font: inherit; font-size: 1rem; letter-spacing: .08em; cursor: pointer; padding: 14px 34px; border-radius: 99px;
  border: 0; background: var(--inv-accent); color: var(--inv-on-accent); box-shadow: 0 8px 24px rgba(0,0,0,.15); transition: transform .15s;
}
.cover-btn:hover { transform: translateY(-2px); }

/* ---------- Card ---------- */
.inv-wrap { padding: 32px 16px 40px; }
.inv-card {
  position: relative; max-width: 560px; margin: 0 auto; padding: 56px 36px 48px; text-align: center;
  background: var(--inv-card); border: 1px solid var(--inv-line); border-radius: 6px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .08);
}
.inv-card::after { content: ''; position: absolute; inset: 10px; border: 1px solid var(--inv-line); border-radius: 3px; pointer-events: none; }
.theme-kutlama .inv-card, .theme-gokyuzu .inv-card, .theme-bahar .inv-card { border-radius: 26px; }
.theme-kutlama .inv-card::after, .theme-gokyuzu .inv-card::after, .theme-bahar .inv-card::after { border-radius: 18px; border-style: dashed; }
.theme-minimal .inv-card { border-radius: 0; box-shadow: none; }
.theme-minimal .inv-card::after { display: none; }
@media (max-width: 480px) { .inv-card { padding: 48px 22px 40px; } }

.inv-ornament { color: var(--inv-accent); font-size: 1.1rem; letter-spacing: .4em; opacity: .85; }
.inv-ornament::before { content: var(--inv-orn); }
.inv-ornament.top { margin-bottom: 14px; }
.inv-ornament.bottom { margin-top: 30px; }

.inv-kicker { letter-spacing: .32em; text-transform: uppercase; font-size: .78rem; color: var(--inv-muted); margin: 0 0 22px; }
.inv-photo { margin: 0 auto 26px; width: 74%; max-width: 330px; }
.inv-photo img {
  width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 999px 999px 18px 18px;
  border: 6px solid var(--inv-card); box-shadow: 0 0 0 1px var(--inv-line), 0 14px 34px rgba(0,0,0,.14);
}
.theme-minimal .inv-photo img { border-radius: 0; }
.theme-kutlama .inv-photo img, .theme-gokyuzu .inv-photo img { border-radius: 50%; aspect-ratio: 1; }
.inv-title { font-size: clamp(2.5rem, 10vw, 3.7rem); line-height: 1.12; color: var(--inv-accent); margin: 0 0 8px; overflow-wrap: anywhere; }
.theme-kutlama .inv-title { font-size: clamp(2.1rem, 8.5vw, 3rem); }
.theme-minimal .inv-title { font-size: clamp(2.1rem, 8vw, 3rem); }
.inv-divider { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 10px auto 22px; color: var(--inv-accent); }
.inv-divider::before, .inv-divider::after { content: ''; height: 1px; width: 70px; background: var(--inv-accent); opacity: .5; }
.inv-divider span::before { content: var(--inv-orn); font-size: .9rem; letter-spacing: .3em; }
.inv-text { margin: 0 auto 30px; max-width: 420px; white-space: normal; overflow-wrap: anywhere; }

.inv-date { margin: 0 auto 26px; }
.inv-date-day { letter-spacing: .3em; text-transform: uppercase; font-size: .82rem; color: var(--inv-muted); margin-bottom: 6px; }
.inv-date-row { display: flex; align-items: center; justify-content: center; gap: 16px; }
.inv-date-side { min-width: 92px; padding: 7px 0; border-top: 1px solid var(--inv-line); border-bottom: 1px solid var(--inv-line); letter-spacing: .2em; text-transform: uppercase; font-size: .85rem; }
.inv-date-num { font-size: 3.4rem; line-height: 1; color: var(--inv-accent); font-weight: 600; min-width: 64px; }
.inv-date-time { margin-top: 10px; letter-spacing: .14em; font-size: 1rem; }
@media (max-width: 400px) { .inv-date-side { min-width: 74px; font-size: .74rem; letter-spacing: .12em; } .inv-date-num { font-size: 2.8rem; } }

.countdown { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; max-width: 340px; margin: 0 auto 34px; }
.countdown div { padding: 10px 4px; border: 1px solid var(--inv-line); border-radius: 10px; background: color-mix(in srgb, var(--inv-card) 70%, var(--inv-bg)); }
.countdown b { display: block; font-size: 1.45rem; color: var(--inv-accent); line-height: 1.1; font-variant-numeric: tabular-nums; }
.countdown small { font-size: .66rem; letter-spacing: .1em; text-transform: uppercase; color: var(--inv-muted); }
.countdown-done { font-style: italic; color: var(--inv-muted); }

.inv-venue { border-top: 1px solid var(--inv-line); padding-top: 26px; }
.inv-venue-icon { font-size: 1.4rem; }
.inv-venue-name { font-family: var(--inv-body); font-size: 1.35rem; font-weight: 600; margin: 4px 0 4px; letter-spacing: .02em; }
.inv-venue-addr { color: var(--inv-muted); margin: 0 auto 16px; max-width: 420px; font-size: .95em; }
.inv-map { height: 220px; border-radius: 12px; border: 1px solid var(--inv-line); margin: 0 0 16px; z-index: 0; }
.inv-buttons { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.inv-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 10px 16px; border-radius: 99px; text-decoration: none;
  border: 1px solid var(--inv-accent); color: var(--inv-accent) !important; font-size: .9rem; font-family: var(--inv-body);
  transition: .15s; background: transparent;
}
.inv-btn:first-child { background: var(--inv-accent); color: var(--inv-on-accent) !important; }
.inv-btn:hover { transform: translateY(-1px); }

.inv-brand { text-align: center; font-size: .78rem; color: var(--inv-muted); margin: 26px 0 0; letter-spacing: .05em; }
.inv-brand a { color: inherit; }

/* ---------- Music toggle ---------- */
.music-toggle {
  position: fixed; right: 16px; bottom: 16px; z-index: 1400; width: 50px; height: 50px; border-radius: 50%; cursor: pointer;
  border: 0; background: var(--inv-accent); color: var(--inv-on-accent); font-size: 1.4rem; box-shadow: 0 8px 20px rgba(0,0,0,.2);
}
.music-toggle.playing { animation: spin 4s linear infinite; }
.music-toggle:not(.playing)::after { content: ''; position: absolute; left: 12px; right: 12px; top: 50%; height: 2px; background: currentColor; transform: rotate(-45deg); }

/* ---------- Reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }

@keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .cover-seal, .music-toggle.playing { animation: none; }
  .reveal { opacity: 1; transform: none; }
}

/* Leaflet inside dark themes */
.inv-page .leaflet-control-attribution { font-size: 10px; }

/* ---------- "Made with davethane" footer (same on every theme) ---------- */
.dv-promo {
  max-width: 420px; margin: 34px auto 8px; padding: 22px 22px 20px; text-align: center;
  background: #fff; color: #20262c; border-radius: 20px; border: 1px solid rgba(32, 38, 44, .08);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .10);
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; font-size: 15px; line-height: 1.5;
}
.dv-promo-logo { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }
.dv-promo-logo img:first-child { height: 34px; width: auto; }
.dv-promo-logo img:last-child { height: 22px; width: auto; margin-top: 3px; }
.dv-promo-slogan { margin: 8px 0 6px; color: #fc4d56; font-weight: 600; }
.dv-promo-text { margin: 0 0 12px; color: #5b636b; font-size: 14px; }
.dv-promo-offer { margin: 0 0 14px; padding: 8px 12px; border-radius: 12px; background: #ffeced; color: #b81f2c; font-size: 14px; }
.dv-promo-btn {
  display: inline-block; padding: 11px 22px; border-radius: 999px; background: #de2c3a; color: #fff !important;
  text-decoration: none; font-weight: 600; font-size: 15px; transition: transform .15s, background .15s;
}
.dv-promo-btn:hover { background: #bd2230; transform: translateY(-1px); }
.dv-promo-note { margin: 14px 0 0; padding-top: 12px; border-top: 1px dashed #e5dcdc; font-size: 12.5px; color: #6b737c; }

/* ---------- Voice message player ---------- */
.inv-voice {
  position: relative; display: flex; align-items: center; gap: 14px; max-width: 420px; margin: 0 auto 30px; padding: 14px 16px;
  border: 1px solid var(--inv-line); border-radius: 18px; text-align: left;
  background: color-mix(in srgb, var(--inv-card) 70%, var(--inv-bg));
}
.voice-play {
  flex: none; width: 52px; height: 52px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--inv-accent); color: var(--inv-on-accent); font-size: 1.05rem; box-shadow: 0 6px 16px rgba(0,0,0,.15);
}
.voice-play.playing { animation: pulse 1.6s ease-in-out infinite; }
.voice-meta { flex: 1; min-width: 0; }
.voice-title { font-size: .95rem; margin-bottom: 8px; color: var(--inv-text); }
.voice-bar { height: 6px; border-radius: 6px; background: color-mix(in srgb, var(--inv-line) 60%, transparent); cursor: pointer; overflow: hidden; }
.voice-bar span { display: block; height: 100%; width: 0; background: var(--inv-accent); transition: width .2s linear; }
.voice-time { font-size: .75rem; color: var(--inv-muted); margin-top: 5px; font-variant-numeric: tabular-nums; }

/* ---------- Photo gallery ---------- */
.inv-gallery { position: relative; margin: 0 -8px 30px; }
.gal-track { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 4px 8px 10px; -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
.gal-item { flex: 0 0 62%; max-width: 240px; padding: 0; border: 0; background: none; cursor: zoom-in; scroll-snap-align: center; }
.gal-item img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 14px; border: 4px solid var(--inv-card); box-shadow: 0 0 0 1px var(--inv-line), 0 8px 20px rgba(0,0,0,.1); }
.gal-hint { font-size: .78rem; color: var(--inv-muted); letter-spacing: .05em; }
.lightbox { position: fixed; inset: 0; z-index: 3000; background: rgba(10,10,12,.92); display: flex; align-items: center; justify-content: center; }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 92vw; max-height: 84vh; border-radius: 10px; }
.lightbox button { position: absolute; background: rgba(255,255,255,.12); color: #fff; border: 0; border-radius: 50%; width: 46px; height: 46px; font-size: 1.6rem; cursor: pointer; line-height: 1; }
.lb-close { top: 16px; right: 16px; }
.lb-prev { left: 12px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 12px; top: 50%; transform: translateY(-50%); }
.lb-count { position: absolute; bottom: 18px; left: 0; right: 0; text-align: center; color: rgba(255,255,255,.8); font-size: .85rem; font-family: system-ui, sans-serif; }
body.lb-open { overflow: hidden; }

/* Preview-only note on extras added after publishing */
.pending-badge { position: absolute; top: -11px; right: 10px; z-index: 2; font-family: system-ui, sans-serif; font-size: 11px; font-weight: 600; background: #fff4e0; color: #8a5b00; border: 1px solid #f6d79c; padding: 3px 8px; border-radius: 99px; }
.inv-venue { position: relative; }
.lightbox button[hidden] { display: none; }
