/* Accessibility — focus, motion, contrast helpers (editorial theme) */

/* Skip link: first focusable control */
body.theme-editorial .c-skip-link {
  position: absolute;
  left: var(--space-4);
  top: 0;
  z-index: 10000;
  padding: 0.75rem 1.25rem;
  background: var(--color-navy);
  color: var(--color-white) !important;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none !important;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  transform: translateY(-120%);
  transition: transform 0.2s ease;
}

body.theme-editorial .c-skip-link:focus,
body.theme-editorial .c-skip-link:focus-visible {
  transform: translateY(0);
  outline: 3px solid var(--color-teal);
  outline-offset: 2px;
}

/* Main is a skip target — no visible outline unless keyboard-focused */
body.theme-editorial #main:focus {
  outline: none;
}

body.theme-editorial #main:focus-visible {
  outline: 3px solid var(--color-teal);
  outline-offset: 4px;
}

/* Prefer :focus-visible; only suppress mouse focus rings on interactive controls */
body.theme-editorial a:focus:not(:focus-visible),
body.theme-editorial button:focus:not(:focus-visible),
body.theme-editorial input:focus:not(:focus-visible),
body.theme-editorial textarea:focus:not(:focus-visible),
body.theme-editorial select:focus:not(:focus-visible),
body.theme-editorial summary:focus:not(:focus-visible) {
  outline: none;
}

body.theme-editorial :focus-visible {
  outline: 3px solid var(--color-teal);
  outline-offset: 3px;
}

body.theme-editorial a:focus-visible,
body.theme-editorial button:focus-visible,
body.theme-editorial .c-btn:focus-visible,
body.theme-editorial .btn-get-started:focus-visible,
body.theme-editorial .btn-get-started-secondary:focus-visible,
body.theme-editorial .cta-btn:focus-visible,
body.theme-editorial .cz-bs-btn:focus-visible,
body.theme-editorial a.c-project-card:focus-visible,
body.theme-editorial .mobile-nav-toggle:focus-visible,
body.theme-editorial .scroll-top:focus-visible,
body.theme-editorial .header-social-links a:focus-visible,
body.theme-editorial .navbar a:focus-visible,
body.theme-editorial .navbar button.nav-dropdown-trigger:focus-visible,
body.theme-editorial input:focus-visible,
body.theme-editorial textarea:focus-visible,
body.theme-editorial select:focus-visible {
  outline: 3px solid var(--color-teal);
  outline-offset: 3px;
}

body.theme-editorial .c-btn:focus-visible,
body.theme-editorial .btn-get-started:focus-visible,
body.theme-editorial .btn-get-started-secondary:focus-visible,
body.theme-editorial .cta-btn:focus-visible,
body.theme-editorial .cz-bs-btn:focus-visible,
body.theme-editorial .auth-form button:focus-visible {
  outline-offset: 4px;
}

/* Auth / form fields */
body.theme-editorial .auth-form input:focus-visible {
  outline: 3px solid var(--color-teal);
  outline-offset: 2px;
  border-color: var(--color-teal);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  body.theme-editorial *,
  body.theme-editorial *::before,
  body.theme-editorial *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
    scroll-behavior: auto !important;
  }

  body.theme-editorial .c-btn:hover,
  body.theme-editorial .btn-get-started:hover,
  body.theme-editorial .cta-btn:hover,
  body.theme-editorial .cz-bs-btn:hover,
  body.theme-editorial .c-project-card__cta i,
  body.theme-editorial a.c-project-card:hover .c-project-card__cta i,
  body.theme-editorial a.c-project-card:hover .c-project-card__img,
  body.theme-editorial .navbar,
  body.theme-editorial .navbar ul,
  body.theme-editorial .mobile-nav-show,
  body.theme-editorial .mobile-nav-hide {
    transform: none !important;
  }
}

/* Touch-friendly minimum targets — do NOT set display here;
   desktop layout.css hides .mobile-nav-show/hide with display:none */
body.theme-editorial .mobile-nav-toggle {
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  background: transparent;
}

body.theme-editorial .header-social-links a {
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding-left: 0;
  margin-left: 0.15rem;
}

@media (max-width: 1279px) {
  body.theme-editorial .mobile-nav-show:not(.d-none),
  body.theme-editorial .mobile-nav-hide:not(.d-none) {
    display: inline-flex;
  }

  body.theme-editorial .header-social-links a {
    padding-left: 0 !important;
  }

  body.theme-editorial .navbar a,
  body.theme-editorial .navbar button.nav-dropdown-trigger {
    min-height: 44px;
  }

  body.theme-editorial .c-btn,
  body.theme-editorial .btn-get-started,
  body.theme-editorial .btn-get-started-secondary,
  body.theme-editorial .cta-btn,
  body.theme-editorial .cz-bs-btn {
    min-height: 44px;
  }

  body.theme-editorial .c-contact-link .info-item {
    min-height: 44px;
  }
}

/* Ensure buttons remain usable on all viewports */
body.theme-editorial .c-btn,
body.theme-editorial .btn-get-started,
body.theme-editorial .btn-get-started-secondary,
body.theme-editorial .cta-btn {
  min-height: 2.75rem;
}

/* Scroll-top: larger hit area + visible when focused even if inactive */
body.theme-editorial .scroll-top {
  min-width: 44px;
  min-height: 44px;
  border: 0;
  cursor: pointer;
  text-decoration: none !important;
}

body.theme-editorial .scroll-top:focus-visible {
  opacity: 1;
  visibility: visible;
}

/* Screen-reader only */
body.theme-editorial .visually-hidden,
body.theme-editorial .sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
