/* ═══════════════════════════════════════════════════════════════════
   RISING EDGE — Utility classes + Responsive overrides
═══════════════════════════════════════════════════════════════════ */

/* Display */
.hidden {
  display: none !important;
}
.flex {
  display: flex;
}
.grid {
  display: grid;
}
.block {
  display: block;
}
.inline {
  display: inline;
}
.inline-flex {
  display: inline-flex;
}

/* Flex helpers */
.flex-col {
  flex-direction: column;
}
.flex-1 {
  flex: 1;
}
.flex-shrink-0 {
  flex-shrink: 0;
}
.items-start {
  align-items: flex-start;
}
.items-center {
  align-items: center;
}
.items-end {
  align-items: flex-end;
}
.justify-start {
  justify-content: flex-start;
}
.justify-center {
  justify-content: center;
}
.justify-between {
  justify-content: space-between;
}
.justify-end {
  justify-content: flex-end;
}
.flex-wrap {
  flex-wrap: wrap;
}
.gap-1 {
  gap: var(--sp-1);
}
.gap-2 {
  gap: var(--sp-2);
}
.gap-3 {
  gap: var(--sp-3);
}
.gap-4 {
  gap: var(--sp-4);
}
.gap-5 {
  gap: var(--sp-5);
}
.gap-6 {
  gap: var(--sp-6);
}
.gap-8 {
  gap: var(--sp-8);
}

/* Padding / Margin */
.p-0 {
  padding: 0;
}
.p-2 {
  padding: var(--sp-2);
}
.p-3 {
  padding: var(--sp-3);
}
.p-4 {
  padding: var(--sp-4);
}
.p-5 {
  padding: var(--sp-5);
}
.p-6 {
  padding: var(--sp-6);
}
.p-8 {
  padding: var(--sp-8);
}
.px-4 {
  padding-left: var(--sp-4);
  padding-right: var(--sp-4);
}
.py-2 {
  padding-top: var(--sp-2);
  padding-bottom: var(--sp-2);
}
.py-4 {
  padding-top: var(--sp-4);
  padding-bottom: var(--sp-4);
}
.mt-2 {
  margin-top: var(--sp-2);
}
.mt-3 {
  margin-top: var(--sp-3);
}
.mt-4 {
  margin-top: var(--sp-4);
}
.mt-6 {
  margin-top: var(--sp-6);
}
.mt-8 {
  margin-top: var(--sp-8);
}
.mt-auto {
  margin-top: auto;
}
.mb-2 {
  margin-bottom: var(--sp-2);
}
.mb-3 {
  margin-bottom: var(--sp-3);
}
.mb-4 {
  margin-bottom: var(--sp-4);
}
.mb-6 {
  margin-bottom: var(--sp-6);
}
.mb-8 {
  margin-bottom: var(--sp-8);
}
.ml-auto {
  margin-left: auto;
}

/* Typography */
.text-xs {
  font-size: var(--text-xs);
}
.text-sm {
  font-size: var(--text-sm);
}
.text-base {
  font-size: var(--text-base);
}
.text-md {
  font-size: var(--text-md);
}
.text-lg {
  font-size: var(--text-lg);
}
.text-xl {
  font-size: var(--text-xl);
}
.text-2xl {
  font-size: var(--text-2xl);
}
.text-3xl {
  font-size: var(--text-3xl);
}

.text-primary {
  color: var(--primary-400);
}
.text-cyan {
  color: var(--cyan-400);
}
.text-success {
  color: var(--success);
}
.text-warning {
  color: var(--warning);
}
.text-danger {
  color: var(--danger);
}
.text-muted {
  color: var(--text-muted);
}
.text-sub {
  color: var(--text-sub);
}
.text-base-c {
  color: var(--text-base);
}
.text-faint {
  color: var(--text-faint);
}

/* Visually hidden but still available to screen readers / a11y tree —
   use for headings that establish document structure (h1→h2→h3 order)
   without needing a visible duplicate label on the page. */
.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;
}

.font-medium {
  font-weight: var(--weight-medium);
}
.font-semi {
  font-weight: var(--weight-semi);
}
.font-bold {
  font-weight: var(--weight-bold);
}
.font-black {
  font-weight: var(--weight-black);
}
.font-mono {
  font-family: var(--font-mono);
}

.text-center {
  text-align: center;
}
.text-right {
  text-align: right;
}
.uppercase {
  text-transform: uppercase;
}
.tracking-wide {
  letter-spacing: 0.06em;
}

