:root {
  --site-header-blue: #00a4ff;
  --site-header-height: 150px;
}

.site-header,
.site-header *,
.site-header *::before,
.site-header *::after {
  box-sizing: border-box;
}

.site-header {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 40;
  width: 100%;
  background: transparent;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body:not(.toolistfy-tool-page) > .site-header + *,
body:not(.toolistfy-tool-page) > script + .site-header + * {
  padding-top: var(--site-header-height);
}

/* Full tool pages can render non-visual configuration scripts between the
   shared header and their actual page root. Keeping the header in normal flow
   is therefore more reliable than trying to offset an assumed next sibling. */
body.toolistfy-tool-page:not(.toolistfy-embed) > .site-header {
  position: relative;
}

/* Legacy audit/mobile shells previously compensated for an absolute header. */
body.toolistfy-tool-page:not(.toolistfy-embed) > .site-header ~ .mobile-view {
  padding-top: 0;
}

.site-header-nav {
  position: relative;
  z-index: 10;
  width: min(1320px, calc(100% - 48px));
  min-height: 150px;
  margin: 0 auto;
  padding: 50px 0;
  display: grid;
  grid-template-columns: 220px 1fr 196px;
  align-items: center;
  gap: 24px;
}

.site-header-brand {
  display: inline-flex;
  width: 199px;
  height: 49px;
  color: inherit;
  text-decoration: none;
}

.site-header-brand-logo {
  width: 199px;
  height: 49px;
  object-fit: contain;
}

.site-header-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(20px, 2.5vw, 48px);
}

.site-header a {
  color: #000;
  text-decoration: none;
}

.site-header-links a {
  font-size: 15px;
  font-weight: 500;
  line-height: 1.3;
  white-space: nowrap;
}

.site-header-links a:hover,
.site-header-links a:focus-visible {
  color: var(--site-header-blue);
}

.site-header-ai-pill {
  width: 196px;
  height: 47px;
  padding: 0 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 4px 19px rgba(0, 164, 255, 0.43);
  font-size: 15px;
  font-weight: 500;
  text-transform: uppercase;
  cursor: pointer;
  list-style: none;
}

.site-header-ai-pill::-webkit-details-marker {
  display: none;
}

.site-header-ai-menu {
  position: relative;
}

.site-header-ai-pill:hover,
.site-header-ai-pill:focus-visible {
  color: #000;
}

.site-header-ai-icon {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.site-header-ai-chevron {
  width: 24px;
  height: 24px;
  object-fit: contain;
  transform: rotate(180deg);
  transition: transform 180ms ease;
}

.site-header-ai-menu[open] .site-header-ai-chevron {
  transform: rotate(0deg);
}

.site-header-dropdown {
  position: absolute;
  top: calc(100% + 14px);
  right: 0;
  width: min(620px, calc(100vw - 32px));
  max-height: min(640px, calc(100vh - 190px));
  overflow-y: auto;
  padding: 24px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px 28px;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(0, 164, 255, 0.14);
  border-radius: 24px;
  box-shadow: 0 20px 55px rgba(28, 89, 127, 0.2);
  backdrop-filter: blur(16px);
}

/* Author display rules must not override the native closed <details> state. */
.site-header-ai-menu:not([open]) > .site-header-dropdown {
  display: none;
}

.site-header-ai-menu[open] > .site-header-dropdown {
  display: grid;
}

.site-header-dropdown-title {
  grid-column: 1 / -1;
  color: #101820;
  font-size: 18px;
  font-weight: 900;
}

.site-header-dropdown-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.site-header-dropdown-category {
  margin-bottom: 2px;
  color: var(--site-header-blue) !important;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.site-header-dropdown-tool {
  color: #344452 !important;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.35;
}

.site-header-dropdown-tool:hover,
.site-header-dropdown-tool:focus-visible {
  color: #008ee0 !important;
}

.site-header-dropdown-all {
  grid-column: 1 / -1;
  padding-top: 16px;
  border-top: 1px solid #e7f1f7;
  color: #008ee0 !important;
  font-size: 14px;
  font-weight: 700;
}

body.toolistfy-embed .site-header {
  display: none;
}

/* Hide legacy page-local navs once the shared header is present. */
.website-audit-tool > .toolistify-logo-recovered-1,
.website-audit-tool > .ai-tools,
.website-audit-tool > .website-audit-tool-child10,
.website-audit-tool > .sparkles-1-icon,
.website-audit-tool > .polygon-icon,
.mobile-view > .mobile-navbar {
  display: none !important;
}

/* Audit uses a transformed legacy canvas. Keep the shared navigation in its
   own visible layer and in normal flow regardless of that canvas. */
body.audit-page > .site-header {
  position: relative !important;
  z-index: 1000;
  background: linear-gradient(180deg, #f4fbff 0%, rgba(244, 251, 255, 0.9) 100%);
}

body.audit-page .site-header-dropdown {
  z-index: 1001;
}

@media (max-width: 1180px) {
  :root {
    --site-header-height: 108px;
  }

  .site-header-nav {
    width: 100%;
    min-height: 108px;
    padding: 30px 65px 30px 14px;
    grid-template-columns: 140px 1fr 110px;
    gap: 12px;
  }

  .site-header-brand,
  .site-header-brand-logo {
    width: 110px;
    height: auto;
  }

  .site-header-brand {
    transform: translate(35px, -6px);
  }

  .site-header-links {
    gap: 18px;
    transform: translate(65px, -4px);
  }

  .site-header-links a {
    font-size: 10px;
  }

  .site-header-ai-pill {
    width: 110px;
    height: 34px;
    padding: 0 8px;
    gap: 7px;
    font-size: 10px;
    transform: translateY(-2px);
  }

  .site-header-dropdown {
    top: calc(100% + 10px);
  }

  .site-header-ai-icon {
    width: 18px;
    height: 18px;
  }

  .site-header-ai-chevron {
    width: 14px;
    height: 14px;
  }
}

@media (max-width: 820px) {
  :root {
    --site-header-height: 72px;
  }

  .site-header-nav {
    width: calc(100% - 32px);
    min-height: 72px;
    padding: 16px 0;
    grid-template-columns: 150px 1fr;
    gap: 24px;
  }

  .site-header-brand,
  .site-header-brand-logo {
    width: 150px;
  }

  .site-header-brand {
    transform: none;
  }

  .site-header-links {
    display: none;
    transform: none;
  }

  .site-header-ai-pill {
    justify-self: end;
    width: 154px;
    height: 44px;
    font-size: 13px;
    transform: none;
  }


  .site-header-ai-menu {
    justify-self: end;
  }

  .site-header-dropdown {
    grid-template-columns: 1fr;
    max-height: calc(100vh - 92px);
    padding: 20px;
    border-radius: 18px;
  }

  .site-header-ai-icon {
    width: 26px;
    height: 26px;
  }

  .site-header-ai-chevron {
    width: 18px;
    height: 18px;
  }
}

@media (max-width: 540px) {
  .site-header-nav {
    grid-template-columns: 120px 1fr;
  }

  .site-header-brand,
  .site-header-brand-logo {
    width: 120px;
  }

  .site-header-ai-pill {
    width: auto;
    padding: 0 12px;
    gap: 7px;
    font-size: 11px;
  }

  .site-header-ai-icon {
    width: 22px;
    height: 22px;
  }

  .site-header-ai-chevron {
    width: 14px;
    height: 14px;
  }
}
