/*
Theme Name: KJ Wedding
Theme URI: https://wedding.mirabz.com
Author: KJ Wedding
Author URI: https://wedding.mirabz.com
Description: Custom presentation theme for Kimberly & Johnkhem's wedding site — envelope-opening intro, countdown, RSVP, shared photo album, and entourage sections, ported from the original Node.js/Express/EJS site. Requires the "KJ Wedding Core" plugin for all data storage and forms; this theme is presentation only and holds no application data.
Version: 1.0.0
Requires at least: 5.9
Requires PHP: 8.1
Tested up to: 6.6
License: GPL v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: kj-wedding
Tags: wedding, custom, minimal

This stylesheet is enqueued via wp_enqueue_style() in functions.php
(get_stylesheet_uri()) — never linked with a hard-coded path. All url()
references below are relative to this file's own location (the theme
root), pointing into assets/img/ and resolving correctly regardless of
what domain/subdirectory the theme is installed under.
*/

/* ==========================================================
   Kimberly & Johnkhem — Wedding Site
   Ported from the original Node.js/Express/EJS application's
   public/css/style.css. Class names, custom properties, and animations are
   preserved as-is so the design renders identically; only asset url()
   paths were adjusted to be theme-relative (see header comment above).
   ========================================================== */

/* ==========================================================
   Kimberly & Johnkhem — Wedding RSVP Site
   "Save the Date" brick-terracotta pass: --deep is now set to the exact
   background color (#A73F24) sampled from the couple's Save-the-Date card,
   used as the site's dominant background tone on the hero and other dark
   sections. --ink is a deeper shade of the SAME hue (not a neutral
   espresso/brown) so the hero reads as one cohesive brick-terracotta
   surface with subtle vignette depth, matching the flat card background
   instead of a brown-to-rust gradient. --accent (gold) and its lighter
   tints stay put — gold text/CTAs against solid terracotta is exactly the
   card's own look (gold "Bryan & Shyra" script, cream headline type).
   ========================================================== */

:root {
  /* Locks the page to the light palette below regardless of the device's
     OS/browser dark-mode setting. The <meta name="color-scheme"> tag in
     each view covers page background/UA chrome; this covers form controls
     (inputs, selects, textareas) which some mobile browsers re-theme to
     dark independently unless told the page is light-only. Together they
     keep every guest seeing the same designed colors, day mode or not. */
  color-scheme: light only;

  --ink: #5c2113;
  --deep: #a73f24;
  --accent: #cf771c;
  --accent-light: #da9246;
  --accent-soft: #d9b079;
  --cream: #faf5f0;
  --white: #ffffff;

  --font-heading: 'Playfair Display', Georgia, serif;
  --font-script: 'Great Vibes', cursive;
  --font-body: 'Cormorant Garamond', Georgia, serif;

  --shadow-soft: 0 10px 40px rgba(92, 33, 19, 0.25);
  --transition: 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);

  /* ----------------------------------------------------------------
     Granular design tokens (Wedding Website → Design & Colors /
     Typography / Layout in wp-admin). These are static fallback
     defaults ONLY — kj-wedding-core injects a #kjw-dynamic-vars
     <style> block in wp_head that re-declares whichever of these an
     administrator has actually changed, so editing a color/font/
     spacing field in wp-admin updates the whole site with no CSS
     file edits. Keep these values in sync with
     KJW_Config_Defaults::get_design_defaults() so a fresh install
     (before the plugin ever writes its own option) still renders
     identically to the fallback below.
     ---------------------------------------------------------------- */
  --kjw-primary-dark: var(--ink);
  --kjw-secondary-dark: var(--deep);
  --kjw-primary-accent: var(--accent);
  --kjw-secondary-accent: var(--accent-light);
  --kjw-page-bg: var(--cream);
  --kjw-alt-section-bg: #f5ebe0;
  --kjw-card-bg: var(--white);
  --kjw-header-bg: var(--cream);
  --kjw-footer-bg: var(--ink);
  --kjw-heading-text: var(--ink);
  --kjw-body-text: var(--ink);
  --kjw-muted-text: rgba(92, 33, 19, 0.7);
  --kjw-nav-text: var(--ink);
  --kjw-button-bg: var(--accent);
  --kjw-button-text: var(--white);
  --kjw-button-hover-bg: var(--accent-light);
  --kjw-link-color: var(--accent);
  --kjw-link-hover-color: var(--accent-light);
  --kjw-border-color: var(--accent-soft);
  --kjw-form-bg: var(--white);
  --kjw-form-text: var(--ink);
  --kjw-success-color: #3f7d4e;
  --kjw-error-color: #a63838;
  --kjw-overlay-color: rgba(92, 33, 19, 0.55);
  --kjw-envelope-color: var(--deep);
  --kjw-wax-seal-color: var(--deep);
  --kjw-decorative-tint: var(--accent-soft);

  --kjw-font-heading: var(--font-heading);
  --kjw-font-script: var(--font-script);
  --kjw-font-body: var(--font-body);
  --kjw-font-nav: var(--font-body);
  --kjw-base-font-size: 19px;
  --kjw-heading-size-h1: 56px;
  --kjw-heading-size-h2: 40px;
  --kjw-heading-size-h3: 28px;
  --kjw-heading-size-h4: 22px;
  --kjw-mobile-heading-size-h1: 36px;
  --kjw-mobile-heading-size-h2: 28px;
  --kjw-mobile-heading-size-h3: 22px;
  --kjw-mobile-heading-size-h4: 18px;
  --kjw-body-line-height: 1.6;
  --kjw-heading-line-height: 1.2;
  --kjw-letter-spacing: 0.5px;
  --kjw-heading-weight: 600;
  --kjw-body-weight: 400;

  --kjw-content-max-width: 1100px;
  --kjw-wide-max-width: 1300px;
  --kjw-section-padding-y: 90px;
  --kjw-mobile-section-padding-y: 48px;
  --kjw-card-radius: 18px;
  --kjw-button-radius: 999px;
  --kjw-field-radius: 10px;
  --kjw-border-width: 1px;
  --kjw-header-height: 84px;
  --kjw-logo-size: 44px;
  --kjw-decorative-size: 100px;
  --kjw-shadow-alpha: 0.25;
}

* { box-sizing: border-box; }
/* Guard rail: some components set an explicit `display` (buttons, flex
   containers, etc.) which — being an author rule — outranks the browser's
   default `[hidden]{display:none}` UA style at equal specificity. Force
   hidden to always win so JS toggling via the `hidden` attribute is reliable
   everywhere on the site. */
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--kjw-font-body, var(--font-body));
  background: var(--kjw-page-bg, var(--cream));
  color: var(--kjw-body-text, var(--ink));
  font-size: var(--kjw-base-font-size, 19px);
  line-height: var(--kjw-body-line-height, 1.6);
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }

a { color: var(--kjw-link-color, inherit); text-decoration: none; }
a:hover { color: var(--kjw-link-hover-color, var(--accent-light)); }

h1, h2, h3, h4 {
  font-family: var(--kjw-font-heading, var(--font-heading));
  font-weight: var(--kjw-heading-weight, 600);
  line-height: var(--kjw-heading-line-height, 1.2);
  color: var(--kjw-heading-text, inherit);
  margin: 0 0 0.5em;
  letter-spacing: var(--kjw-letter-spacing, 0.5px);
}

.container {
  max-width: var(--kjw-content-max-width, 1100px);
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: var(--kjw-section-padding-y, 90px) 0;
  position: relative;
  overflow: hidden;
}
.section .container { position: relative; z-index: 1; } /* keep content above blobs */

.section-dark {
  background: linear-gradient(160deg, var(--ink), var(--deep));
  color: var(--cream);
}

/* Soft blurred color blobs behind light sections so frosted-glass cards
   have something visible to blur against. */
