/* WCAG 2.2 AA baseline accessibility styles */

/* Elevate base body and secondary text colors for contrast across themes */
:root {
  --bs-body-color: #2d3748; /* dark slate for 4.5:1 on white at 14px */
  --bs-secondary-color: #4a5568; /* higher-contrast muted */
  --bs-tertiary-color: #5a6472;
}

/* Ensure base text color is sufficiently dark across the app */
body {
  color: var(--bs-body-color) !important;
}

/* Visible focus indicator across the app */
:focus-visible {
  outline: 3px solid #1a73e8;
  outline-offset: 2px;
}

/* Ensure focus is visible on elements with custom focus reset */
[data-simplebar] :focus-visible,
.navbar :focus-visible,
.sidebar-nav :focus-visible,
.btn:focus-visible,
.form-control:focus-visible,
.form-select:focus-visible,
.form-check-input:focus-visible,
a:focus-visible {
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.35);
}

/* Skip link styling */
.skip-link {
  position: absolute;
  top: 0;
  left: 0;
  transform: translateY(-120%);
  background: #000;
  color: #fff;
  padding: 10px 14px;
  z-index: 2000;
  border-radius: 6px;
}
.skip-link:focus,
.skip-link:active {
  transform: translateY(0);
}

/* Toast region spacing for screen readers */
.sr-only,
.visually-hidden {
  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;
}

/* Minimum target size for actionable items (WCAG 2.5.8 target size – enhanced)
   Avoid forcing height on Bootstrap buttons to preserve vertical alignment */
a:not(.btn),
button:not(.btn),
.form-check-input,
label[for] {
  min-height: 22x;
  min-width: 22px;
}

/* Ensure sufficient contrast on disabled elements when focused */
.btn:disabled:focus-visible,
.form-control:disabled:focus-visible {
  outline-color: #6c757d;
}

/* Contrast fixes: Paragraphs and muted text against white backgrounds */
.text-muted,
body .text-body-secondary,
body .text-body-tertiary {
  color: #4a5568 !important; /* ensure override of weak gray */
}

/* Contrast fix for invite-only marker: ensure foreground/background >= 4.5:1 */
mark.bg-danger-subtle.text-danger,
mark.text-danger {
  color: #8b1c13 !important; /* darkened red */
  background-color: #fde8e6 !important; /* slightly darker bg than #fbf2ef */
}

/* Ensure small helper texts meet contrast */
small,
.form-text,
.help-text,
.text-muted small {
  color: #555d66 !important;
}

/* Ultimate fallback: ensure all paragraphs meet contrast on white */

dddp {
  color: #394150 !important; /* slightly darker than #4a5568 for robust 4.5:1+ */
}


/* Strengthen paragraph contrast within common layout regions */
/*header p,
footer p,
nav p,*/
.header-fp p,
.main-wrapper p,
.container p {
  color: #394150 !important;
}

/* Reset sorting button styling */
.reset-sorting {
  border: none !important;
  background: transparent !important;
  padding: 0.25rem 0.5rem !important;
  color: #6c757d !important;
  transition: all 0.2s ease-in-out !important;
  min-width: 24px !important;
  min-height: 24px !important;
}

.reset-sorting:hover {
  color: #495057 !important;
  background-color: rgba(0, 0, 0, 0.05) !important;
  transform: scale(1.1);
}

.reset-sorting:focus-visible {
  outline: 2px solid #1a73e8 !important;
  outline-offset: 2px !important;
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.35) !important;
}

.reset-sorting:active {
  transform: scale(0.95);
}

/* Ensure reset button column has sufficient space */
.sortableTable th:last-child {
  min-width: 120px; /* Ensure enough space for actions + reset button */
}

.sortableTable th:last-child .reset-sorting {
  margin-left: 0.5rem;
}


