/* ==========================================================================
   1. BASE STYLES & MOBILE DEFAULT (Layar < 568px)
   ========================================================================== */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: var(--fd-z-300);
}
.container-nav {
  width: 100%;
}
.site-header {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.header-wrapper-logo {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: var(--color-brand-primary-100);
  width: var(--bs-width-sm);
  box-sizing: border-box;
}

.site-branding {
  display: flex;
  align-items: center;
  gap: 10px;
}

.site-logo img {
  display: block;
  max-height: 40px;
  width: auto;
  height: auto;
}

.header-wrapper {
  margin: 0 auto;
  color: white;
  padding: 0px 10px 0px 10px;

  display: flex;
  justify-content: space-between;
  align-items: center;
  box-sizing: border-box;
  background: #ffff;
  background: linear-gradient(
    0deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(1, 33, 105, 0.43) 100%
  );
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;

  background-color: transparent;

  transition:
    background-color 0.35s ease,
    border-radius 0.35s ease,
    box-shadow 0.35s ease,
    width 0.35s ease,
    padding 0.35s ease;
}

#site-header.scrolled .header-wrapper {
  background-color: #012169;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  box-shadow: var(--fd-shadow-200);
}
#site-header.scrolled .container-nav {
  background-color: var(--color-brand-primary-100);
}
/* --- TOOGLE HAMBURGER  CSS --- */
.menu-toggle-checkbox {
  display: none;
}
.wrapper-hamburger {
  display: flex;
  align-items: center;
  gap: 10px;
}
.menu-toggle-label {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 26px;
  height: 18px;
  background: transparent;
  cursor: pointer;
  z-index: var(--fd-z-500);
}

.menu-toggle-label .hamburger-bar {
  width: 100%;
  height: 2.5px;
  background-color: white;
  transition: var(--fd-transition-base);
  border-radius: 2px;
}

.menu-toggle-checkbox:checked + .menu-toggle-label .hamburger-bar:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}
.menu-toggle-checkbox:checked + .menu-toggle-label .hamburger-bar:nth-child(2) {
  opacity: 0;
}
.menu-toggle-checkbox:checked + .menu-toggle-label .hamburger-bar:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

.menu-container-responsive {
  display: flex;
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  background-color: #eff7f7;
  flex-direction: column;
  padding: 20px;
  box-sizing: border-box;
  box-shadow: var(--fd-shadow-300);
  border-top: 1px solid var(--color-border-default);

  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: var(--fd-transition-base);
  pointer-events: none;
}

