/**
 * InvitKeun — lapisan premium + perbaikan responsif semua template
 */

html {
    -webkit-text-size-adjust: 100%;
    margin: 0;
    padding: 0;
    background-color: var(--secondary, #1b4332);
}

body.invitation-fluid {
    overflow-x: hidden;
    max-width: 100vw;
    margin: 0;
    padding: 0;
    background-color: var(--secondary, #1b4332);
    background-image: none;
}

body.invitation-fluid #mainContent {
    margin: 0;
    padding: 0;
}

body.invitation-fluid #hero {
    margin-top: 0;
    min-height: 100dvh;
    min-height: 100svh;
}

#mainContent,
#invitation-main {
    overflow-x: hidden;
    max-width: 100%;
}

/* ——— Lebar section seragam (mobile & desktop) ——— */
:root {
    --inv-section-max: min(56rem, calc(100vw - 1.5rem));
}

.inv-section__inner {
    width: 100%;
    max-width: var(--inv-section-max);
    margin-inline: auto;
    padding-inline: clamp(1rem, 4vw, 1.5rem);
    box-sizing: border-box;
}

.section-heading,
.accent-band .section-band-inner,
.section-band-inner.inv-section__inner {
    max-width: var(--inv-section-max);
}

#rsvp .rsvp-form-card,
#guestbook .readable-card,
#guestbook form,
#guestbook .guestbook-compose,
#guestbook .guestbook-wall-wrap,
#guestbook .guestbook-wall,
#guestbook .guestbook-pager {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

#events .grid,
#gallery .grid {
    width: 100%;
    max-width: 100%;
    margin-inline: auto;
}

/* ——— Judul section (fix: eyebrow + title tidak side-by-side) ——— */
/* Cover — nama & tanggal selaras (semua template) */
.cover-names-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 100%;
    margin-inline: auto;
    text-align: center;
    gap: clamp(0.45rem, 2vw, 0.65rem);
}

.cover-couple-names {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: min(100%, 20rem);
    margin: 0 auto;
    padding: 0;
    line-height: 1.1;
    font-size: clamp(2.5rem, 10vw, 3.75rem);
    font-weight: 400;
    text-align: center;
}

.cover-couple-names .cover-name-line {
    display: block;
    width: 100%;
    text-align: center;
    margin: 0;
    padding: 0 0.15rem;
}

.cover-couple-names .cover-ampersand {
    display: block;
    font-family: var(--font-display, 'Playfair Display', Georgia, serif);
    font-size: clamp(1rem, 3.5vw, 1.45rem);
    font-style: normal;
    font-weight: 500;
    line-height: 1.2;
    margin: clamp(0.15rem, 1vw, 0.3rem) 0;
    opacity: 0.92;
    vertical-align: baseline;
}

.cover-save-date {
    display: block;
    width: 100%;
    max-width: 22rem;
    margin: clamp(0.5rem, 2vw, 0.75rem) auto 0;
    padding: 0 0.5rem;
    padding-left: calc(0.5rem + 0.1em);
    text-align: center;
    font-family: var(--font-display, 'Playfair Display', Georgia, serif);
    font-size: clamp(0.7rem, 2.2vw, 0.8125rem);
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.88);
}

.cover-skin-heritage .cover-save-date,
.cover-skin-ornate .cover-save-date,
.cover-skin-pastoral .cover-save-date {
    color: var(--heritage-ink, #3d2f24) !important;
    opacity: 0.82;
}

.cover-guest-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    width: 100%;
    max-width: 20rem;
    margin-inline: auto;
    text-align: center;
}

.cover-guest-line,
.cover-guest-name {
    display: block;
    width: 100%;
    margin: 0;
    text-align: center;
}

.cover-guest-name {
    line-height: 1.35;
    padding: 0.1rem 0;
}

#cover .cover-card-3d {
    overflow: visible;
}

#cover .cover-button-block {
    width: 100%;
    padding-top: clamp(0.65rem, 2.5vw, 0.85rem);
    padding-bottom: max(0.25rem, env(safe-area-inset-bottom, 0px));
    flex-shrink: 0;
}

#cover .cover-open-btn {
    margin-inline: auto;
    touch-action: manipulation;
}

/* Cover — HP pendek / lebar: scroll aman, tombol tidak kepotong (semua template via base.php) */
@media (max-width: 899px) {
    body.has-cover-open #cover {
        overflow-x: hidden !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-y: contain;
        justify-content: flex-start !important;
        padding-bottom: max(18px, env(safe-area-inset-bottom, 14px)) !important;
        scroll-padding-bottom: max(28px, env(safe-area-inset-bottom, 20px));
    }

    body.has-cover-open #cover .cover-stage {
        margin-block: auto;
    }

    body.has-cover-open #cover .cover-card-3d {
        max-height: none !important;
        overflow: visible !important;
    }

    body.has-cover-open #cover .cover-open-btn {
        min-height: 48px;
        min-width: 12.5rem;
    }
}

