:root {
    --env-bg: #1c2b23;
    --gold-accent: #b89947;
    --ink-color: #3e2723;
    --parchment-light: rgba(241, 227, 200, 0.9);
    --nav-height: 70px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

html {
    /* Riserva sempre lo spazio per la scrollbar, evitando i "salti" di layout */
    scrollbar-gutter: stable;
    overflow-y: scroll;
}

body {
    font-family: 'Georgia', serif;
    background-color: #e5d8c5;
    background-image: url('background.jpg');
    background-repeat: repeat;
    color: var(--ink-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* === MENU DI NAVIGAZIONE === */
.navbar {
    position: sticky;
    top: 0;
    width: 100%;
    height: var(--nav-height);
    background: var(--env-bg);
    border-bottom: 2px solid var(--gold-accent);
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 30px;
}

.nav-links a {
    text-decoration: none;
    color: #e5d8c5;
    font-family: 'Cinzel Decorative', serif;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    padding: 8px 12px;
    transition: color 0.3s ease, text-shadow 0.3s ease;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--gold-accent);
    text-shadow: 0 0 8px rgba(184, 153, 71, 0.5);
}

/* === HAMBURGER BUTTON (Nascosto su Desktop) === */
.hamburger {
    display: none;
    cursor: pointer;
    position: relative;
    z-index: 1000;
}

.hamburger span {
    display: block;
    width: 25px;
    height: 2px;
    background-color: var(--gold-accent);
    margin: 5px auto;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* === GESTIONE SWUP E TRANSIZIONI === */
#swup {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.transition-slide {
    transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.6s ease;
    opacity: 1;
    transform: translateX(0);
}

html.is-animating[data-direction="next"] .transition-slide {
    opacity: 0;
    transform: translateX(40px);
}

html.is-animating[data-direction="prev"] .transition-slide {
    opacity: 0;
    transform: translateX(-40px);
}

html.is-animating.is-leaving[data-direction="next"] .transition-slide {
    opacity: 0;
    transform: translateX(-40px);
}

html.is-animating.is-leaving[data-direction="prev"] .transition-slide {
    opacity: 0;
    transform: translateX(40px);
}

/* === LAYOUT HOMEPAGE (.hero-section) E PAGINE INTERNE (.page-section) === */
.hero-section,
.page-section {
    position: relative;
    flex: 1;
    display: flex;
    justify-content: center;
    padding: 40px 20px;
    min-height: calc(100vh - var(--nav-height));
}

.hero-section {
    align-items: center;
}

.page-section {
    align-items: flex-start;
    padding-top: 60px;
}

/* === CONTENITORE CENTRALE === */
.content-card {
    position: relative;
    z-index: 10;
    background: var(--parchment-light);
    backdrop-filter: blur(4px);
    padding: 50px 60px;
    border: 1px solid var(--gold-accent);
    outline: 2px solid var(--ink-color);
    outline-offset: -8px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    width: 100%;
    animation: fadeIn 1.2s ease-out forwards;
}

.hero-section .content-card {
    max-width: 700px;
}

.page-section .content-card {
    max-width: 800px;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* === TESTI HOMEPAGE === */
.hero-names {
    font-family: 'Great Vibes', cursive;
    font-size: 5rem;
    color: var(--gold-accent);
    margin-bottom: 10px;
    line-height: 1.1;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.name-amp {
    display: inline-block;
    margin: 0 15px;
}

.hero-date {
    font-family: 'Cinzel Decorative', serif;
    font-size: 1.4rem;
    letter-spacing: 3px;
    margin-bottom: 20px;
}

.hero-location {
    font-size: 1.1rem;
    font-style: italic;
    margin-bottom: 40px;
    color: rgba(62, 39, 35, 0.8);
    line-height: 1.4;
}

.hero-location strong {
    font-size: 1.3rem;
    font-weight: normal;
    color: var(--ink-color);
}

/* === TESTI PAGINE INTERNE === */
.page-title {
    font-family: 'Cinzel Decorative', serif;
    font-size: 2.5rem;
    color: var(--ink-color);
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

p {
    line-height: 1.6;
    margin-bottom: 15px;
}

/* === ELEMENTI CONDIVISI === */
.divider {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 30px;
}

.divider::before,
.divider::after {
    content: '';
    width: 100px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold-accent), transparent);
    margin: 0 15px;
}

/* === COUNTDOWN HOMEPAGE === */
.countdown-unified {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: 'Cinzel Decorative', serif;
    font-size: 3.5rem;
    color: var(--env-bg);
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.15);
    margin-bottom: 10px;
}

.cd-num {
    min-width: 85px;
    text-align: center;
}

.cd-sep {
    margin: 0 5px;
    color: var(--ink-color);
    transform: translateY(-4px);
    opacity: 0.6;
}

.countdown-legend {
    display: flex;
    justify-content: center;
    gap: 30px;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--ink-color);
    font-weight: bold;
    opacity: 0.8;
}

.legend-item {
    min-width: 85px;
    text-align: center;
}

/* ========================================= */
/* === STILI SPECIFICI: LOCATION.HTML === */
/* ========================================= */

.location-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    width: 100%;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    width: 100%;
}

.info-box {
    background: rgba(255, 255, 255, 0.4);
    border: 1px solid var(--gold-accent);
    padding: 20px;
    border-radius: 4px;
    box-shadow: inset 0 0 15px rgba(139, 69, 19, 0.1);
    text-align: center;
}

