/* ============================================================
   HeartEase — shared top-nav skin (canonical, site-wide)
   The one look for <UtilityBar> + <TopNav> on every page: the
   homepage's "flat editorial chrome". Load AFTER the page's own
   <style> so it wins over legacy per-page nav rules (which are
   retained but dead). Depends on tokens from colors_and_type.css;
   bilingual label visibility lives in lang-switch.css; the mobile
   drawer in nav-mobile.css.
   ============================================================ */

/* ---------- Utility bar — flat navy-deep ---------- */
.hh-util { background: var(--brand-navy-deep); border-bottom: none; }
.hh-util__wa, .hh-util__tg, .hh-util__soc { border-radius: 0; border-color: rgba(247,242,233,0.24); }

/* ---------- Nav bar ---------- */
.hh-nav {
  background: transparent;
  border-bottom: none;
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 40px;
  max-width: 1280px; margin: 0 auto;
  position: sticky; top: 0; z-index: 50;
}
/* full-viewport parchment band behind the 1280px content */
.hh-nav::before {
  content: "";
  position: absolute; top: 0; bottom: 0; left: 50%;
  transform: translateX(-50%);
  width: 100vw;
  background: var(--parchment);
  backdrop-filter: none; -webkit-backdrop-filter: none;
  border-bottom: 1px solid var(--rule);
  z-index: -1;
}
.hh-nav__brand { display: inline-flex; align-items: center; gap: 14px; text-decoration: none; }
.hh-nav__logo { height: 42px; width: 42px; object-fit: contain; flex: none; }
.hh-nav__lockup {
  display: grid;
  grid-template-columns: auto auto;
  grid-template-rows: auto auto;
  column-gap: var(--tw-zh-gap, 10px);
  align-items: baseline;
}
.hh-nav__zh {
  grid-column: 1; grid-row: 1;
  font-family: var(--font-serif-cn);
  font-weight: 700; font-size: 24px;
  color: var(--brand-red);
  letter-spacing: -0.02em; line-height: 1;
}
.hh-nav__wordmark {
  grid-column: 2; grid-row: 1;
  font-family: var(--font-display);
  font-weight: 700; font-size: 22px;
  color: var(--tw-nav-accent, var(--brand-navy));
  letter-spacing: -0.01em; line-height: 1;
  transform: translateX(var(--tw-heartease-offset, 0));
}
.hh-nav__sub {
  grid-column: 1 / -1; grid-row: 2;
  margin-top: 7px;
  font-family: var(--font-sans); font-weight: 600; font-size: 10px;
  letter-spacing: 0.26em; color: var(--ink-mute);
}

/* Twin/EN pages: single-language nav — hide the gloss line.
   (Mirrors lang-switch.css so pages that omit it still behave.) */
html:not([data-he-page="bilingual"]) .hh-nav__bi-cn { display: none; }

/* ---------- Links — uppercase editorial, red underline indicator ---------- */
.hh-nav__links { display: flex; align-items: center; gap: clamp(18px, 2.6vw, 34px); list-style: none; margin: 0; padding: 0; }
.hh-nav__links li { display: flex; align-items: center; }
.hh-nav__links a {
  display: inline-flex; align-items: center;
  font-family: var(--font-sans); font-weight: 600; font-size: 14px;
  color: var(--ink); text-decoration: none;
  padding: 6px 0; position: relative;
  transition: color var(--dur-fast) var(--ease-out);
}
.hh-nav__links a:hover { color: var(--brand-red); }
.hh-nav__links a.is-active { color: var(--brand-red); }
.hh-nav__links .hh-nav__bi-en { font-weight: 600; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; white-space: nowrap; }
/* Chinese-primary twins (/zh-hant/): labels are hanzi — keep them at reading size in the TC face, no uppercase tracking */
html[lang="zh-Hant"] .hh-nav__links .hh-nav__bi-en { font-family: var(--font-sans-tc, var(--font-sans-cn)); font-size: 14px; letter-spacing: 0.02em; text-transform: none; }
.hh-nav__links > li > a { padding: 8px 0; }
.hh-nav__links > li > a::after { content: ""; position: absolute; left: 0; right: 100%; bottom: 0; height: 1px; background: var(--brand-red); transition: right var(--dur-base) var(--ease-out); }
.hh-nav__links > li > a:hover::after, .hh-nav__links > li > a.is-active::after { right: 0; }
.hh-nav__bi, .hh-nav__sub { white-space: nowrap; }

