/* BT — professional header menu (desktop). Pill hover, animated underline, glowing active item. */
@media (min-width: 922px) {
  /* Give the header room so all items stay on one line. */
  .ast-primary-header-bar .site-primary-header-wrap.ast-container,
  .ast-primary-header-bar .ast-builder-grid-row-container { max-width: 1360px !important; }
  .ast-primary-header-bar .ast-builder-grid-row { grid-template-columns: auto 1fr !important; column-gap: 24px; }

  #ast-hf-menu-1 { flex-wrap: nowrap !important; align-items: center; gap: 4px; }
  #ast-hf-menu-1 > .menu-item { margin: 0 !important; }
  #ast-hf-menu-1 > .menu-item > .menu-link {
    position: relative; display: inline-flex; align-items: center;
    padding: 9px 15px !important; border-radius: 999px;
    font-size: 15.5px !important; font-weight: 600; line-height: 1.4 !important;
    white-space: nowrap; letter-spacing: 0;
    color: #c9d6e8 !important;
    transition: color .25s ease, background-color .25s ease, box-shadow .25s ease, transform .25s ease;
  }
  html:not([data-bt-lang="en"]) #ast-hf-menu-1 > .menu-item > .menu-link { font-family: Vazirmatn, "BT Estedad", Tahoma, sans-serif; }

  /* underline that grows from the centre */
  #ast-hf-menu-1 > .menu-item > .menu-link::after {
    content: ""; position: absolute; left: 50%; right: 50%; bottom: 3px; height: 2px; border-radius: 2px;
    background: linear-gradient(90deg, #5ec8ff, #2b7cff);
    transition: left .3s cubic-bezier(.2,.8,.2,1), right .3s cubic-bezier(.2,.8,.2,1);
  }
  #ast-hf-menu-1 > .menu-item > .menu-link:hover,
  #ast-hf-menu-1 > .menu-item > .menu-link:focus-visible {
    color: #fff !important; background: rgba(94,200,255,.09);
    transform: translateY(-1px);
  }
  #ast-hf-menu-1 > .menu-item > .menu-link:hover::after,
  #ast-hf-menu-1 > .menu-item > .menu-link:focus-visible::after { left: 16px; right: 16px; }

  /* current page: soft glowing pill */
  #ast-hf-menu-1 > .current-menu-item > .menu-link,
  #ast-hf-menu-1 > .current_page_item > .menu-link {
    color: #fff !important;
    background: linear-gradient(135deg, rgba(43,124,255,.28), rgba(94,200,255,.14));
    box-shadow: inset 0 0 0 1px rgba(94,200,255,.35), 0 6px 18px rgba(43,124,255,.22);
  }
  #ast-hf-menu-1 > .current-menu-item > .menu-link::after,
  #ast-hf-menu-1 > .current_page_item > .menu-link::after { display: none; }
  /* On the one-page home, hash links all count as "current" — only highlight Home there. */
  .home #ast-hf-menu-1 > .current-menu-item:not(:first-child) > .menu-link {
    background: transparent; box-shadow: none; color: #c9d6e8 !important;
  }
  .home #ast-hf-menu-1 > .current-menu-item:not(:first-child) > .menu-link::after { display: block; }

  /* gentle entrance */
  #ast-hf-menu-1 > .menu-item { animation: btNavIn .5s cubic-bezier(.2,.8,.2,1) both; }
  #ast-hf-menu-1 > .menu-item:nth-child(2) { animation-delay: .04s; }
  #ast-hf-menu-1 > .menu-item:nth-child(3) { animation-delay: .08s; }
  #ast-hf-menu-1 > .menu-item:nth-child(4) { animation-delay: .12s; }
  #ast-hf-menu-1 > .menu-item:nth-child(5) { animation-delay: .16s; }
  #ast-hf-menu-1 > .menu-item:nth-child(6) { animation-delay: .20s; }
  #ast-hf-menu-1 > .menu-item:nth-child(7) { animation-delay: .24s; }
  #ast-hf-menu-1 > .menu-item:nth-child(8) { animation-delay: .28s; }
  #ast-hf-menu-1 > .menu-item:nth-child(n+9) { animation-delay: .32s; }
  @keyframes btNavIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

  /* the inner-page language button is moved into the header row by nav.js, so it never covers the menu */
  .site-header-primary-section-right { flex-wrap: nowrap !important; min-width: 0; }
  .site-header-primary-section-right > .bhr-lang-btn--sw {
    position: static !important; transform: none !important; margin: 0 !important; margin-inline-start: 14px !important;
    flex: 0 0 auto; white-space: nowrap;
  }
  .ast-primary-header-bar .site-title, .ast-primary-header-bar .site-title a { white-space: nowrap; }
  .ast-header-social-wrap .header-social-inner-wrap { display: flex; flex-wrap: nowrap; align-items: center; gap: 2px; }

  /* social icons: same hover language */
  .ast-header-social-wrap .ast-builder-social-element {
    border-radius: 50%; padding: 7px !important; transition: background-color .25s, transform .25s;
  }
  .ast-header-social-wrap .ast-builder-social-element:hover { background: rgba(94,200,255,.12); transform: translateY(-2px); }
  .ast-header-social-wrap .ast-builder-social-element:hover svg { fill: #5ec8ff !important; }
}

/* smaller laptops / narrow windows: tighten so everything stays on one row */
@media (min-width: 922px) and (max-width: 1280px) {
  #ast-hf-menu-1 > .menu-item > .menu-link { padding: 8px 10px !important; font-size: 14px !important; }
  .ast-primary-header-bar .site-title, .ast-primary-header-bar .site-title a { font-size: 17px !important; }
  .ast-primary-header-bar .ast-header-social-wrap { display: none !important; } /* social links remain in the Contact section */
}
@media (min-width: 922px) and (max-width: 1100px) {
  #ast-hf-menu-1 { gap: 0; }
  #ast-hf-menu-1 > .menu-item > .menu-link { padding: 7px 8px !important; font-size: 13.5px !important; }
  .ast-primary-header-bar .site-title, .ast-primary-header-bar .site-title a { font-size: 15px !important; }
  .ast-primary-header-bar .ast-builder-grid-row { column-gap: 12px; }
}
@media (min-width: 922px) and (max-width: 1000px) {
  .ast-primary-header-bar .site-title, .ast-primary-header-bar .site-title a { white-space: normal; line-height: 1.25 !important; }
  .ast-primary-header-bar .site-branding { max-width: 170px; }
  #ast-hf-menu-1 > .menu-item > .menu-link { padding: 6px 7px !important; font-size: 13px !important; }
}

@media (prefers-reduced-motion: reduce) {
  #ast-hf-menu-1 > .menu-item { animation: none !important; }
  #ast-hf-menu-1 > .menu-item > .menu-link, #ast-hf-menu-1 > .menu-item > .menu-link::after { transition: none !important; }
}

/* language button: keep its text visible after it is clicked (theme focus style turned it dark) */
.bhr-lang-btn:focus, .bhr-lang-btn:active, .bhr-lang-btn:hover { color: #5ec8ff !important; }
.bhr-lang-btn:focus-visible { outline: 2px solid #5ec8ff; outline-offset: 2px; }