@media (max-width: 899px) and (max-height: 680px) {
    #cover .cover-photo-wrap {
        width: min(32svh, 160px) !important;
        max-width: 160px !important;
    }

    #cover .cover-guest-block {
        margin-top: 0.5rem !important;
    }

    #cover .animate-fade-in-up.delay-500,
    #cover .animate-fade-in-up.delay-700 {
        margin-top: 0.5rem !important;
    }
}

/* Blok judul section — jarak rapat ke konten di bawahnya (semua template) */
.section-heading-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: clamp(0.28rem, 1vw, 0.42rem);
    width: 100%;
    max-width: 36rem;
    margin: 0 auto var(--inv-heading-to-content);
    padding-inline: 0.5rem;
    text-align: center;
}

.section-heading-block .section-heading {
    margin: 0 !important;
    padding: 0;
    max-width: 100%;
}

.section-heading-block .section-lead {
    margin: 0 !important;
    padding: 0 0.25rem;
    max-width: 32rem;
    font-size: clamp(0.8125rem, 2.6vw, 0.9375rem);
    line-height: 1.55;
    color: var(--muted, #64748b);
}

.section-heading-block .section-heading + .section-lead {
    margin-top: clamp(0.15rem, 0.6vw, 0.3rem) !important;
}

.section-heading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: clamp(0.18rem, 0.75vw, 0.32rem);
    width: 100%;
    max-width: 36rem;
    margin: 0 auto;
    padding-inline: 0.25rem;
}

/* Legacy: heading tanpa wrapper block */
.section-heading-block > .section-heading {
    margin-bottom: 0 !important;
}

.section-eyebrow {
    display: block;
    width: 100%;
    margin: 0;
    padding-left: 0.14em;
    font-size: clamp(0.62rem, 2.4vw, 0.75rem);
    letter-spacing: 0.28em;
    text-transform: uppercase;
    font-weight: 600;
    line-height: 1.4;
    text-align: center;
    color: var(--primary);
    opacity: 0.92;
}

.section-title {
    display: block;
    width: 100%;
    margin: 0;
    font-size: var(--inv-section-title-size);
    line-height: 1.22;
    color: var(--ink);
    position: relative;
    padding-bottom: 0.32rem;
    font-style: normal;
    transform: none !important;
    letter-spacing: 0.01em;
    text-align: center;
}

.section-title.font-display {
    font-weight: 600;
}

.section-title::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 0;
    width: min(3.25rem, 36%);
    height: 2px;
    transform: translateX(-50%);
    background: linear-gradient(90deg, transparent, rgba(var(--accent-rgb), 0.9), transparent);
    border-radius: 999px;
    pointer-events: none;
}

.section-lead {
    display: block;
    width: 100%;
    margin: 0;
    color: var(--muted);
    max-width: 32rem;
}

/* Konten langsung setelah header block — tanpa jarak ekstra */
.inv-section__inner > .section-heading-block + *,
.inv-section__inner > .section-heading + * {
    margin-top: 0;
}

#gallery .section-heading-block + .invitation-gallery-grid,
#story .section-heading-block + .relative,
#events .section-heading-block + .inv-events-grid,
#couple .section-heading-block + .inv-couple-grid {
    margin-top: 0;
}

/* Template style "dark" — judul section terang pakai ink, bukan putih */
.invitation-dark-inner .template-surface.tpl-surface-bg .section-eyebrow {
    color: var(--icon-on-surface, var(--primary)) !important;
    opacity: 1;
}

.invitation-dark-inner .template-surface.tpl-surface-bg .section-title {
    color: var(--ink) !important;
    -webkit-text-fill-color: var(--ink) !important;
}

.invitation-dark-inner .template-surface.tpl-surface-bg .section-lead {
    color: var(--muted) !important;
}

.invitation-dark-inner .accent-band-dark .band-eyebrow,
.invitation-dark-inner .accent-band-dark .band-title,
.invitation-dark-inner .accent-band-dark .band-desc {
    color: #f8fafc !important;
}

.template-surface .section-eyebrow {
    color: var(--icon-on-surface, var(--primary)) !important;
    opacity: 1;
}

.invitation-dark-inner .event-card .text-gray-800,
.invitation-dark-inner .event-card .text-gray-600,
.invitation-dark-inner .event-card .text-gray-400,
.invitation-dark-inner .event-card .text-gray-500 {
    color: #e2e8f0 !important;
}

.invitation-dark-inner .event-card h3 {
    color: #f8fafc !important;
}

.accent-band .section-band-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 36rem;
    margin-inline: auto;
}

.band-eyebrow {
    display: block;
    width: 100%;
    text-align: center;
    margin-bottom: 0.65rem;
    padding-left: 0.15em;
}

h2.band-title,
.band-title {
    display: block;
    width: 100%;
    text-align: center;
    font-size: var(--inv-band-title-display-size);
    line-height: 1.22;
    margin: 0;
    font-weight: 600;
}

.band-title.font-script {
    font-size: var(--inv-band-title-script-size);
    font-weight: 400;
    line-height: 1.18;
}

.band-title.font-display {
    font-size: var(--inv-band-title-display-size);
    font-weight: 600;
    letter-spacing: 0.02em;
}

.inv-band-heading-stack {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    width: 100%;
    text-align: center;
}

