/* =============================================================
   WattKarma Mega Menu
   Pill-shaped nav with two mega dropdown panels.
   All new classes scoped to .wk-pill-nav / .wk-mega-* so
   nothing conflicts with existing .nav / .submenu styles.
   ============================================================= */


/* ---- SKIP-TO-CONTENT LINK ---- */
.wk-skip-link {
  position: absolute;
  top: -100%;
  left: 16px;
  z-index: 100000;
  padding: 10px 20px;
  background: var(--wk-blue-400);
  color: var(--wk-white) !important;
  font-family: Inter, system-ui, sans-serif;
  font-size: 14px;
  font-weight: 600;
  border-radius: 0 0 8px 8px;
  text-decoration: none;
  transition: top 0.15s ease;
}

.wk-skip-link:focus {
  top: 0;
}


/* ---- FOCUS-VISIBLE STYLES ---- */
.wk-pn-trigger:focus-visible,
.wk-pn-link:focus-visible,
.wk-pn-phone:focus-visible,
.wk-mega-link:focus-visible,
.wk-mega-blog-item:focus-visible,
.wk-mega-learn-more:focus-visible {
  outline: 2px solid var(--wk-blue-400);
  outline-offset: 2px;
}

.header-mobile-toggle:focus-visible {
  outline: 2px solid var(--wk-blue-400);
  outline-offset: 2px;
}


/* ---- NAVIGATION CONTAINER ---- */
.wk-pill-nav {
  display: flex;
  align-items: center;
  background: none;
  border: none;
  border-radius: 0;
  padding: 0;
  gap: 12px;
  position: relative;
  height: auto;
  box-sizing: border-box;
}

/* Simple anchor nav link */
.wk-pn-link {
  font-family: Inter, system-ui, sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--wk-text-ink);
  text-decoration: none;
  padding: 10px 16px;
  border-radius: 100px;
  transition: background 0.15s ease;
  white-space: nowrap;
  line-height: 1;
  display: inline-flex;
  align-items: center;
}

.wk-pn-link:hover {
  background: rgba(0, 0, 0, 0.06);
  color: var(--wk-text-ink);
}

/* Dropdown trigger item container */
.wk-pn-item {
  position: static;
}

/* Dropdown trigger button */
.wk-pn-trigger {
  font-family: Inter, system-ui, sans-serif;
  font-size: 14px;
  font-weight: 400;
  color: var(--wk-text-ink);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 10px 16px;
  border-radius: 100px;
  transition: background 0.15s ease;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  line-height: 1;
}

.wk-pn-trigger:hover {
  background: rgba(0, 0, 0, 0.06);
}

.wk-pn-chevron {
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.wk-pn-item.is-open .wk-pn-chevron {
  transform: rotate(180deg);
}

/* Phone button — fills right end of pill */
.wk-pn-phone {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 20px;
  background: var(--wk-blue-400);
  color: var(--wk-white) !important;
  text-decoration: none;
  border-radius: 100px;
  font-family: Inter, system-ui, sans-serif;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
  margin-left: auto;
}

.wk-pn-phone:hover {
  background: var(--wk-blue-500);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(59, 130, 246, 0.35);
}

.wk-pn-phone svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}


/* ---- MEGA PANEL ---- */
.wk-mega-panel {
  position: absolute;
  top: calc(100% + 14px);
  right: 0;
  width: 940px;
  max-width: calc(100vw - 48px);
  background: rgba(255, 255, 255, 0.93);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0px 7px 10px rgba(16, 24, 39, 0.25), 0 2px 4px rgba(16, 24, 39, 0.08);
  border-radius: 16px;
  border: 1px solid rgba(0, 0, 0, 0.07);
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
  z-index: 9999;
}

.wk-pn-item.is-open .wk-mega-panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.wk-mega-inner {
  display: flex;
  min-height: 240px;
}


/* ---- QUICK LINKS SECTION (columns of links) ---- */
.wk-mega-white {
  background: transparent;
  padding: 28px 32px;
  display: flex;
  gap: 32px;
  flex: 2;
}


/* ---- GRAY SECTION (blog-style items) ---- */
.wk-mega-gray {
  background: rgba(0, 0, 0, 0.04);
  padding: 24px 24px;
  flex: 1;
  min-width: 240px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  transition: background 0.35s ease;
}

