/* src/client/components/Header.css */
.header {
  position: sticky;
  z-index: 40;
  display: flex;
  height: var(--header-height);
  padding-inline: max(var(--page-padding-x), calc(50% - 656px + var(--page-padding-x)));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: none;
  justify-content: space-between;
  align-items:  center;
  gap: .75rem;
  top: 0;
}

.header-left {
  display: flex;
  align-items:  center;
  gap: .5rem;
  min-width: 0;
  height: 100%;
}

.header-menu-toggle {
  display: inline-flex;
  color: #fff;
  cursor: pointer;
  background: none;
  border: none;
  border-radius: 8px;
  justify-content: center;
  align-items:  center;
  width: 36px;
  height: 36px;
  padding: 0;
  transition: background .12s;
}

.header-menu-toggle:hover {
  background: #ffffff14;
}

.header-menu-toggle:focus-visible {
  outline: 2px solid var(--brand-orange);
  outline-offset: 2px;
}

.header-brand {
  display: flex;
  text-decoration: none;
  color: inherit;
  align-items:  center;
  min-width: 0;
  height: 100%;
}

.header-logo {
  display: block;
  object-fit: contain;
  width: auto;
  max-width: 100%;
  height: 24px;
}

.header-nav {
  display: none;
  align-items:  center;
  gap: 1rem;
  height: 100%;
}

.header-link {
  display: inline-flex;
  color: #f5f5f7;
  text-decoration: none;
  border-radius: 8px;
  align-items:  center;
  padding: 8px 12px;
  transition: color .12s;
  font-size: 16px;
  font-weight: 500;
  line-height: 1;
}

.header-link:hover {
  color: var(--brand-orange);
}

.header-menu .header-link {
  width: 100%;
  padding: 14px 16px;
  font-size: 16px;
}

.header-dropdown {
  position: relative;
  display: inline-flex;
  align-items:  center;
  height: 100%;
}

.header-dropdown-toggle {
  font: inherit;
  cursor: pointer;
  background: none;
  border: none;
  gap: .35rem;
}

.header-chevron {
  transition: transform .16s;
}

.header-chevron.is-open {
  transform: rotate(180deg);
}

.header-dropdown-panel {
  position: absolute;
  display: flex;
  opacity: 0;
  visibility: hidden;
  z-index: 60;
  background: #0a0a0a;
  border-radius: 12px;
  flex-direction: column;
  min-width: 220px;
  padding: 8px;
  transition: opacity .14s, transform .14s, visibility .14s;
  top: calc(100% - 4px);
  left: 0;
  transform: translateY(-4px);
  box-shadow: 0 16px 40px #00000073;
}

.header-dropdown.is-open .header-dropdown-panel, .header-dropdown:focus-within .header-dropdown-panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.header-dropdown-item {
  display: flex;
  color: #f5f5f7;
  text-decoration: none;
  white-space: nowrap;
  border-radius: 8px;
  align-items:  center;
  padding: 10px 12px;
  transition: background .12s, color .12s;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.2;
}

.header-dropdown-item:hover {
  color: var(--brand-orange);
  outline: none;
  background: #ffffff0f;
}

.header-dropdown-item:focus-visible {
  color: var(--brand-orange);
  outline: none;
  background: #ffffff0f;
}

.header-menu-group {
  display: flex;
  border-top: 1px solid #ffffff0f;
  border-bottom: 1px solid #ffffff0f;
  flex-direction: column;
  gap: 0;
  padding: 8px 0 4px;
}

.header-menu-group-label {
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #f5f5f78c;
  padding: 6px 16px 4px;
  font-size: 12px;
  font-weight: 600;
}

.header-menu .header-menu-sublink {
  padding-left: 28px;
}

.header-cta {
  display: inline-flex;
  color: #000;
  letter-spacing: -.025em;
  text-decoration: none;
  white-space: nowrap;
  background: #fff;
  border-radius: 24px;
  justify-content: center;
  align-items:  center;
  padding: 12px 24px;
  transition: background .12s, transform .12s;
  font-family: Avenir, Plus Jakarta Sans, sans-serif;
  font-size: 16px;
  font-weight: 500;
}

.header-cta:hover {
  background: #f4f4f4;
}

.header-cta:active {
  transform: translateY(1px);
}

.header-menu {
  display: none;
  position: absolute;
  padding: .75rem var(--page-padding-x) 1rem;
  z-index: 50;
  background: #000;
  border-bottom: 1px solid #ffffff14;
  flex-direction: column;
  gap: .5rem;
  top: 100%;
  left: 0;
  right: 0;
}

.header-menu.is-open {
  display: flex;
}

.header-menu .header-cta {
  width: 100%;
  padding: 14px 24px;
  font-size: 16px;
}

@media (width >= 640px) {
  .header {
    padding-left: max(64px, 50% - 592px);
    padding-right: max(64px, 50% - 592px);
  }

  .header-menu-toggle {
    display: none;
  }

  .header-nav {
    display: flex;
  }

  .header-menu, .header-menu.is-open {
    display: none;
  }
}
