/* ==========================================================================
   ACCESSIBILITY WIDGET STYLES (PERSISTENCE CAPITAL INITIATIVE)
   Features: Fixed Top-Right Trigger, Font Size Scaler (A- / A+), High Contrast Toggle
   ========================================================================== */

/* Fixed Floating Widget Container */
.nx-a11y-widget {
  position: fixed;
  top: 18px;
  right: 48px;
  z-index: 2147483647 !important;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
  user-select: none;
  -webkit-user-select: none;
  zoom: 1 !important; /* Keep widget fixed size regardless of page zoom */
}

/* Circular Accessibility Trigger Button */
.nx-a11y-trigger {
  width: 42px;
  height: 42px;
  border-radius: 50% !important;
  border: 1.5px solid rgba(255, 255, 255, 0.28) !important;
  background: #031737 !important;
  color: #ffffff !important;
  cursor: pointer;
  display: flex !important;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(3, 23, 55, 0.28) !important;
  transition: transform 0.2s ease, opacity 0.2s ease, background 0.2s ease, box-shadow 0.2s ease !important;
  outline: none;
  padding: 0;
  margin: 0;
}

.nx-a11y-trigger:hover {
  opacity: 0.92;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(3, 23, 55, 0.4) !important;
}

.nx-a11y-trigger:focus-visible {
  outline: 3px solid #38bdf8 !important;
  outline-offset: 3px !important;
}

.nx-a11y-trigger svg {
  width: 22px;
  height: 22px;
  display: block;
  stroke: #ffffff;
  pointer-events: none;
}

/* Floating Settings Dropdown Panel */
.nx-a11y-panel {
  position: absolute;
  top: 52px;
  right: 0;
  background: #ffffff !important;
  border: 1px solid #d0d5dd !important;
  border-radius: 12px !important;
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.16) !important;
  padding: 16px 18px !important;
  min-width: 230px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 12px !important;
  z-index: 2147483647 !important;
  animation: nxA11yPopup 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
  box-sizing: border-box !important;
}

.nx-a11y-panel[hidden] {
  display: none !important;
}