/* Gray section hover-reveal — background images */
.wk-mega-gray .as-ind-bg-stage {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.wk-mega-gray .as-ind-bg {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.wk-mega-gray .as-ind-bg.is-active {
  opacity: 1;
}

.wk-mega-gray .as-ind-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.wk-mega-gray .as-ind-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(8, 16, 38, 0.72);
}

/* Keep content above background images */
.wk-mega-gray.ind-hover-active > *:not(.as-ind-bg-stage) {
  position: relative;
  z-index: 2;
}

/* Text transitions when hover is active */
.wk-mega-gray.ind-hover-active .wk-mega-gray-heading {
  color: rgba(255, 255, 255, 0.85);
  transition: color 0.3s ease;
}

.wk-mega-gray.ind-hover-active .wk-mega-blog-item {
  background: rgba(255, 255, 255, 0.10);
  border-color: rgba(255, 255, 255, 0.18);
  transition: all 0.25s ease;
}

.wk-mega-gray.ind-hover-active .wk-mega-blog-title {
  color: rgba(255, 255, 255, 0.90);
  transition: color 0.25s ease;
}

.wk-mega-gray.ind-hover-active .wk-mega-blog-desc {
  color: rgba(255, 255, 255, 0.75);
  transition: color 0.25s ease;
}

.wk-mega-gray.ind-hover-active .wk-mega-blog-thumb {
  background: rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.85);
  transition: all 0.25s ease;
}

.wk-mega-gray.ind-hover-active .wk-mega-blog-item:hover {
  background: var(--wk-white);
  border-color: var(--wk-white);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  transform: translateY(-1px);
}

.wk-mega-gray.ind-hover-active .wk-mega-blog-item:hover .wk-mega-blog-title {
  color: var(--wk-near-black);
}

.wk-mega-gray.ind-hover-active .wk-mega-blog-item:hover .wk-mega-blog-desc {
  color: var(--wk-gray-500);
}

.wk-mega-gray.ind-hover-active .wk-mega-blog-item:hover .wk-mega-blog-thumb {
  background: #eff6ff;
  color: var(--wk-blue-500);
}

.wk-mega-gray.ind-hover-active .wk-mega-learn-more {
  color: rgba(255, 255, 255, 0.80);
  transition: color 0.25s ease;
}

.wk-mega-gray.ind-hover-active .wk-mega-learn-more:hover {
  color: var(--wk-white);
}


/* ---- COLUMN LAYOUT ---- */
.wk-mega-col {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.wk-mega-col-heading {
  font-family: Inter, system-ui, sans-serif;
  font-size: 11px;
  font-weight: 600;
  color: var(--wk-blue-400);
  margin: 0 0 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0 10px;
}

/* Link item (white section) */
.wk-mega-link {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  transition: background 0.15s ease;
}

.wk-mega-link-icon {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: rgba(37, 99, 235, 0.08);
  color: var(--wk-blue-500);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

.wk-mega-link-icon svg {
  width: 16px;
  height: 16px;
}

.wk-mega-link-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.wk-mega-link:hover {
  background: var(--wk-gray-100);
}

.wk-mega-link-title {
  font-family: Inter, system-ui, sans-serif;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--wk-text-ink);
  line-height: 1.3;
}

.wk-mega-link-desc {
  font-family: Inter, system-ui, sans-serif;
  font-size: 12px;
  font-weight: 400;
  color: var(--wk-text-slate);
  line-height: 1.4;
}


/* ---- GRAY SECTION: HEADING ---- */
.wk-mega-gray-heading {
  font-family: Inter, system-ui, sans-serif;
  font-size: 11px;
  font-weight: 600;
  color: var(--wk-blue-400);
  margin: 0 0 14px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* Blog items (inside gray panel) — white cards */
.wk-mega-blog-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: var(--wk-white);
  text-decoration: none;
  color: inherit;
  margin-bottom: 7px;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.wk-mega-blog-item:last-of-type {
  margin-bottom: 0;
}

.wk-mega-blog-item:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  border-color: #bfdbfe;
}

.wk-mega-blog-thumb {
  width: 46px;
  height: 40px;
  border-radius: 6px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  line-height: 1;
  background: #eff6ff;
  color: var(--wk-blue-500);
}

.wk-mega-blog-text {
  flex: 1;
  min-width: 0;
}

.wk-mega-blog-title {
  font-family: Inter, system-ui, sans-serif;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--wk-text-ink);
  line-height: 1.35;
  margin-bottom: 2px;
}

.wk-mega-blog-desc {
  font-family: Inter, system-ui, sans-serif;
  font-size: 11.5px;
  font-weight: 400;
  color: var(--wk-text-slate);
  line-height: 1.4;
}

/* "Learn More" text link */
.wk-mega-learn-more {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: Inter, system-ui, sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--wk-blue-400);
  text-decoration: none;
  margin-top: 10px;
  padding: 4px 0;
  transition: color 0.15s ease;
}

.wk-mega-learn-more:hover {
  color: var(--wk-blue-500);
}


/* ---- RESPONSIVE ---- */

/* Hide pill nav on mobile */
@media (max-width: 1024px) {
  .wk-pill-nav {
    display: none;
  }
}

/* On mid-size desktops, compress pill slightly */
@media (min-width: 1025px) and (max-width: 1200px) {
  .wk-pn-trigger,
  .wk-pn-link {
    padding: 8px 10px;
  }
  .wk-pn-phone {
    padding: 9px 14px;
    font-size: 13px;
  }
  .wk-mega-panel {
    width: 820px;
  }
  .wk-mega-gray {
    min-width: 200px;
  }
}

