/* VitaFit base: reset, typography roles, utilities. FROZEN after phase A. */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { margin: 0; padding: 0; }
body {
  min-height: 100vh;
  background: var(--bg-page);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--fs-body1);
  line-height: var(--lh-body1);
  font-weight: var(--fw-regular);
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg, video, canvas { display: block; max-width: 100%; }
img { height: auto; }
svg.ph { flex: none; display: inline-block; vertical-align: middle; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; margin: 0; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
table { border-collapse: collapse; border-spacing: 0; }
[hidden] { display: none !important; }
:focus { outline: none; }
:focus-visible { outline: none; box-shadow: var(--focus-ring); }
/* F1 (E1-05/E2-03): text controls inside a pill/rounded wrapper get NO own (square) ring — the wrapper shows it via
   :focus-within (.search, .field__box in components.css; screen wrappers such as .ins__search-box do the same).
   Buttons, links, checkboxes and stand-alone inputs keep the global ring above. */
.search :is(input, select, textarea):focus-visible,
.field__box :is(input, select, textarea):focus-visible,
[class*="search-box"] :is(input, select, textarea):focus-visible { box-shadow: none; }::selection { background: var(--c-lime-muted); color: var(--text); }

/* ---------- Typography roles (design-tokens §2). Class = Figma style. ---------- */
.t-h1 { font-size: var(--fs-h1); line-height: var(--lh-h1); font-weight: 500; }
.t-h2 { font-size: var(--fs-h2); line-height: var(--lh-h2); font-weight: 500; }
.t-h3 { font-size: var(--fs-h3); line-height: var(--lh-h3); font-weight: 500; }
.t-h4 { font-size: var(--fs-h4); line-height: var(--lh-h4); font-weight: 500; }
.t-h4r { font-size: var(--fs-h4); line-height: var(--lh-h4); font-weight: 400; }
.t-h5 { font-size: var(--fs-h5); line-height: var(--lh-h5); font-weight: 500; }
.t-h5r { font-size: var(--fs-h5); line-height: var(--lh-h5); font-weight: 400; }
.t-body1 { font-size: var(--fs-body1); line-height: var(--lh-body1); font-weight: 400; }
.t-body2 { font-size: var(--fs-body2); line-height: var(--lh-body2); font-weight: 400; }
.t-body3 { font-size: var(--fs-body3); line-height: var(--lh-body3); font-weight: 400; }
.t-body4 { font-size: var(--fs-body4); line-height: var(--lh-body4); font-weight: 400; }
.t-body5 { font-size: var(--fs-body5); line-height: var(--lh-body5); font-weight: 400; }
.t-body6 { font-size: var(--fs-body6); line-height: var(--lh-body6); font-weight: 400; }
.t-label1 { font-size: var(--fs-label1); line-height: var(--lh-label1); font-weight: 500; }
.t-label2 { font-size: var(--fs-label2); line-height: var(--lh-label2); font-weight: 500; }
.t-label3 { font-size: var(--fs-label3); line-height: var(--lh-label3); font-weight: 500; }
.t-label4 { font-size: var(--fs-label4); line-height: var(--lh-label4); font-weight: 500; }
.t-label5 { font-size: var(--fs-label5); line-height: var(--lh-label5); font-weight: 500; }

/* text colours */
.c-text { color: var(--text); }
.c-muted { color: var(--text-muted); }
.c-subtle { color: var(--text-subtle); }
.c-primary { color: var(--primary); }
.c-ink { color: var(--on-accent); }
.c-white { color: #FFFFFF; }
.c-success { color: var(--success); }
.c-warning { color: var(--warning); }
.c-danger { color: var(--danger); }

/* ---------- Utilities ---------- */
.u-row { display: flex; align-items: center; }
.u-col { display: flex; flex-direction: column; }
.u-grow { flex: 1 1 0; min-width: 0; }
.u-between { justify-content: space-between; }
.u-center { align-items: center; justify-content: center; }
.u-baseline { align-items: baseline; }
.u-wrap { flex-wrap: wrap; }
.u-gap-2 { gap: 2px; } .u-gap-4 { gap: 4px; } .u-gap-6 { gap: 6px; } .u-gap-8 { gap: 8px; }
.u-gap-12 { gap: 12px; } .u-gap-16 { gap: 16px; } .u-gap-24 { gap: 24px; } .u-gap-32 { gap: 32px; }
.u-ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.u-nowrap { white-space: nowrap; }
.u-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.u-clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.u-tnum { font-variant-numeric: tabular-nums; }
.u-center-text { text-align: center; }
.u-right-text { text-align: right; }
.u-sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
/* Diagonal line pattern (components §0.2 "Line pattern"). Set --hatch to the line colour. */
.u-hatch {
  --hatch: var(--hatch-dark);
  background-image: repeating-linear-gradient(135deg, var(--hatch) 0 1px, transparent 1px 4px);
}
.u-hatch--lime { --hatch: var(--hatch-lime); }
.u-hatch--pale { --hatch: var(--hatch-pale); }

/* Breakpoint visibility helpers: mobile <768, tablet 768–1279, desktop >=1280 */
@media (max-width: 767.98px) { .u-hide-mobile { display: none !important; } }
@media (min-width: 768px) and (max-width: 1279.98px) { .u-hide-tablet { display: none !important; } }
@media (min-width: 1280px) { .u-hide-desktop { display: none !important; } }
@media (min-width: 768px) { .u-only-mobile { display: none !important; } }
@media (max-width: 767.98px), (min-width: 1280px) { .u-only-tablet { display: none !important; } }
@media (max-width: 1279.98px) { .u-only-desktop { display: none !important; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