@keyframes nxA11yPopup {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Rows */
.nx-a11y-section {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 16px !important;
  width: 100% !important;
}

.nx-a11y-label {
  font-size: 14px !important;
  font-weight: 700 !important;
  color: #031737 !important;
  white-space: nowrap !important;
  margin: 0 !important;
  line-height: 1 !important;
}

/* Font Size Control Cluster */
.nx-a11y-font-controls {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
}

.nx-a11y-font-btn {
  width: 32px !important;
  height: 32px !important;
  border-radius: 6px !important;
  border: 1px solid #d0d5dd !important;
  background: #f9fafb !important;
  color: #031737 !important;
  font-weight: 800 !important;
  font-size: 13px !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: all 0.15s ease !important;
  padding: 0 !important;
  margin: 0 !important;
  line-height: 1 !important;
  outline: none !important;
}

.nx-a11y-font-btn:hover:not(:disabled) {
  background: #e5e7eb !important;
  border-color: #94a3b8 !important;
  color: #0f172a !important;
}

.nx-a11y-font-btn:disabled {
  opacity: 0.35 !important;
  cursor: not-allowed !important;
}

.nx-a11y-font-val {
  font-size: 13px !important;
  font-weight: 600 !important;
  min-width: 36px !important;
  text-align: center !important;
  color: #5b5f66 !important;
  display: inline-block !important;
}

/* Divider Line */
.nx-a11y-divider {
  border-top: 1px solid #e5e7eb !important;
  width: 100% !important;
  margin: 2px 0 !important;
}

/* High Contrast Toggle Switch */
.nx-a11y-toggle {
  position: relative !important;
  width: 44px !important;
  height: 24px !important;
  border-radius: 12px !important;
  border: 1px solid #d0d5dd !important;
  background: #e5e7eb !important;
  cursor: pointer !important;
  padding: 0 !important;
  margin: 0 !important;
  transition: background 0.25s ease, border-color 0.25s ease !important;
  flex-shrink: 0 !important;
  outline: none !important;
  display: inline-block !important;
}

.nx-a11y-toggle.active {
  background: #38bdf8 !important; /* Persistence Capital orange active state */
  border-color: #38bdf8 !important;
}

.nx-a11y-toggle-knob {
  position: absolute !important;
  top: 2px !important;
  left: 2px !important;
  width: 18px !important;
  height: 18px !important;
  border-radius: 50% !important;
  background: #ffffff !important;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25) !important;
  display: block !important;
}

.nx-a11y-toggle.active .nx-a11y-toggle-knob {
  transform: translateX(20px) !important;
}

/* ==========================================================================
   HIGH CONTRAST THEME (PERSISTENCE CAPITAL INSPIRED)
   ========================================================================== */
body[data-high-contrast="true"],
body.nx-high-contrast {
  background-color: #000000 !important;
  color: #ffffff !important;
}

body[data-high-contrast="true"] .nx-a11y-panel {
  background: #000000 !important;
  border-color: #ffffff !important;
  color: #ffffff !important;
  box-shadow: 0 8px 30px rgba(255, 255, 255, 0.2) !important;
}

body[data-high-contrast="true"] .nx-a11y-label {
  color: #ffffff !important;
}

body[data-high-contrast="true"] .nx-a11y-font-btn {
  background: #1e293b !important;
  color: #ffffff !important;
  border-color: #ffffff !important;
}

body[data-high-contrast="true"] .nx-a11y-font-btn:hover:not(:disabled) {
  background: #334155 !important;
}

body[data-high-contrast="true"] .nx-a11y-font-val {
  color: #cbd5e1 !important;
}

body[data-high-contrast="true"] .nx-a11y-divider {
  border-color: #334155 !important;
}

/* Global elements in High Contrast */
body[data-high-contrast="true"] .boxed_wrapper,
body[data-high-contrast="true"] header,
body[data-high-contrast="true"] footer,
body[data-high-contrast="true"] section,
body[data-high-contrast="true"] .nx-section,
body[data-high-contrast="true"] .service-details,
body[data-high-contrast="true"] .nx-designs-showcase-wrapper,
body[data-high-contrast="true"] .nx-numbers-band,
body[data-high-contrast="true"] .nx-hero-section,
body[data-high-contrast="true"] .card,
body[data-high-contrast="true"] div[class*="wrap"]:not(.nx-a11y-widget, .nx-a11y-widget *),
body[data-high-contrast="true"] div[class*="box"]:not(.nx-a11y-widget, .nx-a11y-widget *),
body[data-high-contrast="true"] div[class*="panel"]:not(.nx-a11y-widget, .nx-a11y-widget *),
body[data-high-contrast="true"] div[class*="card"]:not(.nx-a11y-widget, .nx-a11y-widget *) {
  background-color: #000000 !important;
  background-image: none !important;
  color: #ffffff !important;
}

body[data-high-contrast="true"] p,
body[data-high-contrast="true"] span:not(.nx-a11y-widget *),
body[data-high-contrast="true"] li,
body[data-high-contrast="true"] h1,
body[data-high-contrast="true"] h2,
body[data-high-contrast="true"] h3,
body[data-high-contrast="true"] h4,
body[data-high-contrast="true"] h5,
body[data-high-contrast="true"] h6,
body[data-high-contrast="true"] td,
body[data-high-contrast="true"] th,
body[data-high-contrast="true"] strong,
body[data-high-contrast="true"] em {
  color: #ffffff !important;
}

body[data-high-contrast="true"] a:not(.theme-btn, .btn-one, .btn-two, .nx-btn-primary, .nx-a11y-widget *) {
  color: #66b3ff !important;
  text-decoration: underline !important;
}

body[data-high-contrast="true"] a:hover:not(.theme-btn, .btn-one, .btn-two, .nx-btn-primary, .nx-a11y-widget *) {
  color: #7dd3fc !important;
}

body[data-high-contrast="true"] .theme-btn,
body[data-high-contrast="true"] .btn-one,
body[data-high-contrast="true"] .btn-two,
body[data-high-contrast="true"] .nx-btn-primary {
  background: #000000 !important;
  background-image: none !important;
  color: #ffffff !important;
  border: 2px solid #ffffff !important;
  font-weight: 800 !important;
}

/* Border enhancement in High Contrast */
body[data-high-contrast="true"] div[class*="card"],
body[data-high-contrast="true"] div[class*="box"],
body[data-high-contrast="true"] div[class*="tier"],
body[data-high-contrast="true"] div[class*="step"],
body[data-high-contrast="true"] div[class*="row"] {
  border-color: #ffffff !important;
}

/* Refined high contrast rendering for site content */
body[data-high-contrast="true"] {
  background: #000000 !important;
  color: #ffffff !important;
}

body[data-high-contrast="true"] .main-header,
body[data-high-contrast="true"] .header-upper,
body[data-high-contrast="true"] .main-header.fixed-header,
body[data-high-contrast="true"] .sticky-header {
  background: #000000 !important;
  background-image: none !important;
  border-bottom: 1px solid #ffffff !important;
  box-shadow: none !important;
}

body[data-high-contrast="true"] .main-header img,
body[data-high-contrast="true"] .footer-logo img,
body[data-high-contrast="true"] .logo-box img {
  filter: brightness(0) invert(1) !important;
}

body[data-high-contrast="true"] .main-menu .navigation > li > a,
body[data-high-contrast="true"] .main-menu .navigation > li > a span,
body[data-high-contrast="true"] .mobile-menu a,
body[data-high-contrast="true"] .footer-widget a {
  color: #ffffff !important;
  text-decoration: none !important;
}

body[data-high-contrast="true"] .main-menu .navigation > li > a:hover,
body[data-high-contrast="true"] .main-menu .navigation > li.current > a,
body[data-high-contrast="true"] a:not(.theme-btn, .btn-one, .btn-two, .nx-btn-primary, .nx-btn-secondary, .nx-a11y-widget *) {
  color: #7dd3fc !important;
}

body[data-high-contrast="true"] .theme-btn,
body[data-high-contrast="true"] .btn-one,
body[data-high-contrast="true"] .btn-two,
body[data-high-contrast="true"] .nx-btn-primary,
body[data-high-contrast="true"] .nx-btn-secondary,
body[data-high-contrast="true"] button:not(.nx-a11y-widget button),
body[data-high-contrast="true"] input[type="submit"],
body[data-high-contrast="true"] input[type="button"] {
  background: #000000 !important;
  background-image: none !important;
  color: #ffffff !important;
  border: 2px solid #ffffff !important;
  box-shadow: none !important;
  outline: none !important;
  text-decoration: none !important;
}

body[data-high-contrast="true"] .theme-btn:hover,
body[data-high-contrast="true"] .btn-one:hover,
body[data-high-contrast="true"] .btn-two:hover,
body[data-high-contrast="true"] .nx-btn-primary:hover,
body[data-high-contrast="true"] .nx-btn-secondary:hover,
body[data-high-contrast="true"] button:not(.nx-a11y-widget button):hover {
  background: #ffffff !important;
  color: #000000 !important;
  border-color: #ffffff !important;
}

body[data-high-contrast="true"] .theme-btn::before,
body[data-high-contrast="true"] .btn-one::before,
body[data-high-contrast="true"] .btn-two::before,
body[data-high-contrast="true"] .nx-btn-primary::before,
body[data-high-contrast="true"] .nx-btn-secondary::before {
  background: transparent !important;
  transform: none !important;
}

body[data-high-contrast="true"] .nx-a11y-trigger {
  background: #000000 !important;
  color: #ffffff !important;
  border: 2px solid #ffffff !important;
  box-shadow: none !important;
}

body[data-high-contrast="true"] .nx-a11y-panel {
  background: #000000 !important;
  color: #ffffff !important;
  border: 1px solid #ffffff !important;
}

body[data-high-contrast="true"] .nx-a11y-toggle.active {
  background: #ffffff !important;
  border-color: #ffffff !important;
}

body[data-high-contrast="true"] .nx-a11y-toggle.active .nx-a11y-toggle-knob {
  background: #000000 !important;
}

body[data-high-contrast="true"] .nx-hero-section,
body[data-high-contrast="true"] .nx-hero-video-wrap,
body[data-high-contrast="true"] .nx-metrics-video-wrap,
body[data-high-contrast="true"] .nx-intro-visual,
body[data-high-contrast="true"] [class*="video-wrap"],
body[data-high-contrast="true"] [class*="visual"] {
  background: #000000 !important;
  background-image: none !important;
}

body[data-high-contrast="true"] .nx-hero-video-bg,
body[data-high-contrast="true"] .nx-metrics-video-bg {
  opacity: 0.18 !important;
  filter: grayscale(1) contrast(1.2) brightness(0.45) !important;
}

body[data-high-contrast="true"] .nx-hero-trust-strip,
body[data-high-contrast="true"] .nx-hero-trust-item,
body[data-high-contrast="true"] .nx-intro-principles > div,
body[data-high-contrast="true"] .nx-tl-strategy-card,
body[data-high-contrast="true"] .nx-opt3-wrap,
body[data-high-contrast="true"] .nx-opt3-tier,
body[data-high-contrast="true"] .nx-number-box,
body[data-high-contrast="true"] .nx-facts-feature-panel,
body[data-high-contrast="true"] .nx-facts-feature-grid div,
body[data-high-contrast="true"] .nx-leader-card,
body[data-high-contrast="true"] .nx-blog-card,
body[data-high-contrast="true"] .nx-alpha-card,
body[data-high-contrast="true"] .faq-accordion .accordion,
body[data-high-contrast="true"] .accordion,
body[data-high-contrast="true"] .form-inner,
body[data-high-contrast="true"] .contact-form,
body[data-high-contrast="true"] .nx-consultation-portal {
  background: #000000 !important;
  background-image: none !important;
  color: #ffffff !important;
  border-color: #ffffff !important;
  box-shadow: none !important;
}

body[data-high-contrast="true"] svg,
body[data-high-contrast="true"] svg * {
  color: #7dd3fc !important;
  stroke: currentColor !important;
}

body[data-high-contrast="true"] input,
body[data-high-contrast="true"] textarea,
body[data-high-contrast="true"] select,
body[data-high-contrast="true"] .nice-select {
  background: #000000 !important;
  color: #ffffff !important;
  border: 1px solid #ffffff !important;
}

body[data-high-contrast="true"] input::placeholder,
body[data-high-contrast="true"] textarea::placeholder {
  color: #cbd5e1 !important;
}

body[data-high-contrast="true"] *:focus-visible {
  outline: 3px solid #7dd3fc !important;
  outline-offset: 3px !important;
}

/* Responsive adjustment for Mobile & Tablet */
@media (max-width: 991px) {
  .nx-a11y-widget {
    top: 14px;
    right: 60px;
  }
  .nx-a11y-trigger {
    width: 36px;
    height: 36px;
  }
  .nx-a11y-panel {
    top: 48px;
    right: -45px;
    max-width: calc(100vw - 30px);
  }
}

/* Final high contrast guard: keep both JS states visually consistent */
body[data-high-contrast="true"],
body.nx-high-contrast {
  background: #000000 !important;
  color: #ffffff !important;
  filter: none !important;
}

body[data-high-contrast="true"] *,
body[data-high-contrast="true"] *::before,
body[data-high-contrast="true"] *::after,
body.nx-high-contrast *,
body.nx-high-contrast *::before,
body.nx-high-contrast *::after {
  text-shadow: none !important;
}

body[data-high-contrast="true"] *:not(.nx-a11y-widget, .nx-a11y-widget *, .theme-btn:hover, .btn-one:hover, .btn-two:hover, .nx-btn-primary:hover, .nx-btn-secondary:hover),
body.nx-high-contrast *:not(.nx-a11y-widget, .nx-a11y-widget *, .theme-btn:hover, .btn-one:hover, .btn-two:hover, .nx-btn-primary:hover, .nx-btn-secondary:hover) {
  color: #ffffff !important;
}

body[data-high-contrast="true"] a:not(.theme-btn, .btn-one, .btn-two, .nx-btn-primary, .nx-btn-secondary, .nx-a11y-widget *),
body.nx-high-contrast a:not(.theme-btn, .btn-one, .btn-two, .nx-btn-primary, .nx-btn-secondary, .nx-a11y-widget *) {
  color: #7dd3fc !important;
}

body[data-high-contrast="true"] header,
body[data-high-contrast="true"] footer,
body[data-high-contrast="true"] section,
body[data-high-contrast="true"] .main-header,
body[data-high-contrast="true"] .header-upper,
body[data-high-contrast="true"] .sticky-header,
body[data-high-contrast="true"] .mobile-menu,
body.nx-high-contrast header,
body.nx-high-contrast footer,
body.nx-high-contrast section,
body.nx-high-contrast .main-header,
body.nx-high-contrast .header-upper,
body.nx-high-contrast .sticky-header,
body.nx-high-contrast .mobile-menu {
  background-color: #000000 !important;
  background-image: none !important;
  box-shadow: none !important;
}

body[data-high-contrast="true"] .theme-btn,
body[data-high-contrast="true"] .btn-one,
body[data-high-contrast="true"] .btn-two,
body[data-high-contrast="true"] .nx-btn-primary,
body[data-high-contrast="true"] .nx-btn-secondary,
body[data-high-contrast="true"] .nx-btn-outline,
body.nx-high-contrast .theme-btn,
body.nx-high-contrast .btn-one,
body.nx-high-contrast .btn-two,
body.nx-high-contrast .nx-btn-primary,
body.nx-high-contrast .nx-btn-secondary,
body.nx-high-contrast .nx-btn-outline {
  background: #000000 !important;
  background-color: #000000 !important;
  background-image: none !important;
  color: #ffffff !important;
  border: 2px solid #ffffff !important;
  box-shadow: none !important;
}

body[data-high-contrast="true"] .theme-btn:hover,
body[data-high-contrast="true"] .btn-one:hover,
body[data-high-contrast="true"] .btn-two:hover,
body[data-high-contrast="true"] .nx-btn-primary:hover,
body[data-high-contrast="true"] .nx-btn-secondary:hover,
body[data-high-contrast="true"] .nx-btn-outline:hover,
body.nx-high-contrast .theme-btn:hover,
body.nx-high-contrast .btn-one:hover,
body.nx-high-contrast .btn-two:hover,
body.nx-high-contrast .nx-btn-primary:hover,
body.nx-high-contrast .nx-btn-secondary:hover,
body.nx-high-contrast .nx-btn-outline:hover {
  background: #ffffff !important;
  background-color: #ffffff !important;
  color: #000000 !important;
  border-color: #ffffff !important;
}

body[data-high-contrast="true"] .theme-btn::before,
body[data-high-contrast="true"] .btn-one::before,
body[data-high-contrast="true"] .btn-two::before,
body[data-high-contrast="true"] .nx-btn-primary::before,
body[data-high-contrast="true"] .nx-btn-secondary::before,
body[data-high-contrast="true"] .nx-btn-outline::before,
body.nx-high-contrast .theme-btn::before,
body.nx-high-contrast .btn-one::before,
body.nx-high-contrast .btn-two::before,
body.nx-high-contrast .nx-btn-primary::before,
body.nx-high-contrast .nx-btn-secondary::before,
body.nx-high-contrast .nx-btn-outline::before {
  background: transparent !important;
  background-image: none !important;
  opacity: 0 !important;
}

body[data-high-contrast="true"] .card,
body[data-high-contrast="true"] div[class*="card"],
body[data-high-contrast="true"] div[class*="box"],
body[data-high-contrast="true"] div[class*="tier"],
body[data-high-contrast="true"] div[class*="panel"],
body.nx-high-contrast .card,
body.nx-high-contrast div[class*="card"],
body.nx-high-contrast div[class*="box"],
body.nx-high-contrast div[class*="tier"],
body.nx-high-contrast div[class*="panel"] {
  background: #000000 !important;
  background-color: #000000 !important;
  background-image: none !important;
  color: #ffffff !important;
  border-color: #ffffff !important;
  box-shadow: none !important;
}

body[data-high-contrast="true"] img:not(.main-header img, .footer-logo img, .logo-box img),
body[data-high-contrast="true"] video,
body.nx-high-contrast img:not(.main-header img, .footer-logo img, .logo-box img),
body.nx-high-contrast video {
  filter: grayscale(1) contrast(1.1) brightness(0.72) !important;
}

@media (max-width: 767px) {
  body[data-high-contrast="true"] .main-header .menu-area .mobile-nav-toggler,
  body.nx-high-contrast .main-header .menu-area .mobile-nav-toggler {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 3px !important;
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    min-height: 36px !important;
    padding: 0 !important;
    background: #000000 !important;
    border: 2px solid #ffffff !important;
    border-radius: 8px !important;
    box-shadow: none !important;
  }

  body[data-high-contrast="true"] .main-header .menu-area .mobile-nav-toggler .icon-bar,
  body.nx-high-contrast .main-header .menu-area .mobile-nav-toggler .icon-bar {
    display: block !important;
    width: 17px !important;
    height: 2px !important;
    margin: 0 !important;
    background: #ffffff !important;
    border: 0 !important;
    border-radius: 2px !important;
    opacity: 1 !important;
  }
}