.inv-band-heading-stack .band-title {
    margin: 0;
    line-height: 1.22;
}

.template-surface .section-title {
    color: var(--ink) !important;
    text-shadow: none;
}

.section-flow > .mx-auto.px-6 {
    padding-inline: 0;
}

.band-desc {
    display: block;
    width: 100%;
    max-width: 28rem;
    margin-inline: auto;
}

/* Permukaan halus */
.template-surface {
    background-image:
        radial-gradient(ellipse 80% 50% at 50% -10%, rgba(var(--accent-rgb), 0.09), transparent 55%),
        radial-gradient(ellipse 60% 40% at 100% 100%, rgba(var(--primary-rgb), 0.06), transparent 50%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent 40%);
}

.pattern-dots.template-surface,
[class*="pattern-"].template-surface {
    background-blend-mode: soft-light, normal;
}

/* Konten section — padding responsif + ruang bawah antar-section */
:root {
    --inv-section-pad-y: clamp(4rem, 10vw, 6.75rem);
    --inv-section-pad-bottom-extra: clamp(1.5rem, 4vw, 2.75rem);
    --inv-heading-block-gap: clamp(0.2rem, 0.9vw, 0.38rem);
    --inv-heading-to-content: clamp(0.75rem, 2.4vw, 1.05rem);
    /* Judul section — proporsional di mobile & desktop (semua template) */
    --inv-section-title-size: clamp(1.28rem, 4.2vw, 1.72rem);
    --inv-band-title-display-size: clamp(1.22rem, 3.8vw, 1.62rem);
    --inv-band-title-script-size: clamp(1.38rem, 4.8vw, 1.88rem);
}

.section-flow {
    padding-inline: clamp(1rem, 4vw, 1.5rem);
    padding-top: var(--inv-section-pad-y);
    padding-bottom: calc(var(--inv-section-pad-y) + var(--inv-section-pad-bottom-extra));
}

#hero .hero-pattern__content {
    padding-bottom: clamp(5.5rem, 14vw, 9rem);
}

.inv-hero-couple-names {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.1rem;
    line-height: 1.08;
    max-width: min(100%, 24rem);
    margin-inline: auto;
}

.inv-hero-couple-names .hero-name-line {
    display: block;
    width: 100%;
    text-align: center;
    transform: none;
    font-style: normal;
}

.inv-hero-couple-names .hero-name-line {
    font-size: clamp(2.15rem, 8vw, 3.25rem) !important;
    line-height: 1.1;
}

.inv-hero-couple-names .hero-amp {
    font-family: var(--font-display, Georgia, serif);
    font-size: clamp(1.1rem, 3.5vw, 1.45rem);
    font-style: normal;
    font-weight: 500;
    line-height: 1.25;
    margin: 0.35rem 0 0.2rem;
    letter-spacing: 0.06em;
    color: rgba(255, 255, 255, 0.88);
    transform: none;
}

#events.section-flow {
    padding-bottom: calc(var(--inv-section-pad-y) + clamp(2.25rem, 6vw, 4rem));
}

#countdown.section-flow.accent-band {
    padding-bottom: calc(var(--inv-section-pad-y) + clamp(2rem, 5vw, 3.25rem));
}

#events .inv-events-grid {
    margin-bottom: clamp(0.75rem, 3vw, 1.5rem);
}

.inv-band-heading-stack .band-title.font-display {
    font-style: normal;
    letter-spacing: 0.02em;
}

/* Nama mempelai di kartu couple — selaras dengan judul section */
#couple .premium-couple-card h3.font-script {
    font-size: clamp(1.45rem, 5vw, 1.85rem) !important;
    line-height: 1.15;
}

.section-flow .inv-section__inner,
.section-flow .max-w-4xl,
.section-flow .max-w-5xl,
.section-flow .max-w-3xl,
.section-flow .max-w-2xl,
.section-flow .max-w-xl,
.section-flow .max-w-lg {
    width: 100%;
    max-width: var(--inv-section-max);
    margin-left: auto;
    margin-right: auto;
    padding-inline: clamp(1rem, 4vw, 1.5rem);
}

/* Background unik per template (di-set dari base.php) */
.template-surface.tpl-surface-bg {
    background: var(--tpl-surface-bg) !important;
    background-blend-mode: var(--tpl-bg-blend, normal);
    background-color: var(--tpl-paper, #faf9f7);
}

#hero.tpl-hero-bg,
#cover.tpl-cover-bg {
    background: var(--tpl-hero-bg) !important;
}

#hero.has-scene-photo .hero-scene-bg {
    z-index: 1;
}

#cover.has-scene-photo .cover-premium-bg__photo {
    z-index: 2;
}

#cover.has-scene-photo .cover-premium-bg__base {
    z-index: 0;
    opacity: 0;
    visibility: hidden;
}

#cover.has-scene-photo.tpl-cover-bg {
    background: transparent !important;
    background-color: transparent !important;
}

#cover.has-scene-photo .cover-premium-bg__mesh.tpl-cover-mesh {
    opacity: 0.22 !important;
}

