/* ==============================================================
   PHASE B — Reset + utilities
   ============================================================== */

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

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

/* Guards the .cartypes__scroller--bleed breakout (cartypes.css): a
   100vw box runs slightly wider than 100% on a page with a vertical
   scrollbar, which otherwise shows up here as a stray horizontal
   scrollbar. Nothing in this codebase depends on horizontal page
   scroll or position:sticky/fixed, so this is safe to set globally. */
html, body { overflow-x: hidden; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--text-md);
  line-height: var(--leading-normal);
  color: var(--color-ink);
  background: var(--color-surface);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

/* The hidden attribute is only a UA-level display:none, so ANY author
   display rule beats it. Several components here set display:flex,
   which would leave "hidden" elements fully visible. */
[hidden] { display: none !important; }

ul { margin: 0; padding: 0; list-style: none; }

a { color: inherit; text-decoration: none; }

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

/* One focus treatment for the whole component. :focus-visible keeps
   it off mouse clicks without disabling it for keyboard users. */
/* .is-focus lets the style guide show this state statically; it is
   attached here so there is only ever one focus definition. */
:focus-visible,
.is-focus {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}

/* --- Utilities ------------------------------------------------ */

/* The display face is four properties that must stay in step. Defining
   them once stops the block being hand-copied into every component —
   it had been repeated seven times across four files. */
.u-display {
  font-family: var(--font-display);
  /* font-weight is set as well as the axis so browsers that ignore
     font-variation-settings still get a bold face. */
  font-weight: var(--display-wght);
  font-variation-settings: 'wdth' var(--display-wdth), 'wght' var(--display-wght);
  text-transform: uppercase;
}

/* Visually hidden but still announced. clip-path is the modern
   mechanism; clip is kept for older engines. */
.u-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Set while a scroll-locking panel (the mobile drawer) is open. */
.u-scroll-locked,
.u-scroll-locked body { overflow: hidden; }
