/* ============================================
   KE · CPT Single · Page Nav · CSS
   Anchor Nav — sticky desktop top, mobile bottom drawer
   Scope: service, success-story, insight, segment
   
   NOTE: Progress bar styles are in a separate global snippet:
   KE · Global · Progress Bar
   ============================================ */

/* ══════════════════════════════════════════
   DESKTOP TOP BAR NAV
   ══════════════════════════════════════════ */

/* ── Desktop Anchor Nav ── */
#ke-anchor-nav {
  position: fixed;
  top: 0px; /* JS overrides this on every scroll */
  left: 0;
  right: 0;
  width: 100%;
  z-index: 99;
  background: #ffffff;
  border-bottom: 1px solid rgba(0,0,0,0.07);
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
}

/* Offset anchor nav below sticky site header */
#ke-anchor-nav:not(.ke-anav--sidebar) {
  top: 60px !important;
}

#ke-anchor-nav.ke-nav-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* Hide state — triggered when site footer enters viewport ── */
/* Also used when nav hasn't appeared yet (before hero clears) */
#ke-anchor-nav.ke-anav--hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.ke-anav-inner {
  display: flex;
  align-items: center;
  overflow-x: auto;
  scrollbar-width: none;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 5%;
}
.ke-anav-inner::-webkit-scrollbar { display: none; }

.ke-anav-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--ke-ink-5);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 0 16px 0 0;
  border-right: 1px solid rgba(0,0,0,0.07);
  margin-right: 4px;
  white-space: nowrap;
  align-self: center;
  flex-shrink: 0;
}

.ke-anav-link {
  padding: 12px 18px;
  font-size: 12.5px;
  font-weight: 600;
  color: #7A7873;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  text-decoration: none;
  transition: color 0.15s, border-color 0.15s;
  flex-shrink: 0;
}
.ke-anav-link:hover { color: #1A1916; }
.ke-anav-link.ke-anav-active {
  color: #005F36;
  border-bottom-color: #005F36;
}

/* ── Nested H3 links — auto-H2 mode (Insights only) ── */
/* Applied by JS when heading is H3 level */
.ke-anav-link.ke-anav-link--nested,
.ke-anav-link.ke-anav-h3 {
  font-size: 11.5px;
  font-weight: 500;
  padding-left: 10px;
  color: #A8A6A1;
}
.ke-anav-link.ke-anav-link--nested.ke-anav-active,
.ke-anav-link.ke-anav-h3.ke-anav-active {
  color: #005F36;
}

.ke-anav-cta {
  margin-left: auto !important;
  flex-shrink: 0 !important;
  padding: 6px 16px !important;
  background: linear-gradient(135deg, #005F36 0%, #007A48 55%, #00A65E 100%) !important;
  color: #ffffff !important;
  border-radius: 8px !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  text-decoration: none !important;
  white-space: nowrap !important;
  box-shadow: 0 2px 8px rgba(0,95,54,0.25), inset 0 1px 0 rgba(255,255,255,0.12) !important;
  transition: filter 0.15s, transform 0.12s !important;
  align-self: center !important;
}
.ke-anav-cta:hover {
  filter: brightness(1.08) !important;
  transform: translateY(-1px) !important;
}

/* ── Hide desktop nav on mobile ── */
@media (max-width: 768px) {
  #ke-anchor-nav { display: none; }
}

/* ══════════════════════════════════════════
   DESKTOP SIDEBAR NAV
   ══════════════════════════════════════════ */
/* ============================================
   KE · Anchor Nav Variant · Desktop Sidebar
   Use on #ke-anchor-nav with class .ke-anav--sidebar
   ============================================ */

@media (min-width: 1025px) {
  #ke-anchor-nav.ke-anav--sidebar {
    position: sticky !important;
    top: 96px !important;
    left: auto !important;
    right: auto !important;
    width: auto !important;
    z-index: 10 !important;

    background: transparent !important;
    border-bottom: 0 !important;

    opacity: 1 !important;
    transform: none !important;
    pointer-events: auto !important;
  }

  #ke-anchor-nav.ke-anav--sidebar .ke-anav-inner {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;

    max-width: none !important;
    margin: 0 !important;
    /*padding: 18px 20px !important;*/

    overflow: visible !important;
   /* background: #ffffff !important;
    border: 1px solid rgba(0,0,0,0.08) !important;
    border-radius: 14px !important;
    box-shadow: none !important;*/
  }

  #ke-anchor-nav.ke-anav--sidebar .ke-anav-label {
    display: block !important;
    padding: 0 0 14px 0 !important;
    margin: 0 !important;
    justify-items: flex-start;

    border-right: 0 !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    letter-spacing: 0.08em !important;
    text-transform: uppercase !important;
    color: #A8A6A1 !important;
  }

  #ke-anchor-nav.ke-anav--sidebar .ke-anav-link {
    display: block !important;
    padding: 6px 0 !important;

    white-space: normal !important;
    border-bottom: 0 !important;
    text-decoration: none !important;

    font-size: 13px !important;
    font-weight: 500 !important;
    line-height: 1.35 !important;
    color: #7A7873 !important;
  }

  #ke-anchor-nav.ke-anav--sidebar .ke-anav-link:hover {
    color: #1A1916 !important;
  }

  #ke-anchor-nav.ke-anav--sidebar .ke-anav-link.ke-anav-active {
    color: #005F36 !important;
    font-weight: 700 !important;
    border-bottom: 0 !important;
  }

  #ke-anchor-nav.ke-anav--sidebar .ke-anav-link.ke-anav-link--nested,
  #ke-anchor-nav.ke-anav--sidebar .ke-anav-link.ke-anav-h3 {
    padding-left: 12px !important;
    font-size: 12.5px !important;
    font-weight: 500 !important;
    color: #8B8984 !important;
  }

  #ke-anchor-nav.ke-anav--sidebar .ke-anav-link.ke-anav-link--nested.ke-anav-active,
  #ke-anchor-nav.ke-anav--sidebar .ke-anav-link.ke-anav-h3.ke-anav-active {
    color: #005F36 !important;
    font-weight: 700 !important;
  }

  #ke-anchor-nav.ke-anav--sidebar .ke-anav-cta {
    margin-left: 0 !important;
    margin-top: 14px !important;
    text-align: center !important;
  }

  #ke-anchor-nav.ke-anav--sidebar.ke-anav--hidden {
    opacity: 0 !important;
    pointer-events: none !important;
  }
}

