/* Shared invitation feature sections — themed via --if-* CSS variables per template body */

html {
    overflow-x: hidden;
    max-width: 100%;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge legacy */
}

html::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}

body {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

body::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}

/* Cover video used across invitation heroes */
.inv-hero-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 28%;
    z-index: 0;
    pointer-events: none;
}

.mg-hero--video,
.md-hero--video,
.mm-hero--video,
.rc-palace--video,
.ge-splash--video {
    background-color: #140e0c;
    background-image: linear-gradient(180deg, rgba(20, 16, 12, .18) 0%, rgba(20, 16, 12, .72) 100%);
}

.mg-hero--video .mg-hero-veil,
.md-hero--video .md-hero-veil,
.mm-hero--video .mm-hero-veil,
.mm-hero--video .mm-hero-pattern,
.rc-palace--video .rc-palace-veil,
.ge-splash--video .ge-splash-veil {
    z-index: 1;
}

.mg-hero--video .mg-hero-inner,
.md-hero--video .md-hero-inner,
.mm-hero--video .mm-hero-inner,
.rc-palace--video .rc-palace-copy,
.ge-splash--video .ge-splash-copy {
    z-index: 2;
}

@media (max-width: 720px) {
    .mg-hero--video,
    .md-hero--video,
    .mm-hero--video,
    .rc-palace--video,
    .ge-splash--video,
    .mg-hero,
    .md-hero,
    .mm-hero,
    .rc-palace,
    .ge-splash {
        min-height: 100svh;
        min-height: var(--app-vh, 100svh);
        width: 100%;
        max-width: none;
        margin-inline: 0;
        border-radius: 0;
        overflow: hidden;
    }

    .inv-hero-video {
        object-fit: cover;
        object-position: center 22%;
    }
}

