/* ============================================
   WEDDING INVITATION — style.css
   Palette: warm earth tones (terracotta, amber, cream)
   Fonts: Great Vibes (headings) + Source Sans 3 (body)
   ============================================ */

/* --- Google Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Great+Vibes&family=Source+Sans+3:ital,wght@0,300;0,400;0,600;0,700;1,300;1,400&display=swap');

/* --- CSS Variables --- */
:root {
    /* Palette */
    --color-cream:         #FDF6EC;
    --color-cream-dark:    #F5EBDA;
    --color-terracotta:    #C46A3A;
    --color-terracotta-dark: #A85530;
    --color-amber:         #D4952B;
    --color-amber-light:   #E8B44F;
    --color-brown:         #5C3D2E;
    --color-brown-light:   #7A5A4A;
    --color-text:          #4A3728;
    --color-text-light:    #8A7568;
    --color-white:         #FFFFFF;
    --color-overlay:       rgba(74, 55, 40, 0.55);
    --color-gold-border:   #C9A96E;

    /* Typography */
    --font-display: 'Great Vibes', cursive;
    --font-body:    'Source Sans 3', sans-serif;

    /* Sidebar */
    --sidebar-width: 280px;

    /* Spacing */
    --section-padding: 80px 60px;
    --section-padding-mobile: 50px 24px;

    /* Transitions */
    --transition-base: 0.3s ease;
}

/* --- Reset & Base --- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-body);
    color: var(--color-text);
    background-color: var(--color-cream);
    line-height: 1.7;
    overflow-x: hidden;
}

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

a {
    text-decoration: none;
    color: inherit;
}

/* ============================================
   SIDEBAR
   ============================================ */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background-color: var(--color-cream-dark);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 50px 20px 30px;
    z-index: 100;
    border-right: 1px solid rgba(201, 169, 110, 0.3);
}

.sidebar__logo {
    text-align: center;
    margin-bottom: 50px;
}

.sidebar__ornament {
    display: block;
    margin: 0 auto 8px;
    width: 60px;
    height: auto;
    opacity: 0.6;
}

.sidebar__names {
    font-family: var(--font-display);
    font-size: 2rem;
    color: var(--color-terracotta);
    line-height: 1.2;
}

.sidebar__date {
    font-family: var(--font-body);
    font-size: 0.85rem;
    color: var(--color-text-light);
    margin-top: 6px;
    letter-spacing: 1px;
}

/* Navigation */
.sidebar__nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    align-items: center;
}

.sidebar__nav a {
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 400;
    color: var(--color-brown-light);
    padding: 8px 20px;
    border-radius: 4px;
    transition: color var(--transition-base), background-color var(--transition-base);
    letter-spacing: 0.5px;
}

.sidebar__nav a:hover {
    color: var(--color-terracotta);
}

.sidebar__nav a.active {
    color: var(--color-terracotta);
    font-weight: 600;
    border-bottom: 2px solid var(--color-terracotta);
    border-radius: 0;
    padding-bottom: 4px;
}

/* Hamburger (mobile only) */
.hamburger {
    display: none;
    position: fixed;
    top: 18px;
    left: 18px;
    z-index: 200;
    background: var(--color-cream-dark);
    border: 1px solid var(--color-gold-border);
    border-radius: 6px;
    padding: 10px 12px;
    cursor: pointer;
    flex-direction: column;
    gap: 5px;
}

.hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background-color: var(--color-brown);
    border-radius: 2px;
    transition: transform var(--transition-base), opacity var(--transition-base);
}

.hamburger.open span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

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

.hamburger.open span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
}

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

.section-hero__bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}

.section-hero__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        135deg,
        rgba(253, 246, 236, 0.5) 0%,
        rgba(74, 55, 40, 0.4) 100%
    );
    z-index: 1;
}

.section-hero__content {
    position: relative;
    z-index: 2;
}

.section-hero__names {
    font-family: var(--font-display);
    font-size: 4.5rem;
    color: var(--color-white);
    text-shadow: 0 2px 20px rgba(74, 55, 40, 0.4);
    margin-bottom: 12px;
}

.section-hero__details {
    font-family: var(--font-body);
    font-size: 1.2rem;
    color: var(--color-white);
    letter-spacing: 2px;
    text-shadow: 0 1px 10px rgba(74, 55, 40, 0.4);
    font-weight: 300;
}

.section-hero__scroll-hint {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    color: var(--color-white);
    opacity: 0.7;
    font-size: 1.5rem;
    animation: float 2s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50%      { transform: translateX(-50%) translateY(-10px); }
}

/* ============================================
   SECTIONS — General
   ============================================ */
