/* Header shell layout built on top of base .site-header styles */
.header-shell {
  position: sticky;
  top: 0;
  z-index: 40;
}

.header-shell__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4.25rem;
}

/* Brand / logo */
.header-shell__brand {
  display: flex;
  align-items: center;
}

.header-shell__logo-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--gray-900);
}

.header-shell__logo-mark {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.95rem;
  background: radial-gradient(circle at 20% 20%, #ffe5d8 0, #ffae80 40%, #ff7d4a 100%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: var(--shadow-md);
  flex-shrink: 0;
}

.header-shell__logo-mark i {
  font-size: 1.25rem;
}

.header-shell__logo-text {
  display: flex;
  flex-direction: column;
}

.header-shell__logo-title {
  font-family: var(--font-heading);
  font-weight: 600;
  letter-spacing: 0.02em;
  font-size: 1.1rem;
}

.header-shell__logo-highlight {
  color: var(--color-primary);
}

.header-shell__logo-tagline {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
}

/* Navigation */
.header-shell__nav {
  display: flex;
  align-items: center;
}

.header-shell__nav-list {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.header-shell__nav-cta .btn {
  font-size: var(--font-size-xs);
  padding-inline: 1.2rem;
}

/* Mobile toggle */
.header-shell__toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 0.26rem;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--gray-200);
  background-color: #ffffff;
  cursor: pointer;
}

.header-shell__toggle-bar {
  width: 1.2rem;
  height: 2px;
  border-radius: 999px;
  background-color: var(--gray-800);
  transition: transform var(--transition-fast), opacity var(--transition-fast);
}

.header-shell__toggle:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* Toggle animation */
.header-shell__toggle--active .header-shell__toggle-bar:nth-child(1) {
  transform: translateY(4px) rotate(45deg);
}

.header-shell__toggle--active .header-shell__toggle-bar:nth-child(2) {
  opacity: 0;
}

.header-shell__toggle--active .header-shell__toggle-bar:nth-child(3) {
  transform: translateY(-4px) rotate(-45deg);
}

/* Mobile layout */
@media (max-width: 768px) {
  .header-shell__inner {
    height: auto;
    padding-top: var(--space-3);
    padding-bottom: var(--space-3);
  }

  .header-shell__toggle {
    display: inline-flex;
  }

  .header-shell__nav {
    position: absolute;
    inset-inline: 0;
    top: 100%;
    background-color: #ffffff;
    border-bottom: 1px solid rgba(148, 163, 184, 0.3);
    box-shadow: var(--shadow-md);
    transform-origin: top;
    transform: scaleY(0.98);
    opacity: 0;
    visibility: hidden;
    max-height: 0;
    transition:
      opacity var(--transition-base),
      transform var(--transition-base),
      max-height var(--transition-base),
      visibility var(--transition-base);
  }

  .header-shell__nav-list {
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: var(--space-3) var(--space-4) var(--space-4);
  }

  .header-shell__nav-item {
    width: 100%;
  }

  .header-shell__nav-item .site-nav__link,
  .header-shell__nav-item .btn {
    display: inline-flex;
    width: 100%;
    justify-content: flex-start;
    padding-block: 0.55rem;
  }

  .header-shell__nav-cta .btn {
    margin-top: var(--space-2);
    justify-content: center;
  }

  .header-shell__nav--open {
    opacity: 1;
    visibility: visible;
    transform: scaleY(1);
    max-height: 22rem;
  }
}

/* Medium+ screens */
@media (min-width: 769px) {
  .header-shell__nav {
    position: static;
  }
}

/* Utility for when JS enhances focus trapping */
.header-shell__nav--no-scroll {
  overflow: hidden;
}