body {
    --if-accent: var(--rsvp-accent, #b8956b);
    --if-accent-text: #fff;
    --if-text: var(--rsvp-text, inherit);
    --if-muted: var(--rsvp-muted, rgba(120, 100, 90, .85));
    --if-border: var(--rsvp-border, rgba(180, 150, 110, .35));
    --if-field: var(--rsvp-field, rgba(255, 255, 255, .08));
    --if-surface: var(--rsvp-field, rgba(255, 255, 255, .06));
    --if-rsvp-bg: transparent;
    --if-lang-bg: rgba(255, 255, 255, .92);
}

.inv-if-section {
    position: relative;
    z-index: 1;
    padding: 4rem 1.25rem;
    max-width: min(56rem, 100%);
    margin: 0 auto;
    overflow-x: hidden;
    box-sizing: border-box;
}

.inv-if-kicker {
    font-size: .68rem;
    letter-spacing: .32em;
    text-transform: uppercase;
    color: var(--if-muted, rgba(120, 100, 90, .85));
    text-align: center;
}

html[dir="rtl"] .inv-if-kicker {
    letter-spacing: .08em;
    text-transform: none;
}

.inv-if-title {
    margin-top: .65rem;
    font-size: clamp(1.6rem, 4vw, 2.2rem);
    font-weight: 400;
    text-align: center;
    color: var(--if-text, inherit);
}

.inv-if-note {
    margin: .75rem auto 0;
    max-width: 28rem;
    text-align: center;
    font-size: .95rem;
    line-height: 1.65;
    color: var(--if-muted, rgba(120, 100, 90, .85));
}

/* Welcome */
.inv-if-welcome {
    text-align: center;
    border-top: 1px solid var(--if-border, rgba(180, 150, 110, .25));
    border-bottom: 1px solid var(--if-border, rgba(180, 150, 110, .25));
}

.inv-if-welcome-text {
    margin-top: 1rem;
    font-size: clamp(1.05rem, 2.5vw, 1.25rem);
    line-height: 1.85;
    font-style: italic;
    color: var(--if-text, inherit);
}

/* Programme */
.inv-if-programme-list {
    list-style: none;
    margin-top: 1.5rem;
    display: grid;
    gap: .85rem;
}

.inv-if-programme-item {
    display: grid;
    grid-template-columns: 5rem 1fr;
    gap: 1rem;
    align-items: start;
    padding: 1rem 1.1rem;
    border: 1px solid var(--if-border, rgba(180, 150, 110, .28));
    background: var(--if-surface, rgba(255, 255, 255, .04));
}

html[dir="rtl"] .inv-if-programme-item {
    grid-template-columns: 1fr 5rem;
}

.inv-if-programme-time {
    font-size: .85rem;
    letter-spacing: .08em;
    color: var(--if-accent, #b8956b);
    font-weight: 600;
}

html[dir="rtl"] .inv-if-programme-item .inv-if-programme-time {
    text-align: left;
}

.inv-if-programme-name {
    font-size: 1.05rem;
    color: var(--if-text, inherit);
}

.inv-if-programme-desc {
    margin-top: .25rem;
    font-size: .88rem;
    color: var(--if-muted, rgba(120, 100, 90, .85));
}

/* Programme — centred timeline variant */
.inv-if-programme-rail {
    position: relative;
    margin-top: 2.2rem;
}

.inv-if-programme--timeline .inv-if-programme-list {
    position: relative;
    margin-top: 0;
    gap: 1.75rem;
}

.inv-if-programme--timeline .inv-if-programme-list::before {
    content: '';
    position: absolute;
    top: .5rem;
    bottom: .5rem;
    left: 50%;
    width: 1px;
    transform: translateX(-50%);
    background: linear-gradient(180deg, transparent, var(--if-border, rgba(180, 150, 110, .5)) 12%, var(--if-border, rgba(180, 150, 110, .5)) 88%, transparent);
}

.inv-if-programme--timeline .inv-if-programme-item,
html[dir="rtl"] .inv-if-programme--timeline .inv-if-programme-item {
    grid-template-columns: 1fr 2.8rem 1fr;
    align-items: center;
    gap: 0;
    padding: 0;
    border: 0;
    background: none;
    box-shadow: none;
    transition: opacity .35s ease;
}

.inv-if-programme--timeline .inv-if-programme-item::before {
    content: '';
    grid-column: 2;
    grid-row: 1;
    justify-self: center;
    width: .48rem;
    height: .48rem;
    border-radius: .08rem;
    transform: rotate(45deg);
    background: var(--if-accent, #b8956b);
    transition: transform .3s ease, box-shadow .3s ease, background .3s ease;
}

.inv-if-programme--timeline .inv-if-programme-item.is-active::before {
    width: .78rem;
    height: .78rem;
    background: var(--if-accent, #b8956b);
    box-shadow: 0 0 0 .38rem rgba(184, 149, 107, .16);
}

.inv-if-programme--timeline .inv-if-programme-item.is-active .inv-if-programme-name {
    color: var(--if-accent, #b8956b);
}

.inv-if-programme--timeline .inv-if-programme-time,
html[dir="rtl"] .inv-if-programme--timeline .inv-if-programme-item .inv-if-programme-time {
    grid-column: 1;
    grid-row: 1;
    text-align: end;
    padding-inline-end: 1rem;
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: .02em;
    color: var(--if-text, inherit);
}

.inv-if-programme--timeline .inv-if-programme-item > div {
    grid-column: 3;
    grid-row: 1;
    text-align: start;
    padding-inline-start: 1rem;
}

.inv-if-programme--timeline .inv-if-programme-name {
    font-size: 1.05rem;
    line-height: 1.5;
}

/* Rose that travels the timeline with scroll */
.inv-if-programme-rose {
    position: absolute;
    left: 50%;
    top: 0;
    z-index: 4;
    width: 2.35rem;
    height: 2.35rem;
    margin: 0;
    transform: translate(-50%, var(--rose-y, 0px)) rotate(var(--rose-tilt, -8deg));
    color: #c9a961;
    filter: drop-shadow(0 6px 12px rgba(120, 100, 70, .22));
    pointer-events: none;
    will-change: transform;
    transition: filter .3s ease;
}

.inv-if-programme-rose svg {
    display: block;
    width: 100%;
    height: 100%;
}

.inv-if-programme-rose.is-lit {
    color: #a8873f;
    filter: drop-shadow(0 8px 16px rgba(168, 135, 63, .35));
}

@media (max-width: 400px) {
    .inv-if-programme--timeline .inv-if-programme-item,
    html[dir="rtl"] .inv-if-programme--timeline .inv-if-programme-item {
        grid-template-columns: 1fr 1.9rem 1fr;
    }

    .inv-if-programme--timeline .inv-if-programme-time,
    html[dir="rtl"] .inv-if-programme--timeline .inv-if-programme-item .inv-if-programme-time {
        padding-inline-end: .6rem;
        font-size: .92rem;
    }

    .inv-if-programme--timeline .inv-if-programme-item > div {
        padding-inline-start: .6rem;
    }

    .inv-if-programme--timeline .inv-if-programme-name {
        font-size: .96rem;
    }

    .inv-if-programme-rose {
        width: 2rem;
        height: 2rem;
    }
}

/* Gallery grid */
.inv-if-gallery-grid {
    margin-top: 1.5rem;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: .65rem;
}

@media (min-width: 640px) {
    .inv-if-gallery-grid { grid-template-columns: repeat(3, 1fr); }
}

.inv-if-gallery-grid img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    display: block;
    border: 1px solid var(--if-border, rgba(180, 150, 110, .25));
}

.inv-if-gallery-cell {
    margin: 0;
    overflow: hidden;
}

/* Notes */
.inv-if-notes-body {
    margin-top: 1.25rem;
    max-width: 36rem;
    margin-inline: auto;
    padding: 1.25rem 1.35rem;
    border: 1px solid var(--if-border, rgba(180, 150, 110, .28));
    background: var(--if-surface, rgba(255, 255, 255, .04));
    font-size: .98rem;
    line-height: 1.85;
    text-align: center;
    color: var(--if-text, inherit);
}

/* Royal grid — ornate frames */
.inv-if-gallery--grid .inv-if-gallery-cell {
    padding: .45rem;
    border: 1px solid var(--if-border, rgba(180, 150, 110, .35));
    background: var(--if-surface, rgba(255, 255, 255, .03));
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06);
}

/* Showcase slider — rose / maroon */
.inv-if-showcase {
    margin-top: 1.75rem;
    position: relative;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.inv-if-showcase-shell {
    position: relative;
    display: flex;
    align-items: center;
    gap: .5rem;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
    direction: ltr; /* keep ‹ viewport › order even on RTL pages */
}

.inv-if-showcase-viewport {
    flex: 1 1 auto;
    min-width: 0; /* prevent flex track from expanding the page width */
    width: 100%;
    overflow: hidden;
    position: relative;
    padding-block: .5rem;
    mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}

.inv-if-showcase-track {
    display: flex;
    gap: var(--inv-showcase-gap, 1rem);
    width: max-content;
    max-width: none;
    will-change: transform;
    transition: transform .55s cubic-bezier(.22, 1, .36, 1);
    touch-action: pan-y;
    direction: ltr;
}

.inv-if-showcase-slide {
    flex: 0 0 var(--inv-showcase-slide, min(78vw, 340px));
    width: var(--inv-showcase-slide, min(78vw, 340px));
    max-width: none;
    margin: 0;
    transition: opacity .45s ease, transform .45s ease;
    opacity: .45;
    transform: scale(.92);
}

.inv-if-showcase-slide.is-active {
    opacity: 1;
    transform: scale(1);
}

.inv-if-showcase-frame {
    position: relative;
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: zoom-in;
    overflow: hidden;
    border-radius: 1.15rem;
    box-shadow: 0 20px 50px rgba(0, 0, 0, .14);
    border: 1px solid var(--if-border, rgba(180, 150, 110, .28));
}

.inv-if-showcase-frame::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 55%, rgba(0, 0, 0, .22));
    opacity: 0;
    transition: opacity .3s ease;
    pointer-events: none;
}

.inv-if-showcase-slide.is-active .inv-if-showcase-frame::after {
    opacity: 1;
}

.inv-if-showcase-frame img {
    width: 100%;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    display: block;
    transition: transform .6s ease;
}

.inv-if-showcase-slide.is-active .inv-if-showcase-frame:hover img {
    transform: scale(1.03);
}

.inv-if-showcase-zoom {
    position: absolute;
    bottom: .75rem;
    inset-inline-end: .75rem;
    width: 2rem;
    height: 2rem;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: rgba(255, 255, 255, .88);
    color: var(--if-accent, #602423);
    font-size: 1rem;
    line-height: 1;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity .3s ease, transform .3s ease;
    pointer-events: none;
}

.inv-if-showcase-slide.is-active .inv-if-showcase-zoom {
    opacity: 1;
    transform: translateY(0);
}

.inv-if-showcase-nav {
    flex-shrink: 0;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 999px;
    border: 1px solid var(--if-border, rgba(180, 150, 110, .35));
    background: rgba(255, 255, 255, .95);
    color: var(--if-accent, #602423);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .1);
    transition: transform .2s ease, background .2s ease;
    z-index: 5;
    position: relative;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.inv-if-showcase-nav:hover {
    transform: scale(1.06);
    background: #fff;
}

.inv-if-showcase-nav:disabled {
    opacity: .35;
    cursor: not-allowed;
    transform: none;
}

.inv-if-showcase-footer {
    margin-top: 1.25rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .65rem;
}

.inv-if-showcase-dots {
    display: flex;
    gap: .45rem;
    flex-wrap: wrap;
    justify-content: center;
}

.inv-if-showcase-dot {
    width: .45rem;
    height: .45rem;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: var(--if-border, rgba(180, 150, 110, .45));
    cursor: pointer;
    transition: width .3s ease, background .3s ease;
}

.inv-if-showcase-dot.is-active {
    width: 1.35rem;
    background: var(--if-accent, #602423);
}

.inv-if-showcase-counter {
    margin: 0;
    font-size: .72rem;
    letter-spacing: .28em;
    text-transform: uppercase;
    color: var(--if-muted, rgba(120, 100, 90, .85));
}

html[dir="rtl"] .inv-if-showcase-counter {
    letter-spacing: .1em;
    text-transform: none;
}

/* Lightbox */
.inv-if-lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: grid;
    place-items: center;
    padding: 1.25rem;
    background: rgba(12, 8, 8, .92);
    backdrop-filter: blur(8px);
    animation: inv-if-fade-in .25s ease;
}

.inv-if-lightbox[hidden] {
    display: none !important;
}

.inv-if-lightbox-img {
    max-width: min(92vw, 720px);
    max-height: 85vh;
    object-fit: contain;
    border-radius: .25rem;
    box-shadow: 0 24px 80px rgba(0, 0, 0, .45);
}

.inv-if-lightbox-close {
    position: absolute;
    top: 1rem;
    inset-inline-end: 1rem;
    width: 2.75rem;
    height: 2.75rem;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, .12);
    color: #fff;
    font-size: 1.75rem;
    line-height: 1;
    cursor: pointer;
}

@keyframes inv-if-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@media (max-width: 640px) {
    .inv-if-showcase-nav {
        width: 2.15rem;
        height: 2.15rem;
        font-size: 1.25rem;
    }
}

/* Constellation spotlight — midnight-gold exclusive */
.inv-if-constellation {
    margin-top: 1.75rem;
    text-align: center;
}

.inv-if-constellation-hint {
    margin: 0 auto 1.1rem;
    max-width: 24rem;
    font-size: .88rem;
    line-height: 1.65;
    color: var(--if-muted, rgba(120, 100, 90, .85));
}

.inv-if-constellation-sky {
    position: relative;
    width: min(100%, 36rem);
    margin: 0 auto;
    min-height: 30rem;
    isolation: isolate;
}

@media (min-width: 640px) {
    .inv-if-constellation-sky {
        min-height: 34rem;
        width: min(100%, 40rem);
    }
}

.inv-if-constellation-dust,
.inv-if-constellation-dust--b,
.inv-if-constellation-dust--c {
    position: absolute;
    inset: 8% 6%;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
    background-image:
        radial-gradient(1.5px 1.5px at 12% 22%, rgba(255, 236, 190, .7), transparent),
        radial-gradient(1px 1px at 78% 18%, rgba(255, 236, 190, .55), transparent),
        radial-gradient(1.5px 1.5px at 42% 78%, rgba(255, 236, 190, .45), transparent),
        radial-gradient(1px 1px at 88% 62%, rgba(255, 236, 190, .5), transparent),
        radial-gradient(1px 1px at 22% 58%, rgba(255, 236, 190, .4), transparent);
    animation: inv-if-constellation-twinkle 5.5s ease-in-out infinite;
}

.inv-if-constellation-dust--b {
    inset: 12% 10%;
    opacity: .7;
    animation-delay: -1.8s;
    transform: scale(1.05);
}

.inv-if-constellation-dust--c {
    inset: 4% 14%;
    opacity: .55;
    animation-delay: -3.2s;
}

@keyframes inv-if-constellation-twinkle {
    0%, 100% { opacity: .45; }
    50% { opacity: .95; }
}

.inv-if-constellation-lines {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: visible;
}

.inv-if-constellation-lines line {
    stroke: rgba(212, 181, 106, .28);
    stroke-width: 1;
    stroke-linecap: round;
    transition: stroke .35s ease, opacity .35s ease;
}

.inv-if-constellation-lines line.is-lit {
    stroke: rgba(232, 201, 120, .75);
    stroke-width: 1.4;
    filter: drop-shadow(0 0 4px rgba(212, 181, 106, .55));
}

.inv-if-constellation-stage {
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 2;
    width: min(52%, 14.5rem);
    transform: translate(-50%, -50%);
    padding: 0;
}

@media (min-width: 640px) {
    .inv-if-constellation-stage {
        width: min(44%, 16rem);
    }
}

.inv-if-constellation-glow {
    position: absolute;
    inset: -8% -12% auto;
    height: 70%;
    border-radius: 50%;
    background: radial-gradient(ellipse at center, rgba(212, 181, 106, .42), transparent 72%);
    filter: blur(20px);
    pointer-events: none;
    z-index: 0;
    animation: inv-if-constellation-pulse 4.5s ease-in-out infinite;
}

@keyframes inv-if-constellation-pulse {
    0%, 100% { opacity: .55; transform: scale(1); }
    50% { opacity: .95; transform: scale(1.08); }
}

.inv-if-constellation-frame {
    position: relative;
    z-index: 1;
    display: block;
    width: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    overflow: hidden;
    border-radius: 48% 48% 42% 42% / 42% 42% 48% 48%;
    aspect-ratio: 4 / 5;
    cursor: zoom-in;
    background: rgba(0, 0, 0, .28);
    box-shadow:
        0 28px 64px rgba(0, 0, 0, .32),
        0 0 0 1px rgba(212, 181, 106, .4),
        0 0 48px rgba(212, 181, 106, .16);
}

.inv-if-constellation-frame img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity .45s ease, transform .7s ease;
    pointer-events: none;
}

.inv-if-constellation.is-switching .inv-if-constellation-frame img {
    opacity: .28;
    transform: scale(1.06);
}

.inv-if-constellation-counter {
    position: absolute;
    left: 50%;
    bottom: .35rem;
    z-index: 2;
    transform: translateX(-50%);
    margin: 0;
    font-size: .75rem;
    letter-spacing: .22em;
    color: var(--if-accent, #b8956b);
    pointer-events: none;
}

html[dir="rtl"] .inv-if-constellation-counter {
    letter-spacing: .06em;
}

.inv-if-constellation-orbit {
    position: absolute;
    inset: 0;
    z-index: 3;
    margin: 0;
    padding: 0;
    pointer-events: none;
}

.inv-if-constellation-star {
    position: absolute;
    width: 3.6rem;
    height: 3.6rem;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    overflow: hidden;
    cursor: pointer;
    pointer-events: auto;
    background: transparent;
    box-shadow: 0 0 0 1.5px rgba(180, 150, 110, .35);
    transform: translate(-50%, -50%);
    transition: box-shadow .3s ease, filter .3s ease;
    animation: inv-if-constellation-float 5.2s ease-in-out infinite;
}

.inv-if-constellation-star:nth-child(2n) { animation-delay: -.9s; }
.inv-if-constellation-star:nth-child(3n) { animation-delay: -1.7s; }
.inv-if-constellation-star:nth-child(4n) { animation-delay: -2.6s; }

@keyframes inv-if-constellation-float {
    0%, 100% { translate: 0 0; }
    50% { translate: 0 -5px; }
}

.inv-if-constellation-star img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(.72) saturate(.85);
    transition: filter .3s ease, transform .35s ease;
}

.inv-if-constellation-star:hover img {
    filter: brightness(.92) saturate(1);
    transform: scale(1.06);
}

.inv-if-constellation-star.is-active {
    z-index: 4;
    box-shadow:
        0 0 0 2px rgba(212, 181, 106, .95),
        0 0 26px rgba(212, 181, 106, .55);
    animation: none;
}

.inv-if-constellation-star.is-active img {
    filter: none;
    transform: scale(1.08);
}

.inv-if-constellation-nav {
    display: flex;
    justify-content: center;
    gap: .65rem;
    margin-top: 1.15rem;
}

.inv-if-constellation-btn {
    width: 2.6rem;
    height: 2.6rem;
    border-radius: 999px;
    border: 1px solid rgba(180, 150, 110, .4);
    background: rgba(255, 255, 255, .08);
    color: var(--if-accent, #b8956b);
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    transition: background .2s ease, transform .2s ease;
}

.inv-if-constellation-btn:hover {
    background: rgba(212, 181, 106, .18);
    transform: translateY(-1px);
}

@media (min-width: 640px) {
    .inv-if-constellation-star {
        width: 4.35rem;
        height: 4.35rem;
    }
}

@media (max-width: 420px) {
    .inv-if-constellation-sky {
        min-height: 28.5rem;
    }
    .inv-if-constellation-star {
        width: 3.15rem;
        height: 3.15rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .inv-if-constellation-dust,
    .inv-if-constellation-dust--b,
    .inv-if-constellation-dust--c,
    .inv-if-constellation-glow,
    .inv-if-constellation-star {
        animation: none;
    }
}

/* Polaroid — mint garden */
.inv-if-polaroid-grid {
    margin-top: 1.5rem;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
}

@media (min-width: 640px) {
    .inv-if-polaroid-grid { grid-template-columns: repeat(3, 1fr); }
}

.inv-if-polaroid {
    margin: 0;
    padding: .55rem .55rem 1.75rem;
    background: #fff;
    box-shadow: 0 10px 28px rgba(0, 0, 0, .14);
    transform: rotate(var(--inv-rot, 0deg));
    transition: transform .25s ease;
}

.inv-if-polaroid:hover { transform: rotate(0deg) scale(1.02); }

.inv-if-polaroid img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    display: block;
}

/* Filmstrip — golden editorial */
.inv-if-filmstrip {
    margin-top: 1.5rem;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: .85rem 0;
    background: linear-gradient(180deg, rgba(0,0,0,.04), rgba(0,0,0,.02));
    border-block: 3px solid rgba(0, 0, 0, .08);
}

.inv-if-filmstrip-track {
    display: flex;
    gap: 1rem;
    padding-inline: 1rem;
    min-width: min-content;
}

.inv-if-filmstrip-frame {
    flex: 0 0 auto;
    margin: 0;
    padding: .35rem .35rem .65rem;
    background: #111;
    border-inline: 6px dotted rgba(255, 255, 255, .25);
}

.inv-if-filmstrip-frame img {
    width: 200px;
    height: 140px;
    object-fit: cover;
    display: block;
    filter: sepia(.12);
}

/* Album — midnight gold */
.inv-if-album-wrap { text-align: center; }
.inv-if-album-hint {
    margin-top: .75rem;
    font-size: .8rem;
    color: var(--if-muted, rgba(200, 180, 150, .8));
}
.inv-if-album-stage {
    margin-top: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .75rem;
}
.inv-if-album-book {
    position: relative;
    width: min(78vw, 360px);
    aspect-ratio: 3 / 4;
    perspective: 1200px;
}
.inv-if-album-page {
    position: absolute;
    inset: 0;
    margin: 0;
    opacity: 0;
    transform: rotateY(-18deg) scale(.94);
    transition: opacity .45s ease, transform .45s ease;
    pointer-events: none;
    border: 1px solid var(--if-border, rgba(180, 150, 110, .35));
    box-shadow: 0 18px 40px rgba(0, 0, 0, .18);
    background: #fff;
    overflow: hidden;
}
.inv-if-album-page.is-active {
    opacity: 1;
    transform: rotateY(0) scale(1);
    pointer-events: auto;
    z-index: 2;
}
.inv-if-album-page.is-before {
    transform: rotateY(18deg) scale(.94);
}
.inv-if-album-page img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.inv-if-album-nav {
    flex-shrink: 0;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 999px;
    border: 1px solid var(--if-border, rgba(180, 150, 110, .4));
    background: var(--if-surface, rgba(255, 255, 255, .08));
    color: var(--if-accent, #b8956b);
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
}
.inv-if-album-counter {
    margin-top: .75rem;
    font-size: .75rem;
    color: var(--if-muted, rgba(200, 180, 150, .75));
}

/* Map */
.inv-if-map-frame {
    margin-top: 1.25rem;
    overflow: hidden;
    border-radius: 1.35rem;
    border: 1px solid var(--if-border, rgba(180, 150, 110, .35));
    box-shadow: 0 12px 36px rgba(0, 0, 0, .08);
}

.inv-if-map-frame iframe {
    width: 100%;
    height: 270px;
    border: 0;
    display: block;
}

.inv-if-map-link {
    display: inline-block;
    margin-top: 1rem;
    font-size: .85rem;
    color: var(--if-accent, #b8956b);
    text-decoration: none;
}

.inv-if-map-link:hover { text-decoration: underline; }

/* Guestbook */
.inv-if-guestbook-lead {
    margin: .65rem auto 0;
    max-width: 28rem;
    font-size: .92rem;
    line-height: 1.7;
    color: var(--if-muted, rgba(120, 100, 90, .9));
    text-align: center;
}

.inv-if-guestbook-entries {
    margin-top: 1.5rem;
    display: grid;
    gap: .75rem;
}

.inv-if-guestbook-entry {
    padding: 1rem 1.1rem;
    border: 1px solid var(--if-border, rgba(180, 150, 110, .25));
    background: var(--if-surface, rgba(255, 255, 255, .04));
    text-align: start;
}

.inv-if-guestbook-entry-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .45rem .65rem;
}

.inv-if-guestbook-entry strong {
    display: block;
    color: var(--if-accent, #b8956b);
    font-size: .9rem;
}

.inv-if-guestbook-time {
    margin-inline-start: auto;
    font-size: .72rem;
    letter-spacing: .02em;
    opacity: .65;
    white-space: nowrap;
}

.inv-if-guestbook-badge {
    display: inline-flex;
    align-items: center;
    padding: .15rem .55rem;
    border-radius: 999px;
    font-size: .68rem;
    font-weight: 600;
    letter-spacing: .04em;
    color: var(--if-accent, #8a5a4a);
    background: color-mix(in srgb, var(--if-accent, #b8956b) 14%, transparent);
    border: 1px solid color-mix(in srgb, var(--if-accent, #b8956b) 28%, transparent);
}

.inv-if-guestbook-entry p {
    margin-top: .35rem;
    font-size: .95rem;
    line-height: 1.6;
    color: var(--if-text, inherit);
}

.inv-if-voice-player,
.inv-if-voice-preview {
    display: block;
    width: 100%;
    margin-top: .75rem;
    height: 2.35rem;
}

.inv-if-guestbook-form {
    margin-top: 1.75rem;
    max-width: 28rem;
    margin-inline: auto;
    display: grid;
    gap: .85rem;
}

.inv-if-guestbook-modes {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .45rem;
    margin: 0;
    padding: .3rem;
    border: 1px solid var(--if-border, rgba(180, 150, 110, .3));
    background: var(--if-field, rgba(255, 255, 255, .05));
}

.inv-if-guestbook-mode {
    position: relative;
    cursor: pointer;
}

.inv-if-guestbook-mode input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.inv-if-guestbook-mode span {
    display: block;
    text-align: center;
    padding: .65rem .5rem;
    font-size: .85rem;
    font-weight: 600;
    color: var(--if-muted, rgba(120, 100, 90, .9));
    transition: background .2s ease, color .2s ease;
}

.inv-if-guestbook-mode input:checked + span {
    background: var(--if-accent, #602423);
    color: var(--if-accent-text, #fff);
}

.inv-if-optional-hint {
    margin-inline-start: .35rem;
    font-size: .72rem;
    font-weight: 500;
    color: var(--if-muted, rgba(120, 100, 90, .75));
}

.inv-if-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.inv-if-voice-card {
    padding: 1.1rem 1rem 1rem;
    border: 1px solid var(--if-border, rgba(180, 150, 110, .3));
    background:
        linear-gradient(180deg, color-mix(in srgb, var(--if-accent, #b8956b) 8%, transparent), transparent 55%),
        var(--if-surface, rgba(255, 255, 255, .04));
    text-align: center;
}

.inv-if-voice-meter {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: .28rem;
    height: 2.2rem;
    margin-bottom: .55rem;
}

.inv-if-voice-meter span {
    width: .28rem;
    height: .45rem;
    border-radius: 99px;
    background: color-mix(in srgb, var(--if-accent, #b8956b) 45%, transparent);
    transform-origin: bottom center;
}

.inv-if-voice-meter.is-active span {
    animation: inv-if-voice-pulse 1s ease-in-out infinite;
    background: var(--if-accent, #b8956b);
}

.inv-if-voice-meter.is-active span:nth-child(1) { animation-delay: 0s; }
.inv-if-voice-meter.is-active span:nth-child(2) { animation-delay: .1s; }
.inv-if-voice-meter.is-active span:nth-child(3) { animation-delay: .2s; }
.inv-if-voice-meter.is-active span:nth-child(4) { animation-delay: .12s; }
.inv-if-voice-meter.is-active span:nth-child(5) { animation-delay: .05s; }

@keyframes inv-if-voice-pulse {
    0%, 100% { height: .45rem; opacity: .55; }
    50% { height: 1.85rem; opacity: 1; }
}

.inv-if-voice-timer {
    margin: 0;
    font-size: 1.35rem;
    font-variant-numeric: tabular-nums;
    letter-spacing: .06em;
    color: var(--if-text, inherit);
}

.inv-if-voice-status {
    margin: .35rem 0 0;
    font-size: .82rem;
    color: var(--if-muted, rgba(120, 100, 90, .9));
}

.inv-if-voice-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: .5rem;
    margin-top: .95rem;
}

.inv-if-voice-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    min-height: 2.55rem;
    padding: .55rem 1.1rem;
    border: 1px solid var(--if-border, rgba(180, 150, 110, .35));
    background: var(--if-field, rgba(255, 255, 255, .08));
    color: var(--if-text, inherit);
    font: inherit;
    font-size: .85rem;
    font-weight: 600;
    cursor: pointer;
}

.inv-if-voice-btn:disabled {
    opacity: .55;
    cursor: not-allowed;
}

.inv-if-voice-btn--record {
    background: var(--if-accent, #602423);
    border-color: transparent;
    color: var(--if-accent-text, #fff);
}

.inv-if-voice-btn--stop {
    background: #8f2f2f;
    border-color: transparent;
    color: #fff;
}

.inv-if-voice-btn--ghost {
    background: transparent;
}

.inv-if-voice-dot {
    width: .55rem;
    height: .55rem;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 0 0 rgba(255, 255, 255, .45);
}

.is-recording .inv-if-voice-dot {
    animation: inv-if-voice-dot 1.2s ease-out infinite;
}

@keyframes inv-if-voice-dot {
    0% { box-shadow: 0 0 0 0 rgba(255, 255, 255, .5); }
    70% { box-shadow: 0 0 0 .55rem rgba(255, 255, 255, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); }
}

.inv-if-voice-hint,
.inv-if-voice-unsupported {
    margin: .75rem 0 0;
    font-size: .75rem;
    line-height: 1.55;
    color: var(--if-muted, rgba(120, 100, 90, .85));
}

.inv-if-voice-unsupported {
    color: #9a3b3b;
}

.inv-if-field label {
    display: block;
    margin-bottom: .35rem;
    font-size: .8rem;
    color: var(--if-muted, rgba(120, 100, 90, .85));
}

.inv-if-field input,
.inv-if-field textarea {
    width: 100%;
    padding: .7rem .85rem;
    border: 1px solid var(--if-border, rgba(180, 150, 110, .35));
    background: var(--if-field, rgba(255, 255, 255, .06));
    color: var(--if-text, inherit);
    font: inherit;
}

.inv-if-field textarea { min-height: 6rem; resize: vertical; }

.inv-if-submit {
    margin-top: .25rem;
    padding: .85rem 1.5rem;
    border: 0;
    background: var(--if-accent, #602423);
    color: var(--if-accent-text, #fff);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.inv-if-submit:disabled {
    opacity: .55;
    cursor: not-allowed;
}

/* Gratitude */
.inv-if-gratitude {
    text-align: center;
    background: var(--if-surface, rgba(0, 0, 0, .04));
}

.inv-if-gratitude-text {
    margin-top: 1rem;
    font-size: 1.05rem;
    line-height: 1.85;
    color: var(--if-text, inherit);
}

/* RSVP wrapper */
.inv-if-rsvp {
    background: var(--if-rsvp-bg, transparent);
}

/* Watermark */
.inv-if-watermark {
    position: fixed;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 25;
    pointer-events: none;
    padding: .35rem .85rem;
    border-radius: 999px;
    font-size: .65rem;
    letter-spacing: .22em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .72);
    background: rgba(0, 0, 0, .42);
    backdrop-filter: blur(6px);
}

html[dir="rtl"] .inv-if-watermark {
    letter-spacing: .06em;
    text-transform: none;
}

/* Language switch */
.inv-if-lang {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 60;
    display: flex;
    gap: .2rem;
    padding: .22rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, .94);
    border: 1px solid var(--if-border, rgba(180, 150, 110, .35));
    box-shadow: 0 10px 28px rgba(0, 0, 0, .1);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

html[dir="rtl"] .inv-if-lang {
    right: auto;
    left: 1rem;
}

.inv-if-lang a {
    padding: .4rem .75rem;
    font-size: .75rem;
    font-weight: 600;
    text-decoration: none;
    color: var(--if-muted, #5c4a4a);
    border-radius: 999px;
    transition: background .2s ease, color .2s ease;
}

.inv-if-lang a.is-active {
    background: var(--if-accent, #5a1f28);
    color: var(--if-accent-text, #fff);
}

/* Smart entry pass — ticket */
.inv-if-pass .inv-if-note {
    margin-top: 1.25rem;
}

.inv-if-ticket {
    position: relative;
    max-width: 30rem;
    margin: 1.75rem auto 0;
    display: grid;
    grid-template-columns: 1fr;
    border-radius: 1.5rem;
    overflow: hidden;
    background: var(--if-field, rgba(255, 255, 255, .9));
    box-shadow: 0 22px 52px rgba(0, 0, 0, .12);
}

@media (min-width: 560px) {
    .inv-if-ticket {
        grid-template-columns: 1.35fr .85fr;
        align-items: stretch;
    }
}

.inv-if-ticket-main {
    padding: 1.85rem 1.5rem 1.65rem;
    text-align: center;
}

.inv-if-ticket-label {
    font-size: .62rem;
    letter-spacing: .34em;
    text-transform: uppercase;
    color: var(--if-accent, #b8956b);
}

html[dir="rtl"] .inv-if-ticket-label {
    letter-spacing: .1em;
    text-transform: none;
    font-size: .82rem;
}

.inv-if-ticket-names {
    margin-top: .7rem;
    font-size: clamp(1.5rem, 5vw, 2rem);
    line-height: 1.25;
    color: var(--if-text, inherit);
}

.inv-if-ticket-names em {
    font-style: italic;
    color: var(--if-accent, #b8956b);
    font-size: .72em;
    margin: 0 .2rem;
}

.inv-if-ticket-meta {
    margin-top: 1.25rem;
    display: grid;
    gap: 1rem;
    text-align: center;
}

.inv-if-ticket-meta-pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .85rem;
}

.inv-if-ticket-meta-full {
    grid-column: 1 / -1;
    text-align: center;
}

.inv-if-ticket-meta dt {
    font-size: .6rem;
    letter-spacing: .22em;
    text-transform: uppercase;
    color: var(--if-muted, rgba(120, 100, 90, .85));
}

html[dir="rtl"] .inv-if-ticket-meta dt {
    letter-spacing: .04em;
    text-transform: none;
    font-size: .82rem;
}

.inv-if-ticket-meta dd {
    margin-top: .25rem;
    font-size: 1rem;
    color: var(--if-text, inherit);
    line-height: 1.45;
}

.inv-if-ticket-meta-full dd {
    max-width: 16rem;
    margin-inline: auto;
}

.inv-if-ticket-stub {
    position: relative;
    padding: 1.6rem 1.25rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .7rem;
    background: var(--if-surface, rgba(0, 0, 0, .04));
    border-top: 1.5px dashed var(--if-border, rgba(180, 150, 110, .5));
}

@media (min-width: 560px) {
    .inv-if-ticket-stub {
        border-top: 0;
        border-inline-start: 1.5px dashed var(--if-border, rgba(180, 150, 110, .5));
    }
}

.inv-if-ticket-stub::before,
.inv-if-ticket-stub::after {
    content: '';
    position: absolute;
    width: 1.1rem;
    height: 1.1rem;
    border-radius: 50%;
    background: var(--if-punch, #f6f1ea);
}

.inv-if-ticket-stub::before {
    top: -.55rem;
    inset-inline-start: -.55rem;
}

.inv-if-ticket-stub::after {
    bottom: -.55rem;
    inset-inline-start: -.55rem;
}

@media (max-width: 559px) {
    .inv-if-ticket-stub::before {
        top: -.55rem;
        inset-inline-start: -.55rem;
    }
    .inv-if-ticket-stub::after {
        top: -.55rem;
        bottom: auto;
        inset-inline-start: auto;
        inset-inline-end: -.55rem;
    }
}

.inv-if-ticket-qr {
    width: 7.5rem;
    height: 7.5rem;
    padding: .45rem;
    border-radius: .9rem;
    background: #faf4eb;
    box-shadow: 0 8px 20px rgba(0, 0, 0, .12);
}

.inv-if-ticket-qr svg {
    display: block;
    width: 100%;
    height: 100%;
}

.inv-if-ticket-scan {
    font-size: .72rem;
    line-height: 1.5;
    text-align: center;
    color: var(--if-muted, rgba(120, 100, 90, .85));
}

.inv-if-ticket-serial {
    font-size: .66rem;
    letter-spacing: .18em;
    color: var(--if-accent, #b8956b);
}
