/* ==========================================================
   WEDDING PAGES — FRONTEND CSS
   5 Themes: classico | rosa | giardino | notte | vintage
   ========================================================== */

/* ---------- GOOGLE FONTS (loaded via PHP) ---------- */
/* Cormorant Garamond, Great Vibes, Montserrat,
   Playfair Display, Lato, Dancing Script */

/* ===================== RESET & BASE ===================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html.wedding-html { scroll-behavior: smooth; }
body.wedding-body { overflow-x: hidden; min-height: 100vh; }

#petal-canvas {
    position: fixed; top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 0;
}

/* ===================== CSS VARIABLES — PER THEME ===================== */

/* --- CLASSICO: Avorio + Oro --- */
.theme-classico {
    --c-bg:          #faf8f4;
    --c-bg2:         #f5f0e8;
    --c-primary:     #b8956a;
    --c-primary-dark:#8a6b44;
    --c-accent:      #d4af7a;
    --c-accent2:     #e8d5b0;
    --c-text:        #3a2e24;
    --c-text-light:  #7a6a5a;
    --c-white:       #ffffff;
    --c-border:      rgba(184,149,106,0.3);
    --c-hero-overlay:rgba(50,35,20,0.42);
    --c-section-alt: #f0ebe1;
    --font-display:  'Cormorant Garamond', serif;
    --font-script:   'Great Vibes', cursive;
    --font-body:     'Montserrat', sans-serif;
    --font-serif:    'Playfair Display', serif;
    --hero-gradient: linear-gradient(135deg, #b8956a 0%, #d4af7a 50%, #8a6b44 100%);
    --ornament-color:#b8956a;
    --petal-color:   #f0d5b0;
}

/* --- ROSA: Cipria + Borgogna --- */
.theme-rosa {
    --c-bg:          #fdf8f9;
    --c-bg2:         #f9f0f3;
    --c-primary:     #c4687a;
    --c-primary-dark:#9e4a5c;
    --c-accent:      #e8a4b4;
    --c-accent2:     #f4d0d8;
    --c-text:        #3a2028;
    --c-text-light:  #7a5060;
    --c-white:       #ffffff;
    --c-border:      rgba(196,104,122,0.25);
    --c-hero-overlay:rgba(60,20,30,0.40);
    --c-section-alt: #f9f0f3;
    --font-display:  'Dancing Script', cursive;
    --font-script:   'Great Vibes', cursive;
    --font-body:     'Lato', sans-serif;
    --font-serif:    'Cormorant Garamond', serif;
    --hero-gradient: linear-gradient(135deg, #c4687a 0%, #e8a4b4 50%, #9e4a5c 100%);
    --ornament-color:#c4687a;
    --petal-color:   #f4c0cc;
}

/* --- GIARDINO: Verde Salvia + Crema --- */
.theme-giardino {
    --c-bg:          #f8faf6;
    --c-bg2:         #f0f5ed;
    --c-primary:     #6a8c5a;
    --c-primary-dark:#4e6b42;
    --c-accent:      #a8c498;
    --c-accent2:     #d4e8cc;
    --c-text:        #2a3824;
    --c-text-light:  #5a7050;
    --c-white:       #ffffff;
    --c-border:      rgba(106,140,90,0.25);
    --c-hero-overlay:rgba(20,40,20,0.45);
    --c-section-alt: #eef4ea;
    --font-display:  'Playfair Display', serif;
    --font-script:   'Great Vibes', cursive;
    --font-body:     'Lato', sans-serif;
    --font-serif:    'Cormorant Garamond', serif;
    --hero-gradient: linear-gradient(135deg, #6a8c5a 0%, #a8c498 50%, #4e6b42 100%);
    --ornament-color:#6a8c5a;
    --petal-color:   #c8e0bc;
}

/* --- NOTTE: Navy + Argento --- */
.theme-notte {
    --c-bg:          #0e1628;
    --c-bg2:         #151e35;
    --c-primary:     #8fa8d4;
    --c-primary-dark:#6888b8;
    --c-accent:      #c0d0f0;
    --c-accent2:     #d4e0ff;
    --c-text:        #e8eef8;
    --c-text-light:  #a0b0cc;
    --c-white:       #ffffff;
    --c-border:      rgba(143,168,212,0.25);
    --c-hero-overlay:rgba(5,10,20,0.55);
    --c-section-alt: #151e35;
    --font-display:  'Cormorant Garamond', serif;
    --font-script:   'Great Vibes', cursive;
    --font-body:     'Montserrat', sans-serif;
    --font-serif:    'Playfair Display', serif;
    --hero-gradient: linear-gradient(135deg, #0e1628 0%, #1e3060 50%, #0a1020 100%);
    --ornament-color:#c0d0f0;
    --petal-color:   #8fa8d4;
}

/* --- VINTAGE: Seppia + Crema --- */
.theme-vintage {
    --c-bg:          #fdf9f0;
    --c-bg2:         #f5ede0;
    --c-primary:     #8b6b4a;
    --c-primary-dark:#6b4f32;
    --c-accent:      #c4a07a;
    --c-accent2:     #e4c89a;
    --c-text:        #3a2a1a;
    --c-text-light:  #7a6050;
    --c-white:       #fdf9f0;
    --c-border:      rgba(139,107,74,0.3);
    --c-hero-overlay:rgba(40,25,10,0.50);
    --c-section-alt: #f0e8d8;
    --font-display:  'Playfair Display', serif;
    --font-script:   'Dancing Script', cursive;
    --font-body:     'Lato', sans-serif;
    --font-serif:    'Cormorant Garamond', serif;
    --hero-gradient: linear-gradient(135deg, #8b6b4a 0%, #c4a07a 50%, #6b4f32 100%);
    --ornament-color:#8b6b4a;
    --petal-color:   #e4c89a;
}

/* ============================================================
   BIRTHDAY THEMES — 3 varianti a tema compleanno
   ============================================================ */

/* --- BIRTHDAY GOLD: Champagne + Oro + Ivory --- */
.theme-bday_gold {
    --c-bg:          #fffdf5;
    --c-bg2:         #fdf5e0;
    --c-primary:     #c9973a;
    --c-primary-dark:#a87828;
    --c-accent:      #f0c060;
    --c-accent2:     #fae8a0;
    --c-text:        #3a2d10;
    --c-text-light:  #8a7040;
    --c-white:       #ffffff;
    --c-border:      rgba(201,151,58,0.3);
    --c-hero-overlay:rgba(30,20,5,0.45);
    --c-section-alt: #fdf5e0;
    --font-display:  'Cormorant Garamond', serif;
    --font-script:   'Great Vibes', cursive;
    --font-body:     'Montserrat', sans-serif;
    --font-serif:    'Playfair Display', serif;
    --hero-gradient: linear-gradient(135deg, #3a2d10 0%, #c9973a 50%, #f0c060 100%);
    --ornament-color:#f0c060;
    --petal-color:   #f7d880;
}

/* --- BIRTHDAY POP: Vivid multicolor festivo --- */
.theme-bday_pop {
    --c-bg:          #fff8fe;
    --c-bg2:         #fdf0fc;
    --c-primary:     #c040b0;
    --c-primary-dark:#9a2a8a;
    --c-accent:      #f070d0;
    --c-accent2:     #faaae8;
    --c-text:        #2a0a28;
    --c-text-light:  #804070;
    --c-white:       #ffffff;
    --c-border:      rgba(192,64,176,0.25);
    --c-hero-overlay:rgba(40,5,40,0.42);
    --c-section-alt: #fdf0fc;
    --font-display:  'Playfair Display', serif;
    --font-script:   'Dancing Script', cursive;
    --font-body:     'Lato', sans-serif;
    --font-serif:    'Cormorant Garamond', serif;
    --hero-gradient: linear-gradient(135deg, #c040b0 0%, #f070d0 30%, #f0c040 60%, #40b0e0 100%);
    --ornament-color:#f070d0;
    --petal-color:   #f0c040;
}

/* --- BIRTHDAY AZURE: Blu cielo + Argento --- */
.theme-bday_azure {
    --c-bg:          #f5f8ff;
    --c-bg2:         #eaf0ff;
    --c-primary:     #3a78d4;
    --c-primary-dark:#2858a8;
    --c-accent:      #70a8f8;
    --c-accent2:     #b0ccff;
    --c-text:        #0a1840;
    --c-text-light:  #3a5080;
    --c-white:       #ffffff;
    --c-border:      rgba(58,120,212,0.25);
    --c-hero-overlay:rgba(5,15,50,0.48);
    --c-section-alt: #eaf0ff;
    --font-display:  'Cormorant Garamond', serif;
    --font-script:   'Great Vibes', cursive;
    --font-body:     'Montserrat', sans-serif;
    --font-serif:    'Playfair Display', serif;
    --hero-gradient: linear-gradient(135deg, #0a1840 0%, #3a78d4 50%, #70c8f8 100%);
    --ornament-color:#70a8f8;
    --petal-color:   #b0d8ff;
}

/* ---- Birthday ornaments e hero specifici ---- */
.birthday-hero .hero-ornament { font-size: 1.4rem; letter-spacing: 0.6rem; }
.birthday-hero .hero-ornament-top,
.birthday-hero .hero-ornament-bottom { animation: spin-slow 6s linear infinite; }

/* Age number in hero */
.hero-age {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 0.4rem;
    margin: 0.5rem 0 1rem;
    animation: fadeInUp 1s ease 0.8s both;
}
.hero-age-num {
    font-family: var(--font-display);
    font-size: clamp(4rem, 15vw, 9rem);
    font-weight: 300;
    color: var(--c-accent);
    line-height: 1;
    text-shadow: 0 4px 30px rgba(0,0,0,0.3);
}
.hero-age-label {
    font-family: var(--font-serif);
    font-size: clamp(1.5rem, 5vw, 2.5rem);
    color: rgba(255,255,255,0.85);
    font-style: italic;
}

/* About section (compleanno - analogo alla Story) */
.wedding-about { }
.about-text {
    font-family: var(--font-serif);
    font-size: 1.1rem;
    line-height: 1.9;
    color: var(--c-text);
    text-align: center;
    max-width: 720px;
    margin: 0 auto;
}
.about-text p { margin-bottom: 1.2em; }

/* Gift info section */
.wedding-gift-info {
    background: var(--c-section-alt) !important;
}
.gift-card {
    max-width: 600px;
    margin: 0 auto;
    background: var(--c-white);
    border: 1px solid var(--c-border);
    border-radius: 16px;
    padding: 2.5rem 2rem;
    text-align: center;
    box-shadow: 0 4px 30px rgba(0,0,0,0.06);
}
.gift-card .gift-icon { font-size: 2.5rem; margin-bottom: 1rem; }
.gift-card p {
    font-family: var(--font-serif);
    font-size: 1.05rem;
    color: var(--c-text);
    line-height: 1.8;
}

/* ===================== GLOBAL STYLES ===================== */

body.wedding-body {
    background-color: var(--c-bg);
    color: var(--c-text);
    font-family: var(--font-body);
    font-weight: 300;
    line-height: 1.8;
    /* Previene scroll orizzontale causato da elementi o padding che eccedono il viewport */
    overflow-x: hidden;
    max-width: 100%;
}
/* Tutte le sezioni rimangono entro il viewport */
body.wedding-body > section,
body.wedding-body > nav,
body.wedding-body > footer {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* ===================== REVEAL ANIMATION ===================== */
[data-reveal] {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.9s cubic-bezier(0.22,1,0.36,1), transform 0.9s cubic-bezier(0.22,1,0.36,1);
}
[data-reveal].revealed {
    opacity: 1;
    transform: translateY(0);
}

/* ===================== NAVIGATION ===================== */
.wedding-nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1000;
    background: transparent;
    transition: background 0.4s ease, backdrop-filter 0.4s ease, box-shadow 0.4s ease;
    padding: 0 2rem;
}
.wedding-nav.scrolled {
    background: rgba(var(--c-bg-rgb, 250,248,244), 0.92);
    backdrop-filter: blur(12px);
    box-shadow: 0 2px 20px rgba(0,0,0,0.08);
}
.theme-notte .wedding-nav.scrolled { background: rgba(14,22,40,0.92); }

.wedding-nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
}
.wedding-nav-brand {
    font-family: var(--font-script);
    font-size: 1.6rem;
    color: var(--c-white);
    transition: color 0.4s;
    white-space: nowrap;
}
.wedding-nav.scrolled .wedding-nav-brand { color: var(--c-primary); }

.wedding-nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}
.wedding-nav-links a {
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.9);
    text-decoration: none;
    transition: color 0.3s;
    padding-bottom: 2px;
    border-bottom: 1px solid transparent;
}
.wedding-nav.scrolled .wedding-nav-links a { color: var(--c-text); }
.wedding-nav-links a:hover { color: var(--c-accent); border-bottom-color: var(--c-accent); }

.wedding-nav-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--c-white);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
}
.wedding-nav.scrolled .wedding-nav-toggle { color: var(--c-text); }

/* ===================== HERO ===================== */
.wedding-hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    text-align: center;
}

.hero-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transform: scale(1.05);
    transition: transform 8s ease;
}
.wedding-hero:hover .hero-bg { transform: scale(1.08); }
.hero-bg-gradient { background: var(--hero-gradient); animation: heroGradientShift 8s ease infinite alternate; }
@keyframes heroGradientShift {
    from { filter: hue-rotate(0deg) brightness(1); }
    to   { filter: hue-rotate(10deg) brightness(1.05); }
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: var(--c-hero-overlay);
}
.hero-overlay-light { background: rgba(0,0,0,0.15); }

.hero-content {
    position: relative;
    z-index: 2;
    padding: 2rem;
    max-width: 900px;
    width: 100%;
    box-sizing: border-box;
}

.hero-ornament {
    font-size: 0.9rem;
    letter-spacing: 0.5em;
    color: var(--c-accent);
    display: block;
    margin: 1rem 0;
    animation: fadeInDown 1.2s ease both;
}
.hero-ornament-top  { animation-delay: 0.2s; }
.hero-ornament-bottom { animation-delay: 1.2s; }

.hero-pre {
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 400;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.85);
    margin-bottom: 1.5rem;
    animation: fadeInUp 1s ease 0.4s both;
}

