/* ------------------------------------------------------------------
   Threshold - document reset

   Loads first, before threshold-tokens.css, in the slot bootstrap.min.css
   used to hold. Threshold stopped loading Bootstrap on 2026-10-16 (ADR-0035
   addendum); every screen had been laid out on top of Bootstrap's reboot,
   so this file keeps the element-level baseline those screens rely on:
   box sizing, body line height, heading and paragraph margins, list
   indents, form-control font inheritance, button cursors, table border
   collapsing, and the inline code / kbd / mark / link treatments.

   Selectors and metrics match Bootstrap 5.3's reboot, minus its class forms
   (.h1-.h6, .small, .mark), so the cascade against Threshold's own rules is
   unchanged; the link hover and dark code colour use :where() to stay at
   bare-element specificity. Colours come from the --th-* tokens Threshold
   mapped Bootstrap onto under ADR-0035 (link -> advant, code -> advant-deep /
   advant, kbd -> paper text on ink), never from Bootstrap's stock palette;
   mark, which that mapping never covered, uses ink on --th-warn-soft.

   Element rules only. Components and utilities live in their own sheets;
   there is no class selector here.
   ------------------------------------------------------------------ */

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

[data-theme="dark"] {
  color-scheme: dark;
}

@media (prefers-reduced-motion: no-preference) {
  :root {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  font-weight: 400;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}

hr {
  margin: 1rem 0;
  color: inherit;
  border: 0;
  border-top: 1px solid;
  opacity: 0.25;
}

h6, h5, h4, h3, h2, h1 {
  margin-top: 0;
  margin-bottom: 0.5rem;
  font-weight: 500;
  line-height: 1.2;
}

h1 { font-size: calc(1.375rem + 1.5vw); }
h2 { font-size: calc(1.325rem + 0.9vw); }
h3 { font-size: calc(1.3rem + 0.6vw); }
h4 { font-size: calc(1.275rem + 0.3vw); }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

@media (min-width: 1200px) {
  h1 { font-size: 2.5rem; }
  h2 { font-size: 2rem; }
  h3 { font-size: 1.75rem; }
  h4 { font-size: 1.5rem; }
}

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

abbr[title] {
  text-decoration: underline dotted;
  cursor: help;
  text-decoration-skip-ink: none;
}

address {
  margin-bottom: 1rem;
  font-style: normal;
  line-height: inherit;
}

ol, ul {
  padding-left: 2rem;
}

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

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

dt { font-weight: 700; }

dd {
  margin-bottom: 0.5rem;
  margin-left: 0;
}

blockquote { margin: 0 0 1rem; }

b, strong { font-weight: bolder; }

small { font-size: 0.875em; }

mark {
  padding: 0.1875em;
  color: var(--th-ink);
  background-color: var(--th-warn-soft);
}

sub, sup {
  position: relative;
  font-size: 0.75em;
  line-height: 0;
  vertical-align: baseline;
}
sub { bottom: -0.25em; }
sup { top: -0.5em; }

/* :where() keeps the hover rule at the specificity of a bare `a`, so it
   never outranks a component's own link colour (Bootstrap got the same
   effect by swapping a custom property). */
a {
  color: var(--th-advant);
  text-decoration: underline;
}
a:where(:hover) { color: var(--th-advant-deep); }

a:not([href]):not([class]),
a:not([href]):not([class]):hover {
  color: inherit;
  text-decoration: none;
}

pre, code, kbd, samp {
  font-family: var(--th-font-mono);
  font-size: 1em;
}

pre {
  display: block;
  margin-top: 0;
  margin-bottom: 1rem;
  overflow: auto;
  font-size: 0.875em;
}
pre code {
  font-size: inherit;
  color: inherit;
  word-break: normal;
}

code {
  font-size: 0.875em;
  color: var(--th-advant-deep);
  word-wrap: break-word;
}
:where([data-theme="dark"]) code { color: var(--th-advant); }
a > code { color: inherit; }

kbd {
  padding: 0.1875rem 0.375rem;
  font-size: 0.875em;
  color: var(--th-paper);
  background-color: var(--th-ink);
  border-radius: 0.25rem;
}
kbd kbd {
  padding: 0;
  font-size: 1em;
}

figure { margin: 0 0 1rem; }

img, svg { vertical-align: middle; }

table {
  caption-side: bottom;
  border-collapse: collapse;
}

caption {
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
  color: var(--th-ink-2);
  text-align: left;
}

th {
  text-align: inherit;
  text-align: -webkit-match-parent;
}

thead, tbody, tfoot, tr, td, th {
  border-color: inherit;
  border-style: solid;
  border-width: 0;
}

label { display: inline-block; }

button { border-radius: 0; }

button:focus:not(:focus-visible) { outline: 0; }

input, button, select, optgroup, textarea {
  margin: 0;
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
}

button, select { text-transform: none; }

[role="button"] { cursor: pointer; }

select { word-wrap: normal; }
select:disabled { opacity: 1; }

[list]:not([type="date"]):not([type="datetime-local"]):not([type="month"]):not([type="week"]):not([type="time"])::-webkit-calendar-picker-indicator {
  display: none !important;
}

button,
[type="button"],
[type="reset"],
[type="submit"] {
  -webkit-appearance: button;
}

button:not(:disabled),
[type="button"]:not(:disabled),
[type="reset"]:not(:disabled),
[type="submit"]:not(:disabled) {
  cursor: pointer;
}

::-moz-focus-inner {
  padding: 0;
  border-style: none;
}

textarea { resize: vertical; }

fieldset {
  min-width: 0;
  padding: 0;
  margin: 0;
  border: 0;
}

legend {
  float: left;
  width: 100%;
  padding: 0;
  margin-bottom: 0.5rem;
  font-size: calc(1.275rem + 0.3vw);
  line-height: inherit;
}
@media (min-width: 1200px) {
  legend { font-size: 1.5rem; }
}
legend + * { clear: left; }

::-webkit-datetime-edit-fields-wrapper,
::-webkit-datetime-edit-text,
::-webkit-datetime-edit-minute,
::-webkit-datetime-edit-hour-field,
::-webkit-datetime-edit-day-field,
::-webkit-datetime-edit-month-field,
::-webkit-datetime-edit-year-field {
  padding: 0;
}

::-webkit-inner-spin-button { height: auto; }

[type="search"] {
  -webkit-appearance: textfield;
  outline-offset: -2px;
}

::-webkit-search-decoration { -webkit-appearance: none; }

::-webkit-color-swatch-wrapper { padding: 0; }

::-webkit-file-upload-button {
  font: inherit;
  -webkit-appearance: button;
}

::file-selector-button {
  font: inherit;
  -webkit-appearance: button;
}

output { display: inline-block; }

iframe { border: 0; }

summary {
  display: list-item;
  cursor: pointer;
}

progress { vertical-align: baseline; }

[hidden] { display: none !important; }