.section:not(.section-dark)::before,
.section:not(.section-dark)::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}
.section:not(.section-dark)::before {
  top: -120px; right: -100px;
  width: 380px; height: 380px;
  background: radial-gradient(circle, rgba(166, 114, 49, 0.22), transparent 70%);
  filter: blur(10px);
}
.section:not(.section-dark)::after {
  bottom: -140px; left: -110px;
  width: 360px; height: 360px;
  background: radial-gradient(circle, rgba(214, 190, 160, 0.4), transparent 70%);
  filter: blur(10px);
}

.eyebrow {
  display: block;
  font-family: var(--font-body);
  letter-spacing: 4px;
  text-transform: uppercase;
  font-size: 14px;
  color: var(--accent);
  margin-bottom: 14px;
  text-align: center;
}

.section-title {
  text-align: center;
  font-size: clamp(28px, 4vw, 42px);
  margin-bottom: 16px;
}

.section-subtitle {
  text-align: center;
  max-width: 560px;
  margin: 0 auto 50px;
  font-size: 20px;
  opacity: 0.85;
}

.divider {
  width: 230px;
  height: 71px;
  background-image: url('assets/img/garland.png');
  background-image: image-set(url('assets/img/garland.webp') type('image/webp'), url('assets/img/garland.png') type('image/png'));
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  margin: 4px auto 30px;
  position: relative;
  opacity: 0.95;
}

/* ---------- Nav ---------- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  background: rgba(92, 33, 19, 0.0);
  transition: background var(--transition), padding var(--transition), box-shadow var(--transition);
}
.navbar.scrolled {
  background: rgba(92, 33, 19, 0.92);
  backdrop-filter: blur(8px);
  padding: 12px 24px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}
.nav-monogram {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  transition: transform var(--transition);
}
.nav-monogram img {
  display: block;
  height: 42px;
  width: auto;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.35));
  transition: height var(--transition);
}
.navbar.scrolled .nav-monogram img { height: 34px; }
.nav-monogram:hover { transform: scale(1.04); }
.nav-links { display: flex; gap: 26px; list-style: none; margin: 0; padding: 0; }
.nav-links a {
  color: var(--cream);
  font-size: 15px;
  letter-spacing: 1px;
  text-transform: uppercase;
  position: relative;
  padding-bottom: 4px;
}
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  width: 0; height: 1px;
  background: var(--accent);
  transition: width var(--transition);
}
.nav-links a:hover::after { width: 100%; }
.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--cream);
  font-size: 26px;
  cursor: pointer;
  position: relative;
  z-index: 620;
}

@media (max-width: 780px) {
  .nav-links {
    position: fixed;
    top: 0; right: -100%;
    height: 100vh;
    width: 72%;
    max-width: 320px;
    background: linear-gradient(180deg, var(--ink), var(--deep));
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 28px;
    transition: right var(--transition);
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.3);
    z-index: 600;
  }
  .nav-links.open { right: 0; }
  .nav-toggle { display: block; }
}

/* ---------- Hero ---------- */
.hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  z-index: 0;
  background:
    radial-gradient(circle at 20% 20%, rgba(166, 114, 49, 0.18), transparent 45%),
    radial-gradient(circle at 80% 80%, rgba(166, 114, 49, 0.14), transparent 45%),
    linear-gradient(160deg, var(--ink) 0%, var(--deep) 55%, var(--ink) 100%);
  color: var(--cream);
  overflow: hidden;
  padding: 140px 20px 80px;
}
.hero::before,
.hero::after {
  content: '';
  position: absolute;
  inset: 14px;
  border: 1px solid rgba(166, 114, 49, 0.35);
  pointer-events: none;
}
.hero::after { inset: 22px; border-width: 1px; opacity: 0.5; }

.hero-floral-watermark {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 480px;
  height: auto;
  opacity: 0.1;
  pointer-events: none;
  z-index: -1;
  animation: fadeIn 2s ease both;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 0.1; } }
@media (max-width: 700px) {
  .hero-floral-watermark { width: 300px; }
}

/* Corner floral flourishes framing the hero, like the printed corner
   sprays on a formal invitation card. Mirrored left/right, bleeding
   slightly off the edge, sitting behind the hero text and countdown. */
.hero-corner-spray {
  position: absolute;
  top: -18px;
  width: 220px;
  height: auto;
  pointer-events: none;
  z-index: 0;
  filter: drop-shadow(0 8px 18px rgba(92, 33, 19, 0.35));
  animation: heroSpraysFadeIn 1.6s ease both;
}
/* Own keyframes (not the shared `fadeIn` used by the watermark) so each
   element's target opacity isn't silently clobbered by a differently-tuned
   animation endpoint — a running/filled CSS animation always wins over a
   plain `opacity` declaration on the same property, regardless of order. */
@keyframes heroSpraysFadeIn { from { opacity: 0; } to { opacity: 0.92; } }
.hero-corner-spray-left { left: -28px; }
.hero-corner-spray-right { right: -28px; }
@media (max-width: 900px) {
  .hero-corner-spray { width: 150px; }
}
@media (max-width: 700px) {
  .hero-corner-spray { width: 108px; top: -8px; animation-name: heroSpraysFadeInMobile; }
  .hero-corner-spray-left { left: -18px; }
  .hero-corner-spray-right { right: -18px; }
}
@keyframes heroSpraysFadeInMobile { from { opacity: 0; } to { opacity: 0.85; } }
@media (max-width: 700px) {
  .hero {
    justify-content: flex-start;
    padding: 70px 20px 40px;
  }
}

.sparkle-field { position: absolute; inset: 0; pointer-events: none; }
.sparkle {
  position: absolute;
  width: 8px; height: 8px;
  background: var(--accent-light);
  clip-path: polygon(50% 0%, 62% 36%, 100% 50%, 62% 64%, 50% 100%, 38% 64%, 0% 50%, 38% 36%);
  opacity: 0.7;
  filter: drop-shadow(0 0 3px rgba(201, 151, 89, 0.75));
  animation: twinkle 3.5s ease-in-out infinite;
}
.sparkle::before {
  content: "";
  position: absolute;
  inset: -1px;
  background: var(--cream);
  clip-path: polygon(50% 20%, 56% 44%, 80% 50%, 56% 56%, 50% 80%, 44% 56%, 20% 50%, 44% 44%);
  opacity: 0.85;
}
.sparkle-subtle {
  filter: drop-shadow(0 0 2px rgba(201, 151, 89, 0.5));
  animation-name: twinkle-subtle;
}
.sparkle-subtle::before { opacity: 0.55; }

@keyframes twinkle-subtle {
  0%, 100% { opacity: 0.05; transform: scale(0.5) rotate(0deg); }
  50% { opacity: 0.45; transform: scale(1) rotate(45deg); }
}

@keyframes twinkle {
  0%, 100% { opacity: 0.15; transform: scale(0.6) rotate(0deg); }
  50% { opacity: 1; transform: scale(1.35) rotate(45deg); }
}

.hero-ring-emblem {
  width: 156px;
  height: auto;
  margin-top: -22px;
  margin-bottom: 16px;
  filter: drop-shadow(0 6px 16px rgba(92, 33, 19, 0.45));
  animation: fadeDown 1.1s ease both;
}
@media (max-width: 700px) {
  .hero-ring-emblem { width: 82px; margin-top: -8px; margin-bottom: 4px; }
}

.hero-eyebrow {
  letter-spacing: 5px;
  text-transform: uppercase;
  font-size: 14px;
  color: var(--accent-light);
  margin-bottom: 22px;
  animation: fadeDown 1s 0.1s ease both;
}
.hero-names {
  font-family: var(--font-script);
  font-size: clamp(56px, 11vw, 118px);
  line-height: 1.05;
  color: var(--cream);
  margin: 0;
  animation: fadeUp 1.1s 0.15s ease both;
  filter: drop-shadow(0 4px 18px rgba(166, 114, 49, 0.25));
}
/* The gold shimmer lives on .hero-name-text (wrapping just "Kim" / "John"),
   NOT on the parent .hero-names heading. Chrome/Safari mis-render
   background-clip:text on an element that mixes inline text with a nested
   display:block child (the "&" span here) — it leaves a stray, disconnected
   shadow/outline fragment near the swashy glyphs ("ghost bracket" bug).
   Scoping the gradient to isolated inline spans avoids that entirely. */
