/* ============================================================
   HRDelivered — Global Styles (nav, mega menu, footer, tokens)
   Loaded on every custom page template.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ---- Design Tokens ---- */
:root {
  --color-navy:         #001342;
  --color-crimson:      #d7013f;
  --color-crimson-dark: #a40130;
  --color-blue:         #094ffe;
  --color-blue-light:   #5b8cff;
  --color-cream:        #F6F3E8;
  --color-white:        #FFFFFF;
  --font-heading:       'Inter', system-ui, sans-serif;
  --font-body:          'Inter', system-ui, sans-serif;
  --radius-sm:          8px;
  --radius-md:          12px;
  --radius-lg:          16px;
  --radius-xl:          20px;
  --radius-full:        9999px;
  --shadow-card:        0 1px 3px rgba(0,19,66,0.06), 0 4px 16px rgba(0,19,66,0.04);
  --nav-height:         5rem;
}

/* ---- Base Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font-body);
  color: var(--color-navy);
  background-color: var(--color-white);
  font-size: 1rem;
  line-height: 1.6;
  letter-spacing: -0.01em;
}

/* Match body background to footer so no white strip shows below it */
body { background-color: var(--color-navy); }

/* Hide Astra's scroll-to-top button on custom templates */
.ast-scroll-top,
.ast-scroll-top-icon { display: none !important; }

::selection { background-color: var(--color-crimson); color: var(--color-white); }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

/* ---- Global Buttons ---- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.875rem 1.75rem;
  background-color: var(--color-crimson);
  color: var(--color-white);
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  border: none;
  cursor: pointer;
  transition: background-color 0.2s;
}
.btn-primary:hover { background-color: var(--color-crimson-dark); }
.btn-primary-lg    { padding: 1rem 2rem; font-size: 1.0625rem; }

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.875rem 1.75rem;
  background-color: transparent;
  color: var(--color-white);
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 500;
  border-radius: var(--radius-full);
  border: 1px solid rgba(255,255,255,0.30);
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.btn-outline:hover { border-color: var(--color-blue-light); color: var(--color-blue-light); }

.btn-outline-white {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 1rem 2rem;
  background-color: transparent;
  color: var(--color-white);
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 500;
  border-radius: var(--radius-full);
  border: 1px solid rgba(255,255,255,0.35);
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.btn-outline-white:hover { border-color: var(--color-white); }

/* ================================================================
   NAVBAR
   ================================================================ */
.nav {
  position: fixed;
  top: var(--wp-admin--admin-bar--height, 0);
  left: 0; right: 0;
  z-index: 100;
  height: var(--nav-height);
  border-bottom: 1px solid transparent;
  transition: background-color 0.4s, border-color 0.4s;
}
.nav.scrolled {
  background-color: var(--color-white);
  border-color: rgba(0,19,66,0.10);
  box-shadow: 0 1px 12px rgba(0,19,66,0.06);
}

.nav-inner {
  max-width: 1280px;
  margin-inline: auto;
  padding-inline: 1.5rem;
  height: 100%;
  display: flex;
  align-items: center;
  /* No gap/space-between — flex-1 on logo + nav-right handles spacing */
}
@media (min-width: 768px) { .nav-inner { padding-inline: 2.5rem; } }

/* Logo — flex:1 balances nav-right so the middle links are truly centered */
.nav-logo-wrap { position: relative; display: flex; align-items: center; height: 3rem; flex: 1; }
.nav-logo-white { height: 3rem; width: auto; transition: opacity 0.5s; }
.nav-logo-dark  { position: absolute; inset: 0; height: 3rem; width: auto; opacity: 0; transition: opacity 0.5s; }
.nav.scrolled .nav-logo-white { opacity: 0; }
.nav.scrolled .nav-logo-dark  { opacity: 1; }

/* When mobile drawer is open: white nav bar + dark logo + dark hamburger icon */
.nav.drawer-open {
  background-color: var(--color-white);
  border-bottom: 1px solid rgba(0,19,66,0.10);
  box-shadow: 0 1px 12px rgba(0,19,66,0.06);
}
.nav.drawer-open .nav-logo-white    { opacity: 0; }
.nav.drawer-open .nav-logo-dark     { opacity: 1; }
.nav.drawer-open .nav-mobile-toggle { color: var(--color-navy); }

/* Nav links wrapper — auto-sized; centered between equal logo and nav-right columns */
.nav-links {
  display: none;
  align-items: center;
  gap: 2rem;
  /* no flex:1 — logo and nav-right each take flex:1, this sits in the center */
}
@media (min-width: 1024px) { .nav-links { display: flex; } }

