/* Desktop header: pin left + right to edges; free space only BETWEEN them */

.hdr-inner {
  display: flex;
  align-items: center;
  justify-content: space-between; /* between groups — not space-around */
  gap: 2rem; /* minimum middle gap when the bar is tight */
  width: 100%;
}

.hdr-left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex: 0 0 auto; /* hug left edge — do not grow into the middle */
  min-width: 0;
}

.hdr-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  flex: 0 1 auto; /* hug right edge — do not expand leftward */
  min-width: 0;
  margin-left: 0;
}

/* Restore a proper search width (theme default was max 580px) */
.hdr-right .hdr-search {
  flex: 0 1 580px;
  width: 580px;
  max-width: min(580px, 42vw);
  margin-left: 0;
}

.hdr-right .hdr-actions {
  flex-shrink: 0;
}

/* Hamburger only when inline nav is hidden (phone). */
#site-header .mob-menu-btn {
  display: none !important;
}

@media (max-width: 520px) {
  .hdr-inner {
    gap: 0.5rem;
  }

  .hdr-left {
    flex: 1 1 auto;
    gap: 0.5rem;
  }

  .hdr-right {
    flex: 0 0 auto;
    gap: 0.35rem;
  }

  .hdr-right .hdr-search {
    width: auto;
    max-width: none;
  }

  #site-header .mob-menu-btn {
    display: flex !important;
  }
}

@media (min-width: 521px) and (max-width: 1100px) {
  .hdr-inner {
    gap: 1.25rem;
  }

  .hdr-right .hdr-search {
    width: 360px;
    max-width: min(360px, 34vw);
  }
}
