/* --- 1. CSS VARIABLES (Your Design System) --- */
:root {
    --primary-color: #637ca5; 
    --bg-color: #fdfcf8; 
    --text-dark: #222222; 
    
    --font-heading: 'Montserrat', sans-serif;
    --font-body: 'Space Mono', monospace;
}

/* --- 2. GLOBAL RESET --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color); /* fallback for pages without .hero-bg */
    color: var(--text-dark);
    font-family: var(--font-body);
    line-height: 1.6;
    text-align: center;
}

/* Fixed hero background — position:fixed works on iOS Safari where
   background-attachment:fixed on body does not. z-index:-1 puts it
   behind all content; transparent areas (hero spacer) let it show through. */
.hero-bg {
    position: fixed;
    inset: 0;
    z-index: -1;
    background-image: url('./photos/IMG_3022.png');
    background-size: cover;
    background-position: center;
}

/* Desktop: the real <img> inside .hero-bg is hidden; the CSS background handles it */
.hero-img {
    display: none;
}

/* --- 3. TYPOGRAPHY --- */
h1, h2, h3, .nav-links a {
    font-family: var(--font-heading);
    color: var(--primary-color);
    text-transform: lowercase; 
    font-weight: 400;
}

/* --- 4. NAVIGATION --- */
.main-nav {
    display: flex;
    justify-content: center; 
    align-items: center;
    padding: 20px 40px;
    background-color: var(--bg-color);
    position: sticky; 
    top: 0;
    z-index: 100;
    border-bottom: 1px solid #eaeaea;
}

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

.nav-links a {
    text-decoration: none;
    font-size: 0.9rem;
    letter-spacing: 2px;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: var(--text-dark);
}

/* Two-segment language switch — both labels visible, active one filled.
   Sits in the same absolute position the old .lang-btn used to occupy. */
.lang-switch {
    position: absolute;
    right: 40px;
    display: inline-flex;
    border: 1px solid var(--primary-color);
    background: var(--bg-color);
    overflow: hidden;
}

.lang-segment {
    background: transparent;
    color: var(--primary-color);
    border: none;
    padding: 5px 12px;
    cursor: pointer;
    font-family: var(--font-body);
    font-size: 0.85rem;
    letter-spacing: 2px;
    line-height: 1.4;
    transition: background-color 0.25s ease, color 0.25s ease;
}

/* Hairline divider between the two segments, in the same blue */
.lang-segment + .lang-segment {
    border-left: 1px solid var(--primary-color);
}

.lang-segment.active {
    background-color: var(--primary-color);
    color: var(--bg-color);
}

.lang-segment:not(.active):hover {
    background-color: rgba(106, 124, 155, 0.10);
}

/* --- 5. THE SCROLLING ARCHITECTURE --- */
.hero-spacer {
    height: 70vh; 
    width: 100%;
}

.solid-wrapper {
    background-color: var(--bg-color); 
    width: 100%;
    box-shadow: 0px -10px 30px rgba(0,0,0,0.05); 
    padding-bottom: 100px; 
}

