/* ============================================
   SUNSETRIDE BALI - Custom Styles
   ============================================ */

[x-cloak] { display: none !important; }

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ============================================
   SITE NAVIGATION
   ============================================
   2 mode:
   - .site-nav--home   → transparan di awal, gelap saat scroll
   - .site-nav--solid  → SELALU gelap (untuk semua halaman selain home)
   ============================================ */

/* Base: fixed, full width, z-index tinggi */
.site-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    transition: background-color 0.3s ease,
                box-shadow 0.3s ease,
                backdrop-filter 0.3s ease,
                -webkit-backdrop-filter 0.3s ease;
}

/* SOLID mode: selalu gelap (halaman dalam) */
.site-nav--solid {
    background-color: rgba(10, 46, 35, 0.97);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 1px 20px rgba(0, 0, 0, 0.1);
}

/* HOME mode: mulai transparan */
.site-nav--home {
    background-color: transparent;
}

/* HOME mode saat sudah scroll → jadi gelap */
.site-nav--home.nav-scrolled {
    background-color: rgba(10, 46, 35, 0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.15);
}

/* ============================================
   DESKTOP NAV LINKS
   ============================================ */
.nav-link {
    position: relative;
    padding: 0.5rem 0.75rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.75);
    border-radius: 0.5rem;
    transition: color 0.2s ease, background-color 0.2s ease;
    letter-spacing: 0.01em;
    white-space: nowrap;
}
.nav-link:hover {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.08);
}
.nav-link.active {
    color: #D4AF37;
}

/* ============================================
   HAMBURGER ICON
   3 span → X animation via CSS class
   ============================================ */
.hamburger-icon {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 24px;
    height: 24px;
    gap: 6px;
    pointer-events: none;
}
.hamburger-icon span {
    display: block;
    width: 100%;
    height: 2px;
    background-color: #ffffff;
    border-radius: 2px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.15s ease;
    transform-origin: center;
    will-change: transform, opacity;
}
.hamburger-icon.is-active span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}
.hamburger-icon.is-active span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}
.hamburger-icon.is-active span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* ============================================
   MOBILE MENU
   Selalu di DOM, toggle via .is-open

   Z-INDEX HIERARCHY:
   - .site-nav         → z-50  (50)
   - .mobile-menu      → z-[55] (55) — di atas nav agar panel tidak tertutup
   - #menuToggle       → z-[65] (65) — di atas panel agar tombol X tetap klikable
   - Logo link di nav  → tidak perlu z-index sendiri, ikut flow nav
   ============================================ */
.mobile-menu {
    position: fixed;
    inset: 0;
    z-index: 55; /* FIX: naik dari 45 → 55, di atas .site-nav (50) */
    pointer-events: none;
}

.mobile-menu-backdrop {
    position: absolute;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.3s ease;
    -webkit-tap-highlight-color: transparent;
}

.mobile-menu-panel {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 300px;
    background-color: rgba(10, 46, 35, 0.98);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
    -webkit-overflow-scrolling: touch;
}

/* Open state */
.mobile-menu.is-open {
    pointer-events: auto;
}
.mobile-menu.is-open .mobile-menu-backdrop {
    opacity: 1;
}
.mobile-menu.is-open .mobile-menu-panel {
    transform: translateX(0);
}

/* Body scroll lock */
body.menu-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
    touch-action: none;
    -webkit-overflow-scrolling: none;
}
body.menu-open .mobile-menu-panel {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

/* Mobile nav links */
.mobile-nav-link {
    display: block;
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
    transition: color 0.15s ease,
                background-color 0.15s ease,
                padding-left 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}
.mobile-nav-link:hover,
.mobile-nav-link:active {
    color: #D4AF37;
    background-color: rgba(255, 255, 255, 0.05);
    padding-left: 2rem;
}

/* ============================================
   WHATSAPP FLOATING
   ============================================ */
.wa-bubble {
    animation: waBubbleIn 0.5s ease-out 1.5s both;
}
@keyframes waBubbleIn {
    from { opacity: 0; transform: translateY(10px) scale(0.9); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.wa-typing::after {
    content: '|';
    animation: blink 0.6s infinite;
    color: #D4AF37;
    font-weight: 300;
}
@keyframes blink {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0; }
}

/* ============================================
   SCROLL ANIMATIONS
   ============================================ */
[data-animate] {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
[data-animate].is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Skeleton */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: 0.5rem;
}
@keyframes shimmer {
    0%   { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* ============================================
   SCROLL & SCROLLBAR
   ============================================ */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}
::-webkit-scrollbar       { width: 8px; }
::-webkit-scrollbar-track { background: #FAF9F6; }
::-webkit-scrollbar-thumb { background: #E7D9C1; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #D4AF37; }

::selection {
    background-color: rgba(212, 175, 55, 0.2);
    color: #0F4C3A;
}

/* ============================================
   FOCUS & ACCESSIBILITY
   ============================================ */
a:focus-visible,
button:focus-visible {
    outline: 2px solid #D4AF37;
    outline-offset: 2px;
    border-radius: 4px;
}

/* ============================================
   TOAST
   ============================================ */
.toast-notification {
    position: fixed;
    top: 100px;
    right: 24px;
    z-index: 9999;
    padding: 16px 24px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    transform: translateX(120%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: transform;
}
.toast-notification.show { transform: translateX(0); }
.toast-success { background: #0F4C3A; color: #fff; }
.toast-error   { background: #dc2626; color: #fff; }

/* Prose */
.prose-custom h2 { margin-top: 2rem; }
.prose-custom p  { margin-bottom: 0.5rem; }

/* Admin */
.sidebar-link.active {
    background-color: rgba(212, 175, 55, 0.1);
    color: #D4AF37;
    border-right: 3px solid #D4AF37;
}

/* Lazy images */
img.js-lazy       { opacity: 0; transition: opacity 0.4s ease; }
img.js-lazy.img-loaded { opacity: 1; }

/* ============================================
   HERO RESPONSIVE FIX
   Nav height: 64px mobile, 80px desktop
   Inline style padding-top: 64px
   Override untuk sm+ (640px ke atas)
   ============================================ */
@media (min-width: 640px) {
    /* Override inline padding-top 64px → 80px untuk sm+ */
    section[style*="padding-top: 64px"] {
        padding-top: 80px !important;
    }
}

/* Print */
@media print {
    nav, .wa-bubble, #waFloat, .mobile-menu, footer { display: none !important; }
    main { padding-top: 0 !important; }
}

/* Responsive */
@media (max-width: 640px) {
    .nav-link {
        font-size: 0.75rem;
        padding: 0.375rem 0.5rem;
    }
    .mobile-menu-panel {
        max-width: 100%;
    }
}