/* ===== Reset header scope ===== */
#site-header :where(*) {
  all: revert;
  box-sizing: border-box;
}

/* ===== Tokens ===== */
#site-header {
  --topbar-bg: #004D68;
  --header-bg: #0B7698;
  --divider: rgba(0, 83, 160, 0.16);
  --hover: #E8F5FF;
  --submenu-border: rgba(8, 37, 56, 0.14);
  --submenu-shadow: 0 24px 54px rgba(8, 37, 56, 0.22);

  font-family: "Roboto", Arial, sans-serif;
  color: #fff;
}

#site-header a {
  color: inherit;
  text-decoration: none;
}

/* ===== Topbar ===== */
#site-header .topbar {
  background: var(--topbar-bg);
  color: #fff;
  font-size: 12.5px;
}

#site-header .topbar .container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 6px 16px;
  display: flex;
  justify-content: space-between; /* INI KUNCI LAYOUT BARU */
  align-items: center;
}

#site-header .topbar-nav {
  display: flex;
  gap: 24px;
  white-space: nowrap;
  overflow-x: auto;
}

#site-header .topbar-nav a {
  display: inline-flex;
  align-items: center;
  padding: 3px 0;
  color: #fff; /* Pastikan warna teks putih */

  /* GAYA BARU (sesuai Gambar 2) */
  font-weight: 600; /* Lebih tipis dari 700 */
  text-transform: none; /* TIDAK KAPITAL */
  letter-spacing: 0.01em;
}

#site-header .topbar-nav a:hover,
#site-header .topbar-nav a:focus-visible {
  text-decoration: underline;
  color: var(--hover); /* Gunakan variabel hover Anda */
}

/* GAYA UNTUK KOTAK PENCARIAN BARU */
.topbar-search {
  position: relative;
  flex-shrink: 0; /* Jangan biarkan kotak pencarian mengecil */
}

.topbar-search input[type="search"] {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 6px;
  color: white;
  padding: 4px 10px;
  font-size: 13px;
  font-family: "Roboto", Arial, sans-serif;
  font-weight: 500;
  transition: all 0.2s ease;
  width: 150px; /* Beri lebar awal */
}

.topbar-search input[type="search"]::placeholder {
  color: rgba(255, 255, 255, 0.6);
  opacity: 1;
}

.topbar-search input[type="search"]:focus-visible {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.8);
  outline: none;
  width: 200px; /* Sedikit melebar saat difokus */
}

/* ===== Main header ===== */
#site-header .mainbar {
  background: var(--header-bg);
  box-shadow: inset 0 -1px 0 rgba(12, 42, 66, 0.2);
}

#site-header .mainbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 28px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  flex-wrap: wrap;
}

#site-header .logo #logo {
  display: inline-flex;
  align-items: center;
  gap: 14px;
}

/* Sembunyikan img tag default */
#site-header .logo #logo img {
  display: none;
  height: auto;
  width: auto;
  max-height: 65px;
}

/* Tampilkan dan atur ukuran logo UMN di sini */
#site-header .logo #logo .logo-main {
  display: block;
  height: 60px; /* Adjust UMN logo height */
  width: auto;
  max-height: none;
}

/* Perbaiki divider & logo kedua (GreenMetric) */
#site-header .branding-divider {
  display: flex;
  align-items: center;
  padding-left: 20px;
  margin-left: 12px;
  position: relative;
}

#site-header .branding-divider::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 1px;
  height: 50px; /* Perkecil tinggi divider */
  background: var(--divider);
}

#site-header .branding-divider img {
  display: block;
  height: 50px; /* Samakan tinggi logo GreenMetric */
  width: auto;
}

/* Navigation */
#site-header #menu {
  display: flex;
  align-items: center;
  gap: 16px;
}

#site-header #menu-main-menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 36px;
}

#site-header #menu .menu-item {
  position: relative;
  display: flex;
  align-items: center;
}

#site-header #menu .menu-item > a span {
  display: inline-block;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

#site-header #menu .submenu > a span::after {
  content: "";
  display: inline-block;
  margin-left: 8px;
  width: 7px;
  height: 7px;
  border: solid currentColor;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  transition: transform 0.2s ease;
}

#site-header #menu .submenu.is-open > a span::after {
  transform: rotate(-135deg);
}

#site-header #menu .menu-item > a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 0;
  transition: color 0.2s ease, border-color 0.2s ease;
}

