/* EKC Digital Invitation: dasar bersama untuk template temp-inv-ekc05 dan seterusnya.
   Dimuat lebih dulu; tiap template menetapkan variabel di bawah ini di :root lalu menambahkan gayanya sendiri.

   Variabel yang dibaca:
   --bg --tinta --utama --aksen --aksen-tua --kartu --garis --judul --isi --lebar --radius
   --tb-bg --tb-fg --tb-garis  (tombol)  --input (latar kolom isian) */

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: var(--isi);
    font-size: 1rem;
    line-height: 1.65;
    color: var(--tinta);
    background: var(--latar, var(--bg));
    -webkit-font-smoothing: antialiased;
}
body.terkunci { overflow: hidden; }
img { max-width: 100%; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--fokus, var(--utama)); outline-offset: 3px; }
.sr-only {
    position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.layar {
    max-width: var(--lebar, 30rem);
    margin: 0 auto;
    overflow: hidden;
    background: var(--bg);
    box-shadow: 0 0 4rem rgba(0, 0, 0, .12);
}
.blok { padding: 4.5rem 1.5rem; }
.judul { margin: 0 0 1.5rem; font-family: var(--judul); font-weight: 600; line-height: 1.1; }
.lead { margin: 0 0 1.5rem; }

/* ---------- Tombol ---------- */
.tombol {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.75rem;
    padding: .6rem 1.5rem;
    font: 600 1rem/1.2 var(--isi);
    text-decoration: none;
    color: var(--tb-fg);
    background: var(--tb-bg);
    border: 1px solid var(--tb-bg);
    border-radius: var(--tb-radius, var(--radius, .5rem));
    cursor: pointer;
    transition: opacity .2s, transform .2s;
}
.tombol:hover { opacity: .88; }
.tombol.garis { color: var(--tb-garis, var(--tb-bg)); background: transparent; border-color: var(--tb-garis, var(--tb-bg)); }
.tombol.kecil { min-height: 2.5rem; padding: .45rem 1.1rem; font-size: .9375rem; }
.aksi { display: flex; flex-wrap: wrap; gap: .625rem; margin-top: 1rem; }

/* ---------- Cover (dasar) ---------- */
.cover { position: fixed; inset: 0; z-index: 50; overflow-y: auto; }
.cover-isi {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100%;
    padding: 2rem 1.5rem;
    text-align: center;
}
.cover-isi > * { margin-top: 0; margin-bottom: 0; }

/* ---------- Hitung mundur ---------- */
.hitung { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; text-align: center; }
.hitung b { display: block; font-family: var(--judul); font-weight: 600; font-size: 1.75rem; line-height: 1.2; font-variant-numeric: tabular-nums; }
.hitung span { display: block; font-size: .8125rem; }
.hitung-ket { margin: .75rem 0 2rem; text-align: center; font-size: .9375rem; }

/* ---------- Acara ---------- */
.daftar-acara { margin: 0; padding: 0; list-style: none; display: grid; gap: 1rem; }
.acara h3 { margin: 0 0 .25rem; font-family: var(--judul); font-weight: 600; }
.acara p { margin: 0 0 .5rem; }

/* ---------- Galeri ---------- */
.galeri { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.foto { display: block; margin: 0; padding: 0; overflow: hidden; border: 0; background: var(--kartu); cursor: zoom-in; border-radius: var(--radius, .5rem); }
.foto img { display: block; width: 100%; height: 100%; aspect-ratio: 4 / 5; object-fit: cover; }

.lightbox { padding: 0; border: 0; background: transparent; max-width: min(92vw, 40rem); max-height: 90svh; overflow: visible; }
.lightbox::backdrop { background: rgba(0, 0, 0, .9); }
.lightbox img { display: block; width: 100%; max-height: 90svh; object-fit: contain; border-radius: .5rem; }
.lightbox .tutup {
    position: absolute; top: -3rem; right: 0; width: 2.5rem; height: 2.5rem;
    font-size: 1.75rem; line-height: 1; color: #111; background: #fff;
    border: 0; border-radius: 50%; cursor: pointer;
}

/* ---------- Tanda kasih ---------- */
.rekening { display: grid; gap: 1rem; margin: 0 0 1rem; padding: 0; list-style: none; }
.rekening li, .alamat-hadiah {
    padding: 1.25rem;
    background: var(--kartu);
    border: 1px solid var(--garis);
    border-radius: var(--radius, .5rem);
}
.rekening p, .alamat-hadiah p { margin: 0 0 .25rem; }
.bank { font-weight: 700; }
.norek { font-family: var(--judul); font-size: 1.5rem; letter-spacing: .04em; font-variant-numeric: tabular-nums; }
.atasnama { margin-bottom: .75rem !important; }

/* ---------- RSVP ---------- */
.form { display: grid; gap: 1.25rem; max-width: 26rem; }
.kolom { margin: 0; padding: 0; border: 0; min-width: 0; }
.kolom label, .kolom legend { display: block; margin-bottom: .375rem; padding: 0; font-weight: 600; }
.kolom input[type="text"], .kolom select, .kolom textarea {
    width: 100%;
    padding: .7rem .9rem;
    font: inherit;
    color: var(--tinta);
    background: var(--input, #fff);
    border: 1px solid var(--garis-kuat, var(--tinta));
    border-radius: var(--radius, .5rem);
}
.kolom textarea { resize: vertical; }
.pilihan { display: grid; gap: .5rem; }
.kolom .pilih {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin: 0;
    padding: .6rem .9rem;
    font-weight: 500;
    background: var(--input, #fff);
    border: 1px solid var(--garis-kuat, var(--tinta));
    border-radius: var(--radius, .5rem);
    cursor: pointer;
}
.pilih input { accent-color: var(--utama); }
.kolom .pilih:has(input:checked) { outline: 2px solid var(--utama); outline-offset: -2px; }
.form .tombol { justify-self: stretch; }

/* ---------- Penutup ---------- */
.penutup { padding: 4rem 1.5rem 3rem; text-align: center; }
.penutup p { margin: 0 0 1rem; }
.kredit { margin-top: 2rem !important; font-size: .9375rem; }

/* ---------- Musik ---------- */
.musik {
    position: fixed;
    z-index: 40;
    bottom: max(1rem, env(safe-area-inset-bottom));
    right: max(1rem, calc(50% - var(--lebar, 30rem) / 2 + 1rem));
    display: grid;
    place-items: center;
    width: 2.875rem;
    height: 2.875rem;
    color: var(--musik-fg, var(--aksen));
    background: var(--musik-bg, var(--utama));
    border: 1px solid var(--musik-garis, transparent);
    border-radius: 50%;
    cursor: pointer;
}
.musik svg { width: 1.25rem; height: 1.25rem; }
.musik[aria-pressed="false"]::after { content: ""; position: absolute; width: 1.7rem; height: 2px; background: currentColor; transform: rotate(-45deg); }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .cover, .cover *, .tombol { transition: none !important; }
}