.menu-toggle-checkbox:checked ~ .menu-container-responsive {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.menu-left,
.menu-right {
  width: 100%;
}

.menu-left .nav,
.menu-right .nav {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.menu-left .nav {
  margin-bottom: 15px;
}

.menu-left a,
.menu-right a {
  position: relative;
  color: white;
  width: auto;
  padding: 6px 0;
  font-weight: var(--fd-weight-300);
  text-decoration: none;
}

.menu-left a::after,
.menu-right a::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background-color: white;
  transform: translateX(-50%);
  transition: width 0.35s ease;
}

.menu-left a:hover::after,
.menu-right a:hover::after {
  width: 100%;
}

/* Sub-Menu Dropdown Mobile */
.sub-menu {
  display: none;
  list-style: none;
  padding-left: 15px;
  background: transparent;
}

li.menu-open > .sub-menu,
li:focus-within > .sub-menu {
  display: block;
}

/* Language Switcher */
.language-switcher {
  position: relative;
  width: 100%;
}
.customthema-language-current {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: #222222;
  color: #ffffff;
  border-radius: 6px;
  font-size: var(--fd-text-300);
}
.customthema-language-list {
  display: none;
  list-style: none;
  padding: 0;
  margin: 5px 0 0;
  background: var(--color-surface-base);
  border-radius: var(--radius-sm);
  box-shadow: var(--fd-shadow-200);
}
.customthema-language-dropdown.active .customthema-language-list {
  display: block;
}
.customthema-language-list a {
  padding: 8px 12px;
}

/* ==========================================================================
   2. BREAKPOINT SM (>= 568px) 
   ========================================================================== */
@media (min-width: 568px) {
  .header-wrapper-logo {
    height: 93px;
  }
  .site-logo img {
    max-height: 45px;
  }
  .menu-container-responsive {
    padding: 10px 8px 10px 8px;
  }
}

/* ==========================================================================
   3. BREAKPOINT MD (>= 768px) 
   ========================================================================== */
@media (min-width: 768px) {
  .header-wrapper-logo {
    width: 100%;
  }
  .wrapper-hamburger {
    display: none;
  }
  .menu-container-responsive {
    position: static;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 24px 44px 24px 44px;
    background-color: transparent;
    box-shadow: none;
    border-top: none;
    opacity: 1;
    visibility: visible;
    transform: none;
    pointer-events: auto;
  }

  .menu-left {
    margin-right: auto;
    width: auto;
  }
  .menu-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 20px;
    width: auto;
  }
  .menu-left,
  .menu-right {
    display: flex;
    align-items: center;
  }

  .menu-left .nav,
  .menu-right .nav {
    flex-direction: row;
    align-items: center;
    gap: 20px;
    margin-bottom: 0;
  }

  .menu-left a,
  .menu-right a {
    color: white;
    width: auto;
    padding: 6px 0;
    font-weight: var(--fd-weight-300);
    transition: color var(--fd-duration-200) var(--fd-ease-standard);
  }
  /* garis bawah hanya menu utama */
  .menu-left > .nav > li > a::after,
  .menu-right > .nav > li > a::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    transform: translateX(-50%);
    transition: width 0.35s ease;
  }

  .menu-left > .nav > li > a:hover::after,
  .menu-right > .nav > li > a:hover::after {
    width: 100%;
  }

  /* Transformasi Sub-Menu ke Dropdown Melayang */
  .sub-menu {
    display: block;
    position: absolute;
    top: calc(100% + 8px);
    margin-left: -100px;
    min-width: 220px;

    background: #012169;
    padding: 10px 0;

    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);

    border-radius: var(--radius-md);
    box-shadow: var(--surface-overlay-shadow);

    transition: var(--fd-transition-fast);

    z-index: var(--fd-z-500);
  }

  li:hover > .sub-menu,
  li:focus-within > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }

  .sub-menu a {
    position: relative;
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 8px 15px;
    color: white;
    transition: background-color 0.2s ease;
  }
  /* hilangkan animasi garis dropdown */
  .sub-menu a::after {
    display: none;
  }

  .sub-menu a:hover {
    background-color: rgba(255, 255, 255, 0.12);
  }

  /* Kembalikan Language List Melayang */
  .language-switcher {
    width: auto;
  }
  .customthema-language-list {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 100px;
    margin: 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: var(--fd-transition-fast);
    z-index: var(--fd-z-500);
    display: flex;
    flex-direction: column;
  }
  .customthema-language-dropdown.active .customthema-language-list {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }
  .customthema-language-list a:hover {
    background-color: var(--color-surface-sunken);
    color: var(--color-action-primary) !important;
  }
}

/* ==========================================================================
   4. BREAKPOINT LG (>= 1024px) 
   ========================================================================== */
@media (min-width: 1024px) {
  .header-wrapper-logo {
    width: var(--bs-width-lg);
  }
  .site-logo img {
    max-height: 50px;
  }
  .menu-right .nav {
    gap: 28px;
  }
}

/* ==========================================================================
   5. BREAKPOINT XL (>= 1280px) 
   ========================================================================== */
@media (min-width: 1280px) {
  .header-wrapper-logo {
    width: var(--bs-width-xl);
  }
}

/* ==========================================================================
   6. BREAKPOINT 2XL (>= 1536px) 
   ========================================================================== */
@media (min-width: 1536px) {
  .header-wrapper-logo {
    max-width: var(--bs-width-2xl);
  }
}