#site-header #menu .menu-item.current-menu-item > a {
  border-bottom: 2px solid #fff;
  padding-bottom: 8px;
}

#site-header #menu .menu-item > a:hover,
#site-header #menu .menu-item > a:focus-visible {
  color: var(--hover);
}

#site-header #menu .menu-toggle {
  display: none;
}

#site-header #menu .menu-toggle .menu-arrow {
  position: relative;
  display: inline-block;
  width: 12px;
  height: 12px;
}

#site-header #menu .menu-toggle .menu-arrow::before {
  content: "";
  position: absolute;
  inset: 0;
  border: solid currentColor;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  width: 7px;
  height: 7px;
  margin: 2px;
}

#site-header #menu .submenu.is-open > .menu-toggle .menu-arrow::before {
  transform: rotate(-135deg);
}

#site-header #menu .sub-menu {
  position: absolute;
  left: 0;
  top: calc(100% + 12px);
  min-width: 260px;
  margin: 0;
  padding: 14px;
  list-style: none;
  display: none;
  flex-direction: column;
  gap: 6px;
  background: #fff;
  color: #0F172A;
  border: 1px solid var(--submenu-border);
  border-radius: 18px;
  box-shadow: var(--submenu-shadow);
  z-index: 80;
}

#site-header #menu .submenu.is-open > .sub-menu {
  display: flex;
}

#site-header #menu .sub-menu li a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 15px;
  color: currentColor;
  transition: background 0.2s ease, color 0.2s ease;
}

#site-header #menu .sub-menu li a:hover,
#site-header #menu .sub-menu li a:focus-visible {
  background: rgba(0, 83, 160, 0.08);
  color: #00337F;
}

#site-header #menu .sub-menu .menu-code {
  font-size: 12px;
  font-weight: 600;
  color: rgba(15, 23, 42, 0.6);
}

/* Hover dropdown for desktop */
@media (hover: hover) and (pointer: fine) {
  #site-header #menu .submenu:hover > .sub-menu {
    display: flex;
  }

  #site-header #menu .submenu:hover > a span::after {
    transform: rotate(-135deg);
  }

  #site-header #menu .submenu:hover > a span,
  #site-header #menu .submenu:hover > .menu-toggle {
    color: var(--hover);
  }
}

/* Accessibility helper */
#site-header .sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* ===== Responsive ===== */
@media (max-width: 1100px) {
  #site-header .mainbar-inner {
    gap: 24px;
  }
}

/* ===== Branding: Hanging UMN logo (flush top) ===== */

/* 1. Pastikan header 'mainbar' bisa di-overflow */
#site-header .mainbar {
  overflow: visible;
  position: relative; /* Important for z-index */
  z-index: 50;
}

/* 2. Configure main logo container */
#site-header .logo {
  display: flex;
  align-items: center; /* Menengahkan logo GreenMetric secara vertikal */
  /* Pastikan logo tidak 'shrink' di layar kecil */
  flex-shrink: 0;
}

/* 3. UMN logo wrapper (acts as a spacer) */
#site-header .logo .logo-badge {
  position: relative; /* Reference for absolutely positioned image */
  display: block;
  /* Match the spacer width to the UMN logo width */
  width: 140px;
  /* Set the spacer height equal to the header height */
  height: 78px; /* Match your header height */
}

/* 4. UMN logo image (the floating element) */
#site-header .logo .logo-badge img {
  position: absolute;
  left: -20px;
  top: -20px; /* MENEMPEL DI ATAS wrapper */
  /* Set UMN logo image taller than the header */
  height: 160px;
  width: auto;
  display: block;
  /* Bayangan agar terlihat 'pop-out' */
  filter: drop-shadow(0 14px 24px rgba(7,40,62,.22));
  z-index: 51; /* Pastikan logo UMN di atas header */
}

/* 5. Wrapper logo GreenMetric (di sebelah kanan 'spacer') */
#site-header .logo .header-badges {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-left: 0px; /* Jarak kecil dari 'spacer' UMN */
}

/* 6. Gambar logo GreenMetric */
#site-header .logo .header-badges img {
  height: 70px; /* Set the GreenMetric logo height */
  width: auto;
  display: block;
}