/* Background */
.bg-card {
  background: var(--bg-card);
}
.bg-alt {
  background: var(--bg-alt);
}
.bg-muted {
  background: var(--bg-muted);
}
.bg-page {
  background: var(--bg-page);
}

/* Border */
.border {
  border: 1px solid var(--border);
}
.border-med {
  border: 1px solid var(--border-med);
}
.rounded-sm {
  border-radius: var(--radius-sm);
}
.rounded {
  border-radius: var(--radius-md);
}
.rounded-lg {
  border-radius: var(--radius-lg);
}
.rounded-xl {
  border-radius: var(--radius-xl);
}
.rounded-2xl {
  border-radius: var(--radius-2xl);
}
.rounded-full {
  border-radius: var(--radius-full);
}

/* Width / Height */
.w-full {
  width: 100%;
}
.h-full {
  height: 100%;
}
.min-w-0 {
  min-width: 0;
}
.max-w-prose {
  max-width: 68ch;
}

/* Position */
.relative {
  position: relative;
}
.absolute {
  position: absolute;
}
.fixed {
  position: fixed;
}
.sticky {
  position: sticky;
}

/* Overflow */
.overflow-hidden {
  overflow: hidden;
}
.overflow-auto {
  overflow: auto;
}
.overflow-x-auto {
  overflow-x: auto;
}

/* Misc */
.pointer {
  cursor: pointer;
}
.select-none {
  user-select: none;
  -webkit-user-select: none;
}
.shadow-card {
  box-shadow: var(--shadow-card);
}
.shadow-md {
  box-shadow: var(--shadow-md);
}

/* ── Responsive show/hide ─────────────────────────────────────── */
.hide-mobile {
  display: none !important;
}
.hide-desktop {
  display: block;
}

@media (min-width: 640px) {
  .sm\:flex {
    display: flex;
  }
  .sm\:grid {
    display: grid;
  }
  .sm\:hidden {
    display: none;
  }
}
@media (min-width: 768px) {
  .md\:flex {
    display: flex;
  }
  .md\:grid {
    display: grid;
  }
  .md\:hidden {
    display: none;
  }
  .hide-mobile {
    display: block !important;
  }
}
@media (min-width: 1024px) {
  .lg\:flex {
    display: flex;
  }
  .lg\:grid {
    display: grid;
  }
  .lg\:hidden {
    display: none;
  }
  .hide-desktop {
    display: none !important;
  }
  .hide-mobile {
    display: flex !important;
  }
}

/* ── Grid system ──────────────────────────────────────────────── */
.grid-cols-1 {
  grid-template-columns: repeat(1, 1fr);
}
.grid-cols-2 {
  grid-template-columns: repeat(2, 1fr);
}
.grid-cols-3 {
  grid-template-columns: repeat(3, 1fr);
}
.grid-cols-4 {
  grid-template-columns: repeat(4, 1fr);
}
@media (min-width: 640px) {
  .sm\:grid-cols-2 {
    grid-template-columns: repeat(2, 1fr);
  }
  .sm\:grid-cols-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (min-width: 768px) {
  .md\:grid-cols-2 {
    grid-template-columns: repeat(2, 1fr);
  }
  .md\:grid-cols-3 {
    grid-template-columns: repeat(3, 1fr);
  }
  .md\:grid-cols-4 {
    grid-template-columns: repeat(4, 1fr);
  }
}
@media (min-width: 1024px) {
  .lg\:grid-cols-2 {
    grid-template-columns: repeat(2, 1fr);
  }
  .lg\:grid-cols-3 {
    grid-template-columns: repeat(3, 1fr);
  }
  .lg\:grid-cols-4 {
    grid-template-columns: repeat(4, 1fr);
  }
  .lg\:grid-cols-5 {
    grid-template-columns: repeat(5, 1fr);
  }
}

/* ── Auto-fill card grids ─────────────────────────────────────── */
.cards-grid {
  display: grid;
  gap: var(--sp-5);
  grid-template-columns: 1fr;
}
@media (min-width: 640px) {
  .cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (min-width: 1024px) {
  .cards-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.cards-grid-2 {
  display: grid;
  gap: var(--sp-5);
  grid-template-columns: 1fr;
}
@media (min-width: 768px) {
  .cards-grid-2 {
    grid-template-columns: repeat(2, 1fr);
  }
}

.cards-grid-4 {
  display: grid;
  gap: var(--sp-4);
  grid-template-columns: repeat(2, 1fr);
}
@media (min-width: 768px) {
  .cards-grid-4 {
    grid-template-columns: repeat(4, 1fr);
  }
}