.hero-names {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    animation: fadeInUp 1s ease 0.6s both;
}
.hero-name-1, .hero-name-2 {
    font-family: var(--font-display);
    font-size: clamp(3.5rem, 10vw, 7rem);
    font-weight: 300;
    color: var(--c-white);
    line-height: 1.1;
    letter-spacing: 0.02em;
    text-shadow: 0 2px 30px rgba(0,0,0,0.3);
}
.hero-ampersand {
    font-family: var(--font-script);
    font-size: clamp(2.5rem, 7vw, 5rem);
    color: var(--c-accent);
    line-height: 1;
    margin: -0.3em 0;
    animation: pulse 3s ease infinite;
}
@keyframes pulse { 0%,100%{transform:scale(1)} 50%{transform:scale(1.05)} }

.hero-date {
    margin-top: 1.5rem;
    animation: fadeInUp 1s ease 0.9s both;
}
.hero-date-inner {
    display: inline-block;
    font-family: var(--font-serif);
    font-size: 1.2rem;
    font-style: italic;
    color: rgba(255,255,255,0.9);
    letter-spacing: 0.05em;
    padding: 0.5rem 2rem;
    border-top: 1px solid rgba(255,255,255,0.4);
    border-bottom: 1px solid rgba(255,255,255,0.4);
}

