/* Mencegah perilaku zoom gestur di perangkat sentuh */
html, body {
    touch-action: pan-x pan-y;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

:root {
    --primary-mesuji: #0d5c52;
    --accent-gold: #f59e0b;
    --accent-emerald: #10b981;
}

.bg-mesuji { background-color: var(--primary-mesuji); }
.text-mesuji { color: var(--primary-mesuji); }
.bg-cover-foto { background-size: cover; background-position: center; }

/* Mengatur body agar responsif, centering optimal, dan terkunci pas */
/* Mengatur body agar responsif, centering optimal, dan terkunci pas */
body {
    background-image: url('../img/Untitled-21.jpg') !important;
    background-size: cover !important;
    background-position: center top !important; /* Memastikan gambar dikunci ke sisi paling atas layar */
    background-attachment: fixed !important;
    background-repeat: no-repeat !important;
    background-color: var(--primary-mesuji) !important;
    background-blend-mode: multiply !important;
    padding-top: 130px !important;  
    margin: 0 !important;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    overflow-x: hidden;
}

/* background-attachment: fixed sering bikin glitch/konten hilang di HP (Safari iOS dsb),
   jadi khusus perangkat sentuh/layar kecil kita matikan efek fixed-nya */
@media (max-width: 1024px), (hover: none) and (pointer: coarse) {
    body {
        background-attachment: scroll !important;
    }
}

/* Memastikan wrapper utama di dalam body terpusat di semua perangkat */
body > div, body > main, body > section, .main-wrapper, .container {
    width: 100%;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1rem;
    padding-right: 1.25rem;
}

@media (min-width: 768px) {
    body > div, body > main, body > section, .main-wrapper, .container {
        padding-left: 2rem;
        padding-right: 2rem;
    }
}

/* ============================================================
   BREAKPOINT TAMBAHAN: HP KECIL, HP BESAR, TABLET, LAPTOP
   Supaya jarak/padding & ukuran body pas di semua ukuran layar
   ============================================================ */

/* HP kecil (iPhone SE, Android layar sempit, dsb: <= 380px) */
@media (max-width: 380px) {
    body {
        padding-top: 110px !important;
    }
    .section-title { font-size: clamp(20px, 5vw, 26px); }
    #container-layanan > div { padding: 18px 12px; }
}

/* HP pada umumnya (<= 640px) */
@media (max-width: 640px) {
    body {
        padding-top: 120px !important;
    }
    body > div, body > main, body > section, .main-wrapper, .container {
        padding-left: 0.85rem;
        padding-right: 0.85rem;
    }
    .gallery-container { padding: 18px; }
    .gallery-grid { gap: 14px; }
}

/* Tablet portrait (641px - 1024px) */
@media (min-width: 641px) and (max-width: 1024px) {
    body > div, body > main, body > section, .main-wrapper, .container {
        padding-left: 1.75rem;
        padding-right: 1.75rem;
    }
    #container-layanan { gap: 18px; }
}

/* Laptop / layar sedang (1025px - 1439px) sudah tercakup oleh style dasar di atas */

/* ============================================================
   PETA (MAP) & PATH SVG RESPONSIF
   ============================================================ */
#map-container {
    background: transparent !important;
    box-shadow: none !important;
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
}

#map-container svg {
    width: 100% !important;
    height: auto !important;
    max-height: 70vh;
    display: block;
    margin: 0 auto;
}

path {
    cursor: pointer;
    stroke: #0d5c52;
    stroke-width: 40;
    fill: rgba(255, 255, 255, 1);
    stroke-linejoin: round;
    stroke-linecap: round;
    transition: fill 0.2s ease, stroke 0.2s ease, transform 0.2s ease;
}

path:hover {
    fill: #f59e0b !important;
    stroke: #b45309 !important;
    stroke-width: 50;
}

.active {
    fill: #10b981 !important;
    stroke: #047857 !important;
    stroke-width: 60 !important;
}

/* ============================================================
   INPUT PENCARIAN (SEARCH) CENTERED
   ============================================================ */
#search-input {
    background: rgba(255, 255, 255, 0.15) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    border: none !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1) !important;
    color: #ffffff !important;
    transition: none !important;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    display: block;
    font-size: 16px !important; /* Mencegah auto-zoom pada beberapa browser HP saat input diklik */
}

#search-input:focus {
    background: rgba(255, 255, 255, 0.2) !important;
    border: none !important;
    outline: none !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15) !important;
}

#search-input::placeholder { color: rgba(255, 255, 255, 0.7) !important; }

/* ============================================================
   CONTAINER LAYANAN & MODAL (GRID CENTERED)
   ============================================================ */
#container-layanan { 
    padding: 20px; 
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    justify-content: center;
}

#container-layanan > div {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    padding: 24px 16px;
    border-radius: 2rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%;
}

#container-layanan > div:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.15);
    border-color: #0d5c52;
}

#modal-layanan-publik, #modal-navbar {
    transition: opacity 0.3s ease-in-out;
}

/* ============================================================
   NAVIGASI & TOMBOL UMUM
   ============================================================ */
#mobile-menu button { width: 100%; }

.nav-btn {
    transition: all 0.2s ease;
    padding-bottom: 2px;
}
.tab-btn {
    transition: all 0.3s ease;
}
.tab-btn.active {
    color: #0d5c52;
    border-bottom: 2px solid #0d5c52;
}

/* ============================================================
   SECTION GALERI & EFEK FLIP CARD 3D (CENTERED RESPONSIVE)
   ============================================================ */
.page-content { 
    padding: 40px 15px; 
    width: 100%;
    display: flex;
    justify-content: center;
}

.gallery-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
    background-color: #ffffff;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

