/* APILayer site header (redesign, AP-6510).
   Source of truth: https://apilayer-homepage-draft.netlify.app/ (nav + Products mega menu).
   Every class is prefixed "aplhd-" so the theme's Bootstrap rules (.nav, .btn, .dropdown-menu,
   .collapse, .navbar) can't reach it, and the selectors are weighted to beat theme.css element
   rules (a, button, ul, p, img). */

.aplhd {
  --aplhd-top: 31px;            /* gap above the floating nav card (design: 31px) */
  --aplhd-offset: 0px;          /* set by apl-header.js when the WP admin bar is showing */
  --rb-50: #cde1fe; --rb-300: #2b7efb; --rb-400: #0566f7; --rb-500: #0052cc;
  --navy-50: #e9ebed; --navy-300: #6e7786; --navy-400: #525d6e; --navy-600: #232f43; --navy-900: #10161f;
  --n-50: #fdfdfe; --n-200: #f9fafb; --n-300: #edeff2; --n-400: #d5d7da;
  position: fixed;
  top: var(--aplhd-offset);
  left: 0;
  right: 0;
  z-index: 999;
  margin: 0;
  padding: 0;
  background: transparent;
  border: 0;
  pointer-events: none;        /* the empty strip around the card must not block page clicks */
  font-family: 'Open Sauce One', system-ui, -apple-system, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
}
.aplhd #cta-bar { pointer-events: auto; }
.aplhd *, .aplhd *::before, .aplhd *::after { box-sizing: border-box; }
.aplhd ul.aplhd-menu, .aplhd .aplhd-menu ul { padding: 0; list-style: none; }
.aplhd .aplhd-menu ul { margin: 0; }
.aplhd .aplhd-menu li { margin: 0; }
.aplhd p { margin: 0; }
.aplhd img { display: block; max-width: none; }
.aplhd a, .aplhd a:hover, .aplhd a:focus { text-decoration: none; }
.aplhd button { font: inherit; line-height: inherit; margin: 0; padding: 0; background: none; border: 0; border-radius: 0; box-shadow: none; cursor: pointer; }
.aplhd :focus-visible { outline: 2px solid var(--rb-400); outline-offset: 2px; }

/* ---------- floating nav card ---------- */
.aplhd .aplhd-nav {
  pointer-events: auto;
  position: relative;
  display: flex;
  align-items: center;
  width: 1038px;
  max-width: calc(100% - 48px);
  height: 54px;
  margin: var(--aplhd-top) auto 0;
  padding: 0 16px 0 14px;
  background: var(--n-50);
  border: 1px solid var(--n-300);
  border-radius: 7px;
  transition: margin-top .2s ease, box-shadow .2s ease;
}
/* Sticky state (design update 2026-11-18): once the page scrolls, apl-header.js adds .is-stuck and the
   card moves up to 12px from the top with a shadow. At the top of the page it sits 31px down as before. */
.aplhd.is-stuck .aplhd-nav {
  margin-top: 12px;
  box-shadow: 0 8px 24px rgba(16, 22, 31, .14);
}
.aplhd .aplhd-logo { flex: none; }
.aplhd .aplhd-sep { flex: none; width: 1px; height: 25px; margin-left: 11px; background: var(--navy-50); }

.aplhd ul.aplhd-menu { display: flex; align-items: center; gap: 24px; margin: 0 0 0 22px; }
.aplhd .aplhd-top {
  display: inline-flex; align-items: center; gap: 4px;
  font-weight: 600; font-size: 16px; line-height: 20px; letter-spacing: .016em;
  color: var(--navy-900); white-space: nowrap;
}
.aplhd .aplhd-top:hover, .aplhd button.aplhd-top:hover { color: var(--rb-500); }
.aplhd .aplhd-dd > button img { transition: transform .15s; }
.aplhd .aplhd-dd > button[aria-expanded="true"] { color: var(--rb-500); }
.aplhd .aplhd-dd > button[aria-expanded="true"] img { transform: rotate(180deg); }
.aplhd .aplhd-menu-login { display: none; }