.section {
    padding: var(--section-padding);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
}

/* Scroll hint riutilizzabile per le sezioni */
.section__scroll-hint {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--color-text-light);
    opacity: 0.5;
    font-size: 1.3rem;
    animation: float 2s ease-in-out infinite;
}

.section--alt {
    background-color: var(--color-cream-dark);
}

.section__label {
    font-family: var(--font-display);
    font-size: 2.5rem;
    color: var(--color-terracotta);
    margin-bottom: 4px;
    text-align: center;
}

.section__title {
    font-family: var(--font-body);
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--color-brown);
    text-transform: uppercase;
    letter-spacing: 3px;
    margin-bottom: 40px;
    text-align: center;
}

/* ============================================
   SECTION: NOI DUE
   ============================================ */
.couple {
    display: flex;
    justify-content: center;
    gap: 100px;
    flex-wrap: wrap;
    margin-bottom: 60px;
}

.couple__person {
    position: relative;
    display: flex;
    align-items: center;
    max-width: 500px;
    flex: 1;
    min-width: 320px;
}

/* Card contenitore testo */
.couple__card {
    background: var(--color-white);
    border: 1px solid rgba(201, 169, 110, 0.25);
    border-radius: 10px;
    padding: 30px 35px;
    box-shadow: 0 4px 20px rgba(92, 61, 46, 0.08);
    width: 100%;
}

/* Sposa: testo a sinistra, foto a destra che esce dalla card */
.couple__person--left .couple__card {
    padding-right: 150px;
    text-align: left;
}

.couple__person--left .couple__photo-wrapper {
    position: absolute;
    right: -20px;
    top: 50%;
    transform: translateY(-50%);
}

/* Sposo: foto a sinistra che esce dalla card, testo a destra */
.couple__person--right .couple__card {
    padding-left: 150px;
    text-align: left;
}

.couple__person--right .couple__photo-wrapper {
    position: absolute;
    left: -20px;
    top: 50%;
    transform: translateY(-50%);
}

.couple__photo-wrapper {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid var(--color-gold-border);
    box-shadow: 0 4px 20px rgba(92, 61, 46, 0.15);
    flex-shrink: 0;
    z-index: 2;
}

.couple__photo-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.couple__name {
    font-family: var(--font-body);
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--color-brown);
    margin-bottom: 2px;
}

.couple__role {
    font-family: var(--font-display);
    font-size: 1.4rem;
    color: var(--color-amber);
    margin-bottom: 12px;
}

.couple__bio {
    font-size: 0.9rem;
    color: var(--color-text-light);
    line-height: 1.8;
}

/* Testimoni & Genitori */
.witnesses {
    text-align: center;
    margin-top: 20px;
}

.witnesses__group {
    margin-bottom: 30px;
}

.witnesses__label {
    font-family: var(--font-display);
    font-size: 2.2rem;
    color: var(--color-terracotta);
    margin-bottom: 6px;
}

.witnesses__names {
    font-family: var(--font-body);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-brown);
    letter-spacing: 0.5px;
}

/* ============================================
   SECTION: EVENTO
   ============================================ */
.evento__content {
    display: flex;
    gap: 50px;
    align-items: center;
    flex-wrap: wrap;
}

.evento__photo-frame {
    flex: 0 0 550px;
    position: relative;
    padding: 15px;
}

.evento__photo-frame::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 2px solid var(--color-gold-border);
    pointer-events: none;
}

.evento__photo-frame img {
    width: 100%;
    height: auto;
    display: block;
}

.evento__text {
    flex: 1;
    min-width: 280px;
}

.evento__text .section__label,
.evento__text .section__title {
    text-align: left;
}

.evento__text p {
    font-size: 1rem;
    color: var(--color-text-light);
    margin-bottom: 20px;
    line-height: 1.8;
}

/* Countdown banner */
.countdown-banner {
    position: relative;
    padding: 80px 40px;
    text-align: center;
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.countdown-banner__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--color-overlay);
}

.countdown-banner__content {
    position: relative;
    z-index: 2;
}

.countdown-banner__label {
    font-family: var(--font-display);
    font-size: 2.5rem;
    color: var(--color-white);
    margin-bottom: 30px;
}

.countdown {
    display: flex;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
}

.countdown__item {
    text-align: center;
}

.countdown__number {
    font-family: var(--font-body);
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--color-white);
    line-height: 1;
    display: block;
}

.countdown__unit {
    font-family: var(--font-body);
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.8);
    text-transform: uppercase;
    letter-spacing: 3px;
    margin-top: 8px;
    display: block;
}

/* ============================================
   SECTION: DOVE E QUANDO
   ============================================ */
