/* ============================================================
   HAPTO · CARE - UTILITIES
   Layout helpers built on tokens.
   Depends on: tokens.css
   ============================================================ */

/* ---------- CONTAINERS ------------------------------------ */
.container { max-width: var(--container-lg); margin-inline: auto; padding-inline: var(--gutter-page); position: relative; z-index: var(--z-base); }
.container-xl { max-width: var(--container-xl); }
.container-md { max-width: var(--container-md); }
.container-sm { max-width: var(--container-sm); }

/* ---------- SECTIONS -------------------------------------- */
.section { padding-block: clamp(var(--space-8), 8vw, var(--space-9)); position: relative; }
.section-compact { padding-block: clamp(var(--space-7), 6vw, var(--space-8)); }
.section-hero { padding-block: clamp(var(--space-9), 12vw, var(--space-10)); }

/* ---------- DISPLAY / FLEX / GRID ------------------------- */
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }

.grid { display: grid; }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) { .grid-cols-3, .grid-cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .grid-cols-2, .grid-cols-3, .grid-cols-4 { grid-template-columns: 1fr; } }

.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-5 { gap: var(--space-5); }
.gap-6 { gap: var(--space-6); }
.gap-7 { gap: var(--space-7); }

/* ---------- SPACING HELPERS ------------------------------- */
.p-3 { padding: var(--space-3); } .p-4 { padding: var(--space-4); } .p-5 { padding: var(--space-5); } .p-6 { padding: var(--space-6); } .p-7 { padding: var(--space-7); }
.mt-2 { margin-top: var(--space-2); } .mt-3 { margin-top: var(--space-3); } .mt-4 { margin-top: var(--space-4); } .mt-5 { margin-top: var(--space-5); } .mt-6 { margin-top: var(--space-6); } .mt-7 { margin-top: var(--space-7); }
.mb-2 { margin-bottom: var(--space-2); } .mb-3 { margin-bottom: var(--space-3); } .mb-4 { margin-bottom: var(--space-4); } .mb-5 { margin-bottom: var(--space-5); } .mb-6 { margin-bottom: var(--space-6); } .mb-7 { margin-bottom: var(--space-7); }

/* ---------- TEXT HELPERS ---------------------------------- */
.text-mono { font-family: var(--font-mono); }
.text-display { font-family: var(--font-display); }
.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-base); }
.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-strong { color: var(--text-strong); }
.text-default { color: var(--text-default); }
.text-subtle { color: var(--text-subtle); }
.text-faint { color: var(--text-faint); }
.text-brand { color: var(--brand-primary-text); }
.text-accent { color: var(--brand-accent-text); }
.text-care { color: var(--brand-care); }
.text-vital { color: var(--brand-highlight-text); }
.text-ok { color: var(--state-ok-strong); }
.text-warn { color: var(--state-warn-strong); }
.text-crit { color: var(--state-crit-strong); }
.tracking-tight { letter-spacing: var(--tracking-tight); }
.tracking-wide { letter-spacing: var(--tracking-wide); }
.tracking-widest { letter-spacing: var(--tracking-widest); }
.uppercase { text-transform: uppercase; }
.tabular { font-variant-numeric: tabular-nums; }
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-balance { text-wrap: balance; }
.text-pretty { text-wrap: pretty; }

/* Gradient text */
.text-gradient { background: var(--gradient-brand); -webkit-background-clip: text; background-clip: text; color: transparent; }
.text-gradient-vital { background: var(--gradient-vital); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- SURFACES / RADIUS / ELEVATION ----------------- */
.rounded-sm { border-radius: var(--radius-sm); } .rounded-md { border-radius: var(--radius-md); } .rounded-lg { border-radius: var(--radius-lg); } .rounded-xl { border-radius: var(--radius-xl); } .rounded-pill { border-radius: var(--radius-pill); }
.elev-1 { box-shadow: var(--elev-1); } .elev-2 { box-shadow: var(--elev-2); } .elev-3 { box-shadow: var(--elev-3); }
.surface-raised { background: var(--surface-raised); }
.surface-sunken { background: var(--surface-sunken); }

/* ---------- ACCESSIBILITY --------------------------------- */
.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; }

/* ---------- MAX-WIDTH HELPERS ----------------------------- */
.mw-40 { max-width: 40ch; } .mw-48 { max-width: 48ch; } .mw-56 { max-width: 56ch; } .mw-64 { max-width: 64ch; }
.mx-auto { margin-inline: auto; }