/* Panel stays within viewport on narrower desktops */
@media (min-width: 1025px) and (max-width: 1120px) {
  .wk-mega-panel {
    right: auto;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
  }
  .wk-pn-item.is-open .wk-mega-panel {
    transform: translateX(-50%) translateY(0);
  }
}


/* ============================================================
   MOBILE MENU REDESIGN — compact dropdown card (Figma style)
   Overrides the full-screen white menu from styles.css
   ============================================================ */

@media (max-width: 1024px) {

  /* Make the header transparent so the pill sits on the page */
  .site-header {
    background: transparent !important;
    border-bottom: none !important;
    box-shadow: none !important;
    overflow: visible !important;
    padding: 11px 12px !important;
  }

  /* Style the header-wrap as the pill container */
  .header-wrap {
    background: var(--wk-gray-100) !important;
    border: 1px solid #d9d9d9 !important;
    border-radius: 100px !important;
    height: 63px !important;
    padding: 0 8px !important;
    margin: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .header-logo img {
    height: 36px !important;
  }

  .site-header .header-logo {
    padding-left: 8px !important;
  }

  /* Hamburger button stays the same size */
  .header-mobile-toggle {
    background: transparent !important;
    border: none !important;
  }

  /* Mobile menu: compact dropdown card */
  #mobileMenu,
  .mobile-menu {
    display: block !important;
    background: var(--wk-gray-100) !important;
    border: none !important;
    border-top: none !important;
    margin: 8px 0 0 !important;
    border-radius: 12px !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12) !important;
    overflow: hidden !important;
    padding: 8px 0 16px !important;
    position: absolute !important;
    top: calc(63px + 22px) !important; /* pill height + top padding */
    left: 12px !important;
    right: 12px !important;
    z-index: 9000 !important;
    opacity: 0 !important;
    transform: translateY(-8px) !important;
    pointer-events: none !important;
    transition: opacity 0.25s ease, transform 0.25s ease !important;
  }

  #mobileMenu.open,
  .mobile-menu.open {
    opacity: 1 !important;
    transform: translateY(0) !important;
    pointer-events: auto !important;
    max-height: calc(100vh - 100px) !important;
    max-height: calc(100dvh - 100px) !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }

  /* Top-level links */
  #mobileMenu > a,
  .mobile-menu > a {
    font-size: 20px !important;
    font-weight: 400 !important;
    color: var(--wk-text-ink) !important;
    padding: 12px 36px !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06) !important;
    transition: background 0.15s ease !important;
    text-decoration: none !important;
    display: block !important;
  }

  #mobileMenu > a:hover,
  .mobile-menu > a:hover {
    background: rgba(0, 0, 0, 0.04) !important;
    color: var(--wk-text-ink) !important;
  }

  /* Hide phone link in dropdown (it's in the pill nav for desktop) */
  #mobileMenu > a[href^="tel"],
  .mobile-menu > a[href^="tel"] {
    display: none !important;
  }

  /* Subgroup container */
  #mobileMenu .mobile-subgroup,
  .mobile-menu .mobile-subgroup {
    border-bottom: 1px solid rgba(0, 0, 0, 0.06) !important;
  }

  /* Subgroup trigger button */
  #mobileMenu .industries-heading,
  .mobile-menu .industries-heading {
    font-size: 20px !important;
    font-weight: 400 !important;
    color: var(--wk-text-ink) !important;
    background: transparent !important;
    padding: 12px 36px !important;
    min-height: 44px !important;
    width: 100% !important;
    border: none !important;
    border-bottom: none !important;
    text-align: left !important;
    cursor: pointer !important;
  }

  /* Focus styles for mobile toggles */
  #mobileMenu .industries-heading:focus-visible,
  .mobile-menu .industries-heading:focus-visible {
    outline: 2px solid var(--wk-blue-400) !important;
    outline-offset: -2px !important;
  }

  #mobileMenu > a:focus-visible,
  .mobile-menu > a:focus-visible,
  #mobileMenu .mobile-industries-list a:focus-visible,
  .mobile-menu .mobile-industries-list a:focus-visible {
    outline: 2px solid var(--wk-blue-400) !important;
    outline-offset: -2px !important;
  }

  #mobileMenu .industries-heading:hover,
  .mobile-menu .industries-heading:hover {
    background: rgba(0, 0, 0, 0.04) !important;
  }

  /* Sub-items: bold per Figma */
  #mobileMenu .mobile-industries-list a,
  .mobile-menu .mobile-industries-list a {
    font-size: 18px !important;
    font-weight: 600 !important;
    color: var(--wk-text-ink) !important;
    padding: 8px 36px 8px 51px !important;
    background: transparent !important;
  }

  #mobileMenu .mobile-industries-list a:hover,
  .mobile-menu .mobile-industries-list a:hover {
    background: rgba(0, 0, 0, 0.04) !important;
    color: var(--wk-text-ink) !important;
    padding-left: 51px !important;
  }

  /* Remove the dark page overlay */
  .mobile-menu-overlay {
    background: transparent !important;
    pointer-events: auto !important;
  }
}
