/*
  Help Center site header.
  Desktop mega-menus + mobile accordion; compose hc-btn / tokens only.
*/

.hc-header {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  background-color: var(--color-background-nav);
  border-bottom: var(--border-width-default) solid var(--color-border-default);
}

.hc-header__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--spacing-lg);
  min-height: var(--size-header-bar-height);
  padding-block: var(--spacing-lg);
  padding-inline: var(--spacing-9xl);
}

.hc-header__brand-nav {
  display: flex;
  align-items: center;
  gap: var(--spacing-5xl);
  min-width: 0;
}

.hc-header__logo {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-md);
  flex-shrink: 0;
  color: var(--color-text-default);
  text-decoration: none;
}

.hc-header__logo-image {
  display: block;
  width: var(--size-header-logo-width);
  height: var(--size-header-logo-height);
  object-fit: contain;
}

.hc-header__logo-text {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-lg);
  white-space: nowrap;
}

.hc-header__nav {
  display: flex;
  align-items: center;
  gap: var(--spacing-lg);
}

.hc-header__link,
.hc-header__menu-trigger {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-xxs);
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--color-text-default);
  font-family: inherit;
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-regular);
  line-height: var(--line-height-lg);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.hc-header__menu-trigger[aria-expanded="true"],
.hc-header__menu-trigger.is-active {
  color: var(--color-text-primary);
  font-weight: var(--font-weight-medium);
}

.hc-header__logo:focus-visible,
.hc-header__link:focus-visible,
.hc-header__menu-trigger:focus-visible,
.hc-header__menu-toggle:focus-visible {
  outline: var(--focus-ring-width) solid var(--color-focus-ring);
  outline-offset: var(--spacing-xxs);
}

.hc-header__menu-trigger .svg-icon {
  color: inherit;
}

.hc-header__cta {
  flex-shrink: 0;
}

.hc-header__cta .hc-btn {
  min-height: var(--spacing-7xl);
  padding-inline: var(--spacing-lg);
}

.hc-header__menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: var(--spacing-7xl);
  height: var(--spacing-7xl);
  margin: 0;
  padding: 0;
  border: var(--border-width-default) solid var(--color-border-default);
  border-radius: var(--radius-lg);
  background-color: var(--color-background-base-default);
  color: var(--color-icon-default);
  cursor: pointer;
}

.hc-header__menu-toggle-bars,
.hc-header__menu-toggle-bars::before,
.hc-header__menu-toggle-bars::after {
  display: block;
  width: var(--spacing-xl);
  height: 2px;
  background-color: currentColor;
  border-radius: var(--radius-rounded);
}

.hc-header__menu-toggle-bars {
  position: relative;
}

.hc-header__menu-toggle-bars::before,
.hc-header__menu-toggle-bars::after {
  content: "";
  position: absolute;
  inset-inline-start: 0;
}

.hc-header__menu-toggle-bars::before {
  top: calc(-1 * var(--spacing-sm));
}

.hc-header__menu-toggle-bars::after {
  top: var(--spacing-sm);
}

.hc-header__panels {
  border-top: var(--border-width-default) solid var(--color-border-default);
}

.hc-header__panel {
  display: none;
  padding-block: var(--spacing-lg);
  padding-inline: var(--spacing-9xl);
  border-bottom: var(--border-width-default) solid var(--color-border-default);
  background-color: var(--color-background-base-default);
}

.hc-header__panel.is-open {
  display: block;
}

.hc-header__tile-grid {
  display: grid;
  gap: var(--spacing-xl);
  padding-block: var(--spacing-xl);
}

.hc-header__tile-grid--docs {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.hc-header__tile-grid--help {
  grid-template-columns: repeat(3, minmax(0, max-content));
}

.hc-header__tile {
  display: flex;
  align-items: flex-start;
  gap: var(--spacing-sm);
  max-width: var(--size-header-tile-max-width);
  color: inherit;
  text-decoration: none;
}

.hc-header__tile:hover .hc-header__tile-title {
  color: var(--color-text-primary);
}

.hc-header__tile-icon {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: var(--size-header-tile-icon);
  height: var(--size-header-tile-icon);
  padding: var(--spacing-sm);
  background-color: var(--color-background-primary-invert-default);
  border-radius: var(--radius-lg);
  color: var(--color-icon-primary);
  box-sizing: content-box;
}

.hc-header__tile-body {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xxs);
  min-width: 0;
}

.hc-header__tile-title {
  margin: 0;
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-md);
  color: var(--color-text-default);
}

.hc-header__tile-description {
  margin: 0;
  max-width: var(--size-header-tile-description-width);
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-regular);
  line-height: var(--line-height-sm);
  color: var(--color-text-default);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.hc-header__mobile-cta {
  display: none;
}

/* Hamburger through 1024px — desktop nav+brand+CTA need ~1012px and were overlapping. */
@media (max-width: 1024px) {
  .hc-header__bar {
    flex-wrap: wrap;
    padding-inline: var(--container-padding-inline);
  }

  .hc-header__menu-toggle {
    display: inline-flex;
  }

  .hc-header__brand-nav {
    flex: 1 1 auto;
    flex-wrap: wrap;
    gap: var(--spacing-lg);
  }

  .hc-header__nav,
  .hc-header__cta {
    display: none;
  }

  .hc-header.is-nav-open .hc-header__nav {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: var(--spacing-md);
    width: 100%;
    padding-top: var(--spacing-md);
  }

  .hc-header__panels {
    border-top: 0;
  }

  .hc-header__panel {
    padding-inline: var(--container-padding-inline);
  }

  .hc-header__tile-grid--docs,
  .hc-header__tile-grid--help {
    grid-template-columns: 1fr;
  }

  .hc-header__tile {
    max-width: none;
  }

  .hc-header__tile-description {
    max-width: none;
  }

  .hc-header__mobile-cta {
    display: none;
    margin-top: var(--spacing-sm);
  }

  .hc-header.is-nav-open .hc-header__mobile-cta {
    display: block;
  }
}
