/* ==========================================================================
   Base elements — the minimal reset (Tailwind preflight is disabled) and the
   bare-tag defaults every page inherits. Component classes live in their own
   concern files; this file only styles raw elements + cross-cutting control
   normalization. Values resolve to tokens.css.
   ========================================================================== */

/* ---- ---- ---- ---- Reset ---- ---- ---- ---- */

/* Tailwind preflight is disabled; this is the minimal reset it replaces. */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  font-display: swap;
  line-height: var(--leading-normal);
  color: var(--text-body);
  background-color: var(--surface-body);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  gap: var(--space-4);
}

a {
  color: var(--link);
  text-decoration: underline;
}

a:hover {
  color: var(--link-hover);
}

header {
  color: var(--text-on-dark);
}

#header {
  background-image: url(/assets/header-9efa14e6610c5650f077d6a5d6f10aa2bbdd9b8b4a3e6fcf2d6761e4b0fb9c95.png);
  background-repeat: repeat-x;
  border-bottom: 1px solid var(--border-strong);
  height: 80px;
}

/* Lazy-loaded images fade in once loaded. */
img[loading="lazy"] {
  opacity: 0;
  transition: opacity var(--transition);
}

img[loading="lazy"].loaded,
img[loading="lazy"]:not([src=""]) {
  opacity: 1;
}

input {
  max-width: 100%;
}

ul,
ol {
  margin-top: 0;
  margin-bottom: 0;
}

p {
  margin-top: 0;
  margin-bottom: 0;
}

td {
  font: var(--text-xs) var(--font-ui);
  color: var(--text-strong);
  padding: 0;
  text-align: left;
}

blockquote {
  font: italic var(--text-sm) var(--font-ui);
  color: #7e96ac;
}

hr {
  border-top: 1px solid #666;
  border-bottom: 1px solid #eee;
  height: 2px;
  text-align: center;
}

form {
  margin: var(--space-2);
}

/* ---- ---- ---- ---- Control normalization ---- ---- ---- ---- */

/* Uniform control height across every button/input/select/textarea.
   Single knob: --control-height in tokens.css. Checkbox/radio/file excluded
   so they keep their native box. */
.btn,
.button,
.np,
.nextprev,
.form-control,
.tbox,
textarea,
select,
button,
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]) {
  min-height: var(--control-height);
  box-sizing: border-box;
}

/* Vertically centre single-line control content. */
.btn,
.button,
.np,
.nextprev,
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
