/* Melati: palet krem, cokelat, wayang, dan bunga pampas. */
@import url('https://fonts.googleapis.com/css2?family=Abril+Fatface&family=DM+Sans:wght@400;500;600;700&family=Parisienne&display=swap');

:root {
    --bg: #f8f6ed; --card: #fff; --ink: #3b2417; --muted: #705b50; --line: #dfd4c7;
    --accent: #412719; --on-accent: #fff;
    --font-head: 'Abril Fatface', Georgia, serif; --font-name: 'Parisienne', cursive;
    --font-body: 'DM Sans', Arial, sans-serif; --radius: 8px;
    --pattern-outer: 0; --pattern-inner: 0;
}
body { background: #eee7dc; }
.sheet { background: var(--bg); }
.sheet::before, body::before { display: none; }
.sheet section:not(.jw-hero) { background: var(--bg) url('/themes/melati/background.jpg') center / cover no-repeat; }
.sheet section .deco, .cover .deco, .hero { display: none; }

/* Sampul memakai foto cover yang diunggah untuk undangan ini. */
.cover { overflow: hidden; background: #3b2c24; color: #fff; }
.cover::before { content: ''; position: absolute; inset: 0; z-index: -2; background: var(--cover-img, none) center / cover no-repeat, #3b2c24; }
.cover::after { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, #1d161631 0%, #17110a7a 58%, #140d0dbb 100%); }
.cover-inner { position: relative; width: min(100%, 360px); padding: 0 1rem; text-shadow: 0 2px 8px #30251c66; }
.cover .eyebrow { margin: 0 0 .75rem; color: #fff; font: 700 clamp(1.6rem, 7vw, 2.25rem)/1.1 var(--font-head); letter-spacing: 0; text-transform: none; }
.cover .names { color: #fff; font: 400 clamp(2rem, 9vw, 2.8rem)/1.1 Georgia, serif; text-transform: uppercase; }
.melati-cover-names span { display: block; }
.melati-cover-names .melati-amp { margin: .35rem 0; font: italic 700 1.8rem var(--font-head); text-transform: none; }
.cover .to-label { margin: 1.2rem 0 .2rem; color: #fff; font-size: .92rem; font-weight: 700; }
.cover .to-name { margin-bottom: 1.1rem; font: 700 1.05rem var(--font-body); }
.cover .btn { padding: .58rem 1.2rem; border: 3px solid #fff; background: #3b210e; box-shadow: 0 2px 10px #0005; font-weight: 700; }

/* Adegan pembuka dengan wayang dan gelombang. */
.jw-hero { position: relative; display: flex; justify-content: center; align-items: flex-start; min-height: 100svh;
    padding: clamp(2rem, 8svh, 5rem) 1.1rem 170px; overflow: hidden;
    background: #f8f2e7 url('/themes/melati/wayang-background.webp') center bottom / 100% auto no-repeat; }
.jw-panel { position: relative; z-index: 1; width: 100%; max-width: 440px; padding: 1.1rem .65rem 1.5rem;
    border-radius: 18px; background: #fffaf1a8; box-shadow: 0 5px 25px #3b24170d; }
.jw-gunungan { display: block; width: clamp(95px, 32vw, 150px); height: auto; margin: 0 auto .35rem; }
.jw-heading { margin: 0; font: 500 1.06rem var(--font-body); }
.jw-panel .names { margin: .1rem 0 .45rem; font: 400 clamp(2.8rem, 12vw, 4rem)/1.12 var(--font-name); color: var(--ink); }
.jw-save { margin: .4rem 0 0; font: 500 .95rem var(--font-body); }
.jw-panel .date { margin: .2rem 0 .7rem; font: 600 .9rem var(--font-body); }
.jw-panel .countdown { max-width: 285px; margin: .8rem auto 0; padding-top: .65rem; border-top: 3px dashed #c6bdb4; gap: .2rem; }
.jw-panel .countdown div { padding: .15rem .1rem; border: 0; border-radius: 0; background: transparent; }
.jw-panel .countdown b { font: 500 1.1rem var(--font-body); color: #624638; }
.jw-panel .countdown span { display: block; font-size: .65rem; color: #725d51; }
.jw-ground { position: absolute; inset: auto 0 0; z-index: 2; height: 115px; pointer-events: none; }
.jw-waves { position: absolute; inset: auto 0 -1px; width: 100%; height: 84px; }
.jw-wave-layers > use { animation: melati-wave 18s linear infinite alternate; }
.jw-wave-layers > use:nth-child(1) { fill: #aa754b; opacity: .5; animation-delay: -2s; }
.jw-wave-layers > use:nth-child(2) { fill: #825339; opacity: .85; animation-delay: -5s; }
.jw-wave-layers > use:nth-child(3) { fill: #40261a; animation-delay: -8s; }
.jw-wave-layers > use:nth-child(4) { fill: var(--bg); animation-delay: -11s; }
@keyframes melati-wave { to { translate: 50px 0; } }

/* Salam dan kartu mempelai. */
.intro { min-height: 100svh; padding-top: 6rem; padding-bottom: 6rem; }
.intro::before { content: ''; display: block; width: 95px; height: 122px; margin: 0 auto .6rem; background: url('/themes/melati/gunungan-reference.png') center / contain no-repeat; }
.melati-greeting { margin: 0 auto 1rem; font: 400 clamp(1.4rem, 6vw, 2rem) var(--font-head); }
.intro .lead { max-width: 390px; margin: 0 auto; font-size: .9rem; line-height: 1.8; }
.people { display: grid; grid-template-columns: minmax(0, 1fr) 38px minmax(0, 1fr); gap: .35rem; align-items: center; margin-top: 3rem; }
.person { min-width: 0; overflow: hidden; border-radius: 5px 5px 16px 16px; background: #f2ecea; box-shadow: 0 15px 30px #3b241721; }
.person img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; border: 0; border-radius: 0; outline: 0; animation: none; }
.person h3 { margin: 0; padding: .7rem .3rem 0; border-top: 6px solid #8a5735; font: 400 clamp(.92rem, 4vw, 1.2rem) var(--font-head); color: var(--ink); }
.person p { padding: .1rem .35rem .8rem; margin: 0; color: var(--ink); font-size: .72rem; line-height: 1.35; }
.people .amp { align-self: center; margin: 0; font: italic 400 3.3rem var(--font-name); color: var(--ink); }

/* Judul dan isi undangan. */
.sheet section:not(.jw-hero):not(.intro) { padding-top: 5rem; padding-bottom: 5rem; }
.title { margin: 0 0 1.5rem; color: var(--ink); font: 400 clamp(2.4rem, 10vw, 3.5rem)/1.05 var(--font-name); }
.title::before { content: ''; display: block; width: 105px; height: 122px; margin: 0 auto .25rem; background: url('/themes/melati/gunungan-reference.png') center / contain no-repeat; }
.sub-lead { margin: -1rem 0 2rem; color: var(--muted); }
.card { border: 0; border-radius: 7px; background: #fff; box-shadow: 0 12px 26px #39231822; }
.btn { background: var(--accent); border-color: var(--accent); }
.btn-ghost { background: #fff; color: var(--accent); }

/* Kartu acara dengan label vertikal cokelat. */
#acara .card:not(.note) { position: relative; min-height: 165px; margin: 0 0 1.5rem; padding: 1.25rem 1rem 1.25rem 4.2rem; text-align: center; }
#acara .card:not(.note):nth-of-type(even) { padding: 1.25rem 4.2rem 1.25rem 1rem; }
#acara .card:not(.note) h3 { position: absolute; inset: 0 auto 0 0; display: grid; place-items: center; width: 3rem; margin: 0;
    border-radius: 6px 0 0 6px; background: #42291d; color: #fff; font: 700 1rem var(--font-body); letter-spacing: .08em; text-transform: uppercase; writing-mode: vertical-rl; rotate: 180deg; }
#acara .card:not(.note):nth-of-type(even) h3 { inset: 0 0 0 auto; rotate: 0deg; border-radius: 0 6px 6px 0; }
#acara .when { font-weight: 700; }
#acara .card p { font-size: .88rem; }
#acara .map { border-radius: 6px; }
#acara .actions { justify-content: center; }
#acara .actions .btn { font-size: .75rem; }

.story { padding-left: 1.1rem; border-left: 3px solid #b69076; }
.story li { border: 1px dashed #ab9079; border-radius: 0; background: #fffdfb; }
.story li::before { left: calc(-1.1rem - 8px); background: #613f2e; }
.story h3 { font-family: var(--font-head); color: var(--ink); }
.hopes .card { background: #fffaf6; }
.quote { font-family: var(--font-head); }
#galeri { background: linear-gradient(#dcd0c9, #fff) !important; }
.melati-gallery-slider { position: relative; margin: 0 0 1.5rem; }
.melati-gallery-track { display: flex; gap: .65rem; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.melati-gallery-track::-webkit-scrollbar { display: none; }
.melati-gallery-track a { flex: 0 0 78%; scroll-snap-align: center; }
.melati-gallery-track img { display: block; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 16px; }
.melati-gallery-slider button { position: absolute; top: 50%; translate: 0 -50%; width: 34px; height: 42px; border: 0;
    border-radius: 6px; background: #fffdf8d9; color: var(--ink); font-size: 1.3rem; cursor: pointer; box-shadow: 0 2px 9px #3923182b; }
.melati-gallery-prev { left: .4rem; }
.melati-gallery-next { right: .4rem; }
#galeri .gallery img { border-radius: 16px; box-shadow: 0 4px 10px #39231826; }
#ucapan { background: #fff !important; }
.summary div { border: 0; background: #f5eee8; }
.summary b { color: var(--accent); }
#ucapan form { padding: 1.25rem; }
#ucapan input, #ucapan select, #ucapan textarea { border-radius: 16px; background: #fff; }
.wish { padding: .9rem; margin: .5rem 0; border: 0; border-radius: 9px; background: #f6f1ec; }
.closing .names { font-size: 2.9rem; }
.closing .ornament { background: #a97a50; }
.float-nav { background: #ffffffed; }
.float-nav a { color: #412719; }
.music-toggle { background: #fff; }

@media (max-width: 390px) {
    .jw-hero { padding-bottom: 145px; }
    .jw-ground { height: 95px; }
    .intro { padding-inline: .85rem; }
    .people { grid-template-columns: minmax(0, 1fr) 26px minmax(0, 1fr); gap: .2rem; }
    .people .amp { font-size: 2.6rem; }
    #acara .card:not(.note) { padding-left: 3.6rem; }
    #acara .card:not(.note):nth-of-type(even) { padding-right: 3.6rem; }
}
@media (prefers-reduced-motion: reduce) { .jw-wave-layers > use { animation: none; } }

/* Bingkai perangkat diatur halaman pratinjau; isi undangan mengikuti viewport. */
.sheet { max-width: none; }
.sheet section { padding-inline: max(1.25rem, calc((100% - 710px) / 2)); }
.jw-hero { align-items: center; padding: 4rem 3% 6rem; background-position: center bottom 3rem; }
.jw-panel { max-width: none; padding: 2rem 1rem; background: #fffaf17a; }
.jw-hero::before { content: ''; position: absolute; inset: 0; background: url('/themes/melati/pampas.png') center / 100% auto no-repeat; opacity: .55; }
.jw-wave-layers > use:last-child { fill: #3d251b; }
.jw-ground[data-anim] { opacity: 1; translate: none; scale: none; }
.intro::before { width: min(199px, 49vw); height: 170px; background-image: url('/themes/melati/salam.png'); }
.intro .lead { max-width: 600px; }
.intro .lead::first-line { font: 1.5rem var(--font-head); }
.people { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: clamp(.35rem, 3vw, 2rem); }
.people:has(> :only-child) { grid-template-columns: minmax(0, 280px); justify-content: center; }
.people .amp { font-size: clamp(2.6rem, 9vw, 6rem); }
.person img { aspect-ratio: 1; }
.person p { font-size: clamp(.76rem, 2vw, 1rem); }
#acara .card { overflow: hidden; }
.sheet #kisah, .sheet .hopes { background: #f7f2e9 url('/themes/melati/wayang-background.webp') center bottom / cover; }
#kisah .title::before, .hopes .title::before, .sheet section:has(.video) .title::before, #amplop .title::before { display: none; }
.story li { background: #534236ed; color: white; }
.story li h3, .story-date { color: #fff; }
.melati-story-photo { display: block; width: min(100%, 310px); max-height: 300px; object-fit: cover; margin: .75rem auto; }
#galeri .title::before { background-image: url('/themes/melati/album.png'); width: 190px; height: 150px; }
#ucapan .title::before { background-image: url('/themes/melati/pesan.png'); width: 150px; height: 145px; }
.melati-gallery-track { gap: 0; }
.melati-gallery-track a { flex-basis: 100%; }
.melati-gallery-track img { aspect-ratio: 4 / 3; }
.sheet #amplop, .sheet .closing { background: linear-gradient(#342219b8,#452e20d9), var(--cover-img, none) center / cover, #583e31; color: white; }
#amplop .title, .closing .names, .closing .eyebrow, .closing .lead { color: white; }
#amplop .card { color: var(--ink); }
.melati-tools { position: fixed; z-index: 12; right: .5rem; top: 50%; translate: 0 -50%; display: grid; gap: 4rem; }
.melati-tools button { display: grid; justify-items: center; padding: .5rem; background: white; color: var(--ink); border: 0; border-radius: .4rem; box-shadow: 0 3px 10px #0002; cursor: pointer; }
.melati-tools small { font-size: .65rem; }
.melati-tools [aria-pressed=true] { background: var(--ink); color: white; }
body:has(.float-nav) .music-toggle { top: 50%; bottom: auto; right: .45rem; translate: 0 -50%; width: 38px; height: 38px; }
body.is-closed .melati-tools, body.is-closed .music-toggle { display: none; }
@media (max-width: 576px) {
    .jw-panel { padding: 2rem .5rem; }
    .intro { padding-inline: 1rem; }
    .sheet #ucapan { padding-right: 2.9rem; }
}