.cover-premium-bg__mesh.tpl-cover-mesh {
    background: var(--tpl-cover-mesh), var(--tpl-cover-mesh) !important;
}

/* Hero */
#hero .dark-readable-card {
    border-radius: 1.75rem !important;
    border: 1px solid rgba(255, 255, 255, 0.22) !important;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.12), rgba(0, 0, 0, 0.28)) !important;
    box-shadow: 0 28px 70px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.15) !important;
}

.theme-badge {
    display: none !important;
}

/* Acara */
.event-card .btn-event-map,
.event-card a.inline-flex.rounded-full {
    background: linear-gradient(135deg, var(--btn-bg), var(--btn-hover)) !important;
    color: var(--btn-fg) !important;
    border: none !important;
    box-shadow: 0 12px 32px rgba(var(--primary-rgb), 0.22);
    padding: 0.55rem 1.25rem !important;
    font-weight: 600;
}

/* Galeri — mobile 2×4, desktop 4×2 (maks. 8 foto) */
.invitation-gallery-grid,
#gallery .invitation-gallery-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(0.5rem, 2vw, 0.75rem);
    width: 100%;
    max-width: 100%;
    margin-inline: auto;
}

@media (min-width: 768px) {
    .invitation-gallery-grid,
    #gallery .invitation-gallery-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

#gallery .grid {
    gap: clamp(0.5rem, 2vw, 0.75rem);
}

/* Acara — grid rapi (peta hanya lewat tombol di kartu) */
#events .inv-section__inner {
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

#events .inv-events-grid {
    position: relative;
    z-index: 2;
    width: 100%;
    margin-bottom: 0;
}

/* Band gelap/terang — kontras teks seragam semua template */
.accent-band-dark .band-eyebrow,
.accent-band-dark .band-title,
.accent-band-dark .band-desc,
.accent-band-dark .countdown-label {
    color: var(--band-fg, #f8fafc) !important;
    -webkit-text-fill-color: var(--band-fg, #f8fafc) !important;
}

.accent-band-dark .band-desc,
.accent-band-dark .countdown-label {
    color: var(--band-muted, rgba(255, 255, 255, 0.9)) !important;
    -webkit-text-fill-color: var(--band-muted, rgba(255, 255, 255, 0.9)) !important;
}

.accent-band-light .band-eyebrow,
.accent-band-light .band-title {
    color: var(--band-fg, var(--ink)) !important;
    -webkit-text-fill-color: var(--band-fg, var(--ink)) !important;
}

.accent-band-light .band-desc {
    color: var(--band-muted, var(--muted)) !important;
}

/* Footer Terima Kasih */
.inv-footer-thanks {
    text-align: center;
    overflow: visible;
}

.footer-safe,
.inv-footer-thanks.footer-safe {
    padding-bottom: calc(8.75rem + env(safe-area-inset-bottom, 0px)) !important;
}

.inv-footer-thanks__inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
    max-width: 36rem;
    margin-inline: auto;
    text-align: center;
    width: 100%;
}

.inv-footer-thanks__title {
    display: block;
    margin: 0 !important;
    padding: 0 0.5rem 0.35rem;
    font-size: clamp(2rem, 7.5vw, 3rem) !important;
    line-height: 1.22 !important;
    letter-spacing: 0.02em;
    font-style: normal;
    font-weight: 600;
    text-align: center;
    width: 100%;
}

.inv-footer-thanks__title::after {
    display: none;
}

.inv-footer-thanks__desc {
    margin: clamp(0.85rem, 3vw, 1.15rem) 0 0 !important;
    padding: 0 0.75rem;
    max-width: 28rem;
    text-align: center;
    font-size: 0.875rem;
    line-height: 1.75;
}

.inv-footer-thanks__couple {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.35rem 0.75rem;
    width: 100%;
    margin: clamp(1rem, 3vw, 1.35rem) 0 0;
}

.inv-footer-thanks__couple .font-script {
    font-size: clamp(1.35rem, 5vw, 1.875rem);
    line-height: 1.2;
}

.inv-footer-thanks__amp {
    opacity: 0.75;
    font-family: var(--font-display, 'Playfair Display', serif);
    font-size: 1.1rem;
}

.inv-footer-thanks__actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-top: clamp(0.85rem, 2.5vw, 1.1rem);
}

.inv-footer-thanks__btn {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.28);
    transition: transform 0.2s ease, background 0.2s ease;
}

.accent-band-light .inv-footer-thanks__btn {
    background: #fff;
    color: var(--primary);
    border-color: rgba(var(--primary-rgb), 0.15);
    box-shadow: 0 8px 20px rgba(var(--primary-rgb), 0.12);
}

