/**
 * Global resets — box-sizing, scrollbar hiding, focus management,
 * element defaults, and the size-query provider utility.
 *
 * Imported from styles.css (the barrel). Targets document-level
 * defaults and universal selectors; component-scoped rules live in
 * each component's own CSS under `@scope (component-ui)`.
 */

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

*::-webkit-scrollbar {
  display: none;
}

/* Kill default focus outline — components manage their own via --a-focus-ring */
*:focus {
  outline: none;
}

/* Prevent text selection on all interactive components */
:is(button-ui, kbd-ui, tag-ui, input-ui, textarea-ui, select-ui, check-ui, radio-ui, switch-ui,
    slider-ui, range-ui, segmented-ui, segment-ui) {
  user-select: none;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  hanging-punctuation: first last;
  color-scheme: light dark;
}

body {
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;

  margin: 0;
  font-family: var(--a-font-family);
  font-size: var(--a-body-size);
  font-style: normal;
  font-variation-settings: 'slnt' 0, 'ital' 0;
  line-height: 1.5;
  color: var(--a-fg);
  background: var(--a-bg);
  min-block-size: 100dvb;
}

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

ul[role='list'],
ol[role='list'] {
  list-style: none;
  padding: 0;
}

/* ── Size-query provider utility ──────────────────────────────────
   Opt any element into being a container-query size provider for
   its descendants, without the nesting fragility of applying
   container-type to every instance of a primitive. Use sparingly —
   on panels, split-panes, cards that actually need responsive
   children — and descendants query via bare `@container (width < Xrem)`
   (matches nearest) or `@container container (...)` for clarity.

   Why inline-size: block-direction height stays content-driven.
   Why an attribute: explicit opt-in; avoids accidental containment
   collapse when a primitive is composed inside another flex chain. */
[provide-container-inline-size] {
  container-type: inline-size;
  container-name: container;
}


:focus-visible {
  outline: var(--ui-focus-width, 2px) solid var(--ui-focus, Highlight);
  outline-offset: 2px;
}

::selection {
  background: var(--a-selection-bg);
  color: var(--a-selection-text);
  border-radius: var(--a-selection-radius);
}

h1,
h2,
h3,
h4,
h5,
h6 {
  text-wrap: balance;
  line-height: 1.1;
}

p,
li,
figcaption {
  text-wrap: pretty;
}

a:not([class]) {
  text-underline-offset: 0.12em;
}
