/* Copyright (c) Health Dynamics Consulting Ltd. All rights reserved. Proprietary: see LICENSE. */
/*
 * Layer 2 of 5: base. Elements only, plus a handful of text utilities. Every value comes from tokens.css.
 */

*, *::before, *::after { box-sizing: border-box; }

/* Components set display, so make the hidden attribute win everywhere. */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--wfp-topbar-height) + var(--hd-space-4)); }

body {
  margin: 0;
  background: var(--hd-bg);
  color: var(--hd-text);
  font-family: var(--font-body);
  font-size: var(--hd-text-base); /* 16px, agreed */
  line-height: var(--hd-line-height);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img, svg { max-width: 100%; }

a { color: var(--hd-link); text-underline-offset: 3px; }
a:hover { color: var(--hd-oxford); text-decoration-thickness: 2px; }

/* Focus: a 3px deep blue outline with a 2px offset (kept, agreed). Buttons and controls add the white gap ring. */
:focus-visible { outline: 3px solid var(--hd-focus-color); outline-offset: 2px; }

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  color: var(--hd-heading);
  line-height: 1.2;
  margin: 0 0 var(--hd-space-4);
  text-transform: var(--hd-heading-case);
}
h1 { font-size: var(--hd-text-h1); font-weight: var(--hd-weight-h1); letter-spacing: -.01em; }
h2 { font-size: var(--hd-text-h2); font-weight: var(--hd-weight-h2); }
h3 { font-size: var(--hd-text-h3); font-weight: var(--hd-weight-h3); }
h4, .h4 { font-size: 1rem; font-weight: 700; }

p { margin: 0 0 var(--hd-space-4); }

fieldset { min-width: 0; }

kbd { font-family: var(--font-mono); font-size: 13px; padding: 1px 6px; border: 1px solid var(--hd-border); border-bottom-width: 2px; border-radius: 6px; background: var(--hd-bg); white-space: nowrap; }

/* User data is never transformed. */
.as-entered { text-transform: none; }

/* Text utilities */
.muted { color: var(--hd-muted); }
.small { font-size: var(--hd-text-small); }
.hint { color: var(--hd-muted); font-size: var(--wfp-text-hint); }
.mono { font-family: var(--font-mono); font-size: 14px; word-break: break-all; }
.nowrap { white-space: nowrap; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.block { display: block; }

.icon {
  width: 20px;
  height: 20px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: -4px;
}

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

.skip-link {
  position: absolute;
  left: var(--hd-space-4);
  top: -100px;
  z-index: 100;
  background: var(--hd-oxford);
  color: #fff;
  padding: var(--hd-space-2) var(--hd-space-4);
  border-radius: var(--hd-radius-pill);
  font-family: var(--font-heading);
  font-weight: 700;
}
.skip-link:focus { top: var(--hd-space-3); color: #fff; box-shadow: var(--hd-focus-ring); outline: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
