/* General Setup */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { 
    background-color: #f4f4f4; 
    overflow-x: hidden;
}

/* Base Container */
.page-container, .page-section {
    max-width: 480px; 
    margin: 0 auto;
    min-height: 100vh;
    width: 100%;
    position: relative;
    background-color: #fff;
    text-align: center;
}

/* Padding konten untuk halaman selain pembuka & home */
.page-section { padding: 40px 20px; }

/* Helper Classes */
.flex-center { display: flex; flex-direction: column; justify-content: center; align-items: center; }
/* EDIT: Tambah flex-bottom agar bisa dipakai di Home juga */
.flex-bottom { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; }
.hidden { display: none; }
.mt-20 { margin-top: 20px; }

/* Jarak tambahan untuk elemen */
.mt-30 { margin-top: 30px; }
.mt-15 { margin-top: 5px; }

/* Jarak spesifik antara Doa dan tulisan Mempelai */
.mt-40 { 
    margin-top: 40px !important; 
}

/* Fonts */
.txt-montserrat { font-family: 'Montserrat', sans-serif; }
.txt-pinyon { font-family: 'Pinyon Script', cursive; }
.white-text { color: white !important; }
.black-text { color: #000 !important; }
.bold { font-weight: bold; }

/* Font Sizes */
.sz-14 { font-size: 14px !important; }
.sz-18 { font-size: 18px !important; }
.sz-20 { font-size: 20px !important; }
.sz-40 { font-size: 40px !important; } 

/* //halaman pembuka// - TIDAK BERUBAH (Sesuai keinginan Anda) */
#welcome-page {
    background: url('file/sambutan.webp') center/cover no-repeat;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 999;
    display: flex !important;
    flex-direction: column;
    justify-content: flex-end; 
    align-items: center;
    padding-bottom: 80px; 
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
}

.overlay-content { 
    width: 100%; 
    text-align: center;
    padding: 0 20px;
}

.guest-box { margin: 20px 0; }

#btn-open {
    margin-top: 10px;
    padding: 12px 25px;
    background: white;
    border: none;
    cursor: pointer;
    border-radius: 5px;
    font-weight: bold;
}

/* //halaman awal (Home)// - EDIT: Kita perbaiki agar ke bawah */
.section-bg-home { 
    background: url('file/home_bg.webp') center/cover no-repeat; 
    padding: 0 !important; /* Menghilangkan padding agar blok putih mentok bawah */
    display: flex;
    flex-direction: column;
    justify-content: flex-end; /* Menarik blok putih ke bawah */
}

.white-block {
    background: white;
    width: 100%;
    padding: 40px 20px 60px 20px; 
    border-top-left-radius: 50% 80px; 
    border-top-right-radius: 50% 80px;
    position: relative;
    z-index: 2;
}

.img-hero-small { 
    width: 130px; /* Ukuran diperkecil sesuai permintaan */
    height: auto;
    border-radius: 10px; 
    margin-bottom: 15px; 
}

/* Styling khusus countdown di halaman home */
.countdown-home-wrapper {
    margin-top: 15px;
    padding: 10px;
    display: inline-block;
    color: #000 !important; /* Warna hitam sesuai instruksi */
    font-weight: normal;    /* Teks 'Hari | Jam | dll' tetap reguler */
}

/* Hanya angka di dalam span yang menjadi bold */
.countdown-home-wrapper span {
    font-weight: bold !important; 
    color: #000 !important;
}

/* --- Frame & Profile --- */
.frame-container {
    position: relative;
    width: 200px; 
    height: 200px;
    margin: 30px auto 15px auto; /* Tambah jarak atas-bawah */
}

.frame-img, .profile-img { 
    position: absolute; 
    top: 50%; 
    left: 50%; 
    transform: translate(-50%, -50%); 
}

.frame-img { 
    width: 100%; 
    z-index: 2; 
}

.profile-img { 
    width: 85%; 
    height: 85%; 
    object-fit: cover; 
    border-radius: 50%; 
    z-index: 1; 
}

/* --- Ornaments System --- */
.orn-top-right, .orn-bottom-right, .orn-bridge { 
    position: absolute; 
    pointer-events: none; 
}

.orn-top-right { top: 0; right: 0; width: 100px; }
.orn-bottom-right { bottom: 0; right: 0; width: 100px; }