/* ---------- CTA button — compact, outlined navy ---------- */
.hh-nav .hh-btn { text-transform: none; letter-spacing: 0.005em; font-size: 14px; padding: 11px 22px; }
.hh-nav .hh-btn--primary { background: transparent; color: var(--brand-navy); box-shadow: inset 0 0 0 1px var(--brand-navy); }
.hh-nav .hh-btn--primary:hover { background: var(--brand-navy); color: #fff; transform: none; }

/* ---------- Dropdown + megamenu ---------- */
.hh-nav__item--has-menu { position: relative; }
.hh-nav__item--has-menu > a { display: inline-flex; align-items: center; gap: 5px; }
.hh-nav__caret { transition: transform 320ms var(--ease-lift, cubic-bezier(0.19,1,0.22,1)); margin-top: 1px; }
.hh-nav__item--has-menu:hover .hh-nav__caret { transform: rotate(180deg); }
.hh-megamenu {
  position: absolute; top: 100%; left: 0;
  padding-top: 18px;
  opacity: 0; visibility: hidden; transform: translateY(10px) scale(0.985); transform-origin: top left; transition: opacity 200ms var(--ease-out) 140ms, transform 260ms var(--ease-out) 140ms, visibility 0s linear 340ms;
  z-index: 60;
}
.hh-nav__item--has-menu:hover .hh-megamenu,
.hh-nav__item--has-menu:focus-within .hh-megamenu { opacity: 1; visibility: visible; transform: translateY(0) scale(1); transition: opacity 240ms var(--ease-out), transform 380ms var(--ease-lift, cubic-bezier(0.19,1,0.22,1)), visibility 0s; }
.hh-megamenu__panel {
  display: grid; grid-template-columns: 1.4fr 1fr;
  width: 640px;
  background: var(--parchment);
  border: 1px solid var(--rule);
  border-top: 3px solid var(--brand-red);
  border-radius: 0;
  box-shadow: 0 24px 56px rgba(2,29,66,0.20);
  overflow: hidden;
}
.hh-megamenu__col { padding: 24px 26px 26px; }
.hh-megamenu__panel--simple { grid-template-columns: 1fr; width: 320px; }
.hh-megamenu--simple { left: auto; right: 0; }
.hh-megamenu__col--ess { background: var(--brand-navy); display: flex; flex-direction: column; }
.hh-megamenu__heading {
  font-family: var(--font-sans);
  font-weight: 700; font-size: 10.5px;
  letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--brand-red);
  margin-bottom: 16px; padding-bottom: 10px;
  border-bottom: 1px solid var(--rule);
  display: flex; align-items: baseline; gap: 8px;
}
.hh-megamenu__col--ess .hh-megamenu__heading { color: var(--brand-gold); border-bottom-color: rgba(247,242,233,0.18); }
.hh-megamenu__heading-cn { font-family: var(--font-serif-cn); font-weight: 400; font-size: 12px; letter-spacing: 0.04em; color: var(--ink-mute); }
.hh-megamenu__col--ess .hh-megamenu__heading-cn { color: rgba(247,242,233,0.5); }
.hh-megamenu__list { list-style: none; margin: 0; padding: 0; }
/* rows must not inherit the top-nav li/a shrink-wrap */
.hh-megamenu .hh-megamenu__list li { display: block; width: 100%; }
.hh-megamenu .hh-megamenu__dest { display: flex; width: 100%; align-items: stretch; }
.hh-megamenu .hh-megamenu__ess { display: flex; width: 100%; align-items: baseline; }
.hh-megamenu__dest {
  display: flex; flex-direction: column; gap: 2px;
  align-items: stretch;
  padding: 9px 10px; margin: 0 -10px;
  border-radius: 3px;
  text-decoration: none;
  transition: background var(--dur-fast) var(--ease-out);
}
.hh-megamenu__dest:hover { background: #fff; }
.hh-megamenu__dest-top { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; width: 100%; }
.hh-megamenu__dest-name { font-family: var(--font-display); font-weight: 700; font-size: 15px; color: var(--brand-navy); line-height: 1.1; white-space: nowrap; }
.hh-megamenu__dest:hover .hh-megamenu__dest-name { color: var(--brand-red); }
.hh-megamenu__dest-cn { font-family: var(--font-serif-cn); font-weight: 700; font-size: 13px; color: var(--brand-red); line-height: 1; white-space: nowrap; flex: none; }
.hh-megamenu__dest-note { font-family: var(--font-sans); font-size: 11px; line-height: 1.35; color: var(--ink-mute); }
/* atlas feature banner */
.hh-megamenu .hh-megamenu__feature {
  display: flex; align-items: center; gap: 16px;
  width: 100%;
  margin: 0 0 18px; padding: 14px 15px;
  background: var(--brand-navy);
  border-radius: 3px;
  text-decoration: none;
  position: relative; overflow: hidden;
  transition: box-shadow var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
.hh-megamenu__feature::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(rgba(247,242,233,0.045) 1px, transparent 1px), linear-gradient(90deg, rgba(247,242,233,0.045) 1px, transparent 1px);
  background-size: 20px 20px;
  mask-image: linear-gradient(105deg, #000 30%, transparent 85%);
  -webkit-mask-image: linear-gradient(105deg, #000 30%, transparent 85%);
}
.hh-megamenu__feature:hover { box-shadow: 0 12px 26px rgba(2,29,66,0.30); transform: translateY(-2px); }
.hh-megamenu__feature-body { position: relative; flex: 1; min-width: 0; }
.hh-megamenu__feature-eyebrow { font-family: var(--font-sans); font-weight: 700; font-size: 9px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--brand-gold); margin-bottom: 5px; }
.hh-megamenu__feature-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.hh-megamenu__feature-name { font-family: var(--font-display); font-weight: 700; font-size: 19px; color: #F7F2E9; line-height: 1.05; white-space: nowrap; }
.hh-megamenu__feature-cn { font-family: var(--font-serif-cn); font-weight: 700; font-size: 14px; color: var(--brand-gold); line-height: 1; flex: none; white-space: nowrap; }
.hh-megamenu__feature-note { font-family: var(--font-sans); font-size: 11px; line-height: 1.3; color: rgba(247,242,233,0.62); margin-top: 3px; }
.hh-megamenu__feature-arrow {
  position: relative; flex: none;
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--brand-red); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; line-height: 1;
  transition: transform 300ms var(--ease-emph), background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.hh-megamenu__feature:hover .hh-megamenu__feature-arrow { transform: translateX(3px); background: var(--brand-gold); color: var(--brand-navy); }
.hh-megamenu__ess {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  padding: 8px 0;
  text-decoration: none;
  border-bottom: 1px solid rgba(247,242,233,0.08);
  transition: padding-left var(--dur-fast) var(--ease-out);
}
.hh-megamenu__ess:hover { padding-left: 4px; }
.hh-megamenu__ess-label { font-family: var(--font-sans); font-weight: 600; font-size: 13px; color: #F7F2E9; white-space: nowrap; }
.hh-megamenu__ess:hover .hh-megamenu__ess-label { color: var(--brand-gold); }
.hh-megamenu__ess-cn { font-family: var(--font-sans-cn); font-size: 11px; color: rgba(247,242,233,0.5); white-space: nowrap; flex: none; }
.hh-megamenu .hh-megamenu__cta { margin-top: 30px; align-self: flex-start; display: inline-flex; align-items: center; gap: 10px; background: #F7F2E9; color: var(--brand-red); padding: 12px 18px; border-radius: 2px; font-family: var(--font-sans); font-weight: 700; font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; text-decoration: none; white-space: nowrap; transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out); }
.hh-megamenu .hh-megamenu__cta span { transition: transform 300ms var(--ease-emph); }
.hh-megamenu .hh-megamenu__cta:hover { background: var(--brand-red); color: #fff; }
.hh-megamenu .hh-megamenu__cta:hover span { transform: translateX(4px); }

/* ---------- Responsive ---------- */
@media (max-width: 1220px) {
  .hh-nav__logo { height: 38px; width: 38px; }
  .hh-nav__zh { font-size: 21px; }
  .hh-nav__wordmark { font-size: 19px; }
  .hh-nav__sub { font-size: 9px; letter-spacing: 0.2em; }
  .hh-nav .hh-btn { padding: 10px 16px; font-size: 13px; }
  .hh-nav__links .hh-nav__bi-en { font-size: 10.5px; letter-spacing: 0.08em; }
  html[lang="zh-Hant"] .hh-nav__links .hh-nav__bi-en { font-size: 13px; letter-spacing: 0.02em; }
}
@media (max-width: 1080px) {
  .hh-nav { padding-left: 24px; padding-right: 24px; }
  .hh-nav__brand { gap: 10px; }
  .hh-nav__links { gap: 15px; }
  .hh-nav__links .hh-nav__bi-en { font-size: 10px; letter-spacing: 0.05em; }
  html[lang="zh-Hant"] .hh-nav__links .hh-nav__bi-en { font-size: 12.5px; letter-spacing: 0.02em; }
  .hh-nav .hh-btn { padding: 9px 13px; font-size: 12.5px; }
}