.locations {
    display: flex;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
}

.location-card {
    flex: 1;
    min-width: 280px;
    max-width: 520px;
    background: var(--color-white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(92, 61, 46, 0.1);
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.location-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 32px rgba(92, 61, 46, 0.18);
}

.location-card__image {
    width: 100%;
    height: 240px;
    object-fit: cover;
}

.location-card__body {
    padding: 28px 24px;
}

.location-card__title {
    font-family: var(--font-body);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--color-brown);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 16px;
}

.location-card__detail {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 12px;
    font-size: 0.9rem;
    color: var(--color-text-light);
    line-height: 1.5;
}

.location-card__icon {
    color: var(--color-amber);
    font-size: 1rem;
    flex-shrink: 0;
    margin-top: 2px;
}

.location-card__map-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--color-terracotta);
    font-size: 0.9rem;
    font-weight: 600;
    margin-top: 8px;
    transition: color var(--transition-base);
}

.location-card__map-link:hover {
    color: var(--color-terracotta-dark);
}

/* ============================================
   SECTION: CONFERMA (RSVP)
   ============================================ */
.rsvp-section {
    position: relative;
    background-size: cover;
    background-position: center;
    min-height: auto;
}

.rsvp-section__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to bottom,
        rgba(253, 246, 236, 0.92),
        rgba(245, 235, 218, 0.95)
    );
}

.rsvp-section__content {
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: center;
}

.rsvp-form-card {
    background: var(--color-white);
    padding: 50px 50px;
    border-radius: 8px;
    box-shadow: 0 8px 40px rgba(92, 61, 46, 0.12);
    max-width: 680px;
    width: 100%;
}

.rsvp-form-card__title {
    font-family: var(--font-display);
    font-size: 2.8rem;
    color: var(--color-terracotta);
    text-align: center;
    margin-bottom: 8px;
}

.rsvp-form-card__subtitle {
    text-align: center;
    font-size: 0.95rem;
    color: var(--color-text-light);
    margin-bottom: 8px;
}

.rsvp-form-card__deadline {
    text-align: center;
    font-size: 0.85rem;
    color: var(--color-text-light);
    padding-top: 12px;
    margin-bottom: 30px;
    border-top: 1px solid var(--color-cream-dark);
}

/* Saluto personalizzato "Ciao [nome]!" */
.rsvp-form-card__greeting {
    text-align: center;
    font-size: 1.15rem;
    color: var(--color-brown);
    margin-bottom: 18px;
    font-weight: 400;
}

.rsvp-form-card__greeting strong {
    color: var(--color-terracotta);
    font-weight: 600;
}

/* Box informativo per chi arriva senza token */
.rsvp-form-card__info {
    text-align: center;
    font-size: 0.95rem;
    color: var(--color-text-light);
    line-height: 1.8;
    padding: 30px 20px;
    background-color: var(--color-cream);
    border-radius: 6px;
    margin-top: 20px;
}

.rsvp-form-card__info strong {
    color: var(--color-terracotta);
}

/* Box "hai già risposto" */
.rsvp-form-card__already-answered {
    background-color: rgba(232, 180, 79, 0.12);
    border-left: 4px solid var(--color-amber);
    border-radius: 6px;
    padding: 16px 20px;
    margin-bottom: 24px;
}

.rsvp-form-card__already-answered p {
    font-size: 0.9rem;
    color: var(--color-brown);
    line-height: 1.6;
    margin: 0;
}

.rsvp-form-card__already-answered p + p {
    margin-top: 6px;
    color: var(--color-text-light);
    font-size: 0.85rem;
    font-style: italic;
}

.rsvp-form-card__already-answered strong {
    color: var(--color-terracotta-dark);
    font-weight: 600;
}

/* Form fields */
.form-group {
    margin-bottom: 22px;
}

.form-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-brown);
    margin-bottom: 6px;
}

.form-group select,
.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--color-text);
    background: var(--color-cream);
    border: 1px solid rgba(201, 169, 110, 0.4);
    border-radius: 5px;
    transition: border-color var(--transition-base), box-shadow var(--transition-base);
    appearance: none;
    -webkit-appearance: none;
}

.form-group select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%237A5A4A' stroke-width='1.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
    cursor: pointer;
}

.form-group textarea {
    resize: vertical;
    min-height: 110px;
}

.form-group select:focus,
.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-terracotta);
    box-shadow: 0 0 0 3px rgba(196, 106, 58, 0.12);
}

/* Buttons */
.form-actions {
    display: flex;
    gap: 16px;
    margin-top: 30px;
}