.welcome-section {
    padding: 80px 20px 40px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.date-text {
    font-size: 1.2rem;
    letter-spacing: 2px;
    margin-bottom: 40px;
    color: #000000; 
}

.welcome-text {
    font-size: 1rem;
    line-height: 2; 
    color: #000000; 
}

/* --- 6. KNOCKOUT TEXT --- */
.knockout-text {
    font-size: 6rem; 
    letter-spacing: 5px;
    margin-bottom: 20px;
    font-weight: 400; 
    
    background-image: url('./photos/IMG_3022.png'); 
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent; 
}

/* --- 7. SCHEDULE & SECTION ANCHORING --- */
.schedule-section, .how-to-section, .registry-section {
    padding: 60px 20px;
    max-width: 900px;
    margin: 0 auto; 
    scroll-margin-top: 100px; 
}

.section-title {
    font-size: 3rem;
    letter-spacing: 4px;
    margin-bottom: 80px;
    text-align: center;
    text-transform: uppercase;
}

.timeline {
    display: flex;
    flex-direction: column;
}

.timeline-event {
    display: grid;
    grid-template-columns: 1fr 2fr; 
    gap: 40px; 
    margin-bottom: 60px;
    scroll-margin-top: 100px;
}

.timeline-left {
    text-align: right;
    padding-right: 10px; 
}

.timeline-right {
    text-align: left;
    border-left: 2px solid #000000; 
    padding-left: 40px;
}

.event-title {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    color: #000000;
    margin-bottom: 5px;
    text-transform: none; 
    font-weight: 500;
}

.event-date {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    color: #000000;
    margin-bottom: 5px;
    text-transform: none; 
    font-weight: 500;
    white-space: nowrap; 
}

.event-time {
    font-size: 1rem;
    color: var(--text-dark);
}

.event-desc {
    margin-bottom: 20px;
    font-size: 0.95rem;
    color: var(--text-dark);
}

.event-desc a {
    color: var(--primary-color);
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 0.3s ease;
}

.event-desc a:hover {
    color: var(--text-dark);
}

.detail-label {
    font-family: var(--font-heading);
    font-size: 0.85rem;
    letter-spacing: 2px;
    margin-top: 20px;
    margin-bottom: 5px;
    color: #000000;
    text-transform: uppercase;
    font-weight: 700;
}

.detail-text {
    font-size: 0.9rem;
    margin-bottom: 5px; 
}

.getting-there-link {
    display: inline-block;
    font-family: var(--font-body);
    font-size: 0.8rem;
    color: var(--primary-color);
    text-decoration: none;
    text-transform: lowercase;
    letter-spacing: 1px;
    margin-bottom: 15px;
    transition: color 0.3s ease;
}

.getting-there-link:hover {
    color: var(--text-dark);
    text-decoration: underline;
}

.timeline-event-image {
    max-width: 100%; 
    height: auto;
    margin-top: 15px;
}

/* --- REGISTRY SECTION --- */
.registry-subtitle {
    max-width: 600px;
    margin: -40px auto 40px auto; 
    font-size: 0.95rem;
    color: var(--text-dark);
}

.registry-tabs {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 40px;
}

.tab-btn {
    background: none;
    border: none;
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-dark); 
    padding-bottom: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tab-btn:hover {
    color: var(--primary-color);
}

.tab-btn.active {
    color: var(--primary-color); 
    border-bottom: 2px solid var(--primary-color);
}

.gift-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); 
    gap: 20px;
    margin-top: 20px;
}

.gift-card {
    border: 1px solid #eaeaea;
    border-radius: 8px;
    padding: 20px;
    text-align: left;
    background-color: #ffffff;
    aspect-ratio: 1 / 1; 
    display: flex;
    flex-direction: column;
    justify-content: space-between; 
    transition: transform 0.3s ease, border-color 0.3s ease; 
}

.gift-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-5px); 
}

.gift-img {
    width: 100%;
    height: 120px; 
    object-fit: contain;
    margin-bottom: 15px;
}

.gift-price {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--primary-color); 
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.gift-name {
    font-family: var(--font-heading); 
    font-weight: 400;
    font-size: 0.95rem;
    margin-bottom: 10px;
}

.gift-link {
    display: inline-block;
    font-family: var(--font-body);
    font-size: 0.8rem;
    color: #000000; 
    text-decoration: none;
    text-transform: lowercase;
    letter-spacing: 1px;
    transition: color 0.3s ease; 
}

.gift-card:hover .gift-link, 
.gift-link:hover {
    color: var(--primary-color); 
    text-decoration: underline;
}

.copy-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 8px;
    cursor: pointer;
    color: var(--primary-color);
    transition: transform 0.2s ease, color 0.2s ease;
    vertical-align: middle; 
}

.copy-btn:hover {
    color: var(--text-dark);
    transform: scale(1.15); 
}

/* --- GIFT PAGE — SCREEN 1 --- */
.gift-wrapper {
    min-height: 100vh;
    padding-top: 80px;
    background-color: var(--bg-color);
}

