/* AAIS Medan Header Refined v6.0
   Clean institutional polish. Sticky positions remain controlled by v5.0. */
body.aais-site{
  --aais-h-navy:#122848;
  --aais-h-gold:#c69734;
  --aais-h-gold-light:#e3c56e;
  --aais-h-ink:#122848;
  --aais-h-muted:#6d7d91;
}

/* Utility bar: richer gold, still compact. */
body.aais-site .utility-bar{
  overflow:hidden;
  background:linear-gradient(90deg,#b27e20 0%,#c89834 32%,#d9b75b 52%,#c89834 72%,#ad7920 100%)!important;
  border-bottom:1px solid rgba(255,255,255,.16);
  box-shadow:none!important;
}
body.aais-site .utility-bar::after{
  content:"";
  position:absolute;
  inset:0;
  pointer-events:none;
  background:linear-gradient(180deg,rgba(255,255,255,.12),transparent 70%);
}
body.aais-site .utility-inner{
  position:relative;
  z-index:1;
}

/* Masthead: clean white institutional header, no oversized dashboard panel. */
body.aais-site .masthead{
  background:rgba(255,255,255,.97)!important;
  border-bottom:1px solid rgba(18,40,72,.08)!important;
  box-shadow:0 8px 24px rgba(18,40,72,.055)!important;
  -webkit-backdrop-filter:blur(10px);
  backdrop-filter:blur(10px);
}
body.aais-site .masthead-inner{
  min-height:96px;
  gap:24px;
}
body.aais-site .brand{
  gap:15px;
  align-items:center;
}
body.aais-site .brand img{
  width:72px;
  height:72px;
  object-fit:contain;
  padding:3px;
  border-radius:50%;
  background:#fff;
  border:1px solid rgba(198,151,52,.22);
  box-shadow:0 8px 20px rgba(18,40,72,.07);
}
body.aais-site .brand strong{
  color:var(--aais-h-navy)!important;
  font-size:clamp(28px,2.2vw,34px);
  line-height:1.02;
  letter-spacing:-.035em;
}
body.aais-site .brand small{
  margin-top:5px;
  color:var(--aais-h-muted)!important;
  font-size:13px;
  letter-spacing:.01em;
}

/* Actions: retain original layout; add only subtle separation and hover. */
body.aais-site .masthead-actions{
  display:flex;
  align-items:center;
  gap:14px;
  padding:0;
  background:transparent!important;
  border:0!important;
  border-radius:0!important;
  box-shadow:none!important;
}
body.aais-site .masthead-link{
  position:relative;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:44px;
  padding:0 10px;
  color:var(--aais-h-navy)!important;
  font-weight:700;
  border-radius:10px;
  transition:background-color .18s ease,color .18s ease,transform .18s ease;
}
body.aais-site .masthead-link::after{
  content:"";
  position:absolute;
  left:10px;right:10px;bottom:5px;
  height:2px;
  border-radius:999px;
  background:var(--aais-h-gold);
  transform:scaleX(0);
  transform-origin:center;
  transition:transform .18s ease;
}
body.aais-site .masthead-link:hover{
  background:rgba(18,40,72,.035)!important;
  transform:translateY(-1px);
}
body.aais-site .masthead-link:hover::after{transform:scaleX(1)}

body.aais-site .gold-button{
  min-height:50px;
  padding:0 26px;
  border-radius:10px!important;
  background:linear-gradient(135deg,#b67f1d 0%,#d1a03b 56%,#e7c46e 100%)!important;
  color:#fff!important;
  border:1px solid rgba(157,108,20,.22)!important;
  box-shadow:0 10px 24px rgba(183,128,30,.18)!important;
  font-weight:800;
  transition:transform .2s ease,box-shadow .2s ease,filter .2s ease;
}
body.aais-site .gold-button:hover{
  transform:translateY(-2px);
  filter:saturate(1.04);
  box-shadow:0 14px 28px rgba(183,128,30,.24)!important;
}

/* Language switch: subtle framed control only. */
body.aais-site .aais-lang-switch.aais-lang-header{
  border:1px solid rgba(18,40,72,.10)!important;
  border-radius:12px!important;
  background:#fff!important;
  box-shadow:0 6px 16px rgba(18,40,72,.045)!important;
}

/* Nav band: premium gold surface, no bulky pills. */
body.aais-site .navband{
  background:linear-gradient(90deg,#b37f22 0%,#c39431 24%,#d5b353 50%,#c39431 76%,#b37f22 100%)!important;
  border-top:1px solid rgba(255,255,255,.13)!important;
  border-bottom:1px solid rgba(18,40,72,.08)!important;
  box-shadow:0 6px 18px rgba(18,40,72,.07)!important;
}
body.aais-site .navlinks{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  padding:12px 0;
}
body.aais-site .navlinks>a{
  position:relative;
  min-height:40px;
  padding:0 14px!important;
  border-radius:8px!important;
  color:#fff!important;
  font-weight:800;
  letter-spacing:.015em;
  background:transparent!important;
  box-shadow:none!important;
  transition:background-color .18s ease,transform .18s ease;
}
body.aais-site .navlinks>a:hover{
  background:rgba(255,255,255,.10)!important;
  transform:translateY(-1px);
}
body.aais-site .navlinks>a::after{
  content:"";
  position:absolute;
  left:14px;right:14px;bottom:5px;
  height:2px;
  border-radius:999px;
  background:rgba(255,255,255,.88);
  transform:scaleX(0);
  transition:transform .18s ease;
}
body.aais-site .navlinks>a:hover::after{transform:scaleX(1)}

/* Do not style mobile CTA as normal nav underline. */
body.aais-site .navlinks .navlinks-mobile-cta::after{display:none}

/* Scrolled state: slightly denser but still clean. */
body.aais-site.aais-header-scrolled .masthead{
  box-shadow:0 6px 18px rgba(18,40,72,.09)!important;
}
body.aais-site.aais-header-scrolled .navband{
  box-shadow:0 9px 22px rgba(18,40,72,.11)!important;
}

@media(max-width:1024px){
  body.aais-site .masthead-inner{min-height:88px}
  body.aais-site .brand img{width:64px;height:64px}
  body.aais-site .brand strong{font-size:29px}
  body.aais-site .masthead-actions{gap:8px}
  body.aais-site .masthead-link{padding:0 8px}
  body.aais-site .gold-button{padding:0 20px}
  body.aais-site .navlinks{gap:4px}
  body.aais-site .navlinks>a{padding:0 10px!important}
}

@media(max-width:767px){
  body.aais-site .masthead-inner{min-height:78px}
  body.aais-site .brand{gap:10px}
  body.aais-site .brand img{
    width:52px;height:52px;padding:2px;
    box-shadow:0 6px 14px rgba(18,40,72,.06);
  }
  body.aais-site .brand strong{font-size:clamp(20px,5.6vw,26px)}
  body.aais-site .brand small{font-size:10px}
  body.aais-site .masthead-actions{background:transparent!important;border:0!important;box-shadow:none!important}
  body.aais-site .navlinks{
    justify-content:flex-start;
    gap:0;
    padding:12px 16px 18px;
  }
  body.aais-site .navlinks>a{
    width:100%;
    min-height:44px;
    justify-content:flex-start;
    padding:0 12px!important;
    border-radius:10px!important;
  }
  body.aais-site .navlinks>a::after{display:none}
}

@media(prefers-reduced-motion:reduce){
  body.aais-site .masthead-link,
  body.aais-site .masthead-link::after,
  body.aais-site .gold-button,
  body.aais-site .navlinks>a,
  body.aais-site .navlinks>a::after{transition:none!important}
}

/* ======================================================================
   AAIS v7.9 — MOBILE HEADER RESCUE
   Fixes mobile nav accidentally forced open by the desktop refined header.
   ====================================================================== */
@media (max-width:767px){
  /* IMPORTANT: hamburger menu must stay closed until JS adds .is-open */
  body.aais-site .navband .navlinks{
    display:none!important;
    width:100%!important;
    margin:0!important;
    padding:0!important;
  }

  body.aais-site .navband .navlinks.is-open{
    display:flex!important;
    flex-direction:column!important;
    align-items:stretch!important;
    justify-content:flex-start!important;
    gap:5px!important;
    position:absolute!important;
    top:100%!important;
    left:0!important;
    right:0!important;
    width:100%!important;
    padding:12px 14px 18px!important;
    border-top:1px solid rgba(18,40,72,.07)!important;
    background:rgba(255,255,255,.985)!important;
    -webkit-backdrop-filter:blur(18px) saturate(140%);
    backdrop-filter:blur(18px) saturate(140%);
    box-shadow:0 18px 34px rgba(18,40,72,.14)!important;
    max-height:calc(100dvh - var(--aais-sticky-total) - 12px)!important;
    overflow-y:auto!important;
    overscroll-behavior:contain;
  }

  body.aais-site .navband .navlinks.is-open > a:not(.navlinks-mobile-cta){
    display:flex!important;
    align-items:center!important;
    width:100%!important;
    min-height:48px!important;
    padding:0 14px!important;
    margin:0!important;
    color:#122848!important;
    background:#fff!important;
    border:1px solid rgba(18,40,72,.075)!important;
    border-radius:13px!important;
    box-shadow:0 3px 10px rgba(18,40,72,.035)!important;
    font-size:13px!important;
    line-height:1.25!important;
    font-weight:750!important;
    opacity:1!important;
  }

  body.aais-site .navband .navlinks.is-open > a:not(.navlinks-mobile-cta):active{
    background:#f7f3e9!important;
  }

  body.aais-site .navband .navlinks.is-open > a::after{
    display:none!important;
  }

  body.aais-site .navband .navlinks.is-open > .navlinks-mobile-cta{
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    min-height:50px!important;
    margin-top:5px!important;
    padding:0 16px!important;
    color:#fff!important;
    background:linear-gradient(135deg,#b67f1d,#d1a03b 58%,#e7c46e)!important;
    border-radius:13px!important;
    font-size:13px!important;
    font-weight:800!important;
    box-shadow:0 8px 18px rgba(183,128,30,.18)!important;
  }

  /* Language selector already lives in the real masthead on mobile. */
  body.aais-site .navband .aais-lang-switch.aais-lang-nav{
    display:none!important;
  }

  /* When menu is closed the gold navband must not create a blank strip. */
  body.aais-site .navband{
    min-height:0!important;
  }
  body.aais-site .navband > .container{
    min-height:0!important;
  }

  /* Keep the mobile header compact and readable. */
  body.aais-site .masthead-inner{
    padding-top:10px!important;
    padding-bottom:10px!important;
  }
}