/* ===== Perapihan Responsive (Contoh) ===== */
/* Adjust hanging logo size on small screens */
@media (max-width: 768px) {

  /* TAMBAHAN: Kurangi padding header agar logo lebih 'mentok' */
  #site-header .mainbar-inner {
    padding-left: 16px;
    padding-right: 16px;
  }

  /* MODIFIKASI: Sesuaikan 'spacer' logo gantung */
  #site-header .logo .logo-badge {
    width: 120px;
    height: 60px;
  }

  /* MODIFIKASI: Atur ulang logo gantung UMN */
  #site-header .logo .logo-badge img {
    height: 135px; /* Sedikit lebih besar */
    left: -10px;   /* Kurangi 'gantungan' agar tidak terlalu ke kiri */
  }

  /* MODIFIKASI: Perbesar logo GreenMetric */
  #site-header .logo .header-badges img {
    height: 40px; /* Perbesar dari 32px agar lebih jelas */
  }
}
/* Hapus CSS sisa dari layout 'gantung' */
#site-header #menu .menu-item > a {
  padding-right: 0;
}
#site-header #menu .menu-toggle {
  right: auto;
}

/* ===== BLOK RESPONSIVE MASTER (Mulai dari sini) ===== */

/* --- 1. DEFAULT STATE (Sembunyikan elemen mobile di semua ukuran) --- */
#site-header .mobile-menu-toggle {
    display: none;
}
#site-header .mobile-menu {
    display: none;
}


/* --- 2. ATURAN MOBILE & TABLET (1200px ke bawah) --- */
@media (max-width: 1200px) {

    /* Sembunyikan elemen desktop */
    #site-header .topbar {
        display: none !important;
    }
    #site-header nav#menu.desktop-nav {
        display: none !important;
    }

    /* Tampilkan (PAKSA) elemen mobile */
    #site-header .mobile-menu-toggle {
        display: block; /* Paksa tampil */
        background: none;
        border: none;
        cursor: pointer;
        color: #FFFFFF !important; /* Paksa warna ikon */
        padding: 10px;
        opacity: 1 !important;
        visibility: visible !important;
        z-index: 101; /* Pastikan di atas elemen lain */
    }
    
    /* Paksa ikon SVG di dalamnya untuk diisi warna putih */
    #site-header .mobile-menu-toggle svg {
        fill: #FFFFFF !important;
        width: 28px;
        height: 28px;
    }
}


/* --- 3. ATURAN DESKTOP (1025px ke atas) --- */
@media (min-width: 1025px) {
    
    /* Tampilkan elemen desktop */
    #site-header .topbar {
        display: block;
    }
    #site-header nav#menu.desktop-nav {
        display: flex; /* 'flex' agar menu horizontal */
    }

    /* Sembunyikan (paksa) elemen mobile di desktop */
    #site-header .mobile-menu-toggle {
        display: none !important;
    }
    #site-header .mobile-menu {
        display: none !important;
    }
}


/* --- 4. STYLING KONTAINER MOBILE --- */
#site-header .mobile-menu {
    background: #fff;
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
    position: absolute;
    top: 100%; 
    left: 0;
    right: 0;
    z-index: 100;
    display: none; 
}

#site-header .mobile-menu.is-open {
    display: block; /* Tampilkan menu */
}

/* Styling link di dalam menu mobile */
#site-header .mobile-menu-main,
#site-header .mobile-menu-topbar {
    display: flex;
    flex-direction: column;
    padding: 1rem;
    margin: 0;
}
#site-header .mobile-menu-main {
    border-bottom: 1px solid #eee;
}
#site-header .mobile-menu a,
#site-header .mobile-menu span {
    display: block;
    padding: 0.8rem 0.5rem;
    color: #333;
    text-decoration: none;
    font-weight: 600;
}
#site-header .mobile-menu .menu-item-sub a {
    font-weight: 400;
    font-size: 0.9em;
    padding-left: 1.5rem;
}
#site-header .mobile-menu .menu-code {
    font-size: 0.8em;
    opacity: 0.7;
    display: inline;
}
#site-header .mobile-menu-topbar {
    font-size: 0.9em;
}
#site-header .mobile-menu-topbar a {
    font-weight: 400;
    color: #555;
}
/* ===== BLOK RESPONSIVE MASTER (Selesai) ===== */


/* --- Override custom style --- */
#site-header .mobile-menu-toggle {
  position: relative; /* atau biarkan apa adanya kalau sudah diatur */
  z-index: 2000;
}