/* ==========================================================================
   Honor Group Bar — v1.0
   A shared cross-site top bar for the four Honor Holding websites.

   Ships as this one stylesheet plus the markup in /snippets.
   Every colour is a custom property set by [data-host], so the bar adopts
   each site's own ink. Nothing else in this file changes between sites.

   Class prefix: .hgb  (namespaced to avoid collisions with host site CSS)
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Per-site tokens
   -------------------------------------------------------------------------- */
.hgb {
  --hgb-bg: #0b0d10;          /* bar background      */
  --hgb-fg: #ffffff;          /* primary text        */
  --hgb-muted: #9aa0a8;       /* secondary text      */
  --hgb-accent: #ffffff;      /* mark, arrow, focus  */
  --hgb-height: 44px;
  --hgb-font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.hgb[data-host="pro"] {
  --hgb-bg: #0f1720;
  --hgb-fg: #ffffff;
  --hgb-muted: #93a0b4;
  --hgb-accent: #ff5a1f;
}

.hgb[data-host="prime"] {
  --hgb-bg: #013f3b;
  --hgb-fg: #e9f6f4;
  --hgb-muted: #8cc6bf;
  --hgb-accent: #3fcfc2;
}

.hgb[data-host="tech"] {
  --hgb-bg: #1c1526;
  --hgb-fg: #f5f3f8;
  --hgb-muted: #a399b8;
  --hgb-accent: #c6f03c;
}

.hgb[data-host="holding"] {
  --hgb-bg: #000000;
  --hgb-fg: #ffffff;
  --hgb-muted: #8e8e8e;
  --hgb-accent: #ffffff;
}

/* --------------------------------------------------------------------------
   2. Bar shell
   -------------------------------------------------------------------------- */
.hgb {
  position: relative;
  z-index: 1000;
  background: var(--hgb-bg);
  color: var(--hgb-fg);
  font-family: var(--hgb-font);
  font-size: 12.5px;
  line-height: 1;
  -webkit-font-smoothing: antialiased;
}

.hgb *,
.hgb *::before,
.hgb *::after {
  box-sizing: border-box;
}

.hgb__inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  height: var(--hgb-height);
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 24px;
}

/* --------------------------------------------------------------------------
   3. Left — mark + slogan
   -------------------------------------------------------------------------- */
.hgb__brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--hgb-fg);
  font-weight: 600;
  letter-spacing: -0.005em;
  text-decoration: none;
  white-space: nowrap;
}

.hgb__brand:hover .hgb__slogan,
.hgb__brand:focus-visible .hgb__slogan {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.hgb__mark {
  width: 21px;
  height: 16px;
  flex: none;
  color: var(--hgb-accent);
}

/* --------------------------------------------------------------------------
   4. Centre — the site switch
   -------------------------------------------------------------------------- */
.hgb__list {
  display: flex;
  gap: 2px;
  height: 30px;
  margin: 0;
  padding: 3px;
  list-style: none;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
}

.hgb__list > li {
  display: flex;
}

.hgb__item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 22px;
  padding: 0 13px;
  border-radius: 999px;
  color: var(--hgb-muted);
  font-size: 12px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: background 180ms ease, color 180ms ease;
}

.hgb__item:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--hgb-fg);
}

.hgb__item--current {
  background: var(--hgb-fg);
  color: var(--hgb-bg);
  cursor: default;
}

.hgb__dot {
  width: 6px;
  height: 6px;
  flex: none;
  border-radius: 50%;
  background: currentColor;
  opacity: 0;
  transform: scale(0.5);
  transition: opacity 180ms ease, transform 180ms ease;
}

.hgb__item--current .hgb__dot,
.hgb__item:hover .hgb__dot {
  opacity: 1;
  transform: none;
}

/* Each site's own colour on its dot, legible on the dark bar and on the
   white current-pill alike. */
.hgb__item--pro .hgb__dot { background: #ff5a1f; }
.hgb__item--prime .hgb__dot { background: #2fbdb1; }
.hgb__item--tech .hgb__dot { background: #6a35ff; }
.hgb__item--holding .hgb__dot { background: currentColor; }

/* Brand name beside the category — shown only on the current segment */
.hgb__site {
  display: none;
  font-weight: 400;
  opacity: 0.7;
}

.hgb__item--current .hgb__site {
  display: inline;
}

/* --------------------------------------------------------------------------
   5. Right — the cross-site route
   -------------------------------------------------------------------------- */
.hgb__route {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  justify-self: end;
  min-width: 0;
  color: var(--hgb-muted);
  font-weight: 400;
  text-decoration: none;
  white-space: nowrap;
}

.hgb__route b {
  color: var(--hgb-fg);
  font-weight: 600;
}

.hgb__route:hover b,
.hgb__route:focus-visible b {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.hgb__arrow {
  color: var(--hgb-accent);
  transition: transform 200ms ease;
}

.hgb__route:hover .hgb__arrow {
  transform: translateX(3px);
}

/* The strap repeats the route on small screens */
.hgb__strap {
  display: none;
}

/* --------------------------------------------------------------------------
   6. Keyboard focus
   -------------------------------------------------------------------------- */
.hgb a:focus-visible {
  outline: 2px solid var(--hgb-accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* --------------------------------------------------------------------------
   7. Narrow screens
   Two steps down from the full three-column layout:
   below 1080px the route moves to its own strap so it is never truncated,
   and below 760px the brand drops and the switch takes the full width.
   -------------------------------------------------------------------------- */
@media (max-width: 1079px) {
  .hgb__route {
    display: none;
  }

  .hgb__strap {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 34px;
    padding: 0 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--hgb-muted);
    font-size: 11.5px;
    text-decoration: none;
  }

  .hgb__strap b {
    color: var(--hgb-fg);
    font-weight: 600;
  }

  .hgb__strap .hgb__arrow {
    margin-left: auto;
  }
}

@media (max-width: 760px) {
  .hgb {
    --hgb-height: 50px;
  }

  .hgb__inner {
    grid-template-columns: 1fr;
    padding: 0 12px;
  }

  .hgb__brand {
    display: none;
  }

  .hgb__list {
    width: 100%;
    height: 36px;
  }

  .hgb__list > li {
    flex: 1;
  }

  .hgb__item {
    width: 100%;
    height: 28px;
    justify-content: center;
    gap: 6px;
    padding: 0 6px;
    font-size: 11.5px;
  }

  .hgb__item--current .hgb__site,
  .hgb__item--current .hgb__dot {
    display: none;
  }

  .hgb__strap {
    padding: 0 12px;
  }
}

/* --------------------------------------------------------------------------
   8. Optional: hide on scroll down, return on scroll up (needs group-bar.js)
   -------------------------------------------------------------------------- */
.hgb--sticky {
  position: sticky;
  top: 0;
  transition: transform 260ms ease;
}

.hgb--sticky.hgb--hidden {
  transform: translateY(-100%);
}

/* --------------------------------------------------------------------------
   9. Reduced motion
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .hgb *,
  .hgb--sticky {
    transition: none !important;
  }
}