.hero-venue {
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: rgba(255,255,255,0.8);
    margin-top: 1rem;
    letter-spacing: 0.05em;
    animation: fadeInUp 1s ease 1s both;
}

.hero-tagline {
    font-family: var(--font-serif);
    font-style: italic;
    font-size: 1.05rem;
    color: rgba(255,255,255,0.75);
    margin-top: 1rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    animation: fadeInUp 1s ease 1.1s both;
}

/* ---- Countdown ---- */
.wedding-countdown {
    position: relative;
    z-index: 2;
    display: flex;
    gap: 1.5rem;
    align-items: center;
    margin-top: 3rem;
    animation: fadeInUp 1s ease 1.3s both;
    background: rgba(0,0,0,0.25);
    backdrop-filter: blur(8px);
    padding: 1.5rem 2.5rem;
    border-radius: 50px;
    border: 1px solid rgba(255,255,255,0.2);
}
.countdown-unit { text-align: center; }
.count-num {
    display: block;
    font-family: var(--font-display);
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 600;
    color: var(--c-white);
    line-height: 1;
    min-width: 3ch;
    transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1);
}
.count-num.flip { transform: scale(1.2); }
.count-label {
    display: block;
    font-family: var(--font-body);
    font-size: 0.65rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.7);
    margin-top: 0.3rem;
}
.countdown-sep {
    font-size: 2rem;
    color: var(--c-accent);
    font-weight: 300;
    animation: blink 1s step-start infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* ---- Scroll btn ---- */
.hero-scroll-btn {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    font-size: 0.75rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    animation: fadeIn 1.5s ease 2s both;
}
.scroll-arrow { animation: bounce 2s ease infinite; }
@keyframes bounce { 0%,100%{transform:translateY(0)} 50%{transform:translateY(8px)} }

/* ===================== SECTION BASE ===================== */
.wedding-section {
    position: relative;
    z-index: 1;
    padding: 6rem 1.5rem;
}
.wedding-section:nth-child(even) { background: var(--c-section-alt); }

.wedding-container { max-width: 900px; margin: 0 auto; }
.wedding-container-wide { max-width: 1200px; margin: 0 auto; }

.section-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 3.5rem;
    text-align: center;
}
.section-ornament {
    color: var(--c-accent);
    font-size: 1.2rem;
    animation: spin-slow 8s linear infinite;
}
@keyframes spin-slow { to { transform: rotate(360deg); } }

