/* Sahara Rise — stili base non esprimibili con le utility Tailwind.
   I colori arrivano SEMPRE dai token di tokens.css (regola R2). */

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

body {
  line-height: 1.6;
  font-size: 1rem;            /* 16px min; mai sotto 14px (BRANDSITO §2.2) */
  overscroll-behavior-y: none; /* niente bounce/overscroll strano (§8.2) */
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  font-family: var(--sr-font-display);
  line-height: 1.15;
}

a {
  color: var(--sr-terracotta);
  text-underline-offset: 0.15em;
}

/* Tap target minimo 44x44 su elementi interattivi (§8.2) */
:where(button, a[role="button"], .sr-tap) {
  min-height: 44px;
  min-width: 44px;
}

/* Focus visibile e accessibile ovunque */
:where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--sr-oro);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Rispetto delle preferenze di movimento (§2.3 / §8.2) */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* Safe-area per iPhone con notch — usata dalla bottom tab bar (M2) */
:root {
  --sr-safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* Spazio in fondo su mobile perché la bottom tab bar fissa non copra il footer */
@media (max-width: 767px) {
  body { padding-bottom: calc(60px + var(--sr-safe-bottom)); }
}

/* View Transitions cross-document (§8.2): dove supportate animano la navigazione
   tra pagine; altrove il browser fa navigazione normale (nessuna dipendenza). */
@view-transition { navigation: auto; }

@media (prefers-reduced-motion: no-preference) {
  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation-duration: 220ms;
  }
}
