/* ────────────────────────────────────────────────────────────
   base.css — Terra Mia Hugo Theme — neutral foundation
   Aggiornato 2026-05-15 (post-blueprint refactor)

   Cosa contiene:
   - Reset minimo (box-sizing, margin/padding root)
   - Body defaults (font-family fallback, smoothing, color scheme dark)
   - Scroll behavior + skip-link a11y
   - Container utility (.tm-shell)
   - Scroll-reveal IntersectionObserver styles ([data-reveal])
   - Touch target minimum a11y

   Cosa NON contiene:
   - Palette colori (sta in dna-*.css, custom properties)
   - Tipografia specifica DNA (font-family, sizes — sta in dna-*.css)
   - Sezioni specifiche (hero/cards/etc — sta in dna-*.css)

   Caricato SEMPRE in baseof.html, prima di qualsiasi DNA css.
   ──────────────────────────────────────────────────────────── */

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  /* Default font fallback — DNA css overrides with brand-specific stack */
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.5;
}

/* ── Skip link (WCAG 2.4.1) ──────────────────────────────── */
.tm-skip {
  position: absolute;
  left: -9999px;
  top: 0;
  padding: 0.7rem 1.2rem;
  font-weight: 700;
  font-size: 0.84rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  z-index: 200;
  border-radius: 0 0 6px 0;
}
.tm-skip:focus { left: 0; outline: none; }

/* ── Container utility ───────────────────────────────────── */
.tm-shell {
  max-width: var(--tm-shell-max, 1240px);
  margin: 0 auto;
  padding-left: var(--tm-shell-pad, clamp(1.2rem, 3vw, 2rem));
  padding-right: var(--tm-shell-pad, clamp(1.2rem, 3vw, 2rem));
}

/* ── Scroll-reveal animation (IntersectionObserver-driven) ── */
[data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s ease, transform 0.7s ease;
  transition-delay: calc(var(--reveal-delay, 0) * 1ms);
}
[data-reveal].is-visible {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }
  html { scroll-behavior: auto; }
}

/* ── Touch targets (WCAG 2.5.5) ────────────────────────── */
a, button, input, select, textarea {
  min-height: 1px; /* permette override per inline links */
}
@media (pointer: coarse) {
  a:not(.tm-inline), button, .tm-cta, .tm-chip {
    min-height: 44px;
  }
}

/* ── Sr-only utility ─────────────────────────────────────── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ── Image responsive default ────────────────────────────── */
img { max-width: 100%; height: auto; display: block; }
img[loading] { background: var(--tm-bg-soft, #1d1814); }

/* ── Form baseline (input/textarea coherent across DNAs) ── */
input, textarea, select, button {
  font-family: inherit;
  font-size: inherit;
}

/* ── Print baseline (sobrio editoriale) ──────────────────── */
@media print {
  [data-reveal] { opacity: 1; transform: none; }
  .tm-skip, nav, footer { display: none; }
  body { color: #000; background: #fff; font-size: 11pt; }
}
