/*
 * Webdev Zimbabwe — global header, navigation and footer (v2026)
 * Load AFTER style.css, custom.css and webdev-antler-design.css.
 * Linked from header.html so every page that injects the header gets it.
 *
 * This layer deliberately does NOT reuse Antler's `.menu-wrap` nav, which is
 * `position:absolute` and designed to float over a full-bleed carousel. The
 * 2026 design puts a solid header in normal document flow, so the nav is a
 * self-contained component instead of an override of the vendor one.
 */

/* Shared container. Intentionally duplicated in webdev-home.css so each
   entry point is self-sufficient — rules are identical, order-independent. */
.wd-shell {
  margin: 0 auto;
  max-width: var(--wd-container, 1320px);
  padding: 0 clamp(1rem, 3vw, 1.5rem);
  width: 100%;
}

/* ---------- utility bar ---------- */

.wd-topbar {
  background: var(--wd-grey-050);
  border-bottom: 1px solid var(--wd-grey-200);
  font-family: var(--wd-font-sans);
}

.wd-topbar__inner {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
  justify-content: flex-end;
  min-height: 40px;
}

.wd-topbar a {
  align-items: center;
  border-radius: var(--wd-radius-sm);
  color: var(--wd-grey-700);
  display: inline-flex;
  font-size: 0.8125rem;
  font-weight: 600;
  gap: 0.4375rem;
  padding: 0.375rem 0.25rem;
  text-decoration: none;
  transition: color var(--wd-duration) var(--wd-ease);
}

.wd-topbar a:hover {
  color: var(--wd-orange-700) !important;
}

.wd-topbar a:focus-visible {
  box-shadow: var(--wd-focus);
  outline: 0;
}

.wd-topbar svg {
  fill: none;
  height: 1rem;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.5;
  width: 1rem;
}

/* ---------- header shell ---------- */

/*
 * `#header` is the mount point jQuery loads header.html into. It wraps only the
 * utility bar + nav bar, so it is ~106px tall — and a sticky box cannot travel
 * outside its containing block, which capped the sticky header at ~41px of
 * movement. `display: contents` removes that box so the sticky bar's containing
 * block becomes .box-container, which spans the whole document.
 *
 * Keep this rule: without it the header stops sticking almost immediately.
 */
#header {
  display: contents;
}

.wd-header {
  background: var(--wd-white);
  border-bottom: 1px solid var(--wd-grey-200);
  font-family: var(--wd-font-sans);
  position: sticky;
  top: 0;
  transition:
    background-color var(--wd-duration) var(--wd-ease),
    border-color var(--wd-duration) var(--wd-ease),
    box-shadow var(--wd-duration) var(--wd-ease);
  z-index: 1000;
}

/* ---------- stuck state ----------
 * Once scrolled, the bar takes the footer's charcoal so the top and bottom of
 * the page share one surface, and swaps to the footer's light logo.
 * `.is-stuck` is set by the sentinel observer in header.html.
 */