.info-box h3 {
    font-family: 'Cinzel Decorative', serif;
    font-size: 1.1rem;
    color: var(--env-bg);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid rgba(184, 153, 71, 0.5);
    padding-bottom: 8px;
}

.info-box p {
    font-size: 0.95rem;
    margin-bottom: 0;
    line-height: 1.5;
}

.map-container {
    width: 100%;
    height: 350px;
    border: 4px double var(--ink-color);
    border-radius: 2px;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
    background-color: var(--parchment-base);
}

.map-container iframe {
    width: 100%;
    height: 100%;
    border: none;
    filter: sepia(30%) hue-rotate(10deg);
}

.fantasy-button {
    display: inline-block;
    margin-top: 5px;
    padding: 12px 28px;
    border: 2px solid var(--ink-color);
    color: var(--parchment-light);
    background-color: var(--env-bg);
    text-decoration: none;
    font-family: 'Cinzel Decorative', serif;
    font-size: 1rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    border-radius: 4px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.fantasy-button:hover {
    background-color: var(--ink-color);
    color: var(--gold-accent);
    border-color: var(--gold-accent);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.4);
}

/* === RESPONSIVE (SMARTPHONE E TABLET) === */
@media (max-width: 768px) {
    .navbar {
        justify-content: flex-end;
        padding: 0 20px;
    }

    .hamburger {
        display: block;
        position: relative;
    }

    /* Aggiunge l'etichetta testuale a sinistra delle 3 linee */
    .hamburger::before {
        content: "MENU";
        position: absolute;
        right: 40px;
        /* Distanzia il testo dall'icona */
        top: 50%;
        transform: translateY(-50%);
        font-family: 'Cinzel Decorative', serif;
        font-size: 0.85rem;
        color: var(--gold-accent);
        letter-spacing: 2px;
        transition: opacity 0.3s ease, color 0.3s ease;
    }

    /* Cambia la scritta in CHIUDI quando il menu è aperto */
    .hamburger.toggle::before {
        content: "CHIUDI";
        color: var(--parchment-light);
        /* Colore più chiaro per contrastare lo sfondo scuro dell'overlay */
    }

    .nav-links {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background-color: rgba(28, 43, 35, 0.95);
        backdrop-filter: blur(8px);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 40px;
        transform: translateY(-100%);
        transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
        z-index: 999;
    }

    .nav-links.nav-active {
        transform: translateY(0);
    }

    .nav-links a {
        font-size: 1.5rem;
    }

    .hamburger.toggle span:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }

    .hamburger.toggle span:nth-child(2) {
        opacity: 0;
    }

    .hamburger.toggle span:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }

    .hero-section {
        align-items: flex-start;
        padding-top: 60px;
    }

    .page-section {
        padding: 40px 15px;
    }

    .content-card {
        padding: 40px 20px;
    }

    .hero-names {
        font-size: 3.5rem;
    }

    .name-part,
    .name-amp {
        display: block;
    }

    .name-amp {
        font-size: 0.8em;
    }

    .page-title {
        font-size: 1.8rem;
    }

    .countdown-unified {
        font-size: 2.2rem;
    }

    .cd-num {
        min-width: 55px;
    }

    .countdown-legend {
        gap: 15px;
        font-size: 0.65rem;
    }

    .legend-item {
        min-width: 55px;
    }
}

@media (max-width: 480px) {
    .countdown-unified {
        font-size: 1.6rem;
    }

    .cd-num {
        min-width: 40px;
    }

    .cd-sep {
        margin: 0 2px;
        transform: translateY(-2px);
    }

    .countdown-legend {
        gap: 10px;
        font-size: 0.55rem;
    }

    .legend-item {
        min-width: 40px;
    }
}


/* ========================================= */
/* === STILI SPECIFICI: RSVP.HTML === */
/* ========================================= */

.rsvp-form {
    margin-top: 30px;
    text-align: left;
    /* Il form si legge meglio allineato a sinistra, pur essendo nel container centrato */
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-label {
    font-family: 'Cinzel Decorative', serif;
    font-size: 0.9rem;
    color: var(--ink-color);
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.form-control {
    width: 100%;
    padding: 12px;
    font-family: 'Georgia', serif;
    font-size: 1rem;
    color: var(--ink-color);
    background-color: rgba(255, 255, 255, 0.4);
    /* Effetto pergamena traslucida */
    border: 1px solid rgba(62, 39, 35, 0.3);
    /* Bordo inchiostro leggero */
    border-radius: 4px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    resize: vertical;
    /* Permette all'utente di allungare le textarea solo verticalmente */
}

/* Gestione Focus per accessibilità e UX */
.form-control:focus {
    outline: none;
    border-color: var(--gold-accent);
    box-shadow: 0 0 8px rgba(184, 153, 71, 0.3);
    background-color: rgba(255, 255, 255, 0.7);
}

.form-control::placeholder {
    color: rgba(62, 39, 35, 0.5);
    font-style: italic;
}

/* Checkbox/Radio Button Customizzati a Tema */
.radio-group {
    display: flex;
    gap: 20px;
    margin-top: 5px;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 1rem;
}

/* Stile per accentuare il colore dell'inchiostro sui bottoni radio nativi */
.radio-label input[type="radio"] {
    accent-color: var(--ink-color);
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.form-submit {
    margin-top: 15px;
    text-align: center;
    /* Centra il bottone rispetto al form */
}

/* Adattamento Form per Cellulari (<=768px) */
@media (max-width: 768px) {
    .radio-group {
        flex-direction: column;
        gap: 12px;
    }
}