/* ==========================================================================
   Latx Technologies — Reset
   --------------------------------------------------------------------------
   Normalises the user agent, sets the one focus indicator the whole site uses,
   and honours the reduced-motion preference in a single place.

   Nothing here is decorative and nothing here is component specific. Requires
   variables.css.
   ========================================================================== */

/* ------------------------------------------------------------- 1. Box model */

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

* {
  margin: 0;
}

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

html:focus-within {
  scroll-behavior: smooth;
}

/* One place motion is switched off. Every animation and transition in the
   theme is suppressed here, so a component never has to remember to. */
@media (prefers-reduced-motion: reduce) {
  html:focus-within {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  min-height: 100svh;
  font-family: var(--font-family-body);
  font-size: var(--font-size-body);
  line-height: var(--line-height-body);
  color: var(--color-text);
  background-color: var(--color-background);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* The `hidden` attribute must win. Any component that sets its own `display`
   would otherwise override the user-agent rule and render while hidden — which
   the card filters and the mobile drawer both depend on. */
[hidden] {
  display: none !important;
}

/* --------------------------------------------------------- 2. Media defaults */

img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
  font-style: italic; /* styles the alternative text if an image fails to load */
}

/* ---------------------------------------------------------- 3. Form defaults */

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  background: none;
  border: 0;
  cursor: pointer;
}

/* ---------------------------------------------------------- 4. Text defaults */

/* Long words break rather than run out of the element. Anything that holds a
   sentence is listed, because a box that clips its overflow will otherwise cut
   the word in half rather than wrap it. */
p,
h1,
h2,
h3,
h4,
h5,
h6,
li,
dt,
dd,
th,
td,
summary,
figcaption,
blockquote {
  overflow-wrap: break-word;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

/* ------------------------------------------------- 5. Focus and accessibility */

/* One consistent, always-visible focus indicator. Never remove it without
   providing a replacement — keyboard users navigate by it. The transparent
   outline preserves a ring in Windows High Contrast mode, where box-shadow is
   discarded. */
:focus-visible {
  outline: 2px solid transparent;
  outline-offset: 2px;
  box-shadow: var(--focus-ring);
  border-radius: var(--radius-x-small);
}

/* Hidden visually, still announced by screen readers. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: var(--space-2x-small);
  left: var(--space-2x-small);
  z-index: var(--z-index-skip-link);
  padding: var(--space-x-small) var(--space-medium);
  font-family: var(--font-family-display);
  font-weight: var(--font-weight-semibold);
  color: var(--color-white);
  background-color: var(--color-ink-900);
  border-radius: var(--radius-small);
  transform: translateY(calc(-100% - var(--space-medium)));
  transition: transform var(--duration-base) var(--easing-out);
}

.skip-link:focus-visible {
  color: var(--color-white);
  transform: translateY(0);
}
