/* ==========================================================================
   Base – reset, elements, layout primitives, utilities
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + var(--s2));
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--text-md);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; }
p { margin: 0; }
button { font: inherit; color: inherit; }

h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: var(--track-display);
  line-height: 1.1;
}

:focus-visible { outline: 3px solid var(--eyebrow); outline-offset: 3px; border-radius: 4px; }

/* Layout primitives ------------------------------------------------------ */

.wrap {
  max-width: calc(var(--container) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* Column counts per breakpoint come from inline custom properties
   (see toppvald_grid_style()): --cols, --cols-md (≤1100px), --cols-sm (≤700px). */
.grid {
  display: grid;
  grid-template-columns: repeat(var(--cols, 1), minmax(0, 1fr));
  gap: var(--grid-gap, var(--s2));
}
@media (max-width: 1100px) {
  .grid { grid-template-columns: repeat(var(--cols-md, var(--cols, 1)), minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .grid { grid-template-columns: repeat(var(--cols-sm, 1), minmax(0, 1fr)); }
}

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

.list-reset { margin: 0; padding: 0; list-style: none; }

.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link:focus {
  position: fixed !important;
  top: var(--s1);
  left: var(--s1);
  z-index: 100;
  width: auto;
  height: auto;
  clip: auto;
  padding: var(--s1) var(--s2);
  border-radius: var(--radius-pill);
  background: var(--ink);
  color: var(--bg);
}

.tone-blue   { background: var(--tone-blue); }
.tone-yellow { background: var(--tone-yellow); }
.tone-coral  { background: var(--tone-coral); }
.tone-lilac  { background: var(--tone-lilac); }
.tone-green  { background: var(--tone-green); }
.tone-pink   { background: var(--tone-pink); }

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