/* Header styles for HomeToolsPL - builds on base.css */

.ht-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background-color: rgba(15, 23, 42, 0.97);
  color: #e5e7eb;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(18px);
}

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

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

.ht-header__logo-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: #f9fafb;
  font-weight: 700;
  font-size: var(--font-size-lg);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.ht-header__logo-link:hover {
  color: #ffffff;
}

.ht-header__logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: var(--radius-lg);
  background: radial-gradient(circle at 30% 20%, var(--color-accent) 0, #facc15 18%, #1e3a8a 60%, #020617 100%);
  color: #111827;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.55);
}

.ht-header__logo-mark i {
  font-size: 1.15rem;
}

.ht-header__logo-text {
  font-family: "Barlow", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* Navigation */

.ht-header__nav {
  display: flex;
  align-items: center;
}

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

.ht-header__nav-item {
  position: relative;
}

.ht-header__nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-pill);
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: #e5e7eb;
  text-transform: none;
  letter-spacing: 0.02em;
}

.ht-header__nav-link:hover {
  background-color: rgba(55, 65, 81, 0.85);
  color: #f9fafb;
}

.ht-header__nav-link:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
  background-color: rgba(55, 65, 81, 0.6);
}

.ht-header__nav-item--highlight .ht-header__nav-link--highlight {
  background: linear-gradient(135deg, var(--color-accent), #f59e0b);
  color: #111827;
  box-shadow: 0 4px 12px rgba(250, 204, 21, 0.55);
}

.ht-header__nav-item--highlight .ht-header__nav-link--highlight:hover {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: #020617;
}

.ht-header__nav-item--highlight .ht-header__nav-link--highlight i {
  font-size: 0.9rem;
}

/* Mobile toggle */

.ht-header__menu-toggle {
  display: none;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(156, 163, 175, 0.7);
  background-color: rgba(17, 24, 39, 0.9);
  color: #e5e7eb;
  font-size: var(--font-size-sm);
}

.ht-header__menu-toggle:hover {
  background-color: rgba(31, 41, 55, 0.95);
}

.ht-header__menu-toggle:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

.ht-header__menu-toggle-icon {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
}

.ht-header__menu-toggle-bar {
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background-color: currentColor;
  transition: transform var(--transition-base), opacity var(--transition-base), width var(--transition-base);
}

.ht-header__menu-toggle[aria-expanded="true"] .ht-header__menu-toggle-bar:nth-child(1) {
  transform: translateY(5px) rotate(45deg);
}

.ht-header__menu-toggle[aria-expanded="true"] .ht-header__menu-toggle-bar:nth-child(2) {
  opacity: 0;
  width: 0;
}

.ht-header__menu-toggle[aria-expanded="true"] .ht-header__menu-toggle-bar:nth-child(3) {
  transform: translateY(-5px) rotate(-45deg);
}

.ht-header__menu-toggle-text {
  font-weight: 500;
}

/* Responsive behavior */

@media (max-width: 768px) {
  .ht-header__inner {
    padding-top: var(--space-2);
    padding-bottom: var(--space-2);
  }

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

  .ht-header__nav {
    position: absolute;
    inset-inline: 0;
    top: 100%;
    background-color: rgba(15, 23, 42, 0.98);
    border-bottom: 1px solid rgba(31, 41, 55, 0.9);
    transform-origin: top;
    transform: scaleY(0.8);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity var(--transition-base), transform var(--transition-base), visibility var(--transition-base);
  }

  .ht-header__nav-list {
    flex-direction: column;
    align-items: flex-start;
    padding: var(--space-3) var(--space-4) var(--space-4);
    gap: var(--space-1);
  }

  .ht-header__nav-link {
    width: 100%;
    justify-content: flex-start;
  }

  .ht-header__nav--open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: scaleY(1);
  }
}

@media (min-width: 769px) {
  .ht-header__nav {
    position: static;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    transform: none !important;
  }
}