.accent-band-dark .inv-footer-thanks__btn {
    background: rgba(255, 255, 255, 0.12);
    color: var(--band-fg, #fff);
}

.inv-footer-thanks__btn:hover {
    transform: scale(1.06);
}

.inv-footer-thanks__copy {
    margin: 1.75rem 0 0;
    padding: 0 1rem 0.25rem;
    width: 100%;
    text-align: center;
    font-size: 0.68rem;
    line-height: 1.5;
    letter-spacing: 0.04em;
    opacity: 0.72;
    color: var(--band-muted, inherit);
}

.accent-band-dark .inv-footer-thanks__title,
.accent-band-dark .inv-footer-thanks__desc,
.accent-band-dark .inv-footer-thanks__couple,
.accent-band-dark .inv-footer-thanks__couple .font-script,
.accent-band-dark .inv-footer-thanks__amp {
    color: var(--band-fg, #fff) !important;
    -webkit-text-fill-color: var(--band-fg, #fff) !important;
    text-shadow: 0 1px 12px rgba(0, 0, 0, 0.35);
}

.accent-band-dark .inv-footer-thanks__desc,
.accent-band-dark .inv-footer-thanks__copy,
.accent-band-dark .inv-footer-thanks__amp {
    text-shadow: none;
}

.accent-band-dark .inv-footer-thanks__desc,
.accent-band-dark .inv-footer-thanks__copy {
    color: var(--band-muted, rgba(255, 255, 255, 0.88)) !important;
    -webkit-text-fill-color: var(--band-muted, rgba(255, 255, 255, 0.88)) !important;
}

/* Kartu acara — spacing & responsif */
#events .event-card {
    width: 100%;
    min-width: 0;
}

@media (max-width: 767px) {
    #events .inv-events-grid {
        gap: 1rem;
    }

    #events .event-card {
        padding: 1.35rem !important;
    }

    #couple .inv-couple-grid {
        grid-template-columns: 1fr;
        gap: clamp(1.5rem, 6vw, 2.25rem);
    }

    #couple .inv-couple-grid .couple-center-glow {
        order: -1;
        margin-bottom: 0.25rem;
    }
}

@media (min-width: 768px) {
    #couple .inv-couple-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        align-items: center;
    }
}

#gallery .aspect-square,
#gallery .gallery-item {
    border-radius: 1.25rem !important;
    box-shadow: 0 16px 48px rgba(var(--primary-rgb), 0.1);
}

#gallery .gallery-item:focus-visible {
    outline: 2px solid rgba(var(--accent-rgb), 0.85);
    outline-offset: 3px;
}

#gallery .gallery-zoom-icon {
    font-size: 0.95rem;
}

.band-couple-row .font-script {
    font-size: clamp(1.35rem, 5vw, 1.875rem);
}

/* Cover foto bulat — isi penuh lingkaran */
#cover .cover-photo-block {
    display: flex;
    justify-content: center;
    width: 100%;
}

#cover .cover-photo-wrap {
    position: relative;
    display: block;
    aspect-ratio: 1;
    width: min(48svh, 64vw, 228px);
    max-width: 228px;
    margin-inline: auto;
    overflow: hidden;
    border-radius: 999px;
}

#cover .cover-photo-wrap.ornate-photo-frame {
    border-radius: 999px !important;
    padding: 6px !important;
    overflow: hidden;
}

#cover .cover-photo {
    display: block;
    width: 100%;
    height: 100%;
    min-width: 100%;
    min-height: 100%;
    object-fit: cover;
    object-position: center center;
    border-radius: inherit;
}

#cover .ornate-photo-frame .cover-photo {
    border-radius: 999px !important;
}

#cover.cover-pattern::before {
    opacity: 0.35;
}

.cover-premium-bg__photo {
    will-change: transform;
}

/* Foto mempelai sebagai latar (cover + hero) — tajam + overlay */
#cover.has-scene-photo .cover-premium-bg__photo.inv-scene-photo,
#hero.has-scene-photo .hero-scene-bg.inv-scene-photo {
    will-change: auto;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

#hero.has-scene-photo.tpl-hero-bg {
    background: transparent !important;
    background-color: transparent !important;
}

#hero.has-scene-photo .hero-tone-layer {
    z-index: 2;
}

#hero.has-scene-photo .invitation-fx-canvas,
#hero.has-scene-photo .template-deco-layer {
    z-index: 3;
}

#hero.has-scene-photo > .hero-pattern__content,
#hero.has-scene-photo > .relative.z-10 {
    z-index: 10;
}

@media (min-width: 900px) {
    html:has(body.has-cover-open),
    html:has(body.has-cover-open) body {
        overflow: hidden !important;
    }
}

/* ——— Buku tamu (semua kategori template) ——— */
#guestbook.template-surface {
    overflow: visible;
}

#guestbook {
    isolation: isolate;
}

#guestbook .template-deco-layer {
    z-index: 0 !important;
    opacity: 0.32;
}

#guestbook.template-surface::before {
    z-index: 0;
}

#guestbook .inv-section__inner {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

#guestbook .section-heading-block {
    margin-bottom: var(--inv-heading-to-content) !important;
}

/* Buku tamu — form rapi (spacing konsisten) */
#guestbook .guestbook-compose {
    margin-top: 0;
    margin-bottom: clamp(2.25rem, 6vw, 3rem) !important;
    padding: clamp(1.5rem, 5vw, 2rem) clamp(1.35rem, 4.5vw, 1.85rem) clamp(2rem, 6vw, 2.5rem) !important;
    overflow: visible;
    position: relative;
    z-index: 3;
    isolation: isolate;
    box-sizing: border-box;
}