.btn {
    flex: 1;
    padding: 14px 24px;
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color var(--transition-base), transform var(--transition-base);
}

.btn:active {
    transform: scale(0.97);
}

.btn--decline {
    background-color: var(--color-brown-light);
    color: var(--color-white);
}

.btn--decline:hover {
    background-color: var(--color-brown);
}

.btn--confirm {
    background-color: var(--color-terracotta);
    color: var(--color-white);
}

.btn--confirm:hover {
    background-color: var(--color-terracotta-dark);
}

/* Form feedback */
.form-message {
    text-align: center;
    padding: 14px;
    border-radius: 5px;
    margin-top: 20px;
    font-size: 0.9rem;
    display: none;
}

.form-message--success {
    background-color: rgba(76, 140, 74, 0.1);
    color: #3d7a3a;
    border: 1px solid rgba(76, 140, 74, 0.3);
}

.form-message--error {
    background-color: rgba(196, 106, 58, 0.1);
    color: var(--color-terracotta-dark);
    border: 1px solid rgba(196, 106, 58, 0.3);
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
    text-align: center;
    padding: 30px 20px;
    background-color: var(--color-brown);
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.8rem;
    letter-spacing: 0.5px;
}

/* ============================================
   ANIMATIONS — Fade in on scroll
   ============================================ */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================
   RESPONSIVE — Tablet
   ============================================ */
@media (max-width: 1024px) {
    :root {
        --sidebar-width: 220px;
    }

    .section-hero__names {
        font-size: 3.5rem;
    }

    .couple {
        gap: 40px;
    }

    .evento__content {
        gap: 40px;
    }

    .evento__photo-frame {
        flex: 0 0 420px;
    }

    .countdown__number {
        font-size: 2.8rem;
    }
}

/* ============================================
   RESPONSIVE — Mobile
   ============================================ */
@media (max-width: 768px) {
    /* Sidebar → header mobile con hamburger */
    .hamburger {
        display: flex;
    }

    .sidebar {
        width: 100%;
        height: 100vh;
        position: fixed;
        top: 0;
        left: 0;
        transform: translateX(-100%);
        transition: transform var(--transition-base);
        padding: 80px 20px 30px;
        overflow-y: auto;
        box-shadow: none;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar__nav {
        margin-top: 30px;
        gap: 16px;
    }

    .sidebar__nav a {
        font-size: 1.2rem;
        padding: 12px 24px;
    }

    .main-content {
        margin-left: 0;
    }

    /* Hero */
    .section-hero__names {
        font-size: 2.5rem;
    }

    .section-hero__details {
        font-size: 1rem;
    }

    /* Sections */
    .section {
        padding: var(--section-padding-mobile);
    }

    .section__label {
        font-size: 2rem;
    }

    .section__title {
        font-size: 1.3rem;
        letter-spacing: 2px;
        margin-bottom: 30px;
    }

    /* Couple */
    .couple {
        flex-direction: column;
        align-items: center;
        gap: 40px;
    }

    .couple__person {
        max-width: 100%;
        flex-direction: column;
        align-items: center;
    }

    .couple__person--left .couple__photo-wrapper,
    .couple__person--right .couple__photo-wrapper {
        position: relative;
        right: auto;
        left: auto;
        top: auto;
        transform: none;
        margin-bottom: -40px;
        z-index: 2;
    }

    .couple__person--left .couple__card,
    .couple__person--right .couple__card {
        padding: 55px 25px 25px;
        text-align: center;
    }

    /* Evento */
    .evento__content {
        flex-direction: column;
    }

    .evento__photo-frame {
        flex: none;
        width: 100%;
        max-width: 340px;
        margin: 0 auto;
    }

    /* Countdown */
    .countdown-banner {
        padding: 60px 20px;
        background-attachment: scroll;
    }

    .countdown__number {
        font-size: 2.2rem;
    }

    .countdown {
        gap: 24px;
    }

    /* Locations */
    .locations {
        flex-direction: column;
        align-items: center;
    }

    .location-card {
        max-width: 100%;
        width: 100%;
        min-width: unset;
    }

    /* RSVP form */
    .rsvp-form-card {
        padding: 35px 24px;
    }

    .rsvp-form-card__title {
        font-size: 2.2rem;
    }

    .form-actions {
        flex-direction: column;
    }
}

/* ============================================
   RESPONSIVE — Small phones
   ============================================ */
@media (max-width: 400px) {
    .section-hero__names {
        font-size: 2rem;
    }

    .countdown__number {
        font-size: 1.8rem;
    }

    .countdown {
        gap: 16px;
    }

    .rsvp-form-card__title {
        font-size: 1.8rem;
    }
}
