/* ============================================
   KE · CPT Single · Page Nav · CSS
   Anchor Nav + Reading Progress Bar
   Scope: success-story, service, post (insight)
   ============================================ */

/* ── Progress Bar ── */
#ke-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 2px;
  background: linear-gradient(135deg, #005F36 0%, #007A48 55%, #00A65E 100%);
  z-index: 9999;
  transition: width 0.1s linear;
  pointer-events: none;
}

/* ── Desktop Anchor Nav ── */
#ke-anchor-nav {
  position: sticky;
  top: 62px;
  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;
}
#ke-anchor-nav.ke-nav-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
#ke-anchor-nav.ke-nav-hidden {
  opacity: 0;
  pointer-events: none;
}
.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: #A8A6A1;
  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 (insights only) */
.ke-anav-link.ke-anav-h3 {
  font-size: 11.5px;
  font-weight: 500;
  padding-left: 10px;
  color: #A8A6A1;
}
.ke-anav-link.ke-anav-h3.ke-anav-active { color: #005F36; }

.ke-anav-cta {
  margin-left: auto;
  flex-shrink: 0;
  padding: 6px 16px;
  background: linear-gradient(135deg, #005F36 0%, #007A48 55%, #00A65E 100%);
  color: #ffffff;
  border-radius: 8px;
  font-size: 12px;
  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);
  transition: filter 0.15s, transform 0.12s;
  align-self: center;
}
.ke-anav-cta:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

/* ── Mobile — hide desktop nav ── */
@media (max-width: 768px) {
  #ke-anchor-nav { display: none; }
}

/* ── 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);
}
@media (max-width: 768px) {
  #ke-anchor-nav-mobile.ke-nav-visible {
    display: flex;
  }
}
@media (min-width: 769px) {
  #ke-anchor-nav-mobile { display: none !important; }
}

/* 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 */
.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: 7px 14px;
  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);
}

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