.hero-name-text {
  background: linear-gradient(100deg, var(--cream) 44%, var(--accent-light) 50%, var(--cream) 56%);
  background-size: 380% 100%;
  background-position: -140% 0;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: heroGoldShimmer 12s linear infinite;
}
.hero-amp {
  display: block;
  font-family: var(--font-script);
  color: var(--accent-light);
  -webkit-text-fill-color: var(--accent-light);
  font-size: clamp(30px, 5vw, 50px);
  margin: 6px 0;
  animation: fadeUp 1.1s 0.3s ease both;
}

@keyframes heroGoldShimmer {
  0% { background-position: -140% 0; }
  100% { background-position: 240% 0; }
}
.hero-tagline {
  margin-top: 22px;
  font-size: 20px;
  letter-spacing: 2px;
  text-transform: uppercase;
  opacity: 0.9;
  animation: fadeUp 1.1s 0.45s ease both;
}
.hero-verse {
  margin-top: 14px;
  font-family: var(--font-body);
  font-style: italic;
  font-size: 13px;
  line-height: 1.5;
  letter-spacing: 0.3px;
  color: var(--cream);
  opacity: 0.75;
  animation: fadeUp 1.1s 0.5s ease both;
}
.hero-verse-citation {
  display: inline-block;
  margin-top: 4px;
  font-style: normal;
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}
.hero-date {
  margin-top: 30px;
  font-family: var(--font-heading);
  font-size: 30px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--white);
  animation: fadeUp 1.1s 0.6s ease both;
}

.hero-rsvp-btn {
  display: inline-block;
  margin-top: 32px;
  padding: 15px 46px;
  border-radius: 32px;
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  color: var(--white);
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  text-decoration: none;
  box-shadow: 0 12px 28px rgba(207, 119, 28, 0.4);
  transition: var(--transition);
  animation: fadeUp 1.1s 0.68s ease both;
}
.hero-rsvp-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 34px rgba(207, 119, 28, 0.5);
}

@keyframes fadeDown { from { opacity: 0; transform: translateY(-16px);} to { opacity: 1; transform: translateY(0);} }
@keyframes fadeUp { from { opacity: 0; transform: translateY(24px);} to { opacity: 1; transform: translateY(0);} }

/* Countdown */
.countdown {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 100px));
  gap: 16px;
  margin-top: 36px;
  justify-content: center;
  animation: fadeUp 1.1s 0.75s ease both;
}
.countdown-unit {
  background: rgba(247, 234, 221, 0.06);
  border: 1px solid rgba(166, 114, 49, 0.4);
  border-radius: 10px;
  padding: 16px 8px;
  text-align: center;
  backdrop-filter: blur(4px);
  min-width: 0;
  overflow: hidden;
}
.countdown-num {
  font-family: var(--font-heading);
  font-size: clamp(20px, 6vw, 32px);
  color: var(--white);
  display: block;
  white-space: nowrap;
}
.countdown-label {
  font-size: clamp(9px, 2.4vw, 12px);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  opacity: 0.75;
  white-space: nowrap;
}

/* Tighter vertical rhythm on phones so the countdown lands inside the
   initial viewport on both standard and Pro Max-sized screens, instead of
   requiring a scroll to see it (Safari's address/tab bars eat a lot of the
   visible height on top of the device's own screen size). The hero-verse
   block (now 3 lines: 2 of quote + a citation line) added extra height
   here, so every margin below it was trimmed again to keep the countdown
   from getting pushed toward/under the bottom browser chrome on tall
   phones like the iPhone Pro line. */
@media (max-width: 700px) {
  .hero-eyebrow { font-size: 12px; letter-spacing: 3px; margin-bottom: 10px; white-space: nowrap; }
  .hero-names { font-size: 46px; }
  .hero-amp { font-size: 24px; margin: 2px 0; }
  .hero-tagline { margin-top: 10px; font-size: 16px; }
  .hero-verse { margin-top: 6px; font-size: 10.5px; line-height: 1.35; }
  .hero-verse-citation { margin-top: 2px; font-size: 9px; letter-spacing: 1px; }
  .hero-date { margin-top: 8px; font-size: 22px; }
  .hero-rsvp-btn { margin-top: 12px; padding: 11px 32px; font-size: 14px; letter-spacing: 1.5px; }
  .countdown { margin-top: 16px; gap: 10px; }
  .countdown-unit { padding: 10px 6px; }
}

@media (max-width: 420px) {
  .countdown { grid-template-columns: repeat(4, minmax(0, 78px)); gap: 8px; }
  .countdown-unit { padding: 10px 4px; }
}

.scroll-cue {
  position: absolute;
  bottom: 26px; left: 50%;
  transform: translateX(-50%);
  width: 24px; height: 40px;
  border: 2px solid var(--accent-light);
  border-radius: 20px;
  opacity: 0.75;
}
.scroll-cue::before {
  content: '';
  position: absolute;
  top: 6px; left: 50%;
  width: 4px; height: 8px;
  background: var(--accent-light);
  border-radius: 2px;
  transform: translateX(-50%);
  animation: scrollDot 1.8s ease infinite;
}
@keyframes scrollDot { 0% { top: 6px; opacity: 1;} 70% { top: 20px; opacity: 0;} 100% { top: 6px; opacity: 0;} }

@media (max-width: 700px) {
  .scroll-cue { bottom: 12px; width: 20px; height: 32px; }
}

/* ---------- Envelope intro gate ---------- */
/* Hidden by default; only shown while the inline <head> script (see
   index.ejs) has added .envelope-pending to <html> — i.e. once per browser
   tab session, decided before first paint so there's never a flash. */
.envelope-gate { display: none; }
html.envelope-pending body { overflow: hidden; }
html.envelope-pending .envelope-gate {
  display: flex;
  align-items: center;
  justify-content: center;
  position: fixed;
  inset: 0;
  z-index: 3000;
  overflow: hidden;
  text-align: center;
  background:
    radial-gradient(circle at 20% 20%, rgba(166, 114, 49, 0.18), transparent 45%),
    radial-gradient(circle at 80% 80%, rgba(166, 114, 49, 0.14), transparent 45%),
    linear-gradient(160deg, var(--ink) 0%, var(--deep) 55%, var(--ink) 100%);
  color: var(--cream);
  padding: 24px;
  transition: opacity 0.6s ease;
}
.envelope-gate.is-closing { opacity: 0; pointer-events: none; }

.envelope-gate-sparkles { position: absolute; inset: 0; pointer-events: none; }

.envelope-gate-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 480px;
  max-height: 94vh;
  overflow-y: auto;
  overflow-x: visible;
  scrollbar-width: none;
  animation: fadeUp 1s ease both;
}
/* Flex items shrink along the column's main axis by default. The divider
   is an empty decorative div (no text/image content resisting shrink), so
   whenever the gate's total content is taller than the viewport it was the
   first thing squeezed to 0 height — i.e. it silently vanished. Every
   direct child gets flex-shrink:0 so nothing in the gate ever gets crushed
   like that again; if content is too tall, the container scrolls instead
   (overflow-y: auto above), which is the intended fallback. */
.envelope-gate-inner > * { flex-shrink: 0; }
.envelope-gate-inner::-webkit-scrollbar { display: none; }

.envelope-gate-eyebrow {
  display: block;
  letter-spacing: 5px;
  text-transform: uppercase;
  font-size: clamp(15px, 3vw, 19px);
  color: var(--accent-light);
  margin-bottom: 16px;
  animation: fadeDown 1s 0.1s ease both;
}
.envelope-gate-names {
  font-family: var(--font-script);
  /* Capped lower than the old 96px max (and given more line-height) so
     "Kim & John" always sets on a single line and the script font's tall
     swashes (the "K", the "&", the "J" tail) have room to render fully —
     at line-height 1.05 those swashes were getting visually cropped. */
  font-size: clamp(46px, 10vw, 74px);
  line-height: 1.35;
  white-space: nowrap;
  color: var(--cream);
  margin: 0;
  animation: fadeUp 1.1s 0.15s ease both;
  filter: drop-shadow(0 4px 18px rgba(166, 114, 49, 0.25));
}
.envelope-gate-amp {
  display: inline-block;
  margin: 0 6px;
  color: var(--accent-light);
  -webkit-text-fill-color: var(--accent-light);
}
/* The main hero heading's gold-shimmer effect (.hero-name-text — see the
   "ghost bracket" note above .hero-name-text) relies on background-clip:text,
   which mis-renders the tops/tails of this script font's swashy letters at
   the tighter gate sizing. The gate's names use a flat cream fill instead —
   matches the approved mockup (no shimmer there) and fully avoids the bug. */
