/* =============================================
   HEADER
   ============================================= */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  height: var(--header-height);
  transition: box-shadow var(--transition-base), background var(--transition-base);
}

.site-header.scrolled {
  box-shadow: var(--shadow-md);
}

/* The shared .container class has no explicit height (it's auto, sized
   to content), so inside the fixed-height header it was collapsing to
   ~44px and sitting flush against the TOP of the header box instead of
   being vertically centered. Forcing it to fill the header's height
   lets .header-inner's align-items:center actually center everything. */
.site-header .container {
  height: 100%;
}

/* Three-equal-column trick: header-side--start / desktop-nav / header-side--end
   all get flex:1, so the nav is always perfectly centered regardless of how
   wide the logo or the action icons are. */
.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.header-side {
  flex: 1;
  display: flex;
  align-items: center;
  min-width: 0;
}

.header-side--start {
  justify-content: flex-start;
}

.header-side--end {
  justify-content: flex-end;
}

/* Logo */
.site-logo {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  text-decoration: none;
}

.site-logo .logo-icon {
  width: 36px;
  height: 36px;
  background: var(--color-primary);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 18px;
  flex-shrink: 0;
}

.site-logo .logo-text {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--text-lg);
  color: var(--color-text);
  line-height: 1;
}

.site-logo .logo-text span {
  color: var(--color-primary);
}

/* Header Actions (search icon + theme toggle) */
.header-actions {
  gap: var(--space-3);
}

/* Search Icon Trigger — opens the shared search overlay. No full search
   bar here since the Hero section already has the primary search field. */
.header-search-trigger {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-bg-2);
  color: var(--color-text-2);
  border: 1px solid var(--color-border);
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.header-search-trigger:hover {
  background: var(--color-bg-3);
  color: var(--color-primary);
  border-color: var(--color-primary);
}

/* Dark Mode Toggle */
.theme-toggle {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-bg-2);
  color: var(--color-text-2);
  border: 1px solid var(--color-border);
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.theme-toggle:hover {
  background: var(--color-bg-3);
  color: var(--color-primary);
}

.theme-toggle .icon-moon { display: block; }
.theme-toggle .icon-sun  { display: none;  }

[data-theme="dark"] .theme-toggle .icon-moon { display: none;  }
[data-theme="dark"] .theme-toggle .icon-sun  { display: block; }

/* Desktop Nav */
.desktop-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
}

@media (max-width: 991px) {
  .desktop-nav {
    display: none;
  }

  /* Without the centered nav, actions no longer need to balance
     against a matching flex:1 column on the left. */
  .header-side--start,
  .header-side--end {
    flex: 0 0 auto;
  }

  .header-inner {
    justify-content: space-between;
  }
}

.desktop-nav a {
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-2);
  transition: all var(--transition-fast);
  min-height: 36px;
  display: flex;
  align-items: center;
  white-space: nowrap;
}

.desktop-nav a:hover,
.desktop-nav a.active {
  background: var(--color-bg-2);
  color: var(--color-primary);
}
