/* Wanhelp nav award polish — 2026-11-04 R4
   Scope: #navbar / .wh-nav. Does not rewrite page body. */

:root {
  --wh-nav-orange: #fa5f02;
  --wh-nav-orange-deep: #e05500;
  --wh-nav-ink: #1f2937;
  --wh-nav-mute: #4b5563;
  --wh-nav-line: rgba(31, 41, 55, 0.08);
  --wh-nav-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* —— bar shell —— */
#navbar.wh-nav {
  isolation: isolate;
  transition: background-color 0.35s var(--wh-nav-ease),
              box-shadow 0.35s var(--wh-nav-ease),
              border-color 0.35s var(--wh-nav-ease),
              backdrop-filter 0.35s var(--wh-nav-ease);
}

/* Hero transparent: soft scrim so logo/links survive video */
#navbar.wh-nav--hero.bg-transparent::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    rgba(12, 14, 18, 0.55) 0%,
    rgba(12, 14, 18, 0.28) 55%,
    rgba(12, 14, 18, 0.08) 100%
  );
}

#navbar.wh-nav.is-scrolled,
#navbar.wh-nav.bg-white,
#navbar.wh-nav--solid {
  background-color: rgba(255, 255, 255, 0.92) !important;
  backdrop-filter: saturate(1.2) blur(14px);
  -webkit-backdrop-filter: saturate(1.2) blur(14px);
  border-bottom: 1px solid var(--wh-nav-line);
  box-shadow: 0 8px 28px rgba(17, 24, 39, 0.06);
}

#navbar.wh-nav .wh-nav-bar {
  display: grid !important;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  column-gap: 1.5rem;
  min-height: 72px;
  height: 72px;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  box-sizing: border-box;
}
#navbar.wh-nav .wh-nav-logo-link {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  line-height: 0;
}
#navbar.wh-nav .wh-nav-logo {
  width: 137px !important;
  height: 48px !important;
  max-height: 48px !important;
  object-fit: contain;
}
#navbar.wh-nav .wh-nav-bar > nav[aria-label="主要導航"] {
  justify-self: center;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 1.75rem !important;
  margin: 0 !important;
}
@media (min-width: 768px) {
  #navbar.wh-nav .wh-nav-bar > nav[aria-label="主要導航"] {
    display: flex !important;
  }
}
/* kill Tailwind space-x margin variance */
#navbar.wh-nav .wh-nav-bar > nav[aria-label="主要導航"] > * + * {
  margin-left: 0 !important;
}
#navbar.wh-nav .wh-nav-end {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 44px;
}
#navbar.wh-nav .wh-nav-actions {
  display: none;
  align-items: center;
  gap: 0.75rem;
}
@media (min-width: 768px) {
  #navbar.wh-nav .wh-nav-actions {
    display: flex !important;
  }
}

/* Logo contrast on hero — keep orange smile; lift with shadows instead of invert */
#navbar.wh-nav--hero.bg-transparent .wh-nav-logo {
  filter:
    drop-shadow(0 0 0.5px rgba(255, 255, 255, 0.95))
    drop-shadow(0 1px 2px rgba(0, 0, 0, 0.55))
    drop-shadow(0 6px 16px rgba(0, 0, 0, 0.35));
  transition: filter 0.3s var(--wh-nav-ease);
}
#navbar.wh-nav.is-scrolled .wh-nav-logo,
#navbar.wh-nav.bg-white .wh-nav-logo,
#navbar.wh-nav--solid .wh-nav-logo {
  filter: none;
}

#navbar.wh-nav .wh-nav-logo {
  height: 2.75rem;
  width: auto;
  display: block;
}

/* Content links — quieter tracking for CJK, clearer hit area */
#navbar.wh-nav nav[aria-label="主要導航"] {
  gap: 0.15rem 1.35rem;
  column-gap: 1.35rem;
}
@media (min-width: 1024px) {
  #navbar.wh-nav nav[aria-label="主要導航"] {
    column-gap: 1.75rem;
  }
}
#navbar.wh-nav nav[aria-label="主要導航"] .nav-link {
  letter-spacing: 0.01em;
  font-weight: 500;
  padding: 0.55rem 0.35rem;
  line-height: 1.2;
}
#navbar.wh-nav nav[aria-label="主要導航"] .nav-link:after {
  height: 2px;
  border-radius: 999px;
  bottom: 0.15rem;
}
#navbar.wh-nav nav[aria-label="主要導航"] .nav-link[aria-current="page"]:after {
  width: 75%;
}

/* Auth = secondary action chip (not same as content links) */
#navbar.wh-nav .nav-auth {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.5rem;
  padding: 0.45rem 0.95rem;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.2;
  border-radius: 999px;
  border: 1px solid transparent;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.25s var(--wh-nav-ease),
              background-color 0.25s var(--wh-nav-ease),
              border-color 0.25s var(--wh-nav-ease),
              box-shadow 0.25s var(--wh-nav-ease);
}
#navbar.wh-nav--hero.bg-transparent .nav-auth {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.38);
  background: rgba(255, 255, 255, 0.06);
}
#navbar.wh-nav--hero.bg-transparent .nav-auth:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.55);
  color: #fff;
}
#navbar.wh-nav.is-scrolled .nav-auth,
#navbar.wh-nav.bg-white .nav-auth,
#navbar.wh-nav--solid .nav-auth {
  color: var(--wh-nav-ink);
  border-color: rgba(31, 41, 55, 0.14);
  background: rgba(255, 255, 255, 0.7);
}
#navbar.wh-nav.is-scrolled .nav-auth:hover,
#navbar.wh-nav.bg-white .nav-auth:hover,
#navbar.wh-nav--solid .nav-auth:hover {
  border-color: rgba(250, 95, 2, 0.45);
  color: var(--wh-nav-orange);
  background: #fff7f2;
}