.envelope-gate-names .hero-name-text {
  background: none;
  -webkit-background-clip: initial;
  background-clip: initial;
  -webkit-text-fill-color: var(--cream);
  animation: none;
}
.envelope-gate .divider { margin: 4px auto 14px; animation: fadeUp 1.1s 0.25s ease both; }
.envelope-gate-date {
  font-family: var(--font-heading);
  font-size: clamp(26px, 5.6vw, 36px);
  font-weight: 600;
  letter-spacing: 1.5px;
  color: var(--accent-light);
  margin: 0 0 22px;
  animation: fadeUp 1.1s 0.3s ease both;
}

/* Couple illustration standing above the envelope, feet overlapping its
   top edge so the two graphics read as one composed scene (matches the
   supplied mockup). Purely decorative — aria-hidden, sits above the
   envelope in DOM order and z-index so it never blocks the tap target.

   The z-index that actually matters here belongs on .envelope-gate-couple-wrap
   (the <picture>), not on the <img> alone: <picture> is the real flex item
   inside .envelope-gate-inner (a flex column) and is what gets compared
   against the sibling .envelope for paint order. Without a z-index set on
   the flex item itself, both it and .envelope sat at the same "auto"
   stacking level and painted in DOM order — .envelope (later in the
   markup) was drawing over the ~30px the picture's negative margin makes
   it overlap, silently slicing off the bottom of the bride's train. */
.envelope-gate-couple-wrap {
  position: relative;
  z-index: 3;
}
.envelope-gate-couple {
  position: relative;
  z-index: 2;
  display: block;
  width: clamp(150px, 40vw, 220px);
  height: auto;
  margin: 0 auto -30px;
  pointer-events: none;
  filter: drop-shadow(0 16px 28px rgba(92, 33, 19, 0.5));
  animation: fadeUp 1.1s 0.38s ease both;
}

.envelope {
  position: relative;
  z-index: 1;
  width: clamp(270px, 76vw, 420px);
  aspect-ratio: 3 / 2;
  margin: 0 auto;
  cursor: pointer;
  animation: fadeUp 1.1s 0.45s ease both;
}
.envelope:focus-visible .envelope-photo { outline: 2px solid var(--accent-light); outline-offset: 6px; }

/* Soft spotlight glow the wax seal sits in front of, centered on the
   envelope so the seal reads as the focal point of the whole card. */
.envelope-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 40%;
  aspect-ratio: 1 / 1;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(201, 151, 89, 0.45), transparent 72%);
  filter: blur(16px);
  z-index: 1;
  pointer-events: none;
  animation: envelopeGlowPulse 3.2s ease-in-out infinite;
  transition: opacity 0.4s ease;
}
@keyframes envelopeGlowPulse {
  0%, 100% { opacity: 0.65; transform: translate(-50%, -50%) scale(1); }
  50% { opacity: 1; transform: translate(-50%, -50%) scale(1.08); }
}

/* The uploaded envelope artwork — a finished flatlay illustration (espresso
   envelope, copper trim, warm rose bouquet, no printed seal). It's the whole
   "closed invitation" visual; the spinning wax-seal overlay below sits
   centered on top of the bouquet so it reads as one object. */
.envelope-photo {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  z-index: 2;
  filter: drop-shadow(0 20px 40px rgba(92, 33, 19, 0.55));
  transition: transform 0.6s cubic-bezier(0.5, 0, 0.4, 1) 0.15s, opacity 0.6s ease 0.15s;
}

/* The custom K&J wax-seal stamp, centered on the envelope artwork and
   slowly spinning in place like a coin on display. */
.envelope-seal-stamp {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 24%;
  min-width: 60px;
  margin: 0;
  transform: translate(-50%, -50%) rotate(0deg);
  transform-origin: center center;
  z-index: 3;
  filter: drop-shadow(0 6px 14px rgba(92, 33, 19, 0.45));
  animation: envelopeSealSpin 9s linear infinite, envelopeSealPulse 2.6s ease-in-out infinite;
}
@keyframes envelopeSealSpin {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to { transform: translate(-50%, -50%) rotate(360deg); }
}
@keyframes envelopeSealPulse {
  0%, 100% { filter: drop-shadow(0 6px 14px rgba(92, 33, 19, 0.45)) brightness(1); }
  50% { filter: drop-shadow(0 8px 18px rgba(201, 151, 89, 0.55)) brightness(1.08); }
}

.envelope.is-open .envelope-glow { opacity: 0; transition: opacity 0.35s ease; }
.envelope.is-open ~ .envelope-gate-hint { opacity: 0; transition: opacity 0.3s ease; }
.envelope.is-open .envelope-seal-stamp {
  animation: envelopeSealSpinOff 0.55s cubic-bezier(0.45, 0, 0.55, 1) forwards;
}
@keyframes envelopeSealSpinOff {
  0% { transform: translate(-50%, -50%) rotate(0deg) scale(1); opacity: 1; }
  100% { transform: translate(-50%, -50%) rotate(300deg) scale(0.3); opacity: 0; }
}
.envelope.is-open .envelope-photo {
  transform: scale(0.9);
  opacity: 0;
}

.envelope-gate-hint {
  margin-top: 26px;
  font-size: 13px;
  letter-spacing: 1px;
  opacity: 0.7;
  animation: fadeUp 1.1s 0.6s ease both;
}

@media (max-width: 420px) {
  .envelope-gate-date { margin-bottom: 16px; }
}
@media (max-height: 720px) {
  .envelope-gate-eyebrow { margin-bottom: 10px; }
  .envelope { width: clamp(230px, 62vw, 340px); }
  .envelope-gate-names { font-size: clamp(42px, 9.5vw, 72px); }
  .envelope-gate .divider { width: 190px; height: 58px; margin: 2px auto 10px; }
  .envelope-gate-date { margin-bottom: 14px; }
  .envelope-gate-couple { width: clamp(120px, 34vw, 180px); margin-bottom: -22px; }
  .envelope-gate-hint { margin-top: 16px; }
}

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(30px); transition: opacity 0.8s ease, transform 0.8s ease; }
.reveal.in-view { opacity: 1; transform: translateY(0); }

/* ---------- Story / Details cards ---------- */
.details-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  margin-top: 10px;
}
@media (max-width: 720px) { .details-grid { grid-template-columns: 1fr; } }

.detail-card {
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 16px;
  padding: 38px 32px;
  text-align: center;
  box-shadow: var(--shadow-soft);
  transition: transform var(--transition);
  position: relative;
  overflow: hidden;
}
.detail-card::before {
  content: '';
  position: absolute;
  top: -16px; right: -16px;
  width: 140px; height: 116px;
  background: url('assets/img/corner-bouquet.png') no-repeat center / contain;
  background-image: image-set(url('assets/img/corner-bouquet.webp') type('image/webp'), url('assets/img/corner-bouquet.png') type('image/png'));
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  opacity: 0.85;
  pointer-events: none;
}
/* Reception card gets the venue's own photo as its background, washed out
   under a soft cream overlay so it reads as texture rather than a loud
   photo — keeps the heading/address/button text crisp and legible on top. */