#guestbook .guestbook-wall-title {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.5rem;
    width: 100%;
    margin: clamp(2.25rem, 6vw, 3rem) 0 1.15rem !important;
    padding: 0.35rem 0.15rem 0;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.4;
    color: #374151;
    position: relative;
    z-index: 3;
}

#guestbook .guestbook-wall-wrap {
    position: relative;
    z-index: 3;
}

#guestbook .guestbook-wall {
    display: flex;
    flex-direction: column;
    gap: clamp(0.9rem, 3vw, 1.2rem);
}

#guestbook .guestbook-wall > * {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

#guestbook .guestbook-entry {
    position: relative;
    z-index: 4;
    isolation: isolate;
    background: #fff !important;
    padding: 1rem 1.1rem !important;
}

.guestbook-form {
    display: flex;
    flex-direction: column;
    gap: clamp(1.35rem, 4.5vw, 1.85rem);
    width: 100%;
}

.guestbook-form__field {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.6rem;
    width: 100%;
    margin: 0;
    padding: 0;
    position: relative;
    z-index: 1;
}

.guestbook-form__field--attendance {
    gap: 0.7rem;
    z-index: 2;
}

.guestbook-form__field--message {
    gap: 0.6rem;
}

.guestbook-form__label {
    display: block;
    margin: 0;
    padding: 0;
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.35;
    color: #374151;
}

.guestbook-form__input,
.guestbook-form__textarea {
    display: block;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    margin: 0;
    padding: 0.8rem 1rem;
    border: 1px solid rgba(var(--primary-rgb), 0.16);
    border-radius: 0.9rem;
    font-size: 0.9375rem;
    line-height: 1.5;
    color: #111827;
    background: #fff;
}

.guestbook-form__textarea {
    min-height: 7.25rem;
    padding: 0.9rem 1rem 1rem;
    resize: vertical;
    vertical-align: top;
}

.guestbook-form__textarea::placeholder {
    line-height: 1.5;
}

.guestbook-form__actions {
    display: flex;
    justify-content: stretch;
    align-items: stretch;
    width: 100%;
    margin: 0.25rem 0 0;
    padding: 0.75rem 0 0.15rem;
    clear: both;
}

#guestbook .btn-accent-solid.guestbook-form__submit,
.guestbook-form__submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0.9rem 1.65rem;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.25;
    box-sizing: border-box;
    position: relative;
    left: auto;
    right: auto;
    transform: none !important;
    flex-shrink: 0;
}

#guestbook .btn-accent-solid.guestbook-form__submit:hover,
.guestbook-form__submit:hover {
    transform: none !important;
    filter: brightness(1.06);
}

@media (min-width: 640px) {
    .guestbook-form__submit {
        width: auto;
        min-width: 13rem;
    }
}

.guestbook-form .rsvp-attendance-card {
    background: #fff;
    border-color: rgba(var(--primary-rgb), 0.18);
}

.guestbook-badge {
    display: inline-block;
}

/* Kartu kehadiran (legacy class names) */
.rsvp-purpose-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem 1.25rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

.rsvp-purpose-list li {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.4rem 0.85rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.accent-band-light .rsvp-purpose-list li {
    background: rgba(var(--primary-rgb), 0.08);
    border-color: rgba(var(--primary-rgb), 0.15);
    color: var(--color-text, #334155);
}

.guestbook-form .rsvp-attendance-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.85rem;
    width: 100%;
    margin: 0;
}

.rsvp-attendance-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.85rem;
    width: 100%;
    margin: 0;
}

.rsvp-attendance-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 0.35rem;
    min-height: 5.5rem;
    padding: 1.05rem 0.85rem;
    border-radius: 1rem;
    border: 2px solid rgba(var(--primary-rgb), 0.15);
    background: #fff;
    cursor: pointer;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
    transform: none;
}

.rsvp-attendance-card input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.rsvp-attendance-card__icon {
    font-size: 1.5rem;
    line-height: 1;
}

.rsvp-attendance-card__title {
    font-size: 0.9rem;
    font-weight: 600;
}

.rsvp-attendance-card__hint {
    font-size: 0.65rem;
    opacity: 0.7;
}

.rsvp-attendance-card--yes:has(input:checked) {
    border-color: rgba(34, 197, 94, 0.65);
    box-shadow: 0 8px 24px rgba(34, 197, 94, 0.15);
}

.rsvp-attendance-card--no:has(input:checked) {
    border-color: rgba(239, 68, 68, 0.5);
    box-shadow: 0 8px 24px rgba(239, 68, 68, 0.1);
}

.rsvp-attendance-card--yes:has(input:checked) .rsvp-attendance-card__icon {
    color: #16a34a;
}

.rsvp-attendance-card--no:has(input:checked) .rsvp-attendance-card__icon {
    color: #dc2626;
}

.guestbook-compose {
    border: 1px solid rgba(var(--primary-rgb), 0.12);
    box-shadow: 0 12px 40px rgba(15, 23, 42, 0.06);
}

