/*
 * utilities.css — small helper classes: visually-hidden, spacing, text utilities.
 */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.text-xs { font-size: var(--text-xs-size); line-height: var(--text-xs-line); }
.text-sm { font-size: var(--text-sm-size); line-height: var(--text-sm-line); }
.text-base { font-size: var(--text-base-size); line-height: var(--text-base-line); }
.text-lg { font-size: var(--text-lg-size); line-height: var(--text-lg-line); }

/* Color utilities use !important so they reliably override component rules with
   higher selector specificity (e.g. `.table tbody td { color }`). */
.text-muted { color: var(--text-muted) !important; }
.text-secondary { color: var(--text-secondary) !important; }
.text-primary { color: var(--text-primary) !important; }
.text-link { color: var(--text-link) !important; }
.text-success { color: var(--green-700) !important; }
.text-error { color: var(--error-600) !important; }
.text-center { text-align: center; }
.text-right { text-align: right; }

.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.flex-wrap { flex-wrap: wrap; }

.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }

.mt-1 { margin-top: var(--space-1); }
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }
.mb-1 { margin-bottom: var(--space-1); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }

.w-full { width: 100%; }

.hidden { display: none !important; }

@media (min-width: 640px) {
  .sm\:hidden { display: none !important; }
  .sm\:block { display: block !important; }
}
@media (min-width: 768px) {
  .md\:hidden { display: none !important; }
  .md\:block { display: block !important; }
}
@media (max-width: 767px) {
  .max-md\:hidden { display: none !important; }
}

/* --- Additional utilities (UX audit) ------------------------------------- */
.items-start { align-items: flex-start !important; }
.font-mono { font-family: var(--font-mono); }
.break-all { overflow-wrap: anywhere; word-break: break-word; }
.text-warning { color: var(--warning-700) !important; }
.mt-0 { margin-top: 0 !important; }
/* --- Spacing / layout utilities (CSP: replace inline style="") ----------- */
.p-5 { padding: var(--space-5); }
.p-6 { padding: var(--space-6); }
.mb-0 { margin-bottom: 0 !important; }
.flex-1 { flex: 1; }
.w-0 { width: 0; }
.w-12 { width: 3rem; }
.w-16 { width: 4rem; }
.mw-sm { max-width: 24rem; }
.mw-md { max-width: 32rem; }
.mw-lg { max-width: 44rem; }
.list-stack { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.flex-gap-3 { display: flex; gap: var(--space-3); }

/* Two equal columns that stack on small screens. (Not .doc-grid-2 — that one lives in
   assets/css/tools/_doc.css, which only the document tools load.) */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4); align-items: start; }
@media (max-width: 767px) {
  .grid-2 { grid-template-columns: 1fr; }
}