/* Plain nav links — !important prevents WP/Gutenberg inline colour rules from winning */
.nav-link {
  font-size: 0.9375rem;
  font-weight: 500;
  color: rgba(255,255,255,0.85) !important;
  transition: color 0.2s;
  white-space: nowrap;
  text-decoration: none !important;
}
.nav-link:hover {
  color: var(--color-white) !important;
  text-decoration: none !important;
}
.nav.scrolled .nav-link {
  color: var(--color-navy) !important;
}
.nav.scrolled .nav-link:hover {
  color: var(--color-blue) !important;
}

/* Right column: CTA + hamburger — flex:1 + justify-content:flex-end mirrors logo */
.nav-right {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem;
}

/* CTA button */
.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.625rem 1.25rem;
  background-color: var(--color-crimson) !important;
  color: var(--color-white) !important;
  font-size: 0.9375rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  transition: background-color 0.2s;
  flex-shrink: 0;
  white-space: nowrap;
  text-decoration: none !important;
}
.nav-cta:hover {
  background-color: var(--color-crimson-dark) !important;
  color: var(--color-white) !important;
}

/* Login outline button */
.nav-login {
  display: inline-flex;
  align-items: center;
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius-full);
  border: 1.5px solid rgba(255,255,255,0.6);
  color: rgba(255,255,255,0.9) !important;
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none !important;
  white-space: nowrap;
  flex-shrink: 0;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.nav-login:hover {
  border-color: rgba(255,255,255,0.9);
  color: #fff !important;
  background: rgba(255,255,255,0.08);
}
.nav.scrolled .nav-login {
  border-color: var(--color-navy);
  color: var(--color-navy) !important;
}
.nav.scrolled .nav-login:hover {
  border-color: var(--color-blue);
  color: var(--color-blue) !important;
  background: transparent;
}

/* ================================================================
   MEGA MENU
   ================================================================ */

/* Wrapper for each top-level nav item with a dropdown */
.nav-item { position: static; }

/* Caret on trigger link */
.nav-link--mega {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}
.nav-link--mega::after {
  content: '';
  display: inline-block;
  width: 0.4rem;
  height: 0.4rem;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  transition: transform 0.2s;
  opacity: 0.7;
}
.nav-item:hover .nav-link--mega::after,
.nav-item:focus-within .nav-link--mega::after {
  transform: rotate(-135deg) translateY(-2px);
}

/* ── Dropdown panel — floating card constrained to content width ── */
.mega-dropdown {
  position: fixed;
  /* Gap below header bar, accounting for WP admin bar */
  top: calc(var(--wp-admin--admin-bar--height, 0) + var(--nav-height) + 0.5rem);
  /* Center horizontally at content width instead of 100% viewport */
  left: 50%;
  width: calc(100% - 3rem);
  max-width: 1200px;
  background-color: var(--color-white);
  border: 1px solid rgba(0,19,66,0.10);
  border-radius: 14px;
  box-shadow: 0 4px 6px rgba(0,19,66,0.04), 0 12px 40px rgba(0,19,66,0.12);
  padding: 2rem 0 2.25rem;
  opacity: 0;
  visibility: hidden;
  /* translateX(-50%) centers it; translateY handles the animation */
  transform: translateX(-50%) translateY(-8px);
  transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
  z-index: 99;
}
.nav-item:hover .mega-dropdown,
.nav-item:focus-within .mega-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* ── Inner two-section layout ──────────────────────────────────── */
.mega-inner {
  max-width: 100%;
  padding-inline: 2.25rem;
  display: flex;
  align-items: stretch;
  gap: 0;
}

/* Vertical rule between sections */
.mega-vdivider {
  flex-shrink: 0;
  width: 1px;
  background-color: rgba(0,19,66,0.08);
  margin-inline: 2.25rem;
}

/* ── Section (left or right half) ─────────────────────────────── */
.mega-section {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.mega-section--wide   { flex: 1.35; } /* larger half */
.mega-section--narrow { flex: 0.65; } /* smaller half */

/* Section heading row */
.mega-section-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(0,19,66,0.07);
}
.mega-section-label {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: rgba(0,19,66,0.38);
}

/* Pill badge (PEO / HRIS) */
.mega-section-badge {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: var(--radius-full);
  line-height: 1.6;
  text-decoration: none;
}
.mega-section-badge--blue {
  background-color: rgba(9,79,254,0.10);
  color: var(--color-blue);
}
.mega-section-badge--teal {
  background-color: rgba(5,150,105,0.10);
  color: #059669;
  transition: background-color 0.15s;
}
a.mega-section-badge--teal:hover { background-color: rgba(5,150,105,0.20); }