/* Legacy lead di luar block (jika masih ada) */
.template-surface .section-heading + .section-lead:not(.section-heading-block .section-lead) {
    margin-top: var(--inv-heading-block-gap) !important;
    margin-bottom: var(--inv-heading-to-content) !important;
    text-align: center;
    margin-left: auto;
    margin-right: auto;
}

/* FX global — lapisan premium di invitation-fx-premium.css */
.invitation-fx-canvas.invitation-fx-global {
    z-index: 28;
}

body.invitation-fluid #mainContent,
body.invitation-fluid #invitation-main {
    position: relative;
    z-index: 2;
}

.guestbook-wall-title {
    letter-spacing: 0.02em;
}

.guestbook-wall-wrap {
    width: 100%;
    max-width: 100%;
}

.guestbook-wall {
    max-height: none;
    overflow: visible;
}

.guestbook-wall.is-scrollable {
    max-height: min(32rem, 70vh);
    overflow-y: auto;
    padding-right: 0.35rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(var(--primary-rgb), 0.35) transparent;
}

.guestbook-wall.is-scrollable::-webkit-scrollbar {
    width: 6px;
}

.guestbook-wall.is-scrollable::-webkit-scrollbar-thumb {
    background: rgba(var(--primary-rgb), 0.3);
    border-radius: 999px;
}

.guestbook-wall .guestbook-entry {
    border-left: 3px solid rgba(var(--accent-rgb), 0.55);
}

.guestbook-entry[hidden] {
    display: none !important;
}

.guestbook-pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(var(--primary-rgb), 0.1);
}

.guestbook-pager.hidden {
    display: none !important;
}

.guestbook-pager__btn {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 999px;
    border: 1px solid rgba(var(--primary-rgb), 0.2);
    background: #fff;
    color: var(--icon-on-surface, var(--primary));
    display: grid;
    place-items: center;
    transition: background 0.2s ease, transform 0.2s ease;
}

.guestbook-pager__btn:hover:not(:disabled) {
    background: rgba(var(--primary-rgb), 0.08);
    transform: translateY(-1px);
}

.guestbook-pager__btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.guestbook-pager__info {
    font-size: 0.8rem;
    font-weight: 600;
    color: #475569;
    min-width: 4.5rem;
    text-align: center;
}

/* Amplop digital — proporsi kartu bank (ISO ~1.586:1) */
.gift-cards-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1.25rem;
    justify-items: center;
    align-items: start;
    width: 100%;
}

@media (min-width: 640px) {
    .gift-cards-grid {
        grid-template-columns: repeat(auto-fit, minmax(17.5rem, 20.5rem));
        justify-content: center;
        max-width: 44rem;
        margin-inline: auto;
    }
}

.gift-card {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 20.5rem;
    aspect-ratio: 1.586 / 1;
    border-radius: 1.12rem;
    padding: 1.05rem 1.3rem 1.2rem;
    box-sizing: border-box;
    color: #fff;
    overflow: hidden;
    background:
        radial-gradient(circle at 88% 15%, rgba(255, 255, 255, 0.2), transparent 28%),
        linear-gradient(125deg, var(--secondary), var(--primary) 48%, var(--accent));
    box-shadow: 0 18px 44px rgba(var(--primary-rgb), 0.28);
    isolation: isolate;
}

.gift-card::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0.14;
    background: var(--motif-bg);
    background-size: 90px 90px;
    z-index: 0;
    pointer-events: none;
}

.gift-card::after {
    content: '';
    position: absolute;
    width: 8rem;
    height: 8rem;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 999px;
    right: -2.5rem;
    bottom: -3rem;
    pointer-events: none;
    z-index: 0;
}

.gift-card__inner {
    position: relative;
    z-index: 2;
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 0.32rem;
    min-height: 0;
    box-sizing: border-box;
}

.gift-card__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    flex-shrink: 0;
}

.gift-card__brand-label {
    font-size: 0.58rem;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    opacity: 0.68;
    margin: 0 0 0.2rem;
    padding-left: 0.14em;
}

.gift-card__bank {
    font-family: var(--font-display, 'Playfair Display', serif);
    font-size: 1.28rem;
    font-weight: 600;
    line-height: 1.1;
    margin: 0;
    display: flex;
    align-items: flex-end;
}

.gift-card__bank-icon {
    width: 2.1rem;
    height: 2.1rem;
    border-radius: 0.65rem;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.22);
    display: grid;
    place-items: center;
    flex-shrink: 0;
    font-size: 0.95rem;
}

