@use '../abstracts' as *;

// ============================================================
// Reset and base
// ============================================================

html { background: var(--bg); }

// Smooth colour change when the mode switches.
// A component's own transition, declared later, wins (cascade order).
body, .author-box, .post-nav a, .min-nav a {
  transition: background-color 0.45s ease, color 0.45s ease,
              border-color 0.45s ease, box-shadow 0.45s ease, filter 0.45s ease;
}

*,
*::before,
*::after { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: $font-sans;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  line-height: 1.75;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  // Long unbreakable words never widen the page (toolkit PLAYBOOK §2)
  overflow-wrap: break-word;
  // Wide/full blocks measure the page in cqi: 100vw would include the
  // scrollbar (unit-test-findings "Wide and Full"). An inline-size container
  // is not a containing block for fixed children, so the switcher and the
  // preview are unaffected.
  container-type: inline-size;
}

a { color: inherit; }

img,
svg,
video,
iframe { max-width: 100%; }

img,
video { height: auto; }

// One keyboard focus rule; wherever outline: none is set, a replacement is given
:focus-visible {
  outline: 2px solid var(--accent-deep);
  outline-offset: 3px;
}

// A superscript or subscript must not open up its line (titles included)
sup, sub { line-height: 0; }

// Highlighted search terms
mark {
  background: var(--rule-strong);
  color: var(--ink);
  border-radius: 3px;
  padding: 0 2px;
}