.section-title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 300;
    color: var(--c-text);
    letter-spacing: 0.05em;
    position: relative;
}
.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 2px;
    background: var(--c-accent);
    margin: 0.5rem auto 0;
}

/* ===================== STORY ===================== */
.story-timeline {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-bottom: 3rem;
    padding-left: 2rem;
    border-left: 2px solid var(--c-border);
    position: relative;
}
.timeline-item {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    position: relative;
}
.timeline-dot {
    position: absolute;
    left: -2.5rem;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: var(--c-bg);
    border: 2px solid var(--c-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    box-shadow: 0 0 0 4px var(--c-bg);
    transition: transform 0.3s ease;
}
.timeline-item:hover .timeline-dot { transform: scale(1.2); }
.timeline-content h4 {
    font-family: var(--font-serif);
    font-size: 1.1rem;
    color: var(--c-primary);
    margin-bottom: 0.25rem;
}
.timeline-content p { font-size: 0.95rem; color: var(--c-text-light); }

.story-text {
    font-family: var(--font-serif);
    font-size: 1.1rem;
    line-height: 1.9;
    color: var(--c-text);
    text-align: center;
    max-width: 720px;
    margin: 0 auto;
}
.story-text p { margin-bottom: 1.2em; }

/* ===================== EVENT ===================== */
.event-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}
.event-card {
    background: var(--c-white);
    border: 1px solid var(--c-border);
    border-radius: 16px;
    padding: 2.5rem 2rem;
    text-align: center;
    box-shadow: 0 4px 30px rgba(0,0,0,0.06);
    transition: transform 0.4s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.4s ease;
}
.event-card:hover { transform: translateY(-8px); box-shadow: 0 12px 40px rgba(0,0,0,0.12); }
.event-card-icon { font-size: 2.5rem; margin-bottom: 1rem; }
.event-card h3 {
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 400;
    color: var(--c-primary);
    margin-bottom: 1rem;
}
.event-date  { font-size: 0.9rem; color: var(--c-text-light); margin-bottom: 0.5rem; }
.event-venue { font-size: 1.05rem; margin-bottom: 0.5rem; }
.event-address { font-size: 0.9rem; color: var(--c-text-light); margin-bottom: 1rem; }
.event-map-btn {
    display: inline-block;
    padding: 0.5rem 1.2rem;
    background: var(--c-primary);
    color: var(--c-white);
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 500;
    text-decoration: none;
    letter-spacing: 0.05em;
    transition: background 0.3s, transform 0.3s;
}
.event-map-btn:hover { background: var(--c-primary-dark); transform: scale(1.05); }