.detail-card-reception {
  background-image:
    linear-gradient(rgba(250, 245, 240, 0.82), rgba(250, 245, 240, 0.82)),
    url('assets/img/reception-venue-photo.jpg');
  background-image:
    linear-gradient(rgba(250, 245, 240, 0.82), rgba(250, 245, 240, 0.82)),
    image-set(url('assets/img/reception-venue-photo.webp') type('image/webp'), url('assets/img/reception-venue-photo.jpg') type('image/jpeg'));
  background-size: cover;
  background-position: center 55%;
  background-repeat: no-repeat;
}
/* Soft light shadow so the reception card's text pops off the photo behind it. */
.detail-card-reception h3,
.detail-card-reception .detail-time,
.detail-card-reception .detail-venue,
.detail-card-reception .detail-address {
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.9), 0 2px 10px rgba(255, 255, 255, 0.6);
}
.detail-card:hover { transform: translateY(-6px); }
.detail-icon {
  width: 56px; height: 56px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  display: flex; align-items: center; justify-content: center;
  color: var(--cream);
  font-size: 24px;
}
.detail-icon svg { width: 27px; height: 27px; }
.detail-card h3 { font-size: 24px; color: var(--deep); }
.detail-time { color: var(--accent); font-weight: 600; letter-spacing: 1px; margin: 6px 0 14px; }
.detail-venue { font-weight: 600; }
.detail-address { opacity: 0.75; font-size: 17px; margin: 4px 0 16px; }
.detail-link {
  display: inline-block;
  padding: 10px 22px;
  border: 1px solid var(--accent);
  border-radius: 30px;
  font-size: 14px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--accent);
  transition: var(--transition);
}
.detail-link:hover { background: var(--accent); color: var(--white); }
.detail-tbd-note { opacity: 0.75; font-size: 16px; margin: 10px 0 0; }

.dress-code-intro-wrap {
  text-align: center;
  max-width: 620px;
  margin: 0 auto;
}
.dress-code-intro-mark {
  display: block;
  color: var(--accent-light);
  font-size: 15px;
  letter-spacing: 3px;
  margin-bottom: 18px;
  opacity: 0.8;
}
.dress-code-intro {
  font-family: var(--font-body);
  font-size: 18px;
  font-style: italic;
  font-weight: 500;
  line-height: 1.75;
  letter-spacing: 0.2px;
  color: var(--ink);
  opacity: 0.92;
}
.dress-code-intro-rule {
  width: 64px;
  height: 1px;
  margin: 26px auto 0;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  position: relative;
}
.dress-code-intro-rule::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 1px;
  transform: translate(-50%, -50%) rotate(45deg);
}

.dress-code-banner {
  margin-top: 14px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
  padding: 26px 24px 30px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(166, 114, 49, 0.1), rgba(86, 50, 36, 0.06));
  border: 1px dashed rgba(166, 114, 49, 0.5);
}
.dress-code-banner strong { color: var(--deep); }

/* ---------- Dress code color palette (horizontal, compact) ---------- */
.color-palette {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: center;
  gap: 18px 14px;
  margin-top: 22px;
}
.color-swatch {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 84px;
}
.swatch-circle {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  box-shadow: 0 5px 14px rgba(92, 33, 19, 0.2), inset 0 0 0 1px rgba(255, 255, 255, 0.25);
  border: 1px solid rgba(92, 33, 19, 0.08);
  transition: transform 0.3s ease;
}
.color-swatch:hover .swatch-circle { transform: scale(1.08); }
.swatch-circle-light { border: 1px solid rgba(166, 114, 49, 0.4); }
.swatch-name {
  font-family: var(--font-heading);
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--deep);
  margin-top: 4px;
}
.swatch-hex {
  font-size: 10px;
  letter-spacing: 1px;
  color: var(--accent);
  font-weight: 600;
}
.swatch-desc {
  font-size: 11px;
  font-style: italic;
  opacity: 0.65;
}
@media (max-width: 700px) {
  .dress-code-intro { font-size: 13px; line-height: 1.7; }
}
@media (max-width: 480px) {
  .dress-code-banner { padding: 24px 16px 28px; }
  .color-palette { gap: 16px 10px; }
  .color-swatch { width: 72px; }
  .swatch-circle { width: 38px; height: 38px; }
}

/* ---------- Attire inspiration image ---------- */
.attire-guide-image {
  margin-top: 26px;
  padding-top: 24px;
  border-top: 1px dashed rgba(166, 114, 49, 0.35);
}
.attire-guide-image img {
  display: block;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  border-radius: 14px;
  box-shadow: 0 12px 30px rgba(92, 33, 19, 0.18);
}
.attire-guide-note {
  max-width: 460px;
  margin: 20px auto 0;
  padding: 14px 22px;
  font-size: 16px;
  line-height: 1.6;
  text-align: center;
  font-style: italic;
  font-weight: 600;
  color: var(--ink);
  background: linear-gradient(135deg, rgba(166, 114, 49, 0.14), rgba(217, 176, 121, 0.2));
  border: 1px dashed rgba(166, 114, 49, 0.5);
  border-radius: 14px;
}

/* ---------- RSVP ---------- */
.rsvp-wrap {
  max-width: 640px;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 20px;
  box-shadow: var(--shadow-soft);
  padding: 48px 40px;
  position: relative;
  overflow: hidden;
}
.rsvp-wrap::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 6px;
  background: linear-gradient(90deg, var(--accent), var(--accent-soft), var(--accent));
}
.card-sprig {
  display: block;
  width: 104px;
  margin: -6px auto 16px;
  opacity: 0.95;
  filter: drop-shadow(0 6px 14px rgba(92, 33, 19, 0.18));
}
@media (max-width: 600px) { .rsvp-wrap { padding: 34px 22px; } }

.form-row { margin-bottom: 22px; }
.form-row label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
  font-size: 15px;
  letter-spacing: 0.5px;
  color: var(--deep);
}
.form-row input[type="text"],
.form-row input[type="email"],
.form-row input[type="tel"],
.form-row input[type="number"],
.form-row select,
.form-row textarea {
  width: 100%;
  padding: 14px 16px;
  border: 1.5px solid var(--kjw-border-color, #dccdbb);
  border-radius: 10px;
  font-family: var(--font-body);
  font-size: 17px;
  background: var(--cream);
  transition: border var(--transition), box-shadow var(--transition);
}
.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(166, 114, 49, 0.18);
}
.form-row textarea { resize: vertical; min-height: 90px; }

.attend-toggle { display: flex; gap: 14px; }
.attend-option { flex: 1; }
.attend-option input { display: none; }
.attend-option label {
  display: block;
  text-align: center;
  padding: 18px 10px;
  border: 1.5px solid var(--kjw-border-color, #dccdbb);
  border-radius: 12px;
  cursor: pointer;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  font-size: 14px;
  transition: var(--transition);
}
.attend-option input:checked + label {
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  border-color: var(--accent);
  color: var(--white);
  transform: scale(1.02);
}

.conditional-fields {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.5s ease;
}
.conditional-fields.open { max-height: 900px; }

.btn-submit {
  width: 100%;
  padding: 18px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--ink), var(--deep));
  color: var(--cream);
  font-family: var(--font-heading);
  font-size: 18px;
  letter-spacing: 1px;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}