.gift-card__chip-row {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.gift-chip {
    width: 2.15rem;
    height: 1.55rem;
    border-radius: 0.4rem;
    background: linear-gradient(135deg, #f6d777, #b88a25);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
    position: relative;
}

.gift-chip::before,
.gift-chip::after {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 70%;
    height: 1px;
    background: rgba(80, 55, 10, 0.35);
}

.gift-chip::before {
    top: 0.45rem;
}

.gift-chip::after {
    bottom: 0.45rem;
}

.gift-card__number {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(1rem, 2.8vw, 1.28rem);
    letter-spacing: 0.1em;
    margin: 0;
    line-height: 1.15;
    word-break: break-all;
    flex-shrink: 0;
}

.gift-card__foot {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 0.5rem;
    margin-top: auto;
    padding-top: 0.28rem;
    padding-bottom: 0.05rem;
    flex-shrink: 0;
}

.gift-card__holder {
    min-width: 0;
    flex: 1;
}

.gift-card__holder-label {
    display: block;
    font-size: 0.55rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    opacity: 0.58;
}

.gift-card__holder-name {
    display: block;
    font-family: var(--font-display, 'Playfair Display', serif);
    font-size: 0.82rem;
    line-height: 1.2;
    margin-top: 0.08rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

button.gift-card__copy {
    flex-shrink: 0;
    padding: 0.42rem 0.85rem;
    margin: 0;
    font-family: inherit;
    border-radius: 999px;
    background: #fff;
    color: var(--primary);
    font-size: 0.72rem;
    font-weight: 600;
    border: none;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.gift-card__copy:hover {
    transform: scale(1.04);
}

@media (max-width: 639px) {
    .gift-cards-grid {
        gap: 1rem;
        padding-inline: 0.15rem;
    }

    .gift-card {
        max-width: min(100%, 20.5rem);
        padding: 1rem 1.15rem 1.1rem;
    }

    .gift-card__bank {
        font-size: clamp(1.1rem, 4.8vw, 1.28rem);
    }

    .gift-card__number {
        font-size: clamp(0.92rem, 3.8vw, 1.15rem);
    }

    .gift-card__holder-name {
        font-size: 0.78rem;
    }

    .gift-card__copy {
        padding: 0.4rem 0.75rem;
        font-size: 0.65rem;
    }
}

.rsvp-section-bridge a,
.guestbook-section-bridge a {
    text-decoration-thickness: 1px;
}

/* Form */
.rsvp-form-card input,
.rsvp-form-card select {
    background: rgba(255, 255, 255, 0.92) !important;
    border: 1px solid rgba(var(--primary-rgb), 0.12) !important;
    border-radius: 1rem !important;
    max-width: 100%;
}

#guestbook .guestbook-form__input,
#guestbook .guestbook-form__textarea {
    background: #fff !important;
    border: 1px solid rgba(var(--primary-rgb), 0.16) !important;
    border-radius: 0.9rem !important;
    padding: 0.8rem 1rem !important;
    max-width: 100%;
}

#guestbook .guestbook-form__textarea {
    padding: 0.9rem 1rem 1rem !important;
    min-height: 7.25rem;
}

#floatNav {
    max-width: min(calc(100vw - 1.25rem), 26rem);
}

/* Kartu mempelai — padding & kontras (semua template, termasuk dark style) */
#couple .premium-couple-card.couple-profile-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
}

#couple .couple-profile-card .couple-avatar {
    margin-bottom: 0.65rem;
}

#couple .couple-profile-card > p:last-of-type {
    margin-top: 0.35rem;
    margin-bottom: 0.65rem;
    padding-inline: 0.35rem;
    max-width: 18rem;
}

.invitation-dark-inner #couple .premium-couple-card {
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%) !important;
    color: #1f2937 !important;
    border-color: rgba(var(--primary-rgb), 0.14) !important;
}

.invitation-dark-inner #couple .premium-couple-card h3,
.invitation-dark-inner #couple .premium-couple-card .text-gray-800 {
    color: var(--ink) !important;
}

/* Jarak section mobile/tablet — hindari dempet */
/* Countdown — grid 2×2 di mobile (hindari 3+1) */
@media (max-width: 519px) {
    .countdown-flow {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        max-width: min(100%, 20.5rem);
        margin-inline: auto;
    }

    .countdown-cell {
        min-width: 0 !important;
        width: 100%;
    }
}

@media (min-width: 520px) {
    .countdown-flow {
        display: flex !important;
        flex-wrap: nowrap !important;
        justify-content: center;
        max-width: 36rem;
    }
}

@media (max-width: 767px) {
    :root {
        --inv-section-pad-y: clamp(3.5rem, 14vw, 5rem);
        --inv-section-pad-bottom-extra: clamp(1.25rem, 4vw, 2.25rem);
        --inv-section-title-size: clamp(1.2rem, 4.8vw, 1.55rem);
        --inv-band-title-display-size: clamp(1.12rem, 4.2vw, 1.45rem);
        --inv-band-title-script-size: clamp(1.28rem, 5vw, 1.72rem);
    }

    .section-flow.accent-band {
        --inv-section-pad-y: clamp(3.75rem, 14vw, 5.25rem);
    }

    .section-heading-block {
        margin-bottom: clamp(0.85rem, 3vw, 1.15rem) !important;
    }

    .section-separator + .section-flow {
        padding-top: clamp(3.25rem, 12vw, 4.5rem) !important;
    }

    #couple .grid {
        gap: clamp(1.5rem, 6vw, 2.25rem) !important;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    :root {
        --inv-section-pad-y: clamp(4rem, 8vw, 5.5rem);
    }
}

@media (prefers-reduced-motion: reduce) {
    #gallery .aspect-square:hover,
    .event-card:hover {
        transform: none;
    }
}