/* Always hide desktop dummy nav template */
#ke-anchor-nav .ke-anav-link.ke-anav-template,
#ke-anchor-nav.ke-anav--sidebar .ke-anav-link.ke-anav-template {
  display: none !important;
}

/* ══════════════════════════════════════════
   MOBILE BOTTOM NAV
   ══════════════════════════════════════════ */

#ke-anchor-nav-mobile {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 199;
  display: none;
  flex-direction: column;
  padding-bottom: env(safe-area-inset-bottom);
}

/* Show on mobile only when JS adds ke-nav-visible */
@media (max-width: 768px) {
  #ke-anchor-nav-mobile.ke-nav-visible {
    display: flex;
  }
}

/* Never show on desktop/tablet */
@media (min-width: 769px) {
  #ke-anchor-nav-mobile { display: none !important; }
}

/* Hide state — triggered when site footer enters viewport */
#ke-anchor-nav-mobile.ke-anav--hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}


/* ── Drawer ── */
.ke-anav-drawer {
  background: #ffffff;
  border-top: 1px solid rgba(0,0,0,0.07);
  border-radius: 16px 16px 0 0;
  transform: translateY(100%);
  transition: transform 0.28s ease;
  box-shadow: 0 -4px 24px rgba(0,0,0,0.1);
  max-height: 70vh;
  overflow-y: auto;
}
.ke-anav-drawer.ke-drawer-open {
  transform: translateY(0);
}

.ke-anav-drawer-handle {
  display: block;
  width: 36px;
  height: 4px;
  background: #dce3ed;
  border-radius: 2px;
  margin: 10px auto 4px;
}

.ke-anav-drawer-label {
  font-size: 10.5px;
  font-weight: 700;
  color: #A8A6A1;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 8px 20px 10px;
  border-bottom: 1px solid rgba(0,0,0,0.07);
}

.ke-anav-drawer-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 20px;
  font-size: 14px;
  font-weight: 600;
  color: #4A4844;
  text-decoration: none;
  border-bottom: 1px solid rgba(0,0,0,0.07);
  transition: background 0.12s, color 0.12s;
}
.ke-anav-drawer-link:last-child { border-bottom: none; }
.ke-anav-drawer-link:hover,
.ke-anav-drawer-link.ke-anav-active {
  background: #EAF4EE;
  color: #005F36;
}
/*
.ke-anav-drawer-link.ke-anav-active::after {
  content: '●';
  font-size: 7px;
  color: #005F36;
}
*/

/* Nested H3 in drawer — auto-H2 mode (Insights only) */
.ke-anav-drawer-link.ke-anav-link--nested,
.ke-anav-drawer-link.ke-anav-h3 {
  padding-left: 32px;
  font-size: 13px;
  font-weight: 500;
  color: #7A7873;
}


/* ── Bottom trigger bar ── */
.ke-anav-bar {
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid rgba(0,0,0,0.07);
  display: flex;
  align-items: center;
  padding: 0 16px;
  height: 52px;
  gap: 10px;
}

.ke-anav-trigger {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #4A4844;
  cursor: pointer;
  min-width: 0;
}
.ke-anav-trigger-icon {
  font-size: 14px;
  color: #005F36;
  flex-shrink: 0;
}
.ke-anav-trigger-text {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ke-anav-chevron {
  font-size: 10px;
  color: #A8A6A1;
  transition: transform 0.2s;
  flex-shrink: 0;
}
.ke-anav-chevron.ke-chevron-open { transform: rotate(180deg); }

.ke-anav-bar-cta {
  flex-shrink: 0;
  padding: 3px 14px;
  margin-left: 30px;
  background: linear-gradient(135deg, #005F36 0%, #007A48 55%, #00A65E 100%);
  color: #ffffff;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0,95,54,0.25), inset 0 1px 0 rgba(255,255,255,0.12);
}

/* ── Mobile generated list template ── */
.mtd-template {
  display: none !important;
}

/* Active generated mobile item */
.mtd-link.ke-anav-active {
  background: #EAF4EE;
  color: #005F36;
  border-left: 3px solid var(--ke-green);
}

.mtd-link.ke-anav-active .mtd-num {
  background: #005F36;
  color: #ffffff;
}

/* ── Backdrop ── */
.ke-anav-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.3);
  z-index: 188;
  display: none;
}
.ke-anav-backdrop.ke-backdrop-open { display: block; }