/* ===================== DRESS CODE ===================== */
.dresscode-card {
    max-width: 600px;
    margin: 0 auto;
    background: var(--c-white);
    border: 1px solid var(--c-border);
    border-radius: 16px;
    padding: 3rem;
    text-align: center;
    box-shadow: 0 4px 30px rgba(0,0,0,0.06);
    position: relative;
    overflow: hidden;
}
.dresscode-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--c-primary), var(--c-accent), var(--c-primary));
}
.dresscode-icon { font-size: 3rem; margin-bottom: 1rem; }
.dresscode-card h3 {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 400;
    color: var(--c-primary);
    margin-bottom: 1rem;
    letter-spacing: 0.05em;
}
.dresscode-note { font-size: 1rem; color: var(--c-text-light); line-height: 1.8; }

/* ===================== RSVP FORM ===================== */
.wedding-rsvp-section { background: var(--c-bg2) !important; }

.rsvp-message-text {
    text-align: center;
    font-family: var(--font-serif);
    font-style: italic;
    font-size: 1.1rem;
    color: var(--c-text-light);
    margin-bottom: 1rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}
.rsvp-deadline {
    text-align: center;
    font-size: 0.9rem;
    margin-bottom: 2.5rem;
    color: var(--c-primary);
}

.wedding-form {
    background: var(--c-white);
    border: 1px solid var(--c-border);
    border-radius: 20px;
    padding: 3rem;
    box-shadow: 0 8px 50px rgba(0,0,0,0.08);
    max-width: 700px;
    margin: 0 auto;
}

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.form-field { margin-bottom: 1.5rem; }
.form-label {
    display: block;
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--c-text-light);
    margin-bottom: 0.5rem;
}
.wedding-form input[type="text"],
.wedding-form input[type="email"],
.wedding-form input[type="tel"],
.wedding-form input[type="number"],
.wedding-form select,
.wedding-form textarea {
    width: 100%;
    padding: 0.85rem 1.2rem;
    background: var(--c-bg);
    border: 1.5px solid var(--c-border);
    border-radius: 10px;
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--c-text);
    transition: border-color 0.3s, box-shadow 0.3s;
    outline: none;
    -webkit-appearance: none;
}
.wedding-form input:focus,
.wedding-form select:focus,
.wedding-form textarea:focus {
    border-color: var(--c-primary);
    box-shadow: 0 0 0 3px rgba(var(--c-primary-rgb, 184,149,106), 0.15);
}

