/* Sri Lankan Driver - shared accessibility fixes + automatic dark mode
   Dark mode follows the visitor's device setting (prefers-color-scheme). */

/* ---------- Accessibility (all modes) ---------- */
.sld-skip {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: #132a1e; color: #fff; font-weight: 700; font-size: 14px;
  padding: 10px 16px; border-radius: 9999px; text-decoration: none;
  transition: top .15s ease;
}
.sld-skip:focus { top: 12px; }

a:focus-visible, button:focus-visible, summary:focus-visible,
input:focus-visible, select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid #1f9d5c !important; outline-offset: 2px !important;
}

/* Darker greys so small text passes WCAG AA contrast on white */
.text-\[\#7c8781\], .text-\[\#7c8982\], .text-\[\#6d7c73\], .text-\[\#6d7973\], .text-\[\#7a8c82\] { color: #56635c !important; }
.placeholder-\[\#7c8982\]::placeholder, input::placeholder, textarea::placeholder { color: #66746c !important; opacity: 1; }
.text-\[\#22c55e\] { color: #15803d !important; } /* review stars */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .hero-slide { transform: none !important; }
}

/* ---------- Automatic dark mode ---------- */
@media (prefers-color-scheme: dark) {
  html { color-scheme: dark; }
  html body { background-color: #0f1713 !important; color: #e6eee8 !important; }

  /* Surfaces */
  html .bg-white, html .bg-\[\#fafafa\], html .bg-\[\#f7f9f8\], html .bg-\[\#f8f9fa\], html .bg-\[\#f7fbf8\],
  html .bg-\[\#f5f8f6\], html .bg-white\/90, html .bg-white\/95, html .bg-white\/60 { background-color: #17221c !important; }
  html .bg-\[\#eaf4ee\], html .bg-\[\#eaf4ee\]\/80, html .bg-emerald-50, html .bg-\[\#f3f6f4\], html .bg-emerald-950\/10 { background-color: #1f2e26 !important; }
  html .hover\:bg-white:hover, html .hover\:bg-gray-50:hover, html .hover\:bg-\[\#f5f8f6\]:hover, html .hover\:bg-\[\#f7fbf8\]:hover,
  html .hover\:bg-\[\#fafcfb\]:hover, html .hover\:bg-\[\#eaf4ee\]:hover, html .hover\:bg-\[\#f3f6f4\]:hover, html .hover\:bg-pink-50:hover { background-color: #253a2f !important; }

  /* Dark green blocks: lift slightly so they still stand out */
  html .bg-\[\#132A1E\], html .bg-\[\#13291e\] { background-color: #1b3a2a !important; }
  html .hover\:bg-\[\#1c3b2b\]:hover { background-color: #23493a !important; }

  /* Borders */
  html .border-gray-100, html .border-gray-100\/90, html .border-gray-200, html .border-gray-200\/80, html .border-gray-200\/90,
  html .border-\[\#cde2d5\], html .border-\[\#d2e7da\], html .border-\[\#d5e9dd\], html .border-\[\#dce9e1\], html .border-\[\#e6ece8\],
  html .border-\[\#e1e8e3\], html .border-\[\#eef2ef\], html .divide-gray-200\/80 > * + *, html .divide-\[\#edf1ee\] > * + * { border-color: #2b3c33 !important; }

  /* Text */
  html .text-\[\#182920\], html .text-\[\#172b20\], html .text-\[\#192a21\], html .text-\[\#182c21\], html .text-\[\#26362d\],
  html .text-\[\#2c4a3a\], html .text-\[\#2d3b33\], html .text-\[\#132A1E\], html .hover\:text-\[\#182920\]:hover { color: #e6eee8 !important; }
  html .text-\[\#424d47\], html .text-\[\#48524c\], html .text-\[\#48564e\], html .text-\[\#4a5550\], html .text-\[\#4e5852\], html .text-\[\#4a5f54\] { color: #bccac1 !important; }
  html .text-\[\#5e6e64\], html .text-\[\#646f69\], html .text-\[\#647069\], html .text-\[\#6d7973\], html .text-\[\#6d7c73\],
  html .text-\[\#7c8781\], html .text-\[\#7c8982\], html .text-\[\#5b7266\], html .text-\[\#7a8c82\] { color: #9fb0a6 !important; }
  html .text-\[\#237a4b\], html .text-\[\#1f7a44\], html .text-emerald-700, html .group:hover .group-hover\:text-\[\#237a4b\],
  html .hover\:text-emerald-700:hover, html .hover\:text-\[\#1f7a44\]:hover, html .group:hover .group-hover\:text-emerald-700 { color: #6fd6a0 !important; }
  html .text-\[\#22c55e\] { color: #4ade80 !important; }
  html .text-gray-300 { color: #4b5d53 !important; }
  html input, html select, html textarea { color: #e6eee8 !important; }
  html input::placeholder, html textarea::placeholder { color: #8fa197 !important; }

  /* Keep dark text on the bright green WhatsApp buttons */
  html .bg-\[\#22d45c\], html .bg-\[\#22d45c\] *, html .text-\[\#0c2615\] { color: #0c2615 !important; }

  /* Logo has dark lettering: give it a soft light plate in dark mode */
  html img[src$="Logo.svg"] { background: #eef3ef; border-radius: 12px; padding: 3px 8px; }

  /* Product photos with white backgrounds */
  html img[src*="vehicle-"] { background: #eef3ef; border-radius: 14px; }

  /* Cookie notice (inline-styled) */
  html #sld-analytics-consent, html #sld-analytics-consent > div { background: #17221c !important; color: #e6eee8 !important; border-color: #2b3c33 !important; }
  html #sld-analytics-consent button { border-color: #3a4d43 !important; }

  /* Soft shadows read as glow on dark: tone them down */
  html .soft-card { box-shadow: 0 1px 0 rgba(255,255,255,.03), 0 8px 24px -8px rgba(0,0,0,.5) !important; }
}