.btn-submit:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(92, 33, 19, 0.35); }
.btn-submit:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.form-msg { margin-top: 16px; text-align: center; font-weight: 600; }
.form-msg.error { color: var(--kjw-error-color, #a63838); }
.form-msg.success { color: var(--kjw-success-color, #3f7d4e); }

.rsvp-deadline-note { text-align: center; margin-top: 22px; font-size: 15px; opacity: 0.7; }

/* ---------- Photo Contest upload ---------- */
.file-drop {
  position: relative;
  border: 1.5px dashed var(--accent);
  border-radius: 12px;
  padding: 30px 16px;
  text-align: center;
  background: rgba(166, 114, 49, 0.05);
  cursor: pointer;
  transition: var(--transition);
}
.file-drop:hover,
.file-drop.dragover {
  background: rgba(166, 114, 49, 0.1);
  border-color: var(--accent-light);
}
.file-drop input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}
.file-drop-icon {
  font-size: 28px;
  display: block;
  margin-bottom: 8px;
}
.file-drop-text {
  color: var(--deep);
  font-weight: 600;
  font-size: 15px;
}
.file-list {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.file-chip {
  background: var(--cream);
  border: 1px solid var(--kjw-border-color, #dccdbb);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 13px;
  color: var(--deep);
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- Photo hub (Upload Photo / View Album) ---------- */
.photo-hub {
  max-width: 520px;
  margin: 0 auto;
  text-align: center;
}
.photo-stack {
  position: relative;
  width: 168px;
  height: 148px;
  margin: 6px auto 32px;
}
.photo-stack span {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 118px;
  height: 128px;
  border: 1.5px dashed var(--accent-soft);
  border-radius: 12px;
  background: rgba(250, 245, 240, 0.55);
  overflow: hidden;
}
.photo-stack span:nth-child(1) { transform: rotate(-9deg) translate(-26px, 6px); }
.photo-stack span:nth-child(2) { transform: rotate(7deg) translate(22px, 2px); }
.photo-stack span:nth-child(3) {
  transform: rotate(-2deg);
  background: var(--cream);
  border-style: solid;
  box-shadow: 0 10px 24px rgba(92, 33, 19, 0.12);
}
.photo-stack-img {
  display: none;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}
.photo-stack span.has-photo {
  background: var(--cream);
  border-style: solid;
  border-color: var(--accent-soft);
  box-shadow: 0 10px 24px rgba(92, 33, 19, 0.12);
}
.photo-stack span.has-photo .photo-stack-img { display: block; }
.photo-hub-actions {
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
}
.photo-hub-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 34px;
  border-radius: 40px;
  border: 1.5px solid var(--accent);
  background: transparent;
  color: var(--deep);
  font-family: var(--font-heading);
  font-size: 17px;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: var(--transition);
}
.photo-hub-btn:hover { transform: translateY(-2px); border-color: var(--accent-light); background: rgba(166, 114, 49, 0.08); }
.photo-hub-btn-primary {
  background: linear-gradient(135deg, var(--ink), var(--deep));
  color: var(--cream);
  border-color: var(--ink);
}
.photo-hub-btn-primary:hover { box-shadow: 0 10px 24px rgba(92, 33, 19, 0.35); background: linear-gradient(135deg, var(--ink), var(--deep)); }
.photo-hub-icon { font-size: 20px; }
.photo-hub-count { margin-top: 20px; font-size: 15px; opacity: 0.75; min-height: 1.4em; }

.photo-panel { max-width: 720px; margin: 0 auto; }
.photo-panel-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}
.photo-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  color: var(--accent);
  font-family: var(--font-heading);
  font-size: 15px;
  letter-spacing: 0.5px;
  cursor: pointer;
  padding: 4px 0;
}
.photo-back-btn:hover { color: var(--accent-light); }
.photo-refresh-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  color: var(--accent);
  font-family: var(--font-heading);
  font-size: 15px;
  letter-spacing: 0.5px;
  cursor: pointer;
  padding: 4px 0;
}
.photo-refresh-btn:hover { color: var(--accent-light); }
.photo-refresh-btn:disabled { opacity: 0.5; cursor: default; }
.album-refresh-icon { display: inline-block; font-size: 16px; transition: transform 0.4s ease; }
.photo-refresh-btn.is-refreshing .album-refresh-icon { animation: albumRefreshSpin 0.7s linear infinite; }
@keyframes albumRefreshSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.photo-switch-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: 1.5px solid var(--accent);
  border-radius: 30px;
  color: var(--deep);
  font-family: var(--font-heading);
  font-size: 14px;
  letter-spacing: 0.5px;
  cursor: pointer;
  padding: 8px 18px;
  transition: var(--transition);
}
.photo-switch-btn:hover { background: rgba(166, 114, 49, 0.08); border-color: var(--accent-light); }

.btn-outline {
  display: block;
  margin: 28px auto 0;
  padding: 12px 30px;
  border-radius: 30px;
  border: 1.5px solid var(--accent);
  background: transparent;
  color: var(--deep);
  font-family: var(--font-heading);
  font-size: 15px;
  letter-spacing: 1px;
  cursor: pointer;
  transition: var(--transition);
}
.btn-outline:hover { background: rgba(166, 114, 49, 0.08); border-color: var(--accent-light); }

.album-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}
.album-item {
  position: relative;
  padding: 0;
  border: none;
  border-radius: 10px;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  cursor: pointer;
  background: rgba(166, 114, 49, 0.08);
  transition: var(--transition);
}
.album-item:hover { transform: translateY(-3px); box-shadow: 0 10px 20px rgba(92, 33, 19, 0.2); }
.album-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.album-empty, .album-status { text-align: center; margin-top: 20px; opacity: 0.75; }

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(92, 33, 19, 0.94);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}
.lightbox[hidden] { display: none; }
.lightbox-figure {
  max-width: min(90vw, 900px);
  max-height: 86vh;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.lightbox-img {
  max-width: 100%;
  max-height: 72vh;
  border-radius: 6px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
.lightbox-caption {
  color: var(--cream);
  margin-top: 14px;
  font-size: 15px;
  text-align: center;
  opacity: 0.85;
}
.lightbox-close {
  position: absolute;
  top: 18px;
  right: 24px;
  background: none;
  border: none;
  color: var(--cream);
  font-size: 36px;
  line-height: 1;
  cursor: pointer;
  opacity: 0.85;
}
.lightbox-close:hover { opacity: 1; }
.lightbox-download {
  position: absolute;
  top: 18px;
  left: 24px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: 1px solid var(--accent-light);
  color: var(--cream);
  font-family: inherit;
  font-size: 14px;
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 20px;
  cursor: pointer;
  opacity: 0.9;
  transition: var(--transition);
}
.lightbox-download:hover { opacity: 1; background: var(--accent-light); color: var(--ink); }
.lightbox-nav {
  background: none;
  border: none;
  color: var(--cream);
  font-size: 28px;
  cursor: pointer;
  padding: 10px 16px;
  opacity: 0.8;
  transition: var(--transition);
}
.lightbox-nav:hover { opacity: 1; color: var(--accent-light); }

@media (max-width: 640px) {
  .photo-hub-actions { flex-direction: column; align-items: stretch; }
  .photo-hub-btn { justify-content: center; }
  .album-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
  .lightbox-nav { font-size: 22px; padding: 8px 10px; }
  .lightbox { padding: 20px 8px; }
  .lightbox-download { font-size: 12px; padding: 6px 12px; top: 14px; left: 14px; }
  .lightbox-close { top: 10px; right: 14px; }
}

/* ---------- Registry ---------- */
.registry-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 26px;
}
.registry-card {
  background: rgba(247, 234, 221, 0.05);
  border: 1px solid rgba(166, 114, 49, 0.35);
  border-radius: 16px;
  padding: 32px 26px;
  text-align: center;
  transition: var(--transition);
}
.registry-card:hover { transform: translateY(-6px); border-color: var(--accent); }
.registry-icon { font-size: 34px; margin-bottom: 14px; color: var(--accent-light); }
.registry-card h3 { font-size: 21px; margin-bottom: 6px; }
.registry-card p { opacity: 0.8; font-size: 16px; margin-bottom: 18px; }
.registry-btn {
  display: inline-block;
  padding: 10px 24px;
  border-radius: 30px;
  border: 1px solid var(--accent-light);
  font-size: 14px;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.registry-btn:hover { background: var(--accent-light); color: var(--ink); }

/* ---------- Entourage (formal invitation-style card) ---------- */
.invite-card {
  max-width: 800px;
  margin: 0 auto;
  padding: 50px 44px;
  position: relative;
  border: 1px solid var(--accent-light);
}
.invite-card::before {
  content: "";
  position: absolute;
  inset: 14px;
  border: 1px solid rgba(201, 151, 89, 0.35);
  pointer-events: none;
}

.invite-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px 40px;
  text-align: center;
}
.invite-columns-spaced { margin-top: 30px; }
.invite-columns-3 { grid-template-columns: repeat(3, 1fr); }
/* A lone entry (e.g. Veil, with no partner to pair it with) spans both
   columns of its row so it stays centered instead of hugging the left half. */
.invite-col-solo { grid-column: 1 / -1; }

.invite-label {
  font-family: var(--font-heading);
  font-size: 15px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent-light);
  margin: 0 0 10px;
}
.invite-label-sm { font-size: 12px; letter-spacing: 1.5px; }