/* Attending Toggle */
.attending-toggle {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}
.attending-opt {
    flex: 1;
    min-width: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem;
    border: 2px solid var(--c-border);
    border-radius: 12px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.3s cubic-bezier(0.34,1.56,0.64,1);
    background: var(--c-bg);
}
.attending-opt input[type="radio"] { display: none; }
.attending-opt:has(input:checked) {
    border-color: var(--c-primary);
    background: var(--c-primary);
    color: var(--c-white);
    transform: scale(1.03);
}

/* Submit button */
.wedding-submit-btn {
    width: 100%;
    padding: 1.2rem;
    background: linear-gradient(135deg, var(--c-primary), var(--c-primary-dark));
    color: var(--c-white);
    border: none;
    border-radius: 50px;
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.34,1.56,0.64,1);
    margin-top: 0.5rem;
    position: relative;
    overflow: hidden;
}
.wedding-submit-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--c-accent), var(--c-primary));
    opacity: 0;
    transition: opacity 0.3s;
}
.wedding-submit-btn:hover { transform: translateY(-3px); box-shadow: 0 8px 25px rgba(0,0,0,0.2); }
.wedding-submit-btn:hover::before { opacity: 1; }
.wedding-submit-btn span { position: relative; z-index: 1; }
.wedding-submit-btn:disabled { opacity: 0.7; cursor: not-allowed; transform: none; }

.rsvp-success-msg {
    background: linear-gradient(135deg, var(--c-primary), var(--c-accent));
    color: var(--c-white);
    padding: 2rem;
    border-radius: 16px;
    text-align: center;
    font-family: var(--font-serif);
    font-size: 1.2rem;
    font-style: italic;
    line-height: 1.7;
    animation: fadeInUp 0.6s ease;
}

/* ===================== GALLERY ===================== */
.gallery-slideshow {
    position: relative;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    /* aspect-ratio imposta altezza automatica: se il browser è vecchio e non la
       supporta, min-height evita che il container collassi a zero. */
    aspect-ratio: 16 / 9;
    min-height: 200px;
    background: #111;
}
/* Fallback padding-bottom per browser senza aspect-ratio (raro, ma possibile) */
@supports not (aspect-ratio: 1) {
    .gallery-slideshow {
        padding-bottom: 56.25%;   /* 16:9 */
        height: 0;
        min-height: 0;
    }
}

.gallery-slide {
    position: absolute;
    /* 'inset' non è supportato su alcuni vecchi WebKit mobile: usiamo le proprietà esplicite */
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    opacity: 0;
    transition: opacity 0.8s ease, transform 0.8s ease;
    transform: scale(1.03);
    z-index: 0;       /* stack base */
}
/* La prima slide ha class 'active' già nel PHP → visibile senza aspettare il JS */
.gallery-slide.active {
    opacity: 1;
    transform: scale(1);
    z-index: 1;       /* sopra le slide inattive */
}
.gallery-slide.prev {
    opacity: 0;
    transform: scale(0.97);
    z-index: 0;
}

