/* BodyScreen — base: reset, tipografia, focus. I colori vengono da tokens.css. */

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

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

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: var(--font-size-base);
  line-height: var(--line-height);
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0; color: var(--color-text); font-weight: var(--font-weight-bold); line-height: 1.2; }
h1 { font-size: var(--font-size-2xl); }
h2 { font-size: var(--font-size-xl); }
h3 { font-size: var(--font-size-lg); }
p { margin: 0 0 var(--space-3); }
p:last-child { margin-bottom: 0; }

a { color: var(--color-primary); text-underline-offset: 2px; }
a:hover { color: var(--color-primary-hover); }

img, svg { display: block; max-width: 100%; }
.icon { flex: none; display: inline-block; vertical-align: middle; }

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

/* Focus da tastiera ben visibile (2 px) */
:focus-visible { outline: var(--focus-ring); outline-offset: 2px; }
:focus:not(:focus-visible) { outline: none; }

hr { border: 0; border-top: 1px solid var(--color-border); margin: var(--space-6) 0; }

.muted { color: var(--color-text-muted); }
.small { font-size: var(--font-size-sm); }

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

/* Elementi che hanno senso solo con JavaScript attivo */
.no-js .js-only { display: none !important; }

/* Link "Salta al contenuto" */
.skip-link {
  position: absolute;
  left: var(--space-4);
  top: calc(-1 * var(--space-12));
  z-index: 100;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-sm);
  background: var(--color-primary);
  color: var(--color-on-primary);
  font-weight: var(--font-weight-medium);
}
.skip-link:focus { top: var(--space-2); color: var(--color-on-primary); }

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