.gift-checkout-container {
    max-width: 900px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr; 
    gap: 60px;
    align-items: center;
    padding: 0 20px;
}

.checkout-img {
    width: 100%;
    height: auto;
    max-height: 500px;
    object-fit: contain;
}

.checkout-title {
    font-family: var(--font-heading);
    color: #000000;
    font-size: 1.8rem;
    margin-bottom: 10px;
    text-transform: none; 
}

.checkout-suggested-price {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--primary-color);
    font-size: 1.2rem;
    margin-bottom: 40px;
}

.input-group {
    margin-bottom: 30px;
    text-align: left;
}

.input-label {
    display: block;
    font-family: var(--font-body);
    font-size: 0.8rem;
    color: var(--text-dark);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.editorial-input {
    width: 100%;
    max-width: 200px;
    border: none;
    border-bottom: 2px solid #eaeaea; 
    background: transparent;
    font-family: var(--font-body);
    font-size: 1.2rem;
    padding: 10px 5px;
    color: var(--primary-color);
    transition: border-color 0.3s ease;
    outline: none;
}

.editorial-input:focus {
    border-bottom: 2px solid var(--primary-color); 
}

.editorial-btn {
    display: inline-block;
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.9rem;
    padding: 12px 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.editorial-btn:hover {
    background: var(--primary-color);
    color: var(--bg-color);
}

/*
 * Disabled state. pointer-events intentionally left on so the browser
 * renders cursor:not-allowed — setting pointer-events:none suppresses it.
 */
.editorial-btn:disabled,
.editorial-btn[disabled] {
    opacity: 0.35;
    cursor: not-allowed;
    border-color: #999;
    color: #999;
}

.editorial-btn:disabled:hover,
.editorial-btn[disabled]:hover {
    background: transparent;
    color: #999;
}

.field-error {
    font-family: var(--font-body);
    font-size: 0.75rem;
    color: #b04040;
    margin-top: 8px;
    letter-spacing: 0.5px;
}

/* --- GIFT PAGE — SCREEN 2 (checkout) ---
   Reuses .solid-wrapper for the cream background and the existing
   sticky .main-nav at the top. No sidebar.
*/
.checkout-main {
    max-width: 800px;
    margin: 0 auto;
    padding: 60px 20px 100px;
    text-align: left;
}

.checkout-page-title {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 400;
    color: var(--text-dark);
    letter-spacing: 3px;
    text-transform: lowercase;
    margin-bottom: 36px;
}

.checkout-notification {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background-color: rgba(106, 124, 155, 0.10);
    border-left: 3px solid var(--primary-color);
    padding: 14px 18px;
    margin-bottom: 52px;
    font-family: var(--font-body);
    font-size: 0.82rem;
    color: var(--primary-color);
    letter-spacing: 0.3px;
}

.notification-dismiss {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.75rem;
    color: var(--primary-color);
    padding: 0;
    flex-shrink: 0;
    opacity: 0.55;
    transition: opacity 0.2s ease;
}

.notification-dismiss:hover {
    opacity: 1;
}

.checkout-section {
    margin-bottom: 48px;
    padding-bottom: 48px;
    border-bottom: 1px solid #eaeaea;
}

.checkout-section:last-of-type {
    border-bottom: none;
    margin-bottom: 36px;
    padding-bottom: 0;
}

.checkout-section-title {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-dark);
    text-transform: none;
    letter-spacing: 0;
    margin-bottom: 28px;
}

.checkout-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
}

.checkout-form-field {
    display: flex;
    flex-direction: column;
}

/*
 * Reuses the bottom-border editorial aesthetic from .editorial-input
 * but without the 200px max-width cap — inputs fill their column.
 */
.checkout-input {
    width: 100%;
    border: none;
    border-bottom: 1px solid #cccccc;
    background: transparent;
    font-family: var(--font-body);
    font-size: 1rem;
    padding: 10px 4px;
    color: var(--text-dark);
    border-radius: 0;
    outline: none;
    -webkit-appearance: none;
    transition: border-color 0.3s ease;
}