.invite-name {
  font-family: var(--font-body);
  font-size: 18px;
  color: var(--cream);
  margin: 4px 0;
}

.invite-heading {
  font-family: var(--font-heading);
  font-size: 22px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--accent-light);
  text-align: center;
  margin: 0 0 24px;
}
.invite-heading::after {
  content: "";
  display: block;
  width: 60px;
  height: 1px;
  background: var(--accent);
  margin: 10px auto 0;
}

.invite-flourish {
  text-align: center;
  color: var(--accent);
  font-size: 13px;
  letter-spacing: 12px;
  margin: 36px 0;
}

.invite-sponsor-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 40px;
  max-width: 560px;
  margin: 0 auto;
}
.invite-sponsor-grid .invite-name { text-align: center; padding: 4px 0; }

.sponsor-floral-wrap { position: relative; }
.sponsor-floral-watermark {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 340px;
  height: auto;
  opacity: 0.12;
  pointer-events: none;
  z-index: 0;
}
.sponsor-floral-wrap > .invite-heading,
.sponsor-floral-wrap > .invite-sponsor-grid {
  position: relative;
  z-index: 1;
}
@media (max-width: 700px) {
  .sponsor-floral-watermark { width: 230px; }
}

.invite-divider-line {
  height: 1px;
  background: rgba(201, 151, 89, 0.3);
  max-width: 560px;
  margin: 32px auto;
}

@media (max-width: 640px) {
  .invite-card { padding: 38px 20px; }
  .invite-card::before { inset: 9px; }
  /* Keep paired roles (Maid of Honor/Best Man, Bridesmaids/Groomsmen, etc.)
     side by side on one line even on mobile, rather than each stacking to
     its own full-width row — that's what keeps this section from running
     very long on a phone. Only .invite-columns-3 (unused by default, kept
     for any custom 3-up content) still collapses to a single column. */
  .invite-columns { grid-template-columns: 1fr 1fr; gap: 18px 14px; }
  .invite-columns-3 { grid-template-columns: 1fr; gap: 26px; }
  .invite-columns-spaced { margin-top: 22px; }
  .invite-sponsor-grid { gap: 8px 14px; }
  .invite-name { font-size: 15px; }
  .invite-sponsor-grid .invite-name { font-size: 15px; }
  .invite-heading { font-size: 19px; }
  .invite-flourish { letter-spacing: 8px; font-size: 12px; margin: 28px 0; }
}

@media (max-width: 380px) {
  .invite-card { padding: 30px 14px; }
  .invite-columns { gap: 16px 10px; }
  .invite-label { font-size: 13px; letter-spacing: 1.5px; }
  .invite-label-sm { font-size: 11px; letter-spacing: 1px; }
  .invite-name { font-size: 14px; }
  .invite-sponsor-grid { gap: 6px 8px; }
  .invite-sponsor-grid .invite-name { font-size: 13.5px; }
}

/* ---------- Updates & Announcements (compact swipeable strip, sits
   directly under the hero so guests see it without a long scroll) ---------- */
.updates-strip {
  --update-card-w: 300px;
  background: var(--cream);
  padding: 20px 0 22px;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid rgba(166, 114, 49, 0.18);
}
/* Soft color blobs behind the strip so the frosted-glass cards below have
   something to blur/tint against — same treatment used behind .detail-card
   and .rsvp-wrap elsewhere on the site, kept subtle since this strip is short. */
.updates-strip::before,
.updates-strip::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}
.updates-strip::before {
  top: -60px; left: -40px;
  width: 220px; height: 220px;
  background: radial-gradient(circle, rgba(166, 114, 49, 0.16), transparent 70%);
  filter: blur(10px);
}
.updates-strip::after {
  bottom: -80px; right: -50px;
  width: 240px; height: 240px;
  background: radial-gradient(circle, rgba(214, 190, 160, 0.35), transparent 70%);
  filter: blur(10px);
}
.updates-strip-label,
.updates-scroll { position: relative; z-index: 1; }
.updates-strip-label {
  text-align: center;
  font-size: 12px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}
.updates-strip-icon { color: var(--accent-light); margin-right: 4px; }
.updates-strip-hint {
  margin-left: 10px;
  font-size: 11px;
  letter-spacing: 0.5px;
  text-transform: none;
  opacity: 0.55;
}

/* The scroll container is padded so the first/last card can each scroll all
   the way to dead-center — combined with mandatory snap, a card always
   settles in the middle and swiping left/right steps to the next/previous
   one (rather than free-scrolling to an arbitrary offset). */
.updates-scroll {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding: 4px calc(50% - (var(--update-card-w) / 2)) 8px;
  scrollbar-width: none;
}
.updates-scroll::-webkit-scrollbar { display: none; }

.update-card {
  flex: 0 0 var(--update-card-w);
  width: var(--update-card-w);
  scroll-snap-align: center;
  scroll-snap-stop: always;
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-left: 3px solid var(--accent);
  border-radius: 10px;
  padding: 16px 20px;
  box-shadow: 0 4px 14px rgba(92, 33, 19, 0.08);
  transition: transform var(--transition);
}
.update-card:hover { transform: translateY(-4px); }
.update-card-date { font-size: 11.5px; letter-spacing: 1px; text-transform: uppercase; color: var(--accent); margin-bottom: 5px; }
.update-card-title {
  font-size: 17px;
  margin: 0 0 6px;
  color: var(--deep);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.update-card-msg {
  font-size: 14.5px;
  line-height: 1.45;
  margin: 0;
  opacity: 0.85;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (max-width: 700px) {
  .updates-strip { --update-card-w: 262px; padding: 16px 0 18px; }
  .updates-strip-label { font-size: 11px; letter-spacing: 2px; margin-bottom: 10px; }
  .updates-scroll { gap: 12px; }
  .update-card { padding: 14px 16px; }
  .update-card-title { font-size: 16px; }
  .update-card-msg { font-size: 14px; }
}

@media (max-width: 380px) {
  .updates-strip { --update-card-w: 224px; }
  .update-card { padding: 12px 14px; }
}

/* ---------- Contact / Guest Communication ---------- */
.contact-wrap { max-width: 640px; margin: 0 auto; }

/* ---------- Footer ---------- */
.footer {
  background: var(--ink);
  color: var(--accent-soft);
  text-align: center;
  padding: 50px 20px 30px;
}
.footer-sprig { display: block; width: 210px; margin: 0 auto 14px; opacity: 0.92; }
.footer-monogram {
  display: inline-block;
  height: 64px;
  width: auto;
  margin-bottom: 12px;
  filter: drop-shadow(0 3px 10px rgba(0, 0, 0, 0.4));
}
.footer small { opacity: 0.6; display: block; margin-top: 10px; }

/* ---------- Welcome Aboard Overlay ---------- */
.welcome-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at center, rgba(86, 50, 36, 0.97), rgba(92, 33, 19, 0.99));
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
}
.welcome-overlay.show { opacity: 1; pointer-events: all; }

.welcome-card {
  text-align: center;
  color: var(--cream);
  padding: 50px 40px;
  max-width: 480px;
  transform: scale(0.85);
  opacity: 0;
  transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.6s ease;
}
.welcome-overlay.show .welcome-card { transform: scale(1); opacity: 1; }

.welcome-icon {
  width: 90px; height: 90px;
  margin: 0 auto 24px;
  border-radius: 50%;
  border: 2px solid var(--accent-light);
  display: flex; align-items: center; justify-content: center;
  font-size: 40px;
  color: var(--accent-light);
  animation: pulseRing 2s ease-in-out infinite;
}
@keyframes pulseRing {
  0%, 100% { box-shadow: 0 0 0 0 rgba(166, 114, 49, 0.4); }
  50% { box-shadow: 0 0 0 16px rgba(166, 114, 49, 0); }
}

