/* ==========================================================
   DIYNEWS MAIN HEADER & NAVIGATION STYLING (CLEAN MASTER)
   Version : 1.1 (Fixed Sticky Shrink Engine)
   ========================================================== */

/* ----------------------------------------------------------
   1. PONDASI UTAMA HEADER (KONDISI DEFAULT DI PALING ATAS)
   ---------------------------------------------------------- */
.site-header {
    position: relative;
    top: 0;
    left: 0;
    width: 100%;
    background: #ffffff;
    z-index: 99999; /* Mengunci agar menu berada di lapisan teratas layar */
    border-bottom: 1px solid #e5e7eb;
    transition: box-shadow 0.3s ease-in-out;
    margin-top: 0; 
}

/* Sektor Kop Atas (Tempat Logo & Kotak Cari) */
.header-main { 
    background: #ffffff; 
    padding: 15px 0 12px 0; /* Padding awal desktop yang longgar dan mewah */
    border-bottom: 1px solid #eee; 
    width: 100%;
    transition: padding 0.3s ease-in-out; /* Transisi menyusut halus */
}

.header-main .diy-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

/* Sektor Bilah Menu Navigasi (Navbar) */
.navbar { 
    background: linear-gradient(80deg, #d9091b 0%, #3920c9 100%); 
    padding: 10px 0; /* Padding awal menu navigasi */
    width: 100%;
    transition: padding 0.3s ease-in-out; /* Transisi menyusut halus */
}


/* ----------------------------------------------------------
   2. ATRIBUT BRANDING LOGO & TOOLS
   ---------------------------------------------------------- */
.logo-branding {
    display: flex;
    align-items: center;
}

.logo-branding a {
    display: inline-block;
    line-height: 1;
    text-decoration: none !important;
}

/* Pengaman Ukuran Gambar Logo Biar Anti-Gepeng */
.logo-branding img {
    max-height: 55px; /* Tinggi awal logo di desktop */
    width: auto;      
    display: block;
    object-fit: contain;
    transition: max-height 0.3s ease-in-out; /* Transisi logo mengecil */
}

/* Cadangan Teks Jika Belum Upload Gambar Logo */
.logo-branding h1 {
    font-size: 1.6rem;
    font-weight: 850;
    letter-spacing: -1px;
    margin: 0;
    line-height: 1;
    color: #212529;
    transition: font-size 0.3s ease-in-out;
}

.header-tools { 
    display: flex; 
    align-items: center; 
    gap: 20px; 
}

.search-box { 
    background: #f0f0f0; 
    border-radius: 50px; 
    padding: 8px 20px; 
    width: 300px; 
    display: flex; 
    align-items: center; 
    justify-content: space-between; 
    border: 1px solid #ddd; 
}

.icon-box { 
    cursor: pointer; 
    font-size: 1.2rem; 
    color: #333; 
}


/* ----------------------------------------------------------
   3. ATRIBUT BARIS STRUKTUR NAV-MENU
   ---------------------------------------------------------- */

.nav-menu {
    list-style: none;
    display: flex;
    justify-content: center; 
    margin: 0;
    padding: 0;
    gap: 30px;
}

/* PERBAIKAN UTAMA: Menghapus !important agar ukuran huruf bisa dimanipulasi */
.nav-menu li a {
    color: #ffffff;
    text-decoration: none !important;
    font-weight: 600;
    white-space: nowrap; 
    font-size: 0.95rem; /* Ukuran huruf awal */
    padding: 4px 0;    /* Jarak padding sentuh awal */
    display: block;
    transition: all 0.3s ease-in-out; /* Efek menyusut terpadu */
}

.nav-menu li a:hover { 
    opacity: 0.8; 
}

/* Aksesori Penanda Kategori (Badges) */
.badge-hot, .badge-pop { 
    font-size: 0.6rem; 
    padding: 2px 5px; 
    border-radius: 3px; 
    margin-left: 5px; 
    vertical-align: top; 
    color: #fff;
}
.badge-hot { background: #d32f2f; }
.badge-pop { background: #388e3c; }

/* Wadah Konten Utama Di Bawah Header Diatur Agar Tetap Kokoh Menempel */
.diy-main-site-content-wrapper {
    position: relative;
    z-index: 9999; /* Wajib sejajar dengan header agar ikut menimbun */
    background: #ffffff !important; /* Memberi warna solid, ubah sesuai selera web Anda */
    width: 100%;
    box-shadow: 0 -10px 30px rgba(0,0,0,0.05); /* Efek bayangan halus saat bodi naik menimbun iklan */
}

/* ----------------------------------------------------------
   4. KUNCI UTAMA SAKELAR REKREASI: MAINKAN SQUISH SAAT IS-STICKY AKTIF
   ---------------------------------------------------------- */
/* Efek Bayangan Melayang */
.site-header.is-sticky {
    position: fixed;
    top: 0;
    left: 0;

    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08); 
}

/* A. Menyusutkan Ketebalan Baris Kop Atas */
.site-header.is-sticky .header-main {
    padding: 8px 0 6px 0 !important; /* Padding langsung merapat tipis */
}

/* B. Otomatis Memotong Tinggi Gambar Logo */
.site-header.is-sticky .logo-branding img {
    max-height: 30px; /* Logo menyusut rapi dari 55px menjadi 38px */
}

/* C. Menyusutkan Teks Cadangan Nama Situs */
.site-header.is-sticky .logo-branding h1 {
    font-size: 1.25rem;
}

/* D. Menyusutkan Ketebalan Baris Pembungkus Navbar Menu */
.site-header.is-sticky .navbar {
    padding: 5px 0; /* Jarak baris warna gradasi menu merapat tipis */
}

/* E. KUNCI PENYUSUTAN HURUF: Mengecilkan teks link navigasi atas */
.site-header.is-sticky .navbar .nav-menu li a {
    font-size: 13px; /* Huruf mengecil rapi menjadi 13px agar proporsional */
    padding: 2px 0;  /* Spasi link merapat */
}

.body.is-sticky{
    padding-top:190px;
}
/* ----------------------------------------------------------
   5. MEDIA QUERIES (OPTIMASI RESPONSIF LAYAR MOBILE)
   ---------------------------------------------------------- */


@media (max-width: 768px) {
    .header-main .diy-container {
        flex-direction: column; /* Membuat susunan logo dan search box menumpuk vertikal di HP */
        gap: 15px;
    }
    
    .search-box {
        width: 100%; /* Kotak cari memanjang penuh mengikuti lebar layar HP */
    }

    .nav-menu {
        gap: 15px !important;
        overflow-x: auto; /* KUNCI: Membuat menu bisa digeser kesamping (scroll horizontal) di HP agar tidak meluap */
        justify-content: flex-start !important;
        padding: 0 10px !important;
        -webkit-overflow-scrolling: touch;
    }
    
    .nav-menu::-webkit-scrollbar {
        display: none; /* Menyembunyikan batang scrollbar bawaan browser agar estetik */
    }
    .logo-branding {
        max-height: 45px; /* Perkecil area wadah di layar HP sempit */
    }
    
    .logo-branding img {
        max-height: 40px; /* Perkecil tinggi gambar logo agar muat berdampingan dengan menu mobile */
    }

    .logo-branding h1 {
        font-size: 1.25rem; /* Perkecil ukuran teks cadangan di HP */
    }

}