.checkout-input:focus {
    border-bottom-color: var(--primary-color);
}

.order-table {
    width: 100%;
}

.order-table-header {
    display: flex;
    justify-content: space-between;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--text-dark);
    font-family: var(--font-heading);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--text-dark);
}

.order-table-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 14px 0;
    border-bottom: 1px solid #eaeaea;
    font-family: var(--font-body);
    font-size: 0.88rem;
    color: var(--text-dark);
}

.order-total-row {
    border-bottom: none;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1rem;
    padding-top: 16px;
}

.checkout-payment-text {
    font-family: var(--font-body);
    font-size: 0.88rem;
    color: var(--text-dark);
    line-height: 2;
}

.gift-submit-btn {
    margin-top: 8px;
}

/* --- MOBILE RESPONSIVENESS (all breakpoints in one place) --- */
@media (max-width: 768px) {

    html, body {
        overflow-x: clip; /* clip ≠ hidden: doesn't create a scroll container, so position:sticky works */
        width: 100%;
    }

    /* Navigation */
    .main-nav {
        padding: 15px;
        flex-direction: column; 
    }

    .nav-links {
        flex-wrap: wrap; 
        justify-content: center;
        gap: 15px;
        margin-top: 15px;
    }

    .lang-switch {
        position: static; 
        margin-top: 15px;
    }

    /* Home */
    .knockout-text {
        font-size: 3rem; 
        letter-spacing: 2px;
    }

    /* Timeline */
    .timeline-event {
        grid-template-columns: 1fr; 
        gap: 10px;
    }

    .timeline-left {
        text-align: left;
    }

    .timeline-right {
        border-left: none; 
        padding-left: 0;
    }

    /* Registry */
    .gift-grid {
        grid-template-columns: 1fr; 
    }

    /* Gift page — screen 1 */
    .gift-wrapper {
        padding-bottom: 80px; /* room above Safari's URL bar */
    }

    .gift-checkout-container {
        grid-template-columns: 1fr;
        gap: 20px;
        text-align: center;
    }

    .checkout-img {
        max-height: 180px;
        width: auto;
        max-width: 65%;
        margin: 0 auto;
    }

    .input-group {
        text-align: center;
    }

    .editorial-input {
        text-align: center;
    }

    /* Gift page — screen 2 (checkout) */
    .checkout-main {
        padding: 40px 20px 80px;
    }

    .checkout-page-title {
        font-size: 1.4rem;
        letter-spacing: 2px;
    }

    .checkout-form-row {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}
/* --- GIFT PAGE — SCREEN 3 (success) --- */
.success-screen {
    text-align: center;
    padding-top: 80px;
}

.success-checkmark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    font-size: 2rem;
    margin-bottom: 32px;
}

.success-message {
    max-width: 480px;
    margin: 0 auto 20px auto;
    font-size: 1rem;
    line-height: 1.8;
    color: var(--text-dark);
}

.success-email-note {
    font-size: 0.82rem;
    color: #999999;
    letter-spacing: 0.5px;
    margin-bottom: 48px;
}

.success-home-btn {
    text-decoration: none;
}
/* ─── RSVP SECTION ──────────────────────────────────────────────────────────── */

.rsvp-outer {
    background-color: var(--bg-color);
    width: 100%;
}

.rsvp-step {
    /* Each step fills the same space; JS toggles display */
}

.rsvp-inner {
    max-width: 700px;
    margin: 0 auto;
    padding: 60px 20px 100px;
    text-align: left;
}

.rsvp-intro {
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: #666;
    text-align: center;
    margin-top: -60px;
    margin-bottom: 60px;
    letter-spacing: 0.5px;
}

/* Two-column form grid */
.rsvp-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px 40px;
    margin-bottom: 40px;
}

.rsvp-field-span {
    grid-column: 1 / -1;
}