/* ── Item grids ────────────────────────────────────────────────── */
.mega-grid { display: grid; gap: 0.125rem; }
.mega-grid--3 { grid-template-columns: repeat(3, 1fr); }
.mega-grid--2 { grid-template-columns: repeat(2, 1fr); }
.mega-grid--1 { grid-template-columns: 1fr; }

/* ── Individual item link ──────────────────────────────────────── */
.mega-item {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: background-color 0.15s;
}
.mega-item:hover { background-color: rgba(9,79,254,0.05); }

.mega-item-icon {
  flex-shrink: 0;
  color: var(--color-blue);
  opacity: 0.80;
  margin-top: 2px;
}

.mega-item-title {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-navy);
  line-height: 1.3;
  transition: color 0.15s;
}
.mega-item:hover .mega-item-title { color: var(--color-blue); }

.mega-item-desc {
  display: block;
  font-size: 0.75rem;
  color: rgba(0,19,66,0.48);
  line-height: 1.5;
  margin-top: 0.2rem;
}

/* ================================================================
   MOBILE NAV (hamburger — shown below 1024px)
   ================================================================ */
.nav-mobile-toggle {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 0.5rem;
  cursor: pointer;
  background: none;
  border: none;
  color: var(--color-white);
}
@media (min-width: 1024px) { .nav-mobile-toggle { display: none; } }
.nav.scrolled .nav-mobile-toggle { color: var(--color-navy); }

.nav-mobile-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background-color: currentColor;
  border-radius: 2px;
  transition: transform 0.25s, opacity 0.25s;
}
.nav-mobile-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-mobile-toggle.open span:nth-child(2) { opacity: 0; }
.nav-mobile-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Hide desktop-only nav buttons on mobile — Login + Get Started live in the drawer */
@media (max-width: 1023px) {
  .nav-login { display: none !important; }
  .nav-cta   { display: none !important; }
}

/* ── Mobile drawer ─────────────────────────────────────────────── */
/*
   Full-screen fixed overlay. Starts at top:0 so the browser's scroll engine
   treats it as a proper scroll container (avoids iOS scroll-through bug).
   padding-top pushes the content clear of the sticky nav bar.
   z-index:99 keeps the nav bar (z:100) floating above the drawer.
*/
.nav-mobile-drawer {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 99;
  background-color: var(--color-white);
  padding-top: calc(var(--wp-admin--admin-bar--height, 0px) + var(--nav-height));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.nav-mobile-drawer.open { display: block; }
@media (min-width: 1024px) { .nav-mobile-drawer { display: none !important; } }

/* Section group wrapper */
.mobile-group {
  border-bottom: 1px solid rgba(0,19,66,0.07);
  padding: 0.75rem 0;
}
.mobile-group:last-of-type { border-bottom: none; }

/* Section heading */
.mobile-section-heading {
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: rgba(0,19,66,0.35);
  padding: 0.75rem 1.25rem 0.375rem;
}

/* Individual link row */
.mobile-link {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.6rem 1.25rem;
  color: var(--color-navy);
  text-decoration: none;
  border-radius: 0;
  transition: background-color 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.mobile-link:active,
.mobile-link:hover { background-color: rgba(9,79,254,0.05); }

/* Icon wrapper */
.mobile-link-icon {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  border-radius: var(--radius-sm);
  background-color: rgba(9,79,254,0.07);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-blue);
}

/* Text content */
.mobile-link-body strong {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-navy);
  line-height: 1.3;
}
.mobile-link-body span {
  display: block;
  font-size: 0.75rem;
  color: rgba(0,19,66,0.50);
  line-height: 1.4;
  margin-top: 0.1rem;
}

/* Plain links (no description) */
.mobile-link--plain {
  gap: 0;
  padding: 0.7rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 500;
}
.mobile-link--plain::after {
  content: '';
  display: block;
  margin-left: auto;
  width: 0.4rem;
  height: 0.4rem;
  border-right: 1.5px solid rgba(0,19,66,0.30);
  border-bottom: 1.5px solid rgba(0,19,66,0.30);
  transform: rotate(-45deg);
  flex-shrink: 0;
}

