/* Reset e Variabili */
:root {
    --primary-gold: #D4AF37;
    --secondary-gold: #C5A028;
    --soft-pink: #FADADD;
    /* Rosa cipria delicato */
    --soft-pink-bg: #FFF0F5;
    /* Sfondo rosa chiarissimo */
    --text-dark: #4A4A4A;
    --text-light: #7A7A7A;
    --bg-marble: #f9f9f9;
    --font-serif: 'Cinzel', serif;
    --font-script: 'Great Vibes', cursive;
    --font-sans: 'Lato', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-sans);
    color: var(--text-dark);
    line-height: 1.6;
    background-color: var(--bg-marble);
    background-image: url('assets/sfondo_marmo.png');
    background-size: cover;
    background-attachment: fixed;
}

/* Typography */
h1,
h2,
h3 {
    font-family: var(--font-serif);
    color: var(--primary-gold);
    text-transform: uppercase;
    letter-spacing: 2px;
}

h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

h2 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    text-align: center;
    position: relative;
    padding-bottom: 15px;
    display: inline-block;
}

h2::after {
    content: '';
    display: block;
    width: 80px;
    height: 3px;
    background: linear-gradient(to right, var(--primary-gold), var(--soft-pink));
    margin: 15px auto 0;
}

.subtitle {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: var(--text-dark);
}

.announcement {
    font-family: var(--font-script);
    font-size: 2.5rem;
    color: var(--primary-gold);
    margin-bottom: 2.5rem;
}

/* Menu Hamburger */
.hamburger-menu {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1000;
    cursor: pointer;
}

.hamburger-icon {
    width: 40px;
    height: 30px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 5px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.hamburger-icon span {
    display: block;
    width: 100%;
    height: 3px;
    background-color: var(--primary-gold);
    transition: all 0.3s ease;
    border-radius: 3px;
}

.menu-items {
    position: fixed;
    top: 0;
    left: -300px;
    width: 280px;
    height: 100vh;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    padding: 80px 20px 20px;
    transition: all 0.3s ease;
    z-index: 999;
    overflow-y: auto;
}

.menu-items a {
    display: block;
    padding: 12px 15px;
    color: var(--text-dark);
    text-decoration: none;
    font-family: var(--font-serif);
    font-size: 1.1rem;
    margin: 5px 0;
    border-radius: 4px;
    transition: all 0.3s ease;
    text-align: left;
}

.menu-items a:hover,
.menu-items a:focus {
    background-color: var(--soft-pink-bg);
    color: var(--primary-gold);
    transform: translateX(5px);
}

.menu-items a.highlight {
    background-color: var(--primary-gold);
    color: white;
    margin-top: 20px;
    text-align: center;
    font-weight: bold;
}

.menu-items a.highlight:hover {
    background-color: var(--secondary-gold);
    transform: translateX(5px);
}

/* Menu aperto */
.hamburger-menu.active .hamburger-icon {
    background: rgba(255, 255, 255, 0.9);
}

.hamburger-menu.active .hamburger-icon span:nth-child(1) {
    transform: translateY(11px) rotate(45deg);
}

.hamburger-menu.active .hamburger-icon span:nth-child(2) {
    opacity: 0;
}

.hamburger-menu.active .hamburger-icon span:nth-child(3) {
    transform: translateY(-11px) rotate(-45deg);
}

.hamburger-menu.active .menu-items {
    left: 0;
}

/* Stili per la sezione del menu */
.menu-divider {
    height: 1px;
    background-color: rgba(0, 0, 0, 0.1);
    margin: 15px 0;
    width: 100%;
}

.menu-section-title {
    font-family: var(--font-serif);
    color: var(--primary-gold);
    font-size: 1.1rem;
    font-weight: bold;
    margin: 20px 0 10px 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.9;
}

/* Miglioramento per i link della sezione Simpson */
.menu-items a[href^="pagine meme/"] {
    padding-left: 25px;
    font-size: 0.95rem;
    color: #666;
    position: relative;
}

.menu-items a[href^="pagine meme/"]:before {
    content: "•";
    position: absolute;
    left: 10px;
    color: var(--primary-gold);
}

.menu-items a[href^="pagine meme/"]:hover {
    color: var(--primary-gold);
    transform: translateX(5px);
}

/* Layout */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
    text-align: center;
    position: relative;
    z-index: 1;
}

.section {
    padding: 100px 0;
    position: relative;
}

/* Decorazioni Floreali */
.floral-corner {
    position: absolute;
    width: 300px;
    pointer-events: none;
    z-index: 0;
    opacity: 0.9;
    mix-blend-mode: multiply;
    /* Rende trasparente il bianco */
}