/* ---- Override CSS del tema WordPress ----
   I temi spesso dichiarano `img { max-width:100%; height:auto; }`
   che rompe height:100% sulle slide. Usiamo !important qui perché
   il contesto è inequivocabile e controllato. */
.gallery-slideshow .gallery-img {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    object-fit: cover !important;
}

.gallery-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    margin: 1.5rem 0;
}
.gallery-btn {
    width: 48px; height: 48px;
    border-radius: 50%;
    background: var(--c-primary);
    color: var(--c-white);
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34,1.56,0.64,1);
    display: flex;
    align-items: center;
    justify-content: center;
}
.gallery-btn:hover { background: var(--c-primary-dark); transform: scale(1.1); }

.gallery-dots { display: flex; gap: 0.5rem; align-items: center; }
.gallery-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--c-border);
    cursor: pointer;
    transition: all 0.3s;
}
.gallery-dot.active { background: var(--c-primary); transform: scale(1.4); }

.gallery-grid-preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 0.5rem;
    margin-top: 1.5rem;
}
.gallery-grid-item {
    aspect-ratio: 1;
    min-height: 80px;           /* Fallback se aspect-ratio non regge */
    overflow: hidden;
    border-radius: 8px;
    cursor: pointer;
    position: relative;
    background: var(--c-bg2);   /* Placeholder color mentre l'immagine carica */
}
/* Override CSS del tema per le miniature della griglia */
.gallery-grid-item img {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    object-fit: cover !important;
    transition: transform 0.4s ease;
}
.gallery-grid-item:hover img { transform: scale(1.1); }
.gallery-grid-overlay {
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;  /* No inset per compatibilità */
    background: rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    opacity: 0;
    transition: opacity 0.3s;
}
.gallery-grid-item:hover .gallery-grid-overlay { opacity: 1; }

/* ===================== LIGHTBOX ===================== */
.wedding-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.95);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}
.lightbox-img-wrap {
    max-width: 90vw;
    max-height: 85vh;
    display: flex;
    align-items: center;
    justify-content: center;
}
.lightbox-img-wrap img {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 8px;
    animation: fadeInScale 0.4s ease;
}
@keyframes fadeInScale { from { opacity:0; transform: scale(0.9); } to { opacity:1; transform: scale(1); } }

.lightbox-close {
    position: absolute;
    top: 1.5rem; right: 1.5rem;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: #fff;
    width: 44px; height: 44px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s;
}
.lightbox-close:hover { background: rgba(255,255,255,0.25); transform: rotate(90deg); }
.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: #fff;
    padding: 1rem;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s;
    border-radius: 8px;
}
.lightbox-nav:hover { background: rgba(255,255,255,0.25); }
.lightbox-prev { left: 1.5rem; }
.lightbox-next { right: 1.5rem; }