/* Attendance radios */
.rsvp-radio-group {
    display: flex;
    gap: 40px;
    margin-top: 10px;
}

.rsvp-radio-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-body);
    font-size: 0.85rem;
    color: var(--text-dark);
    cursor: pointer;
    letter-spacing: 0.5px;
}

.rsvp-radio-label input[type="radio"] {
    appearance: none;
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border: 1.5px solid #aaa;
    border-radius: 50%;
    flex-shrink: 0;
    cursor: pointer;
    transition: border-color 0.2s ease, background-color 0.2s ease;
    position: relative;
}

.rsvp-radio-label input[type="radio"]:checked {
    border-color: var(--primary-color);
    background-color: var(--primary-color);
    box-shadow: inset 0 0 0 3px var(--bg-color);
}

/* Additional guests block */
.rsvp-guests-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-top: 8px;
}

.rsvp-add-guest-btn {
    background: none;
    border: 1.5px solid var(--primary-color);
    color: var(--primary-color);
    font-family: var(--font-heading);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    padding: 6px 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.rsvp-add-guest-btn:hover {
    background: var(--primary-color);
    color: var(--bg-color);
}

/* Two side-by-side buttons (+ Add adult / + Add child) on the right side
   of the header. Wraps under the label on narrow screens. */
.rsvp-add-guest-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Individual guest row (step 1) */
.rsvp-guest-row {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 20px;
    align-items: end;
    padding: 16px 0;
    border-top: 1px solid #eaeaea;
}

/* Child rows have an extra Age column before the remove button. The fixed
   width (90px) keeps the age field tight rather than letting it eat into
   the name fields. */
.rsvp-guest-row[data-guest-type="child"] {
    grid-template-columns: 1fr 1fr 90px auto;
}

.rsvp-remove-btn {
    background: none;
    border: none;
    font-size: 1rem;
    color: #bbb;
    cursor: pointer;
    padding: 8px 4px;
    line-height: 1;
    transition: color 0.2s ease;
    font-family: var(--font-body);
}

.rsvp-remove-btn:hover {
    color: #b04040;
}

/* ── Step 2: Per-guest detail cards ── */
.rsvp-guest-detail-card {
    border: 1px solid #eaeaea;
    border-radius: 6px;
    padding: 28px 32px;
    margin-bottom: 28px;
    background: #fff;
}

.rsvp-guest-detail-card:first-child {
    border-color: var(--primary-color);
}

.rsvp-guest-card-name {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-dark);
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.rsvp-guest-card-badge {
    font-family: var(--font-body);
    font-size: 0.7rem;
    color: var(--primary-color);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-bottom: 24px;
}

.rsvp-card-field {
    margin-bottom: 20px;
}

.rsvp-card-field:last-child {
    margin-bottom: 0;
}

/* Checkbox group for dietary / accommodations */
.rsvp-checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 24px;
    margin-top: 10px;
}

.rsvp-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-body);
    font-size: 0.8rem;
    color: var(--text-dark);
    cursor: pointer;
    letter-spacing: 0.3px;
}

.rsvp-checkbox-label input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border: 1.5px solid #aaa;
    border-radius: 2px;
    flex-shrink: 0;
    cursor: pointer;
    transition: border-color 0.2s, background-color 0.2s;
    position: relative;
}

.rsvp-checkbox-label input[type="checkbox"]:checked {
    border-color: var(--primary-color);
    background-color: var(--primary-color);
}

.rsvp-checkbox-label input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 2px;
    top: 0px;
    width: 5px;
    height: 8px;
    border: 2px solid #fff;
    border-top: none;
    border-left: none;
    transform: rotate(45deg);
}

.rsvp-other-input {
    width: 100%;
    border: none;
    border-bottom: 1px solid #ccc;
    background: transparent;
    font-family: var(--font-body);
    font-size: 0.85rem;
    padding: 6px 4px;
    margin-top: 10px;
    outline: none;
    color: var(--text-dark);
    transition: border-color 0.2s ease;
}

.rsvp-other-input:focus {
    border-bottom-color: var(--primary-color);
}