.floral-top-left {
    top: -50px;
    left: -50px;
    transform: rotate(0deg);
}

.floral-bottom-right {
    bottom: -50px;
    right: -50px;
    transform: rotate(180deg);
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero-content {
    padding: 60px;
    border: 3px solid var(--primary-gold);
    background: rgba(255, 255, 255, 0.95);
    max-width: 900px;
    width: 90%;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.1);
    position: relative;
}

.hero-content::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    bottom: 10px;
    border: 1px solid var(--primary-gold);
    pointer-events: none;
}

/* Buttons */
.buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 40px;
}

.btn {
    display: inline-block;
    padding: 15px 40px;
    text-decoration: none;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 2px;
    transition: all 0.3s ease;
    border: 1px solid var(--primary-gold);
    color: var(--primary-gold);
    background: white;
    font-weight: bold;
}

.btn-primary {
    background: var(--primary-gold);
    color: white;
    box-shadow: 0 5px 15px rgba(212, 175, 55, 0.3);
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.btn-primary:hover {
    background: var(--secondary-gold);
    border-color: var(--secondary-gold);
}

/* Invitation Section - Gallery Style */
.invitation-section {
    background-color: var(--soft-pink-bg);
    overflow: hidden;
    /* Hide scrollbar if any on body */
}

/* Allow wider container for invitation gallery to support larger images */
.invitation-section .container {
    max-width: 1400px;
}

.invitation-gallery {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 15px;
    /* Tighter gap */
    padding: 20px 10px 40px;
    /* More vertical space */
    -webkit-overflow-scrolling: touch;
    align-items: center;
    /* Center vertically */
    min-height: 400px;
    /* Ensure space for rotated items */
    scrollbar-width: none;
    /* Hide scrollbar Firefox */
}

.invitation-gallery::-webkit-scrollbar {
    display: none;
    /* Hide scrollbar Chrome/Safari */
}

.invitation-slide {
    flex: 0 0 90%;
    /* Larger on mobile (was 85%) */
    max-width: 450px;
    /* Larger max width */
    scroll-snap-align: center;
    position: relative;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    background: white;
    padding: 5px;
    /* Less padding to maximize image */
    border: 1px solid rgba(212, 175, 55, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    /* Ensure height for rotated image */
}

/* Rotate first slide image -90deg & Scale Up */
.invitation-slide:first-child img {
    transform: rotate(-90deg) scale(1.35);
    /* Zoom in to fill space */
    width: 80%;
    /* Base width */
    max-width: none;
    margin: 40px auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    /* Separate shadow for rotated element */
}

.invitation-slide img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 5px;
}

/* Center active slide visually if needed, but scroll-snap handles alignment */

.gallery-hint {
    font-size: 0.9rem;
    color: var(--primary-gold);
    margin-top: 10px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    opacity: 0.8;
    animation: pulseHint 2s infinite;
}

@keyframes pulseHint {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.8;
    }

    50% {
        transform: scale(1.05);
        opacity: 1;
    }
}

@media (min-width: 768px) {
    .invitation-gallery {
        justify-content: center;
        /* Center on desktop if they fit */
        scroll-snap-type: none;
        /* Optional: disable snap on desktop if grid preferred */
        flex-wrap: wrap;
        /* Wrap on large screens? Or keep carousel? Let's wrap for better overview on desktop */
        overflow-x: visible;
    }

    .invitation-slide {
        flex: 0 0 calc(50% - 20px);
        /* 2 per row on tablet */
        max-width: 400px;
        /* Increased from 350px */
        margin-bottom: 20px;
    }

    .gallery-hint {
        display: none;
    }
}

@media (min-width: 1024px) {
    .invitation-slide {
        flex: 0 0 calc(25% - 20px);
        /* 4 in a row on desktop */
        max-width: 340px;
        /* Increased from 300px */
    }
}

.gallery-section {
    background: white;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-top: 40px;
}

.gallery-item {
    background: white;
    padding: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease;
}

.gallery-item:hover {
    transform: translateY(-5px) rotate(1deg);
    z-index: 2;
}

.gallery-item img {
    width: 100%;
    height: 300px;
    object-fit: cover;
    display: block;
}

.gallery-placeholder {
    width: 100%;
    height: 300px;
    background-color: #eee;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #aaa;
    font-style: italic;
    border: 1px dashed #ccc;
}

.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 1000;
}

.lightbox-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

