/* Header styles for TravelMotionHub */

.tmh-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background-color: rgba(247, 244, 239, 0.92);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-xs);
}

.tmh-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: var(--space-3);
  gap: var(--space-4);
}

/* Brand */

.tmh-header__brand {
  display: flex;
  align-items: center;
}

.tmh-header__logo-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: inherit;
}

.tmh-header__logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: radial-gradient(circle at 20% 20%, var(--color-secondary), var(--color-primary));
  color: #ffffff;
  box-shadow: var(--shadow-sm);
}

.tmh-header__logo-icon {
  font-size: 1rem;
}

.tmh-header__logotype {
  display: flex;
  flex-direction: column;
}

.tmh-header__site-name {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0.02em;
  font-size: var(--font-size-lg);
}

.tmh-header__tagline {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

/* Navigation */

.tmh-header__nav {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

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

.tmh-header__nav-link {
  position: relative;
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--color-text);
}

.tmh-header__nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -0.35rem;
  width: 0;
  height: 2px;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
  transition: width var(--transition-base);
}

.tmh-header__nav-link:hover::after,
.tmh-header__nav-link:focus-visible::after {
  width: 100%;
}

.tmh-header__cta-wrap {
  margin-left: var(--space-4);
}

.tmh-header__cta {
  font-size: var(--font-size-xs);
  padding-inline: 1.75rem;
}

/* Mobile toggle */

.tmh-header__toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(15, 23, 42, 0.08);
  background-color: var(--color-surface);
  cursor: pointer;
}

.tmh-header__toggle-bar {
  width: 20px;
  height: 2px;
  border-radius: 999px;
  background-color: var(--color-text);
  transition: transform var(--transition-base), opacity var(--transition-base);
}

.tmh-header__toggle-bar + .tmh-header__toggle-bar {
  margin-top: 4px;
}

/* Toggle animation when active */

.tmh-header__toggle--active .tmh-header__toggle-bar:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.tmh-header__toggle--active .tmh-header__toggle-bar:nth-child(2) {
  opacity: 0;
}

.tmh-header__toggle--active .tmh-header__toggle-bar:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* Responsive layout */

@media (max-width: 768px) {
  .tmh-header__toggle {
    display: inline-flex;
  }

  .tmh-header__nav {
    position: absolute;
    inset-inline: 0;
    top: 100%;
    margin-top: 0.25rem;
    padding: var(--space-4) var(--container-padding);
    background-color: var(--color-surface);
    box-shadow: var(--shadow-md);
    border-radius: 0 0 var(--radius-xl) var(--radius-xl);
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-4);

    /* Progressive enhancement: visible by default for no-JS, hidden once JS adds helper class */
  }

  .tmh-header__nav-list {
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    gap: var(--space-3);
  }

  .tmh-header__cta-wrap {
    margin-left: 0;
    width: 100%;
  }

  .tmh-header__cta {
    width: 100%;
    justify-content: center;
  }

  /* When JS is enabled it will add class .tmh-header--js and control visibility through .tmh-header__nav--open */
  .tmh-header.tmh-header--js .tmh-header__nav {
    display: none;
  }

  .tmh-header.tmh-header--js .tmh-header__nav.tmh-header__nav--open {
    display: flex;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tmh-header__toggle-bar {
    transition: none;
  }
}
