/*
 * Base: reset, document typography, layout primitives, accessibility helpers.
 * Uses tokens from tokens.css only: no raw colors, sizes or radii.
 */

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

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

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-ink);
  font-family: var(--font-body);
  font-size: var(--fs-body-m);
  font-weight: var(--fw-regular);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

img {
  height: auto;
}

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

p,
h1,
h2,
h3,
h4,
h5,
h6 {
  overflow-wrap: break-word;
}

/* ── Typography (style guide 1.2) ──────────────────────────────────── */
h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0 0 var(--space-4);
  font-family: var(--font-heading);
  color: var(--color-ink);
}

h1 { font-size: var(--fs-h1); font-weight: var(--fw-black);     line-height: var(--lh-tight); }
h2 { font-size: var(--fs-h2); font-weight: var(--fw-extrabold); line-height: var(--lh-heading); }
h3 { font-size: var(--fs-h3); font-weight: var(--fw-extrabold); line-height: var(--lh-snug); }
h4 { font-size: var(--fs-h4); font-weight: var(--fw-extrabold); line-height: var(--lh-snug); }
h5 { font-size: var(--fs-h5); font-weight: var(--fw-bold);      line-height: var(--lh-ui); }
h6 { font-size: var(--fs-h6); font-weight: var(--fw-bold);      line-height: var(--lh-ui); }

p {
  margin: 0 0 var(--space-4);
}

/* Links: ink, thicker underline on hover. Red is reserved for buying actions. */
a {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-thickness: from-font;
  text-underline-offset: .15em;
  transition: text-decoration-thickness var(--dur-fast) var(--ease-out);
}

a:hover {
  text-decoration-thickness: .125em;
}

/* ── Focus (style guide: 2px ink ring with 3px cream gap) ──────────── */
:focus-visible {
  outline: 2px solid transparent; /* keeps a visible outline in forced-colors mode */
  box-shadow: var(--focus-ring);
}

/* ── Layout ────────────────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

.site-main {
  display: block;
}

.site-main:focus {
  outline: none;
}

/* ── Accessibility helpers ─────────────────────────────────────────── */
.skip-link {
  position: absolute;
  top: var(--space-4);
  left: var(--space-4);
  z-index: 1000;
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-pill);
  background: var(--color-ink);
  color: var(--color-bg);
  font-family: var(--font-heading);
  font-weight: var(--fw-bold);
  text-decoration: none;
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
}

/* WordPress core class for visually hidden text. */
.screen-reader-text {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.screen-reader-text:focus {
  /* Shown like .skip-link when focused. */
  clip: auto;
  width: auto;
  height: auto;
  margin: 0;
}