.lightbox-content {
    max-width: min(900px, 100%);
    max-height: calc(100vh - 80px);
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.lightbox-nav {
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 32px;
    cursor: pointer;
    padding: 8px 12px;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

.lightbox-nav:focus {
    outline: none;
}

.lightbox-image {
    max-width: 100%;
    max-height: calc(100vh - 120px);
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    transform: scale(0.96);
    transition: transform 0.3s ease;
}

.lightbox-overlay.visible .lightbox-image {
    transform: scale(1);
}

.lightbox-caption {
    margin-top: 12px;
    color: #f9f9f9;
    font-size: 0.95rem;
}

.lightbox-close {
    position: absolute;
    top: 18px;
    right: 24px;
    color: #ffffff;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
}

/* Program Section */
.program-section {
    background: white;
}

.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 0;
}

.timeline-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 30px;
    position: relative;
    z-index: 1;
}

.timeline-line {
    width: 2px;
    height: 60px;
    background: linear-gradient(to bottom, var(--primary-gold), var(--soft-pink));
    margin: 10px auto;
}

.icon {
    font-size: 2.5rem;
    margin-bottom: 15px;
    background: var(--soft-pink-bg);
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 2px solid var(--primary-gold);
    color: var(--primary-gold);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.time {
    font-weight: bold;
    color: var(--primary-gold);
    margin-bottom: 5px;
    font-size: 1.2rem;
}

.details h3 {
    font-size: 1.8rem;
    margin-bottom: 10px;
    font-family: var(--font-serif);
    color: var(--text-dark);
}

/* RSVP Section */
.rsvp-section {
    background-color: var(--soft-pink-bg);
}

/* Stile Form RSVP */
.section-rsvp {
    background-color: var(--soft-pink-bg);
    padding: 80px 0;
}

#rsvp-form {
    background: white;
    padding: 40px;
    border: 2px solid var(--primary-gold);
    max-width: 600px;
    margin: 0 auto;
    text-align: left;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.05);
    border-radius: 8px;
}

#rsvp-form label {
    display: block;
    margin-bottom: 20px;
    font-weight: bold;
    color: var(--primary-gold);
    font-family: var(--font-serif);
    font-size: 1.1rem;
}

#rsvp-form input,
#rsvp-form textarea {
    width: 100%;
    padding: 12px;
    margin-top: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: var(--font-sans);
    font-size: 1rem;
    background: #fdfdfd;
    transition: all 0.3s ease;
}

#rsvp-form input:focus,
#rsvp-form textarea:focus {
    border-color: var(--primary-gold);
    outline: none;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

#rsvp-form button {
    width: 100%;
    margin-top: 10px;
    padding: 15px;
    font-size: 1.1rem;
    cursor: pointer;
}

.rsvp-status {
    margin-top: 20px;
    text-align: center;
    font-weight: bold;
    min-height: 1.5em;
}

/* Gift Section */
.gift-section {
    background: white;
}

.gift-message {
    font-family: var(--font-script);
    font-size: 2rem;
    margin-bottom: 40px;
    color: var(--text-light);
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.iban-card {
    background: var(--soft-pink-bg);
    padding: 50px;
    border: 2px solid var(--primary-gold);
    display: inline-block;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.1);
    position: relative;
    border-radius: 10px;
}

.iban-card::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    bottom: 10px;
    border: 1px dashed var(--primary-gold);
    pointer-events: none;
    border-radius: 5px;
}

.iban-label {
    font-weight: bold;
    text-transform: uppercase;
    color: var(--primary-gold);
    margin-bottom: 15px;
    letter-spacing: 2px;
}

.iban-code {
    font-family: 'Lato', monospace;
    font-size: 1.5rem;
    letter-spacing: 2px;
    margin-bottom: 20px;
    font-weight: bold;
    color: var(--text-dark);
}

/* Photo Section */
.photo-section {
    background-color: var(--soft-pink-bg);
}

.qr-box {
    width: 180px;
    height: 180px;
    background: white;
    margin: 40px auto;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--primary-gold);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    font-weight: bold;
    color: var(--primary-gold);
}

.qr-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 16px;
}

/* Footer */
footer {
    background: #2c2c2c;
    color: #d4af37;
    padding: 40px;
    text-align: center;
    font-size: 1rem;
    letter-spacing: 2px;
    border-top: 5px solid var(--primary-gold);
}

/* Responsive */
@media (max-width: 768px) {
    h1 {
        font-size: 2.5rem;
    }

    h2 {
        font-size: 2rem;
    }

    .announcement {
        font-size: 1.8rem;
    }

    .hero-content {
        padding: 30px;
    }

    .iban-code {
        font-size: 1.1rem;
    }

    .floral-corner {
        width: 150px;
    }
}