/* =================================================================
   Accessibility Contrast Fixes — WCAG 2.1 AA (4.5:1 minimum)
   Applied after all other CSS to override low-contrast colors.
   ================================================================= */

/* --- Topbar: white-on-green must be full opacity --- */
.so-topbar__text {
  color: rgba(255, 255, 255, 0.95);
}
.so-topbar__link {
  color: rgba(255, 255, 255, 0.95);
}
.so-topbar__sep {
  color: rgba(255, 255, 255, 0.6);
}
.so-topbar {
  color: #fff;
}

/* --- Services grid subtitle: light gray on white needs darker --- */
.so-services-grid__subtitle,
.so-destinations-grid__subtitle,
.so-portal-links__subtitle,
.so-how-it-works__subtitle {
  color: #4a5568 !important; /* gray-700: 4.6:1 on white */
}

/* --- Service item descriptions and explore links --- */
.so-service-item__desc {
  color: #4a5568 !important; /* gray-700 */
}

/* --- Service item stats badges: ensure dark enough text on light bg --- */
.so-service-item__stats-badge {
  font-weight: 600;
}
.so-service-item__stats-badge[style*="color: #3b82f6"] {
  color: #1d4ed8 !important; /* blue-700: 4.7:1 on #eff6ff */
}
.so-service-item__stats-badge[style*="color: #10b981"] {
  color: #047857 !important; /* emerald-700: 4.5:1 on #ecfdf5 */
}
.so-service-item__stats-badge[style*="color: #f59e0b"] {
  color: #b45309 !important; /* amber-700: 4.5:1 on #fffbeb */
}
.so-service-item__stats-badge[style*="color: #8b5cf6"] {
  color: #6d28d9 !important; /* violet-700: 4.6:1 on #f5f3ff */
}
.so-service-item__stats-badge[style*="color: #ec4899"] {
  color: #be185d !important; /* pink-700: 4.5:1 on #fdf2f8 */
}

/* --- Service item explore links --- */
.so-service-item__explore {
  font-weight: 700;
}
.so-service-item__explore[style*="color: #3b82f6"] {
  color: #1d4ed8 !important;
}
.so-service-item__explore[style*="color: #10b981"] {
  color: #047857 !important;
}
.so-service-item__explore[style*="color: #f59e0b"] {
  color: #b45309 !important;
}
.so-service-item__explore[style*="color: #8b5cf6"] {
  color: #6d28d9 !important;
}
.so-service-item__explore[style*="color: #ec4899"] {
  color: #be185d !important;
}

/* --- Featured section subtitles --- */
.so-featured__subtitle,
.so-featured__subtitle[style*="color: var(--so-gray-500)"] {
  color: #4a5568 !important; /* gray-700 */
}

/* --- Featured card rating text on white --- */
.so-featured__card-rating {
  color: #92400e !important; /* amber-800: high contrast on white */
  font-weight: 700;
}

/* --- Featured card "/ person" text --- */
.so-featured__card-price span,
.so-featured__card .so-featured__card-meta span {
  color: #374151; /* gray-700 */
}

/* --- Portal item descriptions --- */
.so-portal-item__desc {
  color: #4a5568 !important; /* gray-700 */
}

/* --- Trust features section: white-on-green --- */
.so-trust-features__subtitle,
.so-trust-features__subtitle[style*="rgba(255,255,255,0.7)"] {
  color: rgba(255, 255, 255, 0.95) !important;
}
.so-trust-item__desc {
  color: rgba(255, 255, 255, 0.95) !important;
}
/* Ensure trust section has proper contrast for all text */
.so-trust-features[style*="background: var(--so-primary)"] .so-trust-item__desc,
.so-trust-features[data-theme="dark"] .so-trust-item__desc {
  color: rgba(255, 255, 255, 0.95) !important;
}

/* --- How it works steps --- */
.so-step-item__desc {
  color: #4a5568 !important; /* gray-700 */
}

/* --- Accessibility panel section titles --- */
.so-a11y-section-title {
  color: #1a202c !important; /* gray-900 */
  font-weight: 700;
}

/* --- Generic: any body landing page text --- */
body.page-node-type-landing_page {
  color: #1a1a18; /* near-black, high contrast */
}

/* --- Featured cards: ensure sufficient contrast for all text --- */
.so-featured__card[style*="border: 1px solid rgba(0,0,0,0.06)"] {
  color: #1a202c;
}
.so-featured__card-city {
  color: #4a5568;
}

/* --- AI Powered stats badge: var(--so-primary) on var(--so-primary-light) ---
   Inline style="color: var(--so-primary)" resolves to #087F72 which is only
   3.5:1 on the light green background. We override the CSS variable value
   within this element scope so var(--so-primary) resolves to the darker green. */
.so-service-item__stats-badge[style] {
  --so-primary: #05635a;
}
/* Also directly override for badges that use var(--so-primary) as text color */
span.so-service-item__stats-badge[style*="--so-primary"] {
  color: #05635a !important;
}

/* --- Currency widget: fix all low-contrast elements --- */

/* "Updated 02:26 AM" — #9ca3af on dark widget bg is too light */
.so-currency-widget__updated {
  color: #4b5563 !important; /* gray-600: 5.7:1 on white */
}

/* Currency name (e.g. "US Dollar") — #9ca3af on white is 2.6:1 */
.so-currency-widget__name {
  color: #4b5563 !important; /* gray-600: 5.7:1 on white */
}

/* "SAR" label — #9ca3af on white is 2.6:1 */
.so-currency-widget__label {
  color: #4b5563 !important; /* gray-600 */
}

/* Active card: white text on green bg — fix low-opacity text */
.so-currency-widget__card.is-active .so-currency-widget__name {
  color: rgba(255, 255, 255, 0.92) !important; /* 4.6:1 on #087F72 */
}

.so-currency-widget__card.is-active .so-currency-widget__label {
  color: rgba(255, 255, 255, 0.92) !important; /* 4.6:1 on #087F72 */
}

/* Whole widget container — ensure all nested text meets contrast */
.so-currency-widget {
  color: #1a202c;
}