/* ===================== FOOTER ===================== */
.wedding-footer {
    background: var(--c-text);
    color: var(--c-white);
    text-align: center;
    padding: 4rem 2rem;
    position: relative;
    z-index: 1;
}
.theme-notte .wedding-footer { background: #050a14; }

.footer-hearts {
    display: flex;
    gap: 0.8rem;
    justify-content: center;
    margin-bottom: 1.5rem;
}
.footer-hearts span {
    color: var(--c-accent);
    font-size: 1.5rem;
    animation: heartbeat 2s ease infinite;
}
.footer-hearts span:nth-child(2) { animation-delay: 0.3s; }
.footer-hearts span:nth-child(3) { animation-delay: 0.6s; }
@keyframes heartbeat { 0%,100%{transform:scale(1)} 50%{transform:scale(1.2)} }

.footer-names {
    font-family: var(--font-script);
    font-size: 2.5rem;
    color: var(--c-accent);
    margin-bottom: 0.5rem;
}
.footer-date { font-size: 0.9rem; opacity: 0.7; margin-bottom: 1rem; }
.footer-tagline { font-family: var(--font-serif); font-style: italic; opacity: 0.6; }

/* ===================== ANIMATIONS ===================== */
@keyframes fadeIn  { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeInUp   { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeInDown { from { opacity: 0; transform: translateY(-20px); } to { opacity: 1; transform: translateY(0); } }

/* ===================== NOTTE THEME EXTRAS ===================== */
.theme-notte .wedding-section { color: var(--c-text); }
.theme-notte .event-card,
.theme-notte .dresscode-card,
.theme-notte .wedding-form {
    background: var(--c-bg2);
    border-color: var(--c-border);
}
.theme-notte .wedding-form input,
.theme-notte .wedding-form select,
.theme-notte .wedding-form textarea,
.theme-notte .attending-opt {
    background: var(--c-bg);
    color: var(--c-text);
}
.theme-notte .section-title { color: var(--c-accent2); }

/* Stars for notte theme */
.theme-notte .wedding-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(1px 1px at 10% 20%, white, transparent),
        radial-gradient(1px 1px at 30% 50%, rgba(255,255,255,0.8), transparent),
        radial-gradient(1px 1px at 50% 10%, white, transparent),
        radial-gradient(1px 1px at 70% 35%, rgba(255,255,255,0.7), transparent),
        radial-gradient(1px 1px at 90% 60%, white, transparent),
        radial-gradient(1px 1px at 20% 80%, rgba(255,255,255,0.9), transparent),
        radial-gradient(1px 1px at 55% 70%, rgba(255,255,255,0.6), transparent),
        radial-gradient(1px 1px at 80% 90%, white, transparent),
        radial-gradient(1px 1px at 40% 40%, rgba(255,255,255,0.8), transparent);
    animation: twinkle 4s ease infinite alternate;
    pointer-events: none;
}
@keyframes twinkle { from { opacity: 0.6; } to { opacity: 1; } }

/* ===================== VINTAGE EXTRAS ===================== */
.theme-vintage .hero-bg-gradient {
    background: radial-gradient(ellipse at center, #c4a07a, #8b6b4a, #6b4f32);
}
.theme-vintage .section-title { font-variant: small-caps; }

/* ===================== MOBILE RESPONSIVE ===================== */
@media (max-width: 768px) {
    .wedding-nav-links { display: none; flex-direction: column; position: fixed; top: 70px; left: 0; right: 0; background: var(--c-bg); padding: 1rem 2rem; box-shadow: 0 4px 20px rgba(0,0,0,0.1); border-top: 1px solid var(--c-border); }
    .wedding-nav-links.open { display: flex; }
    .wedding-nav-links a { color: var(--c-text); padding: 0.75rem 0; font-size: 0.9rem; }
    .theme-notte .wedding-nav-links { background: var(--c-bg); }
    .wedding-nav-toggle { display: block; }

    .hero-names { font-size: 3rem; }
    .hero-content { padding: 1rem; }
    .wedding-countdown { flex-wrap: wrap; gap: 0.75rem; padding: 1rem 1.5rem; border-radius: 16px; }
    .countdown-sep { display: none; }
    .count-num { font-size: 2rem; }

    .wedding-section { padding: 4rem 1.25rem; }
    .story-timeline { padding-left: 1.5rem; }
    .timeline-dot { left: -2rem; }
    .form-row { grid-template-columns: 1fr; }
    .wedding-form { padding: 1.5rem; }
    .event-cards { grid-template-columns: 1fr; }
    .gallery-grid-preview { grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); }
    /* Ratio 4:3 su mobile — il contenuto si vede meglio di 16:9 su uno schermo stretto */
    .gallery-slideshow { aspect-ratio: 4 / 3; min-height: 220px; }
    .lightbox-nav { padding: 0.7rem; font-size: 1.1rem; }
    .lightbox-prev { left: 0.5rem; }
    .lightbox-next { right: 0.5rem; }
    .attending-toggle { flex-direction: column; }
    .attending-opt { min-width: auto; }
}

@media (max-width: 480px) {
    .hero-name-1, .hero-name-2 { font-size: 2.5rem; }
    .hero-ampersand { font-size: 2rem; }
    /* 3 colonne fisse nella griglia anteprima */
    .gallery-grid-preview { grid-template-columns: repeat(3, 1fr); }
    /* Su schermi molto piccoli la griglia è sufficiente, nascondiamo il lightbox
       se l'immagine è più grande dello schermo e usiamo object-fit */
    .lightbox-img-wrap img { border-radius: 0; }
}