.welcome-title {
  font-family: var(--font-script);
  font-size: 54px;
  color: var(--accent-light);
  margin-bottom: 10px;
}
.welcome-sub { font-size: 20px; opacity: 0.9; margin-bottom: 24px; }
.welcome-detail { font-size: 16px; opacity: 0.75; margin-bottom: 30px; line-height: 1.7; }
.welcome-close {
  display: inline-block;
  padding: 12px 30px;
  border: 1px solid var(--accent-light);
  border-radius: 30px;
  letter-spacing: 1px;
  text-transform: uppercase;
  font-size: 14px;
  cursor: pointer;
  background: none;
  color: var(--cream);
  transition: var(--transition);
}
.welcome-close:hover { background: var(--accent-light); color: var(--ink); }

.confetti-canvas { position: fixed; inset: 0; z-index: 2001; pointer-events: none; }

/* ---------- Back to top ---------- */
.back-to-top {
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid var(--accent-light);
  background: linear-gradient(135deg, var(--ink), var(--deep));
  color: var(--accent-light);
  font-size: 20px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 900;
  box-shadow: 0 6px 20px rgba(92, 33, 19, 0.35);
  opacity: 0;
  transform: translateY(14px);
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease, background 0.3s ease;
}
.back-to-top.show { opacity: 1; transform: translateY(0); pointer-events: all; }
.back-to-top:hover { background: var(--accent-light); color: var(--ink); }
@media (max-width: 640px) {
  .back-to-top { right: 14px; bottom: 14px; width: 42px; height: 42px; font-size: 18px; }
}

/* ---------- Background music toggle ---------- */
.music-toggle {
  position: fixed;
  left: 18px;
  bottom: 18px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid var(--accent-light);
  background: linear-gradient(135deg, var(--ink), var(--deep));
  color: var(--accent-light);
  font-size: 18px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 900;
  opacity: 0.55;
  box-shadow: 0 6px 20px rgba(92, 33, 19, 0.35);
  transition: opacity 0.3s ease, background 0.3s ease;
}
.music-toggle:hover { opacity: 1; background: var(--accent-light); color: var(--ink); }
.music-toggle.muted { opacity: 0.4; }
@media (max-width: 640px) {
  .music-toggle { left: 14px; bottom: 14px; width: 42px; height: 42px; font-size: 16px; }
}

/* Declined state (softer, no confetti) */
.welcome-card.declined .welcome-icon { color: var(--accent-soft); border-color: var(--accent-soft); }
.welcome-card.declined .welcome-title { color: var(--accent-soft); font-size: 42px; }

/* ---------- Utility ---------- */
.text-center { text-align: center; }
.mt-20 { margin-top: 20px; }

@media (max-width: 600px) {
  .section { padding: 64px 0; }
  body { font-size: 17px; }
}

/* ==========================================================
   WordPress-port additions (not present in the original CSS)
   ========================================================== */

/* Honeypot fields (RSVP/contact/photo-upload forms) — visually hidden but
   NOT display:none, so it stays in the accessibility tree exactly the way
   a screen-reader-only trap field should (real users never see or reach
   it; naive bots that fill every field still trip it). */
.kjw-honeypot {
	position: absolute !important;
	width: 1px; height: 1px;
	padding: 0; margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* Respect the visitor's OS-level "reduce motion" preference: disable
   decorative animations (shimmer, sparkles, floats, spins, confetti-style
   pulsing) while keeping the reveal-on-scroll content instantly visible
   rather than perpetually hidden. */
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after {
		animation-duration: 0.001ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.001ms !important;
		scroll-behavior: auto !important;
	}
	.reveal { opacity: 1; transform: none; }
	.hero-name-text { animation: none; background: none; -webkit-text-fill-color: var(--cream); }
}

/* Admin bar offset so the fixed navbar/envelope gate never sits underneath
   the WordPress admin toolbar for logged-in editors. */
@media screen and (min-width: 783px) {
	.admin-bar .navbar { top: 32px; }
	.admin-bar html.envelope-pending .envelope-gate { top: 32px; height: calc(100vh - 32px); }
}
@media screen and (max-width: 782px) {
	.admin-bar .navbar { top: 46px; }
	.admin-bar html.envelope-pending .envelope-gate { top: 46px; height: calc(100vh - 46px); }
}

/* Consistent, visible keyboard focus outline across every interactive
   control the design didn't already give one to (buttons, links, form
   controls) — the envelope/lightbox/nav already had bespoke focus styles
   above; this is the site-wide fallback. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
	outline: 2px solid var(--accent-light, #da9246);
	outline-offset: 3px;
}

/* Screen-reader-only text utility, used for a couple of form status
   regions that need an accessible label without a visible one. */
.screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px;
	padding: 0; margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* =====================================================================
   v2 "Wedding Website" admin additions: Homepage Sections layout
   controls, header CTA/sticky variants, hero variants, RSVP/photo closed
   states, announcement link/style variants, footer social links. Kept
   additive/appended — every rule below only fires when the matching admin
   field is actually used, so a site that hasn't touched these screens
   renders byte-for-byte the same as before.
   ===================================================================== */

/* Homepage Sections: width / padding / dark-tone controls, applied on top
   of a section's own base .section-dark / .section rules. */
.section-full { padding-left: 0; padding-right: 0; }
.section-full > .container { max-width: 100%; }
.section-padding-compact { padding-top: 50px; padding-bottom: 50px; }
.section-padding-spacious { padding-top: 140px; padding-bottom: 140px; }

/* Header & Navigation */
.navbar-static { position: absolute; }
.nav-link-cta {
	background: var(--accent, #a94718);
	color: #fff !important;
	padding: 8px 18px !important;
	border-radius: 30px;
}
.nav-link-cta:hover { background: var(--accent-light, #da9246); }

/* Hero variants (Couple & Wedding → Hero & Homepage Banner) */
.hero-full-viewport { min-height: 100vh; }
.hero-align-left { text-align: left; align-items: flex-start; }
.hero-align-right { text-align: right; align-items: flex-end; }
.hero-decorative-0, .hero-decorative-1, .hero-decorative-2 { position: absolute; max-width: 220px; opacity: 0.85; }
.hero-decorative-0 { top: 8%; left: 4%; }
.hero-decorative-1 { top: 8%; right: 4%; }
.hero-decorative-2 { bottom: 6%; left: 50%; transform: translateX(-50%); max-width: 320px; }

/* Wedding Details: repeatable event card image */
.detail-card-image { width: 100%; max-height: 160px; object-fit: cover; border-radius: 10px; margin-bottom: 14px; }

/* RSVP / Photos: closed-state notices */
.rsvp-closed-notice {
	max-width: 560px;
	margin: 0 auto;
	padding: 22px 28px;
	border: 1px solid rgba(166, 114, 49, 0.35);
	border-radius: 14px;
	background: rgba(247, 234, 221, 0.06);
	text-align: center;
}

/* Announcements: style variants + optional link */
.update-card-highlight { border-color: var(--accent-light, #da9246); box-shadow: 0 0 0 1px var(--accent-light, #da9246) inset; }
.update-card-urgent { border-color: #a63838; box-shadow: 0 0 0 1px #a63838 inset; }
.update-card-link { display: inline-block; margin-top: 8px; font-size: 13px; font-weight: 700; text-decoration: underline; color: var(--accent-light, #da9246); }

/* Photo Album: admin-configurable grid column count */
.album-grid { grid-template-columns: repeat(var(--kjw-album-columns, auto-fill), minmax(150px, 1fr)); }

/* Footer & Social */
.footer-social-links { display: flex; justify-content: center; gap: 16px; flex-wrap: wrap; margin: 14px 0; }
.footer-social-link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 13px;
	opacity: 0.85;
	text-decoration: none;
}
.footer-social-link:hover { opacity: 1; }
.footer-copyright { display: block; margin-top: 4px; opacity: 0.7; }