/* ---------- simple dropdowns (Business, Developers, ...) ---------- */
.aplhd .aplhd-dd { position: relative; }
.aplhd .aplhd-dd-menu {
  display: none;
  position: absolute; top: calc(100% + 18px); left: -16px; z-index: 20;
  min-width: 240px; padding: 8px;
  background: var(--n-50); border: 1px solid var(--n-300); border-radius: 7px;
  box-shadow: 0 8px 24px rgba(16, 22, 31, .12);
}
.aplhd .aplhd-dd > button[aria-expanded="true"] + .aplhd-dd-menu { display: block; }
.aplhd .aplhd-dd-menu a {
  display: flex; padding: 8px 10px; border-radius: 4px;
  font-weight: 600; font-size: 16px; line-height: 20px; letter-spacing: .016em; color: var(--navy-900);
}
.aplhd .aplhd-dd-menu a:hover { background: var(--n-300); color: var(--navy-900); }

/* ---------- Products mega menu ---------- */
.aplhd .aplhd-dd-mega { position: static; }
.aplhd .aplhd-mega {
  display: none;
  position: absolute; z-index: 20; top: calc(100% + 12px); left: -1px; right: -1px;
  max-height: calc(100vh - 96px - var(--aplhd-offset)); overflow-x: hidden; overflow-y: auto;
  background: var(--n-50); border: 1px solid var(--n-300); border-radius: 7px;
  box-shadow: 0 16px 40px rgba(16, 22, 31, .16); text-align: left;
}
.aplhd .aplhd-dd > button[aria-expanded="true"] + .aplhd-mega { display: block; }
.aplhd .aplhd-mega-grid { column-count: 4; column-gap: 12px; padding: 22px 20px 0; }
.aplhd .aplhd-mega-group { break-inside: avoid; padding-bottom: 26px; }
.aplhd .aplhd-mega-label {
  padding-left: 8px; font-weight: 500; font-size: 12px; line-height: 16px;
  letter-spacing: .06em; text-transform: uppercase; color: var(--navy-300);
}
.aplhd .aplhd-mega-group ul { display: grid; gap: 4px; margin: 10px 0 0; }
.aplhd a.aplhd-mega-item {
  display: flex; align-items: flex-start; gap: 12px; padding: 8px; border-radius: 6px;
  font-weight: 400; font-size: 14px; letter-spacing: 0; color: var(--navy-900);
}
.aplhd a.aplhd-mega-item:hover, .aplhd a.aplhd-mega-item:focus-visible { background: rgba(205, 225, 254, .55); color: var(--navy-900); }
.aplhd .aplhd-mega-ic {
  flex: none; display: grid; place-items: center; width: 32px; height: 32px;
  background: #fff; border: 1px solid var(--n-300); border-radius: 5px;
}
.aplhd .aplhd-mega-txt b { display: block; font-weight: 600; font-size: 15px; line-height: 20px; color: var(--navy-900); }
.aplhd .aplhd-mega-txt small { display: block; margin-top: 2px; font-weight: 400; font-size: 13px; line-height: 18px; color: var(--navy-400); }
.aplhd .aplhd-mega-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  height: 54px; padding: 0 24px 0 28px;
  background: var(--n-200); border-top: 1px solid var(--n-300);
  font-size: 14px; line-height: 20px; color: var(--navy-400);
}
.aplhd .aplhd-mega-foot a {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 600; font-size: 15px; letter-spacing: .016em; color: var(--navy-900);
}
.aplhd .aplhd-mega-foot a:hover { color: var(--rb-500); }

/* ---------- right side: GitHub, Login, Start for free ---------- */
.aplhd .aplhd-right { display: flex; align-items: center; margin-left: auto; }
.aplhd a.aplhd-gh { display: flex; align-items: center; gap: 5px; color: var(--navy-900); }
.aplhd .aplhd-gh-count {
  display: inline-flex; align-items: center; height: 27px; padding: 0 8px;
  border: 1px solid var(--navy-400); border-radius: 13.5px;
  font-weight: 600; font-size: 14px; letter-spacing: .03em; color: var(--navy-900);
}
.aplhd a.aplhd-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 36px; border: 1px solid transparent; border-radius: 3px;
  font-weight: 600; font-size: 14px; line-height: 20px; letter-spacing: .03em; white-space: nowrap;
  transition: background-color .15s, border-color .15s;
}
.aplhd a.aplhd-btn-3 { background: var(--n-300); border-color: var(--n-400); color: var(--navy-900); }
.aplhd a.aplhd-btn-3:hover { background: var(--n-200); color: var(--navy-900); }
.aplhd a.aplhd-btn-1 { background: var(--rb-500); border-color: var(--rb-300); color: var(--n-50); }
.aplhd a.aplhd-btn-1:hover { background: var(--rb-400); color: var(--n-50); }
.aplhd a.aplhd-login { margin-left: 22px; padding: 0 10px; }
.aplhd a.aplhd-cta { margin-left: 22px; padding: 0 9px 0 11px; gap: 7px; }