/* CTA area */
.mobile-cta-wrap {
  padding: 1.5rem 1.25rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.mobile-cta-wrap .btn-primary { justify-content: center; }
.mobile-phone-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: rgba(0,19,66,0.60);
  padding: 0.75rem;
  border: 1px solid rgba(0,19,66,0.12);
  border-radius: var(--radius-full);
  transition: border-color 0.2s, color 0.2s;
}
.mobile-phone-link:hover { border-color: var(--color-navy); color: var(--color-navy); }
.mobile-login-link {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--color-navy);
  padding: 0.65rem;
  border: 1.5px solid rgba(0,19,66,0.25);
  border-radius: var(--radius-full);
  text-decoration: none;
  transition: border-color 0.2s, color 0.2s;
}
.mobile-login-link:hover { border-color: var(--color-navy); color: var(--color-navy); }

/* ================================================================
   MOBILE NAV SIZING (below 480px — reduce nav bar + logo to fit small phones)
   ================================================================ */
@media (max-width: 479px) {
  :root { --nav-height: 3.75rem; }
  .nav-logo-wrap         { height: 2.125rem; }
  .nav-logo-white,
  .nav-logo-dark         { height: 2.125rem; }
  .nav-inner             { padding-inline: 1rem; }
  .nav-mobile-toggle     { padding: 0.375rem; }
  .mobile-link-body strong { font-size: 0.8125rem; }
  .mobile-link-body span   { font-size: 0.6875rem; }
  .mobile-link             { padding: 0.5rem 1rem; gap: 0.625rem; }
  .mobile-link-icon        { width: 1.75rem; height: 1.75rem; }
  .mobile-section-heading  { padding: 0.625rem 1rem 0.25rem; }
  .mobile-cta-wrap         { padding: 1.25rem 1rem 0; }
}

/* ================================================================
   FOOTER
   ================================================================ */
footer {
  background-color: var(--color-navy);
  padding-block: 5rem 4rem;
  /* Horizontal padding lives inside .footer-grid / .footer-bottom
     so it aligns with .nav-inner (both use max-width:1280px + padding-inline:2.5rem) */
}
@media (min-width: 768px) { footer { padding-block: 7rem 4rem; } }

footer a { color: rgba(255,255,255,0.55); transition: color 0.2s; }
footer a:hover { color: var(--color-white); }

/* 4-column grid: brand | services | systems+solutions | resources+partners */
.footer-grid {
  max-width: 1280px;
  margin: 0 auto;
  padding-inline: 1.5rem;
  display: grid;
  grid-template-columns: 1fr;       /* single column on mobile */
  gap: 2.5rem 2rem;
  margin-bottom: 5rem;
}
@media (min-width: 768px) {
  .footer-grid {
    padding-inline: 2.5rem;
    grid-template-columns: 1.1fr 1fr 1fr 1fr;
    gap: 2rem 3rem;
    align-items: start;
  }
}

.footer-brand { grid-column: span 1; }

.footer-logo    { height: 3.25rem; width: auto; margin-bottom: 1.125rem; }
.footer-tagline { font-size: 0.875rem; color: rgba(255,255,255,0.55); line-height: 1.65; max-width: 260px; margin-bottom: 1.5rem; }

.footer-socials { display: flex; gap: 0.625rem; flex-wrap: wrap; }
.social-link {
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 50%;
  color: rgba(255,255,255,0.55);
  transition: border-color 0.2s, color 0.2s;
}
.social-link:hover { border-color: var(--color-crimson); color: var(--color-crimson); }

/* Regular single-section column */
.footer-col h4 {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.45);
  margin-bottom: 1.25rem;
}
.footer-col ul { display: flex; flex-direction: column; gap: 0.625rem; }
.footer-col a  { font-size: 0.875rem; }

/* Multi-section column (two stacked sub-columns) */
.footer-col--multi {
  display: flex;
  flex-direction: column;
  gap: 3.5rem;
}
.footer-sub-col h4 {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.45);
  margin-bottom: 1.25rem;
}
.footer-sub-col ul { display: flex; flex-direction: column; gap: 0.625rem; }
.footer-sub-col a  { font-size: 0.875rem; color: rgba(255,255,255,0.55); transition: color 0.2s; }
.footer-sub-col a:hover { color: var(--color-white); }

.footer-bottom {
  max-width: 1280px;
  margin: 0 auto;
  padding-inline: 1.5rem;           /* matches nav-inner mobile gutter */
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
  padding-top: 2rem;
  border-top: 1px solid rgba(255,255,255,0.10);
}
@media (min-width: 768px) { .footer-bottom { padding-inline: 2.5rem; } }
@media (min-width: 768px) { .footer-bottom { flex-direction: row; justify-content: space-between; } }
.footer-bottom p, .footer-bottom a { font-size: 0.75rem; color: rgba(255,255,255,0.40); }
.footer-bottom a:hover { color: var(--color-white); }
.footer-legal { display: flex; gap: 1.5rem; }
