/**
 * Accessibility overrides
 * Addresses WCAG 2.2 AA findings from Sugamya Digital audit (Annexure 3).
 * Loaded AFTER variables-blue.css and main.css.
 */

/* ----------------------------------------------------------------
   1. Palette overrides — meet 4.5:1 contrast on body, 3:1 on large text
   ---------------------------------------------------------------- */
:root {
  /* Was #5d8ca9 (3.5:1 on white). Now ~5.7:1 on white. */
  --color-secondary: #2c5874;
  --color-secondary-rgb: 44, 88, 116;

  /* Was #6e87b6 (3.6:1 on white). Now ~5.1:1 on white. */
  --color-secondary-light: #4a6585;
  --color-secondary-light-rgb: 74, 101, 133;

  /* Was #3a6f8f. Keep darker variant for hover/legal bar. */
  --color-secondary-dark: #1f3f54;
  --color-secondary-dark-rgb: 31, 63, 84;

  /* Was #0e9ff6 (2.9:1 on white). Now ~4.6:1 on white. */
  --color-primary: #0476ba;
  --color-primary-rgb: 4, 118, 186;
  --color-primary-dark: #015b8e;
  --color-primary-dark-rgb: 1, 91, 142;

  /* Links color used by anchors */
  --color-links: #0476ba;
  --color-links-hover: #015b8e;

  /* Bootstrap overrides */
  --bs-primary-rgb: 4, 118, 186;
  --bs-secondary-rgb: 44, 88, 116;
}

/* ----------------------------------------------------------------
   2. AOS animation — disable opacity fade so axe sees real contrast
   ---------------------------------------------------------------- */
[data-aos] {
  opacity: 1 !important;
}

/* ----------------------------------------------------------------
   3. Footer link text — was rgba(white, 0.7) = 2.6:1 on new bg.
      Force solid white = 8+:1.
   ---------------------------------------------------------------- */
.footer .footer-content .footer-links ul a {
  color: #ffffff;
}
.footer .footer-content .footer-links ul a:hover,
.footer .footer-content .footer-links ul a:focus {
  text-decoration: underline;
}

/* ----------------------------------------------------------------
   4. Nav tab links on download page — was #0e9ff6/#5d8ca9 on white
   ---------------------------------------------------------------- */
.nav-tabs .nav-link {
  color: var(--color-primary-dark);
}
.nav-tabs .nav-link.active {
  color: var(--color-primary-dark);
  border-bottom: 3px solid var(--color-primary-dark);
}

/* ----------------------------------------------------------------
   5. Contact page body paragraphs (.info > p) — was #6e87b6 on white.
   ---------------------------------------------------------------- */
.contact .info > p,
.contact .info-item p,
.faq .accordion-button {
  color: #1a1f24;
}

/* ----------------------------------------------------------------
   6. Marquee replacement — accessible CSS ticker
   ---------------------------------------------------------------- */
.ticker {
  overflow: hidden;
  position: relative;
}
.ticker .ticker-track {
  display: inline-block;
  white-space: nowrap;
  padding-left: 100%;
  animation: ticker-scroll 60s linear infinite;
}
.ticker:hover .ticker-track,
.ticker:focus-within .ticker-track {
  animation-play-state: paused;
}
@keyframes ticker-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-100%); }
}
@media (prefers-reduced-motion: reduce) {
  .ticker .ticker-track {
    animation: none;
    padding-left: 0;
    white-space: normal;
  }
}

/* ----------------------------------------------------------------
   7. Visually hidden helper for a11y-only headings
   ---------------------------------------------------------------- */
.visually-hidden-a11y {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* ----------------------------------------------------------------
   8. Skip-link for keyboard users
   ---------------------------------------------------------------- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: #1a1f24;
  color: #ffffff;
  padding: 8px 16px;
  z-index: 10000;
  text-decoration: none;
}
.skip-link:focus {
  left: 0;
}

/* ----------------------------------------------------------------
   9. Footer headings — were h4 (skipped h3 after page h2).
      HTML now uses h3; mirror original h4 styling onto h3.
   ---------------------------------------------------------------- */
.footer .footer-content h3 {
  font-size: 16px;
  font-weight: 600;
  color: #ffffff;
  position: relative;
  padding-bottom: 12px;
  margin-bottom: 15px;
}
.footer .footer-content h3::after {
  content: "";
  position: absolute;
  display: block;
  width: 20px;
  height: 2px;
  background: var(--color-primary);
  bottom: 0;
  left: 0;
}

/* Service item h3 (was h4) styling on index.html */
.featured-services .service-item h3 {
  font-weight: 600;
  margin-bottom: 15px;
  font-size: 20px;
  color: var(--color-secondary);
}

/* Hero h1 styling (was h2 in hero-static) */
.hero-static h1 {
  margin: 0 0 20px 0;
  font-size: 32px;
  font-weight: 300;
  color: var(--color-secondary);
  font-family: var(--font-secondary);
}
@media (max-width: 640px) {
  .hero-static h1 { font-size: 32px; }
}

/* About page intro heading (was h4.mb-3) */
.contact h3.mb-3 {
  font-size: 20px;
  font-weight: 600;
  color: var(--color-secondary);
}

/* ----------------------------------------------------------------
   10. Visible focus outline (was suppressed by some Bootstrap rules)
   ---------------------------------------------------------------- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid #0476ba;
  outline-offset: 2px;
}