/* hamburger: not in the design, which simply hides the links below 1060px with no way to
   reach them. Added so the menu stays usable on tablets and phones. */
.aplhd .aplhd-burger {
  display: none; flex-direction: column; justify-content: center; gap: 4px;
  width: 36px; height: 36px; margin-left: 12px; padding: 0 9px;
  border: 1px solid var(--n-400); border-radius: 3px; background: var(--n-300);
}
.aplhd .aplhd-burger span { display: block; height: 2px; border-radius: 1px; background: var(--navy-900); transition: transform .15s, opacity .15s; }
.aplhd .aplhd-burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.aplhd .aplhd-burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.aplhd .aplhd-burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ---------- responsive (design breakpoints: 1200 / 1060 / 760) ---------- */
@media (max-width: 1200px) {
  .aplhd ul.aplhd-menu { gap: 16px; }
}
@media (max-width: 1060px) {
  .aplhd .aplhd-sep, .aplhd a.aplhd-gh { display: none; }
  .aplhd .aplhd-burger { display: inline-flex; }
  .aplhd .aplhd-mega-grid { column-count: 2; }

  /* the link list becomes a drop-down panel under the card */
  .aplhd ul.aplhd-menu {
    display: none;
    position: absolute; top: calc(100% + 8px); left: -1px; right: -1px; z-index: 20;
    flex-direction: column; align-items: stretch; gap: 0;
    margin: 0; padding: 8px;
    max-height: calc(100vh - 110px); overflow: auto;
    background: var(--n-50); border: 1px solid var(--n-300); border-radius: 7px;
    box-shadow: 0 16px 40px rgba(16, 22, 31, .16);
  }
  .aplhd .aplhd-nav.is-open ul.aplhd-menu { display: flex; }
  .aplhd .aplhd-menu > li > .aplhd-top { display: flex; justify-content: space-between; width: 100%; padding: 12px 10px; }
  .aplhd .aplhd-menu > li + li { border-top: 1px solid var(--n-300); }
  /* sub-menus open in place (accordion) instead of floating */
  .aplhd .aplhd-dd-menu, .aplhd .aplhd-mega {
    position: static; min-width: 0; max-height: none; overflow: visible;
    margin: 0 0 8px; padding: 0 0 0 8px; border: 0; box-shadow: none; background: transparent;
  }
  .aplhd .aplhd-mega-grid { padding: 4px 0 0; }
  .aplhd .aplhd-mega-group { padding-bottom: 12px; }
  .aplhd .aplhd-mega-foot { height: auto; padding: 12px 8px; border-radius: 6px; border: 0; }
}
@media (max-width: 760px) {
  .aplhd a.aplhd-login { display: none; }
  .aplhd .aplhd-menu-login { display: block; }
  .aplhd a.aplhd-cta { margin-left: 12px; }
  .aplhd .aplhd-mega-grid { column-count: 1; }
  .aplhd .aplhd-mega-txt small { display: none; }
}
@media (max-width: 400px) {
  .aplhd .aplhd-nav { padding: 0 10px; }
  .aplhd .aplhd-logo img { width: 92px; height: auto; }
  .aplhd a.aplhd-cta { margin-left: 8px; padding: 0 8px; font-size: 13px; letter-spacing: .01em; }
  .aplhd a.aplhd-cta img { display: none; }
  .aplhd .aplhd-burger { width: 32px; height: 32px; margin-left: 8px; padding: 0 7px; }
}
@media (prefers-reduced-motion: reduce) {
  .aplhd *, .aplhd *::before, .aplhd *::after { transition: none !important; }
}
