/*!
 * Rankrix Theme — Reset
 *
 * Tight modern reset based on commonly-accepted defaults (Andy Bell's
 * "modern CSS reset" pattern, abbreviated). Establishes consistent box
 * sizing, removes default margins, sets up dark-mode body, and gives
 * media elements sensible defaults.
 */

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

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* The body sits on the galactic background image (injected as a fixed-position
 * element via template-parts/chrome/galactic-background.php). The body itself
 * gets a solid-black fallback so the page never flashes light during paint,
 * and stays transparent on its non-image surfaces so the nebula shows through.
 */
body {
  min-height: 100vh;
  font-family: var(--rx-font-body);
  font-weight: var(--rx-weight-regular);
  font-size: var(--rx-text-base);
  line-height: var(--rx-leading-normal);
  color: var(--rx-text);
  background-color: var(--rx-black);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;

  /* The fixed footer pill sits at the bottom of the viewport; pages need
   * bottom padding equal to the pill's reserved space so content doesn't
   * disappear behind it. The chrome.css already sets this for the pill's
   * own dimensions; we just preserve it here as a defensive measure. */
}

/* Render flow elements as block-level by default for safer authoring. */
img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

/* Form elements inherit font; otherwise they default to system UI. */
input, button, textarea, select {
  font: inherit;
  color: inherit;
}

/* Long words shouldn't overflow narrow containers. */
p, h1, h2, h3, h4, h5, h6 {
  overflow-wrap: break-word;
}

/* Reasonable defaults for links. Each component can override. */
a {
  color: var(--rx-accent-soft);
  text-decoration: none;
  transition: color var(--rx-dur-fast) var(--rx-ease-out);
}
a:hover {
  color: var(--rx-text);
}
a:focus-visible {
  outline: 2px solid var(--rx-accent);
  outline-offset: 3px;
  border-radius: var(--rx-radius-px);
}

/* Lists used as semantic lists keep their bullets/numbers; lists used as
 * UI primitives (nav menus, button groups) should opt out via .rx-list-reset. */
.rx-list-reset {
  list-style: none;
  padding: 0;
}

/* Hide content visually while keeping it accessible to screen readers.
 * Standard "sr-only" pattern. */
.rx-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Anchor-link skip target — used by the "Skip to content" link in header.php.
 * Briefly slides into view on focus. */
.rx-skip-link {
  position: absolute;
  top: -100px;
  left: 0;
  z-index: var(--rx-z-overlay);
  padding: var(--rx-space-3) var(--rx-space-4);
  background: var(--rx-accent);
  color: var(--rx-white);
  font-weight: var(--rx-weight-semi);
  border-radius: var(--rx-radius-px);
}
.rx-skip-link:focus {
  top: var(--rx-space-3);
}

/* Selection colour matches the brand. Picked subtly transparent so text
 * underneath remains readable. */
::selection {
  background: hsla(238 82% 52% / 0.55);
  color: var(--rx-white);
}