@media (min-width: 768px) {
    .gallery-container {
        padding: 40px;
    }
}

.section-title-wrapper {
    text-align: center;
    margin-bottom: 40px;
    width: 100%;
}

.section-badge {
    border: 1px solid #10b981;
    color: #0f766e;
    padding: 6px 16px;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    background-color: #f0fdf4;
}

.badge-dot {
    width: 8px;
    height: 8px;
    background-color: #f59e0b;
    border-radius: 50%;
}

.section-title {
    color: #1e293b;
    font-size: clamp(24px, 4vw, 34px);
    font-weight: 700;
    margin: 0 0 16px 0;
    position: relative;
    padding-bottom: 16px;
    text-align: center;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, #10b981, #f59e0b);
    border-radius: 2px;
}

.section-subtitle {
    color: #64748b;
    font-size: clamp(14px, 2vw, 16px);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
    text-align: center;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    padding: 15px 0;
    justify-content: center;
    align-items: stretch;
}

.gallery-item {
    aspect-ratio: 4/3;
    perspective: 1000px;
    background-color: transparent;
    border-radius: 12px;
    width: 100%;
}

.gallery-card {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(0,0,0,0.06);
    border-radius: 12px;
}

.gallery-item:hover .gallery-card,
.gallery-item:focus-within .gallery-card {
    transform: rotateY(180deg);
}

.gallery-front, .gallery-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border-radius: 12px;
    overflow: hidden;
    top: 0;
    left: 0;
}

.gallery-front {
    background-color: #f1f5f9;
    border-bottom: 4px solid #10b981;
}

.gallery-front img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.gallery-back {
    background: linear-gradient(135deg, #0f766e, #115e59);
    color: #ffffff;
    transform: rotateY(180deg);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    text-align: center;
    box-sizing: border-box;
    border-bottom: 4px solid #f59e0b;
}

.gallery-back h3 {
    font-size: clamp(16px, 2.5vw, 20px);
    margin: 0 0 8px 0;
    font-weight: 600;
    color: #f59e0b;
}

.gallery-back p {
    font-size: clamp(12px, 2vw, 14px);
    line-height: 1.5;
    color: #e2e8f0;
    margin: 0;
}

/* ============================================================
   SISTEM RATING BINTANG
   ============================================================ */
.star-rating {
    display: flex;
    flex-direction: row-reverse;
    justify-content: center;
    gap: 8px;
    width: 100%;
}

.star-rating input { display: none; }

.star-rating label {
    font-size: clamp(2rem, 4vw, 2.5rem);
    color: #e2e8f0;
    cursor: pointer;
    transition: color 0.15s ease-in-out, transform 0.1s ease-in-out;
}

.star-rating label:hover,
.star-rating label:hover ~ label,
.star-rating input:checked ~ label {
    color: #fbbf24;
}

.star-rating label:active { transform: scale(1.2); }

/* ============================================================
   PERBAIKAN MENU MOBILE & LAYAR KACA (RESPONSIF)
   ============================================================ */
@media (max-width: 768px) {
    header#mainHeader.menu-terbuka, 
    header#mainheader.menu-terbuka {
        background-color: rgba(13, 92, 82, 0.98) !important;
        height: auto !important;
        max-height: 85vh !important;
        overflow-y: auto !important;
        padding-bottom: 1.5rem !important;
    }

    header#mainHeader.menu-terbuka nav,
    header#mainheader.menu-terbuka nav {
        flex-direction: column !important;
        align-items: flex-start !important;
        width: 100% !important;
    }

    header#mainHeader.menu-terbuka nav > div.hidden,
    header#mainheader.menu-terbuka nav > div.hidden,
    header#mainHeader.menu-terbuka .md\:flex,
    header#mainheader.menu-terbuka .md\:flex {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        align-items: flex-start !important;
        gap: 1.25rem !important;
        margin-top: 1.5rem !important;
        border-top: 1px solid rgba(255, 255, 255, 0.15);
        padding-top: 1.5rem !important;
    }

    header#mainHeader nav .absolute,
    header#mainheader nav .absolute {
        position: relative !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        box-shadow: none !important;
        background-color: rgba(255, 255, 255, 0.05) !important;
        padding: 0 1rem !important;
        margin-top: 0 !important;
        border-radius: 0.5rem !important;
        display: none !important; 
        max-height: 0;
        overflow: hidden;
        transition: all 0.3s ease-out;
    }

    header#mainHeader nav .relative.dropdown-aktif .absolute,
    header#mainheader nav .relative.dropdown-aktif .absolute {
        display: block !important;
        max-height: 500px !important;
        padding: 0.75rem 1rem !important;
        margin-top: 0.5rem !important;
    }

    header#mainHeader nav .absolute a,
    header#mainheader nav .absolute a {
        display: block !important;
        padding: 0.6rem 0 !important;
        color: rgba(255, 255, 255, 0.8) !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }
    header#mainHeader nav .absolute a:last-child {
        border-bottom: none;
    }
}

/* Dukungan khusus untuk layar besar / ultra-wide / layar kaca besar */
@media (min-width: 1440px) {
    .gallery-container, #container-layanan, #search-input, #map-container {
        max-width: 1320px;
    }
}

/* ============================================================
   PAKSA MAIN & SECTION UTAMA SELALU PENUH LEBAR & CENTER
   (Jaga-jaga kalau class Tailwind w-[..%] gagal ke-apply
   sehingga kotak kartu/section jadi menciut ke kiri)
   ============================================================ */
main, main > section, #sec_kategori, #dynamic-container-wrapper,
.layanan-wrapper {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

#dynamic-container-wrapper {
    max-width: 1200px !important;
}