.wd-header.is-stuck {
  background: var(--wd-slate-600, #4c555d);
  border-bottom-color: transparent;
  box-shadow: var(--wd-shadow-sm);
}

/* The toggle stays on the bar at every width, so its white ink is unconditional. */
.wd-header.is-stuck .wd-navtoggle {
  border-color: rgb(255 255 255 / 28%);
  color: var(--wd-white);
}

/*
 * White nav ink belongs to the DESKTOP nav only — the one that actually sits on
 * the stuck bar's dark slate.
 *
 * Below 1200px the nav is not on the bar at all: it is a drawer with a white
 * background (see the `max-width: 1199.98px` block). Applying the stuck colour
 * there painted white links onto white and emptied the entire menu — every row
 * blank, with only the orange Client Area button visible because it carries its
 * own background. It only bit after scrolling, since `.is-stuck` is what sets
 * it, which is what made it look intermittent.
 *
 * Keep every stuck rule that colours .wd-nav__link inside this query.
 */
@media (min-width: 1200px) {
  .wd-header.is-stuck .wd-nav__link,
  .wd-header.is-stuck .wd-nav__link[aria-current="page"] {
    color: var(--wd-white);
  }

  /* Focus ring needs a dark separation gap instead of the white one. */
  .wd-header.is-stuck .wd-nav__link:focus-visible {
    box-shadow:
      0 0 0 2px var(--wd-slate-600, #4c555d),
      0 0 0 5px var(--wd-orange-500);
  }
}

@media (hover: hover) and (pointer: fine) and (min-width: 1200px) {
  .wd-header.is-stuck .wd-nav__link:hover {
    color: var(--wd-white) !important;
  }
}

/* The toggle and logo do sit on the dark bar at every width, so their focus
   ring keeps the dark gap unconditionally. */
.wd-header.is-stuck .wd-navtoggle:focus-visible,
.wd-header.is-stuck .wd-header__logo:focus-visible {
  box-shadow:
    0 0 0 2px var(--wd-slate-600, #4c555d),
    0 0 0 5px var(--wd-orange-500);
}

/*
 * Logo swap — both files are in the DOM, only one is ever displayed.
 *
 * These selectors must carry TWO classes plus the type. `.wd-header__logo img`
 * below sets `display: block` at specificity (0,1,1); a bare
 * `.wd-header__logo--light` (0,1,0) or `img.wd-header__logo--light` (0,1,1)
 * either loses or merely ties and then loses on source order — which showed
 * both wordmarks side by side. (0,2,1) wins regardless of order.
 */
.wd-header__logo img.wd-header__logo--light {
  display: none;
}

.wd-header.is-stuck .wd-header__logo img.wd-header__logo--dark {
  display: none;
}

.wd-header.is-stuck .wd-header__logo img.wd-header__logo--light {
  display: block;
}

.wd-header__inner {
  align-items: center;
  display: flex;
  gap: clamp(1rem, 2vw, 2rem);
  justify-content: space-between;
  min-height: 72px;
}

.wd-header__logo {
  align-items: center;
  display: inline-flex;
  flex: 0 0 auto;
  padding: 0.5rem 0;
}

/* Sized by height, not width: the dark and light files have different aspect
   ratios (4.36:1 vs 5.29:1), so matching widths would render them at visibly
   different heights and the swap would jump. */
.wd-header__logo img {
  display: block;
  height: clamp(30px, 3.2vw, 38px);
  width: auto;
}

.wd-header__logo:focus-visible {
  box-shadow: var(--wd-focus);
  border-radius: var(--wd-radius-sm);
  outline: 0;
}

.wd-header__actions {
  align-items: center;
  display: flex;
  flex: 0 0 auto;
  gap: 0.75rem;
}

/* Icon inside a button. Inherits the label colour, so it flips to white on
   hover with the text rather than being styled separately. */
.wd-btn__icon {
  fill: none;
  flex: 0 0 auto;
  height: 1.0625rem;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
  width: 1.0625rem;
}

/* ---------- primary navigation ---------- */

.wd-nav__list {
  align-items: center;
  display: flex;
  gap: clamp(0.25rem, 1vw, 1rem);
  list-style: none;
  margin: 0;
  padding: 0;
}

.wd-nav__item {
  position: relative;
}

/* Shared look for links and dropdown triggers */
.wd-nav__link {
  align-items: center;
  background: none;
  border: 0;
  border-radius: var(--wd-radius-sm);
  color: var(--wd-charcoal-900);
  cursor: pointer;
  display: inline-flex;
  /* 400/16px. Set in the shorthand rather than appended after it, so weight and
     size are declared once. */
  font: 400 1rem/1 var(--wd-font-sans);
  gap: 0.375rem;
  min-height: 44px;
  padding: 0 0.625rem;
  position: relative;
  text-decoration: none;
  white-space: nowrap;
}

/*
 * Active / hover indicator. The link is 44px tall with ~15px of centred text,
 * so the underline needs to sit near 7px from the bottom — at 12px it collided
 * with the descenders and read as a text-decoration rather than an indicator.
 * Rounded ends, and it grows left-to-right on hover per the design system.
 */
.wd-nav__link::after {
  background: var(--wd-orange-500);
  border-radius: 999px;
  bottom: 7px;
  content: "";
  height: 2px;
  left: 0.625rem;
  position: absolute;
  right: 0.625rem;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform var(--wd-duration) var(--wd-ease);
}

/* Keyboard focus gets the same indicator as hover, not just the focus ring. */
.wd-nav__link:focus-visible::after {
  transform: scaleX(1);
}

@media (hover: hover) and (pointer: fine) {
  .wd-nav__link:hover {
    color: var(--wd-charcoal-950) !important;
  }

  .wd-nav__link:hover::after {
    transform: scaleX(1);
  }
}

.wd-nav__link:focus-visible {
  box-shadow: var(--wd-focus);
  outline: 0;
}

/* Active page — never colour alone, `aria-current` carries the semantics. */
.wd-nav__link[aria-current="page"] {
  color: var(--wd-charcoal-950);
}

.wd-nav__link[aria-current="page"]::after {
  transform: scaleX(1);
}

.wd-nav__chevron {
  fill: none;
  height: 0.875rem;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  transition: transform var(--wd-duration) var(--wd-ease);
  width: 0.875rem;
}

.wd-nav__link[aria-expanded="true"] .wd-nav__chevron {
  transform: rotate(180deg);
}

/* ---------- dropdown panel ---------- */

.wd-menu {
  background: var(--wd-white);
  border: 1px solid var(--wd-grey-200);
  border-radius: var(--wd-radius-md);
  box-shadow: var(--wd-shadow-md);
  display: grid;
  gap: 0.125rem;
  left: 0;
  min-width: 310px;
  padding: 0.625rem;
  position: absolute;
  top: calc(100% + 6px);
  z-index: 20;
}

/*
 * Hover bridge over the 6px gap above the panel.
 *
 * The panel is offset from the trigger for visual separation, but that gap is
 * outside .wd-nav__item — so a pointer travelling from the trigger down to the
 * panel left the item, fired mouseleave and closed the menu before it could be
 * clicked. This transparent strip covers the gap so the pointer stays inside the
 * hover target the whole way. It is decorative and non-interactive.
 *
 * Keep this in sync with the `top` offset above: the strip must be at least as
 * tall as the gap.
 */
.wd-menu::before {
  content: "";
  height: 12px;
  left: 0;
  position: absolute;
  right: 0;
  top: -12px;
}

.wd-menu[hidden] {
  display: none;
}

/* Keep the last dropdowns inside the viewport */
.wd-nav__item:nth-last-child(-n + 2) .wd-menu {
  left: auto;
  right: 0;
}

.wd-menu a {
  border-radius: var(--wd-radius-sm);
  color: var(--wd-menu-ink);
  display: block;
  padding: 0.625rem 0.75rem;
  text-decoration: none;
  transition: background-color var(--wd-duration) var(--wd-ease);
}

.wd-menu a strong {
  display: block;
  font-size: 0.9375rem;
  font-weight: 400;
}

.wd-menu a span {
  color: var(--wd-grey-500);
  display: block;
  font-size: 0.8125rem;
  line-height: 1.4;
  margin-top: 0.125rem;
}

.wd-menu a:hover {
  background: var(--wd-orange-050);
  color: var(--wd-charcoal-950) !important;
}

.wd-menu a:focus-visible {
  box-shadow: var(--wd-focus);
  outline: 0;
}

/*
 * The "View all" row leads the dropdown now, so the rule that separated it
 * flipped from the top edge to the bottom. The account menu in the client-area
 * template keeps ITS .wd-menu__all last -- that block is the signed-in user's
 * details link, not a section index, so it reads as a footer and is excluded
 * from this ordering.
 */
.wd-menu__all {
  border-bottom: 1px solid var(--wd-grey-100);
  margin-bottom: 0.25rem;
  padding-bottom: 0.25rem;
}

/* The client-area account block is still the last child, so it keeps the
   original top-edge rule. */
.wd-menu__all:last-child {
  border-bottom: 0;
  border-top: 1px solid var(--wd-grey-100);
  margin: 0.25rem 0 0;
  padding: 0.25rem 0 0;
}

.wd-menu__all a strong {
  color: var(--wd-orange-700);
}

/* ---------- mobile drawer trigger ---------- */

.wd-navtoggle {
  align-items: center;
  background: none;
  border: 1px solid var(--wd-grey-200);
  border-radius: var(--wd-radius-sm);
  color: var(--wd-charcoal-900);
  cursor: pointer;
  display: none;
  height: 44px;
  justify-content: center;
  width: 44px;
}

.wd-navtoggle svg {
  fill: none;
  height: 1.375rem;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 1.75;
  width: 1.375rem;
}

.wd-navtoggle:focus-visible {
  box-shadow: var(--wd-focus);
  outline: 0;
}

.wd-navtoggle__close {
  display: none;
}

.wd-navtoggle[aria-expanded="true"] .wd-navtoggle__open {
  display: none;
}

.wd-navtoggle[aria-expanded="true"] .wd-navtoggle__close {
  display: block;
}

/* ---------- footer ---------- */

.wd-footer {
  background: var(--wd-slate-600, #4c555d);
  color: var(--wd-grey-200);
  font-family: var(--wd-font-sans);
  line-height: 1.6;
}

.wd-footer a {
  color: var(--wd-grey-200);
  text-decoration: none;
  transition: color var(--wd-duration) var(--wd-ease);
}

.wd-footer a:hover {
  color: var(--wd-orange-500) !important;
}

.wd-footer a:focus-visible {
  border-radius: var(--wd-radius-sm);
  box-shadow: 0 0 0 2px var(--wd-slate-600, #4c555d), 0 0 0 5px var(--wd-orange-500);
  outline: 0;
}

.wd-footer__main {
  display: grid;
  gap: clamp(2rem, 4vw, 3rem);
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1.3fr) repeat(3, minmax(0, 1fr));
  padding: clamp(2.75rem, 5vw, 4rem) 0 clamp(2rem, 3vw, 2.5rem);
}

.wd-footer__brand img {
  height: auto;
  width: 158px;
}

.wd-footer__tagline {
  color: var(--wd-grey-300);
  font-size: 0.9375rem;
  margin: 1rem 0 1.25rem;
  max-width: 22rem;
}

.wd-footer__social {
  display: flex;
  gap: 0.5rem;
}

.wd-footer__social a {
  align-items: center;
  border: 1px solid rgb(255 255 255 / 22%);
  border-radius: 50%;
  display: inline-flex;
  height: 40px;
  justify-content: center;
  width: 40px;
}

.wd-footer__social a:hover {
  border-color: var(--wd-orange-500);
}

.wd-footer h2 {
  color: var(--wd-white);
  font-size: 0.9375rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin: 0 0 1rem;
}

.wd-footer__links {
  display: grid;
  gap: 0.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.wd-footer__links a {
  font-size: 0.9375rem;
}

/* Offices */
.wd-office + .wd-office {
  margin-top: 1.5rem;
}

.wd-office h3 {
  color: var(--wd-orange-500);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  margin: 0 0 0.625rem;
  text-transform: uppercase;
}

.wd-office ul {
  display: grid;
  gap: 0.4375rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.wd-office li {
  color: var(--wd-grey-300);
  display: grid;
  font-size: 0.875rem;
  gap: 0.5rem;
  grid-template-columns: 1rem 1fr;
}

.wd-office svg {
  fill: none;
  height: 1rem;
  margin-top: 0.1875rem;
  stroke: var(--wd-grey-500);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.5;
  width: 1rem;
}

/* Webdev Group strip */
.wd-footer__group {
  border-top: 1px solid rgb(255 255 255 / 12%);
  padding: 1.5rem 0;
}

.wd-footer__group h2 {
  margin-bottom: 0.75rem;
}

.wd-footer__group ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.wd-footer__group a {
  border: 1px solid rgb(255 255 255 / 18%);
  border-radius: var(--wd-radius-pill, 999px);
  display: inline-block;
  font-size: 0.8125rem;
  padding: 0.375rem 0.875rem;
}

.wd-footer__group a:hover {
  border-color: var(--wd-orange-500);
}

/* Bottom bar */
.wd-footer__bottom {
  align-items: center;
  border-top: 1px solid rgb(255 255 255 / 12%);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  justify-content: space-between;
  padding: 1.25rem 0;
}

.wd-footer__bottom p {
  color: var(--wd-grey-500);
  font-size: 0.8125rem;
  margin: 0;
}

.wd-footer__bottom ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.wd-footer__bottom a {
  color: var(--wd-grey-500);
  font-size: 0.8125rem;
}

/* ---------- responsive ---------- */

/* Just above the drawer breakpoint the full seven-item nav still needs to be
   tightened, or the Client Area button runs past the right edge. */
@media (min-width: 1200px) and (max-width: 1365.98px) {
  .wd-nav__list {
    gap: 0;
  }

  .wd-nav__link {
    font-size: 0.9375rem;
    padding: 0 0.4375rem;
  }

  .wd-nav__link::after {
    left: 0.4375rem;
    right: 0.4375rem;
  }

  .wd-header__inner {
    gap: 1rem;
  }
}

@media (max-width: 1099.98px) {
  .wd-footer__main {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/*
 * Drawer takes over below 1200px, not 1024px. Seven nav items plus the logo and
 * the Client Area button need ~1140px; between 1024 and 1199 the bar was
 * overflowing and clipping the Client Area button. Keep this breakpoint in sync
 * with the DESKTOP media query in header.html.
 */
@media (max-width: 1199.98px) {
  .wd-navtoggle {
    display: inline-flex;
  }

  .wd-header__inner {
    min-height: 64px;
  }

  /*
   * While the drawer is open the bar is FIXED, not sticky, and header.html sets
   * the matching `top` inline.
   *
   * Opening the drawer locks the page with `body { overflow: hidden }`, and a
   * `position: sticky` element whose scroll container no longer scrolls falls
   * back to its STATIC position. Once the visitor had scrolled, that position
   * was hundreds of pixels above the viewport, so the bar — and the close
   * button on it — disappeared the instant the menu opened, leaving a
   * full-screen panel with no way out but the browser's back gesture.
   *
   * Fixed positioning survives the scroll lock. The inline `top` is measured
   * before the lock so the bar does not visibly move as it switches.
   */
  .wd-header.is-drawer-open {
    left: 0;
    position: fixed;
    right: 0;
  }

  /* Drawer visibility is driven by `.is-open`, not the `hidden` attribute:
     display:none already removes it from the accessibility tree, and the
     trigger's aria-expanded carries the state. */
  .wd-nav {
    background: var(--wd-white);
    border-top: 1px solid var(--wd-grey-200);
    bottom: 0;
    display: none;
    left: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 1rem clamp(1rem, 3vw, 1.5rem) 2rem;
    position: fixed;
    right: 0;
    top: var(--wd-header-offset, 64px);
    z-index: 999;
  }

  .wd-nav.is-open {
    display: block;
  }

  .wd-nav__list {
    align-items: stretch;
    flex-direction: column;
    gap: 0;
  }

  .wd-nav__item {
    border-bottom: 1px solid var(--wd-grey-100);
  }

  .wd-nav__link {
    font-size: 1rem;
    justify-content: space-between;
    min-height: 52px;
    padding: 0 0.25rem;
    width: 100%;
  }

  .wd-nav__link::after {
    content: none;
  }

  .wd-nav__link[aria-current="page"] {
    color: var(--wd-orange-700);
  }

  .wd-menu,
  .wd-nav__item:nth-last-child(-n + 2) .wd-menu {
    border: 0;
    border-radius: 0;
    box-shadow: none;
    left: auto;
    min-width: 0;
    padding: 0 0 0.75rem 0.25rem;
    position: static;
    right: auto;
    top: auto;
  }

  .wd-menu a {
    padding: 0.5rem 0.5rem;
  }

  /* Client Area sits above the product list so it needs no scrolling */
  .wd-nav__cta {
    display: block;
    margin-bottom: 1rem;
  }

  .wd-nav__cta .wd-btn {
    width: 100%;
  }

  .wd-header__actions .wd-btn {
    display: none;
  }
}

@media (min-width: 1200px) {
  .wd-nav__cta {
    display: none;
  }
}

@media (max-width: 767.98px) {
  .wd-topbar__inner {
    gap: 0.25rem 1rem;
    justify-content: space-between;
  }

  .wd-topbar a {
    font-size: 0.75rem;
  }

  .wd-footer__main {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  .wd-nav__link::after,
  .wd-nav__chevron {
    transition-duration: 0.01ms !important;
  }
}

/* ===========================================================================
 * CLIENT-AREA ONLY
 *
 * These classes exist solely in assets/layout/sections/menu.tpl — the WHMCS
 * client-area header ported from html/header.html. They never appear on the
 * marketing pages, so nothing here can affect them.
 * ======================================================================== */

/*
 * WHMCS's live account controls sitting inside our utility bar: the locale
 * switcher, the notification bell, the basket link, the admin-masquerade bar and
 * the sign-in control. They come from WHMCS includes whose markup we do not
 * own, so this only lays them out and normalises their scale — it does not try
 * to restyle their internals.
 */
.wd-topbar__whmcs {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  margin-left: auto;
}

/* The legacy includes carry their own font sizes and margins. */
.wd-topbar__whmcs .iconews,
.wd-topbar__whmcs a {
  font-size: 0.8125rem;
}

.wd-topbar__whmcs .f-18 {
  font-size: 1rem !important;
}

/* Their dropdown panels are positioned by the legacy theme; keep them above the
   sticky header rather than behind it. */
.wd-topbar__whmcs .dropdown-menu {
  z-index: 1200;
}

/*
 * The signed-in Billing entry. It is additive — the public menu stays exactly
 * as html/header.html — so it only needs the account items to read as one
 * column rather than the two-line product entries the marketing menus use.
 */
.wd-nav__item--account .wd-menu {
  min-width: 15rem;
}

.wd-nav__item--account .wd-menu a strong {
  display: block;
}

/* ---------- footer review button ----------
 * Sits directly above the social row and is styled to match it: same hairline
 * border, same orange hover. It reads as one set with the icons rather than a
 * page CTA that wandered into the footer, which is why it does not reuse
 * .wd-btn — those variants assume a light surface.
 */
/*
 * a.wd-footer__review, not the bare class: `.wd-footer a` is (0,1,1) and a
 * lone class is (0,1,0), so the white below was silently losing to the footer
 * link colour and the label rendered grey. Adding the type ties the specificity
 * and wins on source order, since this block is last in the file.
 */
a.wd-footer__review {
  align-items: center;
  border: 1px solid rgb(255 255 255 / 22%);
  border-radius: var(--wd-radius-pill, 999px);
  color: var(--wd-white);
  display: inline-flex;
  font-size: 0.9375rem;
  font-weight: 600;
  gap: 0.5rem;
  margin-bottom: 0.875rem;
  padding: 0.5rem 1rem 0.5rem 0.875rem;
}

.wd-footer__review svg {
  fill: none;
  height: 1rem;
  stroke: var(--wd-orange-500);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.5;
  width: 1rem;
}

a.wd-footer__review:hover {
  border-color: var(--wd-orange-500);
}
