/* Header chrome. Enqueued globally from inc/enqueue.php. */

/* The SHELL is what sticks — it wraps the utility bar, the nav row and the
   mobile drawer. Sticking the shell rather than .effectus-header means the
   drawer can be positioned against it with top:100% and never needs to know
   how tall the utility bar is. Do not move `position:sticky` back down. */
.effectus-header-shell {
  position: sticky;
  top: 0;
  z-index: 100;
}

/* --- Utility bar ---------------------------------------------------------- */

.effectus-topbar {
  background: var(--effectus-topbar);
  color: #ffffff;
  font-size: .875rem;
}
.effectus-topbar__inner {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 24px;
  min-height: 40px;
  flex-wrap: wrap;
}
.effectus-topbar__item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #ffffff;
  text-decoration: none;
  padding: 6px 0;
}
.effectus-topbar__item .effectus-icon { color: var(--effectus-accent); flex: none; }
.effectus-topbar__item:hover { color: var(--effectus-accent); }

/* --- Nav row -------------------------------------------------------------- */

.effectus-header {
  background: var(--effectus-bg);
  border-bottom: 1px solid #d8d8d8;
}

.effectus-header__inner {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: var(--effectus-header-height);
}

.effectus-header__logo { display: flex; align-items: center; text-decoration: none; font-weight: 700; }
.effectus-header__logo .custom-logo-link { display: block; line-height: 0; }
.effectus-header__logo img { max-height: 52px; width: auto; }

/* margin-left:auto on the nav pushes nav + actions to the right. */
.effectus-nav { margin-left: auto; }

.effectus-nav__list {
  display: flex;
  align-items: center;
  gap: 28px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.effectus-nav__list > li { position: relative; }
.effectus-nav__list a {
  display: block;
  text-decoration: none;
  font-size: .95rem;
  font-weight: 500;
  color: var(--effectus-topbar);
  padding: 20px 0;
  transition: color .2s var(--effectus-ease);
}
.effectus-nav__list a:hover { color: var(--effectus-accent); }
.effectus-nav__list .current-menu-item > a,
.effectus-nav__list .current-menu-ancestor > a { color: var(--effectus-brand); }

/* Dropdown ("Servers" > "Supermicro Servers"). Opened on hover AND on
   keyboard focus — :focus-within is what makes it reachable by tab. */
.effectus-nav__list .sub-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 220px;
  margin: 0;
  padding: 6px 0;
  list-style: none;
  background: #f9f9f9;
  border: 1px solid var(--effectus-border);
  box-shadow: 0 8px 24px rgba(0,0,0,.08);
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity .18s var(--effectus-ease), transform .18s var(--effectus-ease), visibility .18s;
}
.effectus-nav__list > li:hover > .sub-menu,
.effectus-nav__list > li:focus-within > .sub-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.effectus-nav__list .sub-menu a { padding: 10px 16px; white-space: nowrap; }
.effectus-nav__list .sub-menu a:hover { background: var(--effectus-accent); color: #ffffff; }

.effectus-header__actions { display: flex; align-items: center; gap: 12px; }

.effectus-header__cta {
  background: var(--effectus-brand);
  color: #ffffff;
  border-radius: 0;
  padding: 15px 22px;
  font-weight: 600;
  font-size: .95rem;
  line-height: 1;
  text-decoration: none;
  transition: background .2s var(--effectus-ease);
}
.effectus-header__cta:hover { background: var(--effectus-accent); color: #ffffff; }

/* Burger — hidden on desktop. */
.effectus-burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px; height: 44px;
  padding: 0;
  background: none;
  border: 0;
  cursor: pointer;
}
.effectus-burger span {
  display: block;
  height: 2px;
  width: 24px;
  margin-inline: auto;
  background: var(--effectus-text);
  transition: transform .25s var(--effectus-ease), opacity .25s var(--effectus-ease);
}
.effectus-burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.effectus-burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.effectus-burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Off-canvas drawer, slides in from the right. */
.effectus-drawer {
  position: absolute;
  top: 100%;
  right: 0;
  max-height: calc(100vh - 100%);
  width: min(360px, 86vw);
  z-index: 99;
  background: var(--effectus-card-bg);
  border-left: 1px solid var(--effectus-border);
  padding: 32px 28px;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform .3s var(--effectus-ease);
}
.effectus-drawer.is-open { transform: translateX(0); }

.effectus-drawer__list { list-style: none; margin: 0; padding: 0; text-align: right; }
.effectus-drawer__list li { border-bottom: 1px solid var(--effectus-border); }
.effectus-drawer__list a { display: block; padding: 14px 0; text-decoration: none; font-size: 1.05rem; }
.effectus-drawer__list .sub-menu { list-style: none; margin: 0; padding-right: 16px; }
.effectus-drawer__list .sub-menu a { font-size: .95rem; color: var(--effectus-text-muted); }

@media (max-width: 992px) {
  .effectus-nav,
  .effectus-header__cta { display: none; }
  .effectus-burger { display: flex; }

  /* The nav carried margin-left:auto; hiding it would collapse the burger back
     next to the logo. Re-assert the push on the actions container. */
  .effectus-header__actions { margin-left: auto; }
}

@media (prefers-reduced-motion: reduce) {
  .effectus-drawer, .effectus-burger span { transition: none; }
}

/* --------------------------------------------------------------------------
   Mobile corrections.

   The original overflowed horizontally at 390px because the utility bar forced
   the phone and the (long) email onto one non-wrapping line. Here the bar
   wraps and centres, and the logo is capped so the burger always has room —
   the original constrained it to 120px at <=1024 and 80px at <=767.
   -------------------------------------------------------------------------- */

@media (max-width: 1024px) {
  .effectus-header__logo img { max-height: 44px; width: auto; max-width: 150px; }
}

@media (max-width: 767px) {
  .effectus-topbar { font-size: .8125rem; }
  .effectus-topbar__inner {
    justify-content: center;
    gap: 4px 16px;
    padding-block: 6px;
  }
  .effectus-topbar__item {
    padding: 2px 0;
    /* The email is the widest string on the page at this width. Let it shrink
       and ellipsise rather than push the bar wider than the viewport. */
    min-width: 0;
    max-width: 100%;
  }
  .effectus-topbar__item span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .effectus-header__inner { gap: 12px; min-height: 68px; }
  .effectus-header__logo img { max-height: 38px; max-width: 120px; }
}