/* Primary CTA */
#navbar.wh-nav .nav-cta.btn-primary,
#navbar.wh-nav a.nav-cta {
  min-height: 2.75rem;
  padding: 0.65rem 1.35rem;
  border-radius: 999px;
  font-weight: 600;
  letter-spacing: 0.02em;
  box-shadow: 0 8px 20px rgba(250, 95, 2, 0.28);
  transition: transform 0.25s var(--wh-nav-ease),
              box-shadow 0.25s var(--wh-nav-ease),
              background-color 0.25s var(--wh-nav-ease);
}
#navbar.wh-nav .nav-cta.btn-primary:hover,
#navbar.wh-nav a.nav-cta:hover {
  background-color: var(--wh-nav-orange-deep);
  box-shadow: 0 10px 24px rgba(250, 95, 2, 0.36);
  transform: translateY(-1px);
}
#navbar.wh-nav .nav-cta.btn-primary:active,
#navbar.wh-nav a.nav-cta:active {
  transform: translateY(0);
  box-shadow: 0 4px 12px rgba(250, 95, 2, 0.24);
}


/* Toggle — 桌面必須隱藏（勿用 display:inline-flex 蓋掉 Tailwind md:hidden） */
#navbar.wh-nav .wh-nav-toggle {
  width: 2.75rem;
  height: 2.75rem;
  display: none;
  align-items: center;
  justify-content: center;
  border-radius: 0.75rem;
  border: 1px solid transparent;
  transition: background-color 0.2s var(--wh-nav-ease),
              border-color 0.2s var(--wh-nav-ease),
              color 0.2s var(--wh-nav-ease);
}
@media (max-width: 767.98px) {
  #navbar.wh-nav .wh-nav-toggle {
    display: inline-flex;
  }
}
@media (min-width: 768px) {
  #navbar.wh-nav .wh-nav-toggle {
    display: none !important;
    position: absolute !important;
    width: 0 !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    overflow: hidden !important;
    pointer-events: none !important;
  }
  #navbar.wh-nav .wh-nav-mobile {
    display: none !important;
  }
}
#navbar.wh-nav--hero.bg-transparent .wh-nav-toggle {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.08);
}
#navbar.wh-nav.is-scrolled .wh-nav-toggle,
#navbar.wh-nav.bg-white .wh-nav-toggle,
#navbar.wh-nav--solid .wh-nav-toggle {
  color: var(--wh-nav-ink);
  border-color: rgba(31, 41, 55, 0.12);
  background: #fff;
}
#navbar.wh-nav .wh-nav-toggle:hover {
  border-color: rgba(250, 95, 2, 0.4);
  color: var(--wh-nav-orange);
}
#navbar.wh-nav .wh-nav-toggle:focus-visible {
  outline: 2px solid rgba(250, 95, 2, 0.75);
  outline-offset: 2px;
}

/* Focus rings */
#navbar.wh-nav .nav-link:focus-visible,
#navbar.wh-nav .nav-auth:focus-visible,
#navbar.wh-nav .nav-cta:focus-visible {
  outline: 2px solid rgba(250, 95, 2, 0.75);
  outline-offset: 3px;
}

/* Mobile sheet */
#navbar.wh-nav .wh-nav-mobile {
  border-top: 1px solid var(--wh-nav-line);
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 18px 40px rgba(17, 24, 39, 0.12);
}
#navbar.wh-nav .wh-nav-mobile .wh-nav-mobile-inner {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding-top: 0.75rem;
  padding-bottom: 1.1rem;
}
#navbar.wh-nav .wh-nav-mobile a:not(.nav-cta):not(.wh-nav-mobile-cta) {
  display: block;
  padding: 0.85rem 0.35rem;
  font-size: 1rem;
  font-weight: 500;
  color: var(--wh-nav-ink);
  border-radius: 0.65rem;
  transition: background-color 0.2s var(--wh-nav-ease), color 0.2s var(--wh-nav-ease);
}
#navbar.wh-nav .wh-nav-mobile a:not(.nav-cta):not(.wh-nav-mobile-cta):hover {
  background: #fff7f2;
  color: var(--wh-nav-orange);
}
#navbar.wh-nav .wh-nav-mobile .wh-nav-mobile-cta {
  margin-top: 0.65rem;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  border-radius: 999px;
  background: var(--wh-nav-orange);
  color: #fff !important;
  font-weight: 600;
  box-shadow: 0 8px 20px rgba(250, 95, 2, 0.28);
}
#navbar.wh-nav .wh-nav-mobile .wh-nav-mobile-auth {
  margin-top: 0.25rem;
  border: 1px solid rgba(31, 41, 55, 0.12);
  text-align: center;
  font-weight: 600 !important;
}

@media (prefers-reduced-motion: reduce) {
  #navbar.wh-nav,
  #navbar.wh-nav .nav-auth,
  #navbar.wh-nav .nav-cta,
  #navbar.wh-nav .wh-nav-logo,
  #navbar.wh-nav .nav-link {
    transition: none !important;
  }
  #navbar.wh-nav .nav-cta:hover {
    transform: none;
  }
}
