/* ==========================================================================
   Labour Life practice system: base
   Reset, body type, headings, links, focus, helpers, the boot screen,
   keyframes and reduced motion (SPEC 7.3). Loaded second, after tokens.css.

   Helper classes that live here (do not restate them elsewhere):
     .label .muted .fine .nw .num .ellipsis .sr-only .link .plain .mention
     mark, .skip-link, .boot, .noscript
   Keyframes for every other file to use:
     llSpin  llRise  llPop  llFade  llBreathe  llSheet
   ========================================================================== */

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

/* Component display rules (.btn inline-flex, .field grid) would otherwise
   beat the hidden attribute and show things that are meant to be hidden.
   Keep this rule first. */
[hidden] { display: none !important; }

html {
  height: 100%;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  font-weight: 400;
  font-style: normal;
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-wrap: break-word;
}

/* ---------- type ---------- */

h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-style: normal;
  line-height: var(--lh-tight);
  letter-spacing: 0;
  color: var(--ink);
}
h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }
h4 { font-size: var(--fs-lg); line-height: var(--lh-snug); }

p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
dl, dd { margin: 0; }
figure { margin: 0; }
b, strong { font-weight: 600; }
/* The fonts have no italics. Never let the browser fake one. */
em, i, cite, address, dfn { font-style: normal; }
small { font-size: var(--fs-sm); }
hr { border: 0; border-top: 1px solid var(--line); margin: var(--s4) 0; }

img, svg, canvas, video { display: block; max-width: 100%; }
img { height: auto; }
svg.i { flex: none; }

button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; margin: 0; }
button { cursor: pointer; }
button:disabled, [aria-disabled="true"] { cursor: default; }
textarea { resize: vertical; }
fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
legend { padding: 0; }
table { border-collapse: collapse; border-spacing: 0; }
th { text-align: left; font-weight: 600; }

a { color: inherit; }

code, pre, kbd, samp { font-family: var(--font-mono); font-size: .9375em; }
pre { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }

::selection { background: var(--red); color: var(--on-red); }
::placeholder { color: var(--ink-mute); opacity: 1; }

/* ---------- focus ---------- */

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
/* The coal top bar (the shell and the signed-out screens). */
.top :focus-visible { outline-color: var(--focus-on-dark); }
/* #main takes focus after every route change (SPEC 7.3, rule 4). It is not a
   control, so it shows no ring. */
main:focus, main:focus-visible { outline: none; }

/* ---------- helpers ---------- */

/* Links in running text. Components opt out with .plain. */
.prose a, a.link, .link {
  color: var(--link);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}
.prose a:hover, a.link:hover, .link:hover { color: var(--link-hover); }
button.link { background: none; border: 0; padding: 0; font: inherit; text-align: inherit; }
.plain { text-decoration: none; color: inherit; }

/* The small uppercase label. Fixed words only, never data. */
.label {
  font: 600 var(--fs-label)/1.25 var(--font-display);
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--ink-soft);
}

.muted { color: var(--ink-soft); }
.fine { font-size: var(--fs-sm); line-height: var(--lh-body); color: var(--ink-mute); }
.nw { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%);
  white-space: nowrap; border: 0;
}

/* A person named in a note (core/util.js richText). */
.mention {
  padding: 0 .25em;
  border-radius: var(--r-xs);
  background: var(--sunken);
  color: var(--ink);
  font-weight: 600;
  white-space: nowrap;
}

/* The matched part of a search result (core/util.js highlight). */
mark {
  padding: 0 .1em;
  border-radius: var(--r-xs);
  background: var(--warning-bg);
  color: inherit;
}

/* The first element on every page. It carries data-native, so the router
   leaves it alone. */
.skip-link {
  position: fixed; top: 8px; left: 8px; z-index: 1000;
  display: inline-flex; align-items: center;
  min-height: var(--tap);
  padding: 0 var(--s4);
  border-radius: var(--r-sm);
  background: var(--ink); color: var(--surface);
  font-weight: 600; text-decoration: none;
  transform: translateY(-300%);
  transition: transform var(--dur-1) var(--ease-out);
}
.skip-link:focus, .skip-link:focus-visible { transform: none; outline-color: var(--focus-on-dark); }

/* ---------- boot screen, and the "not answering" screen ---------- */

.boot {
  min-height: 100vh; min-height: 100svh;
  display: grid; place-content: center; justify-items: center;
  gap: var(--s4);
  padding: var(--gutter);
  text-align: center;
  color: var(--ink-soft);
}
.boot__mark { width: auto; height: 48px; animation: llBreathe 1.6s ease-in-out infinite; }
.boot__t { font-size: var(--fs-body); }
.boot--fail .boot__mark { animation: none; }
.boot__h { font-size: var(--fs-h2); }
.boot__p { max-width: 34ch; }
.boot__btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: var(--control-h); padding: 0 var(--s5);
  border: 1px solid var(--red); border-radius: var(--r-sm);
  background: var(--red); color: var(--on-red);
  font: 600 1rem/1 var(--font-body);
}
.boot__btn:hover { background: var(--red-hover); border-color: var(--red-hover); }
.boot__btn:active { background: var(--red-active); border-color: var(--red-active); }

.noscript { padding: var(--s6); text-align: center; }

/* ---------- keyframes ---------- */

@keyframes llBreathe { 0%, 100% { opacity: .45; transform: scale(.96); } 50% { opacity: 1; transform: scale(1); } }
@keyframes llSpin { to { transform: rotate(360deg); } }
@keyframes llRise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes llPop { from { opacity: 0; transform: translateY(-4px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes llFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes llSheet { from { transform: translateY(100%); } to { transform: none; } }

/* ---------- motion and contrast preferences ---------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}

@media (forced-colors: active) {
  .mention, mark { border: 1px solid; }
  .boot__btn { border: 1px solid ButtonText; }
}

@media print {
  body { background: #fff; }
  .skip-link { display: none; }
}
