/* Touch Target Accessibility Improvements */

/* Ensure interactive controls meet minimum 44x44px requirement.
   NOTE: We intentionally do NOT target bare <a> here — that would blow up
   inline text links inside paragraphs (block layout, huge vertical gaps). */
button,
[role="button"],
input[type="button"],
input[type="submit"],
input[type="reset"],
select {
  min-width: 44px;
  min-height: 44px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

a {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* Enhanced touch targets for mobile */
@media (max-width: 768px) {
  /* Buttons need extra padding — scoped to real buttons, not inline links */
  .btn,
  button,
  [role="button"] {
    min-height: 48px;
    touch-action: manipulation;
  }

  /* Form elements */
  input,
  textarea,
  select {
    min-height: 52px;
    padding: 12px 16px;
    font-size: 16px; /* Prevents zoom on iOS */
  }

  /* Navigation / standalone menu links only — NOT inline prose links */
  nav a,
  .nav-link,
  [role="navigation"] a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }

  /* Card interactions */
  .card[role="button"],
  .clickable-card {
    min-height: 60px;
    padding: 16px;
  }
}

/* High contrast mode improvements */
@media (prefers-contrast: high) {
  button,
  [role="button"],
  a[href] {
    border: 2px solid currentColor;
  }
}

/* Focus indicators for keyboard navigation */
button:focus,
[role="button"]:focus,
a:focus,
input:focus,
select:focus,
textarea:focus {
  outline: 3px solid hsl(var(--accent));
  outline-offset: 2px;
  border-radius: 4px;
}

/* Remove focus outline on mouse interaction */
button:focus:not(:focus-visible),
[role="button"]:focus:not(:focus-visible),
a:focus:not(:focus-visible) {
  outline: none;
}

/* Ensure adequate spacing in component layouts */
.button-group {
  gap: 8px;
}

.button-group.mobile {
  gap: 12px;
}

@media (max-width: 768px) {
  .button-group {
    gap: 12px;
  }
  
  .button-group.mobile {
    gap: 16px;
  }
}