/* Ornamen Penyatu (Bridge) */
.orn-bridge {
    width: 120px !important; /* Sesuai penyesuaian Anda */
    left: -10px;
    top: 45%;
    transform: translateY(-50%);
    /* KUNCI UTAMA: z-index sangat rendah */
    z-index: 0 !important; 
}

/* --- Penataan Jarak Mempelai --- */
#bride-content, #groom-content, #gallery-section {
    position: relative; /* Wajib ada agar z-index di bawahnya bekerja */
    z-index: 5; /* Pastikan konten lebih tinggi dari ornamen */
}

/* Jarak antara pengantin wanita dan pria */
#groom-content {
    margin-top: 80px !important; /* Menambah jarak agar tidak menumpuk */
}

/* Jarak antara info pengantin pria dan gallery */
#gallery-section {
    margin-top: 60px !important;
}

/* --- Gallery Portrait (3:4) --- */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 25px;
}

.gallery-item {
    aspect-ratio: 3/4; /* Mengubah square menjadi portrait */
    overflow: hidden;
    border-radius: 8px;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.gallery-item img:hover {
    transform: scale(1.05);
}

/* //halaman acara// */
/* --- Halaman Acara (Event) --- */
.section-bg-event { 
    padding: 0 !important; /* Hilangkan padding bawaan */
    background: none !important; 
}

.event-top {
    position: relative;
    background: url('file/waktu.webp') center/cover no-repeat;
    min-height: 60vh;
    padding: 60px 20px;
}

/* Overlay Hitam 60% agar teks putih jelas */
.black-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1;
}

.relative-z { position: relative; z-index: 2; }

/* Bagian Bawah (Akad) */
.event-bottom {
    background-color: #fff;
    padding: 60px 0; /* Ubah padding kiri-kanan jadi 0 agar maps bisa full ke pinggir jika mau */
    width: 100%;
    max-width: 480px;
}

/* Berikan padding hanya pada teks di dalam event-bottom agar tidak kena pinggir, 
   tapi biarkan maps-container mengatur jaraknya sendiri */
.event-bottom .content-wrapper {
    padding: 0 20px;
}

.maps-container {
    margin-top: 30px;
    width: 100%;
    padding: 0 10px; /* Memberi sedikit jarak manis di kiri kanan peta */
}

.maps-container iframe {
    width: 100%;
    height: 250px; /* Kita naikkan tingginya agar lebih jelas dilihat */
    border-radius: 12px;
    border: 1px solid #eee;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

/* --- Countdown Event Style --- */
.countdown-event-wrapper {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.cd-item {
    background: white;
    color: black;
    padding: 10px;
    border-radius: 8px;
    min-width: 60px;
    display: flex;
    flex-direction: column;
}

.cd-item .num { font-size: 24px; font-weight: bold; }
.cd-item .lab { font-size: 10px; text-transform: uppercase; }

/* Table Styling untuk Akad */
.info-table { margin: 0 auto; text-align: left; border-collapse: collapse; }
.info-table td { padding: 5px; vertical-align: top; }

.countdown-box { background: white; padding: 15px; border-radius: 10px; display: inline-block; color: #000; }
.akad-box { background: rgba(255,255,255,0.8); padding: 20px; border-radius: 10px; width: 100%; }

/* Form Ucapan */
#wish-form { text-align: left; width: 100%; }
#wish-form .btn-group {
    margin-left: 85px; /* Sesuai Lebar Label (70px) + Gap (15px) */
    display: flex;
    gap: 10px;
}

#wish-form .btn-custom {
    flex: 1; /* Tombol akan membagi rata sisa ruang form */
    padding: 12px 5px;
    white-space: nowrap; /* Teks tombol tidak turun ke bawah */
}
.form-group { margin-bottom: 15px; }
input, textarea { width: 100%; padding: 10px; border: 1px solid #ccc; border-radius: 5px; }
.btn-group { display: flex; gap: 10px; }
.btn-hadir { background: black; color: white; border: none; flex: 1; padding: 10px; cursor: pointer; }
.btn-tidak-hadir { background: #ccc; color: black; border: none; flex: 1; padding: 10px; cursor: pointer; }

/* Popups */
/* Container utama popup */
.popup-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px; /* Jarak agar gambar tidak nempel pinggir layar */
}

/* Container untuk gambar dan tombol navigasi */
.popup-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 400px; /* Batasi lebar maksimal setara layar HP */
}

/* Styling gambar agar pas di layar */
#popup-img {
    max-width: 100%; /* Lebar maksimal mengikuti container */
    max-height: 80vh; /* Tinggi maksimal 80% dari tinggi layar */
    object-fit: contain; /* Memastikan gambar tidak terpotong */
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
}