/* Textarea (message to couple) */
.rsvp-message-section {
    margin-top: 12px;
    margin-bottom: 40px;
}

.rsvp-textarea {
    width: 100%;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    font-family: var(--font-body);
    font-size: 0.88rem;
    padding: 14px;
    color: var(--text-dark);
    resize: vertical;
    outline: none;
    transition: border-color 0.2s ease;
    margin-top: 10px;
    line-height: 1.7;
}

.rsvp-textarea:focus {
    border-color: var(--primary-color);
}

/* Single-line equivalent of .rsvp-textarea, used by the song dedication
   field. Shares all visual properties for consistency; only resize and
   line-height differ. */
.rsvp-input-text {
    width: 100%;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    font-family: var(--font-body);
    font-size: 0.88rem;
    padding: 14px;
    color: var(--text-dark);
    outline: none;
    transition: border-color 0.2s ease;
    margin-top: 10px;
}

.rsvp-input-text:focus {
    border-color: var(--primary-color);
}

/* Step 2 action row */
.rsvp-step2-actions {
    display: flex;
    align-items: center;
    gap: 32px;
}

.rsvp-back-btn {
    background: none;
    border: none;
    font-family: var(--font-body);
    font-size: 0.8rem;
    color: #999;
    cursor: pointer;
    letter-spacing: 1px;
    padding: 0;
    transition: color 0.2s ease;
}

.rsvp-back-btn:hover {
    color: var(--text-dark);
}

/* Decline RSVP: skip step 2, go straight to 3b */
/* (handled purely in JS) */

/* --- GALLERY SECTION --- */
.gallery-section {
    padding: 60px 20px;
    max-width: 1000px; /* Slightly wider than other sections to let photos breathe */
    margin: 0 auto; 
    scroll-margin-top: 100px; 
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr); 
    gap: 60px 40px; /* More vertical space for the captions */
}

.gallery-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.gallery-img-wrapper {
    width: 100%;
    overflow: hidden;
    margin-bottom: 16px;
    /* We removed the rigid aspect-ratio so the container wraps the full image */
}

.gallery-img {
    width: 100%;
    height: auto; /* This tells the image to display its full, natural height */
    display: block;
    filter: grayscale(15%); 
    transition: transform 0.6s ease, filter 0.6s ease;
}

.gallery-item:hover .gallery-img {
    transform: scale(1.03); /* Gentle zoom */
    filter: grayscale(0%); /* Brings back full color on hover */
}

.gallery-caption {
    font-family: var(--font-body);
    font-size: 0.85rem;
    color: var(--text-dark);
    letter-spacing: 1px;
    font-style: italic;
    text-transform: lowercase;
}

/* --- MAP SCREENSHOTS (inside "How to get there") --- */
/* Two side-by-side figures showing parking-area screenshots. The caption
   style intentionally mirrors .gallery-caption so the editorial voice
   (lowercase, italic, monospace) stays consistent across the site. */
.map-screenshots {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-top: 24px;
}

.map-screenshot {
    display: flex;
    flex-direction: column;
    margin: 0; /* override the default <figure> margin */
}

