/* =========================================================
   Accessibility enhancements — visual appearance unchanged
   ========================================================= */

/* --- Skip link (visually hidden until focused) --- */
.skip-link {
  position: absolute;
  top: -999px;
  left: 0;
  z-index: 99999;
  background: #1a1a1a;
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 10px 18px;
  border-radius: 0 0 4px 0;
  text-decoration: none;
  white-space: nowrap;
  transition: top 0.1s;
}
.skip-link:focus {
  top: 0;
  outline: 3px solid #ff6a00;
  outline-offset: 0;
}

/* --- Keyboard focus indicators --- */
/* Only show outline for keyboard users (not mouse clicks) */
:focus:not(:focus-visible) {
  outline: none;
}
:focus-visible {
  outline: 3px solid #ff6a00;
  outline-offset: 3px;
  border-radius: 2px;
}

/* Ensure nav links, buttons, form controls all get focus rings */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid #ff6a00;
  outline-offset: 3px;
  border-radius: 2px;
}

/* Fallback for browsers without :focus-visible support */
a:focus,
button:focus,
input:focus,
textarea:focus,
select:focus {
  outline: 3px solid #ff6a00;
  outline-offset: 3px;
  border-radius: 2px;
}
/* Remove the fallback for pointer users via JS (added by accessibility.js polyfill if needed) */
body.using-mouse a:focus,
body.using-mouse button:focus,
body.using-mouse input:focus,
body.using-mouse textarea:focus,
body.using-mouse select:focus {
  outline: none;
}

/* --- Visually hidden utility (screen-reader only) --- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* --- Mobile nav toggle: make the icon-wrapper itself a proper button --- */
.nav-mobile-toggle {
  cursor: pointer;
}
/* Ensure sufficient touch target */
@media (max-width: 768px) {
  .nav-mobile-toggle {
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

/* --- Contact form: visible labels (hidden but accessible) --- */
.form--square .field-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: #555;
  margin-bottom: 2px;
  padding-left: 2px;
}

/* --- Ensure sufficient colour contrast for semi-transparent text --- */
/* The KPI labels use color:8f8f8f8c (invalid value, renders as #000).
   We target those inline-div children via the parent section gradient. */

/* --- High-contrast focus for dark backgrounds (nav, footer, dark sections) --- */
nav a:focus-visible,
footer a:focus-visible,
.bg--dark a:focus-visible,
.imagebg a:focus-visible {
  outline-color: #fff;
  background-color: rgba(255,106,0,0.25);
  border-radius: 2px;
}
nav a:focus,
footer a:focus,
.bg--dark a:focus,
.imagebg a:focus {
  outline-color: #fff;
}
body.using-mouse nav a:focus,
body.using-mouse footer a:focus,
body.using-mouse .bg--dark a:focus,
body.using-mouse .imagebg a:focus {
  outline: none;
  background-color: transparent;
}

/* --- Footer link contrast: override opacity-based fade with explicit colour ---
   Default: bg--dark a = #fff, opacity 0.5 on #232323 ≈ 3.1:1 (WCAG fail).
   Fix: raise opacity to 0.75 → ≈5.7:1 (WCAG AA pass) while keeping the
   hover = 1.0 (full white) intact. No visible change to sighted users. */
.footer-4 .footer__navigation li a,
.footer__navigation li a {
  opacity: 0.75;
}
.footer-4 .footer__navigation li a:hover,
.footer__navigation li a:hover {
  opacity: 1;
}

/* --- Footer touch targets: ensure min 44x44 px tap area --- */
.footer__navigation li a {
  display: inline-block;
  min-height: 44px;
  line-height: 44px;
  padding: 0 4px;
}

/* --- Footer section headings: h4 visually styled as h6 to fix heading-order ---
   The h4 semantically fits the page hierarchy (h1→h2→h3→h4) while
   .footer-section-heading makes it look identical to the previous h6. */
footer h4.footer-section-heading {
  font-family: 'Roboto', sans-serif, Helvetica, Arial, sans-serif;
  font-size: 0.625em;
  font-weight: 600;
  line-height: 2.6em;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #ffffff;
  margin-top: 0;
  margin-bottom: 2.36363636363636em;
  font-variant-ligatures: common-ligatures;
}

/* --- Reduced motion respect --- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