/* Tombol Navigasi agar tidak menutupi gambar di layar kecil */
.nav-btn {
    background: rgba(255, 255, 255, 0.3);
    color: white;
    border: none;
    padding: 10px 15px;
    cursor: pointer;
    font-size: 20px;
    border-radius: 50%;
    position: absolute;
    z-index: 10001;
}

.nav-btn:first-child { left: -50px; } /* Tombol Prev */
.nav-btn:last-child { right: -50px; } /* Tombol Next */

/* Responsif untuk layar HP yang sangat kecil */
@media (max-width: 420px) {
    .nav-btn:first-child { left: 10px; }
    .nav-btn:last-child { right: 10px; }
    .nav-btn { background: rgba(0, 0, 0, 0.5); } /* Lebih gelap di HP agar kontras */
    .form-group-row { flex-direction: column; align-items: flex-start; gap: 5px; }
    #wish-form .btn-group { margin-left: 0; width: 100%; }
}

.btn-close, .btn-close-dark {
    position: absolute;
    top: 20px; right: 20px;
    font-size: 40px;
    cursor: pointer;
    z-index: 10000;
}

.btn-close { color: white; }
.btn-close-dark { color: black; }

.popup-content {
    background: white;
    padding: 30px 20px;
    width: 90%;
    max-width: 400px;
    border-radius: 15px;
    position: relative;
}

/* --- Halaman Wishes --- */
.section-top {
    display: flex;
    flex-direction: column;
    justify-content: flex-start !important; /* Tarik ke atas */
    padding-top: 60px !important;
}

.form-group-row {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    gap: 15px;
    text-align: left;
}

.form-group-row label {
    width: 70px;
    font-weight: bold;
}

.form-group-row input, 
.form-group-row textarea {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-family: 'Montserrat', sans-serif;
}

/* Button Custom (Mirip Welcome Page) */
.btn-custom {
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
}

.btn-black {
    background: #000;
    color: #fff;
    border: 2px solid #000;
}

.btn-outline {
    background: #eee;
    color: #000;
    border: 2px solid #000;
}

.btn-custom:active { transform: scale(0.95); }

/* Comment Styling */
.comment-item {
    background: #f9f9f9; /* Blok abu-abu terang */
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 15px;
    border-left: 5px solid #000; /* Garis hitam tebal di samping kiri */
    text-align: left !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05); /* Bayangan halus agar lebih muncul */
}

.comment-name {
    font-weight: bold;
    font-size: 14px;
    margin-bottom: 5px;
    display: block;
}

.comment-text {
    text-align: justify;
    line-height: 1.6;
    font-size: 13px;
    color: #333;
}
.read-more { color: #888; cursor: pointer; font-weight: bold; }

/* Pagination Buttons */
.pagination-controls {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
}

.page-btn {
    background: #fff;
    color: #000;
    border: 1px solid #000;
    padding: 6px 14px;
    font-weight: bold;
    cursor: pointer;
}

.page-btn.active {
    background: #000 !important;
    color: #fff !important;
}

/* --- Tombol Save Calendar Flat --- */
.btn-save-calendar {
    display: inline-flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.9);
    color: #000;
    padding: 10px 20px;
    border-radius: 30px;
    text-decoration: none;
    /* Font sesuai permintaan: Montserrat 14, tidak bold */
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    font-weight: 400; 
    transition: 0.3s;
    border: 1px solid #000; /* Border hitam tipis agar senada dengan icon */
}

.btn-save-calendar:hover {
    background: #000;
    color: #fff;
}

/* Mengubah warna icon SVG saat tombol di-hover menjadi putih */
.btn-save-calendar:hover svg {
    stroke: white;
}

/* Penyesuaian jarak countdown agar tidak terlalu mepet tombol */
.countdown-event-wrapper {
    margin-bottom: 10px;
}

/* Popup Scroll */
.scrollable { max-height: 80vh; overflow-y: auto; }

/* Pastikan class ini ada untuk mematikan interaksi elemen */
.hidden-completely { 
    display: none !important; 
    visibility: hidden !important;
    pointer-events: none !important; 
    z-index: -1 !important;
}

/* Jika popup sedang disembunyikan, gunakan class ini */
.popup-overlay.hidden-completely {
    display: none !important;
}