.map-screenshot-img {
    width: 100%;
    aspect-ratio: 4 / 3; /* Forces both images to be the exact same dimensions */
    object-fit: cover; /* Ensures the image fills the space without distortion */
    display: block;
    border: 1px solid #eaeaea;
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.map-screenshot-img:hover {
    opacity: 0.85;
}

.map-screenshot-caption {
    font-family: var(--font-body);
    font-size: 0.8rem;
    color: var(--text-dark);
    letter-spacing: 1px;
    font-style: italic;
    text-transform: lowercase;
    margin-top: 10px;
    text-align: left; /* keeps the caption aligned with the rest of the timeline-right column */
}

/* If a caption is empty (data-key resolves to ''), collapse the gap rather
   than leaving a phantom blank line. Achieved by hiding empty figcaptions. */
.map-screenshot-caption:empty {
    display: none;
}

/* --- MAP MODAL (LIGHTBOX) --- */
.map-modal {
    display: none; /* Hidden by default */
    position: fixed;
    z-index: 2000; /* Sit above the navigation */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(253, 252, 248, 0.95); /* Matches your --bg-color but slightly transparent */
    align-items: center;
    justify-content: center;
}

.map-modal-content {
    max-width: 90%;
    max-height: 85vh;
    border: 1px solid #eaeaea;
    box-shadow: 0px 15px 40px rgba(0,0,0,0.08);
    object-fit: contain;
}

.close-modal {
    position: absolute;
    top: 30px;
    left: 40px; /* Upper left corner as requested */
    color: var(--text-dark);
    font-size: 1.5rem;
    font-family: var(--font-body);
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    transition: color 0.3s ease, transform 0.3s ease;
}

.close-modal:hover {
    color: var(--primary-color);
    transform: scale(1.1);
}

/* --- FOOTER & LOGO --- */
.site-footer {
    text-align: center;
    padding: 60px 20px 80px 20px;
    background-color: var(--bg-color);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.footer-logo {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 12px;
}

.footer-text {
    font-family: var(--font-body);
    font-size: 0.75rem;
    color: #888888;
    letter-spacing: 0.5px;
    font-style: italic;
}

/* ── Mobile ── */
@media (max-width: 768px) {
    .rsvp-form-grid {
        grid-template-columns: 1fr;
    }
    .rsvp-field-span {
        grid-column: 1;
    }
    .rsvp-guest-row {
        grid-template-columns: 1fr 1fr;
    }
    /* Mobile child rows: name fields side-by-side on top, age full-width below */
    .rsvp-guest-row[data-guest-type="child"] {
        grid-template-columns: 1fr 1fr;
    }
    .rsvp-guest-row[data-guest-type="child"] .rsvp-guest-age-field {
        grid-column: 1 / -1;
    }
    .rsvp-guest-row .rsvp-remove-btn {
        grid-column: 1 / -1;
        text-align: right;
        padding-bottom: 0;
    }
    .rsvp-radio-group {
        flex-direction: column;
        gap: 16px;
    }
    .rsvp-step2-actions {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }
    .rsvp-guest-detail-card {
        padding: 20px;
    }

    /* Gallery */
    .gallery-grid {
        grid-template-columns: 1fr; 
        gap: 40px;
    }

    /* Map screenshots — stack into a single column on phones */
    .map-screenshots {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

/* ─── HAMBURGER + LOGO GROUP (hidden on desktop, shown on mobile) ────────── */
.nav-left {
    display: none;
}

.hamburger-btn {
    display: none;
}

.nav-logo {
    display: none;
}

/* ─── MOBILE ENHANCEMENTS ────────────────────────────────────────────────── */
@media (max-width: 768px) {

    /* Hero on mobile: use a real <img> instead of CSS background for reliable sizing.
       The image is 4:3 (2048×1536), so at full viewport width its natural height = 75vw. */
    .hero-bg {
        background-image: none; /* suppress the CSS background; <img> takes over */
    }

    .hero-img {
        display: block;
        width: 100%;
        height: auto; /* full image, never cropped */
    }

    /* Spacer height = image's natural height at 100vw wide (4:3 ratio = 75vw) */
    .hero-spacer {
        height: 75vw;
    }

    /* Remove the shadow that was creating the darker bar at the image/content boundary */
    .solid-wrapper {
        box-shadow: none;
    }

    /* Tighter top padding so the welcome text is visible below the image on first load */
    .welcome-section {
        padding-top: 36px;
    }

    /* Nav bar: single row — hamburger left, lang-switch right */
    .main-nav {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 16px 20px;
    }

    .hamburger-btn {
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: 5px;
        background: none;
        border: none;
        cursor: pointer;
        padding: 5px;
        flex-shrink: 0;
        z-index: 301;
    }

    .hamburger-btn span {
        display: block;
        width: 22px;
        height: 1.5px;
        background-color: var(--primary-color);
        transform-origin: center;
        transition: transform 0.3s ease, opacity 0.3s ease;
    }

    /* Animate three lines → X when open */
    .hamburger-btn[aria-expanded="true"] span:nth-child(1) {
        transform: translateY(6.5px) rotate(45deg);
    }
    .hamburger-btn[aria-expanded="true"] span:nth-child(2) {
        opacity: 0;
        transform: scaleX(0);
    }
    .hamburger-btn[aria-expanded="true"] span:nth-child(3) {
        transform: translateY(-6.5px) rotate(-45deg);
    }

    /* Full-screen nav overlay — hidden via opacity so transition works */
    .nav-links {
        position: fixed;
        inset: 0;
        background-color: var(--bg-color);
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 40px;
        z-index: 300;
        flex-wrap: nowrap;
        margin-top: 0;
        display: flex;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.35s ease;
    }

    .nav-links.nav-open {
        opacity: 1;
        pointer-events: auto;
    }

    .nav-links a {
        font-size: 1.3rem;
        letter-spacing: 3px;
    }

    /* Hamburger + logo grouped on the left.
       position:relative + z-index:302 ensures it paints above the
       nav-links overlay (z-index:300) within .main-nav's stacking context. */
    .nav-left {
        display: flex;
        align-items: center;
        gap: 10px;
        flex-shrink: 0;
        position: relative;
        z-index: 302;
    }

    .nav-logo {
        display: block;
        width: 34px;
        height: 34px;
        border-radius: 50%;
        object-fit: cover;
    }

    /* Lang-switch stays visible in the nav bar */
    .lang-switch {
        position: static;
        margin-top: 0;
        flex-shrink: 0;
    }

    /* Section titles: 3rem + 4px letter-spacing is too wide for ~375px screens */
    .section-title {
        font-size: 2rem;
        letter-spacing: 3px;
    }

    /* Knockout text: reliable primary-colour fallback on mobile
       (background-attachment:fixed + background-clip:text is unreliable on iOS) */
    .knockout-text {
        background-image: none;
        background: none;
        -webkit-background-clip: unset;
        background-clip: unset;
        -webkit-text-fill-color: var(--primary-color);
        color: var(--primary-color);
        font-size: 2.8rem;
    }

    /* ── 2-column gift grid with compact cards ── */
    .gift-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        grid-auto-rows: 200px; /* every card in every row gets this exact height */
    }
    .gift-card {
        padding: 12px;
        min-width: 0;
        aspect-ratio: auto; /* grid-auto-rows owns the height; aspect-ratio would fight it */
    }
    .gift-img {
        height: 75px;
        margin-bottom: 10px;
    }
    .gift-price {
        font-size: 0.75rem;
        margin-bottom: 3px;
    }
    .gift-name {
        font-size: 0.78rem;
        margin-bottom: 6px;
    }
    .gift-link {
        font-size: 0.68rem;
    }

    /* Center the last card when there's an odd total.
       Spans it across both columns, then constrains width to match a normal
       column: (grid - gap) / 2 = 50% - 6px */
    .gift-card:last-child:nth-child(odd) {
        grid-column: 1 / -1;
        width: calc(50% - 6px);
        margin-left: auto;
        margin-right: auto;
    }

    /* ── Scroll reveal: sections fade and slide up into view ── */
    .reveal-target {
        opacity: 0;
        transform: translateY(28px);
        transition: opacity 0.7s ease, transform 0.7s ease;
    }
    .reveal-target.revealed {
        opacity: 1;
        transform: none;
    }

    /* ── Touch-active: replicates desktop :hover pop on scroll ── */
    .gift-card.touch-active {
        border-color: var(--primary-color);
        transform: translateY(-5px);
        box-shadow: 0 8px 24px rgba(88, 130, 202, 0.10);
    }
    .gift-card.touch-active .gift-link {
        color: var(--primary-color);
    }

    .gallery-item.touch-active .gallery-img {
        transform: scale(1.03);
        filter: grayscale(0%);
    }
}