﻿/* ===================================================
   BASE.CSS — Reset, variabili, tipografia, utilities
   =================================================== */

/* ---------- Font: Open Sauce via jsDelivr ---------- */
@import url('https://cdn.jsdelivr.net/npm/@fontsource/open-sauce-sans@latest/index.css');

/* ---------- Variabili globali ---------- */
:root {
  /* Palette cromatica */
  --crema:        #F6F0D7;  /* sfondo dominante della pagina */
  --verde-chiaro: #C5D89D;  /* sezioni alternate e card, con parsimonia */
  --salvia:       #9CAB84;  /* header, footer, dettagli */
  --oliva:        #89986D;  /* accenti secondari, bordi */
  --testo:        #2C3127;  /* testo e titoli */
  --terracotta:   #E07856;  /* CTA e accento caldo */

  /* Tipografia */
  --font-titoli: 'Barrio', cursive;
  --font-corpo:  'Open Sauce Sans', system-ui, sans-serif;

  /* Dimensioni */
  --radius:     8px;
  --radius-lg:  16px;
  --gap:        1.5rem;
  --max-width:  1200px;

  /* Transizioni */
  --transizione: 0.3s ease;
}

/* ---------- Reset moderno ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  font-family: var(--font-corpo);
  color: var(--testo);
  background-color: var(--crema);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Tipografia di base ---------- */
/* Barrio per tutti i titoli del sito; Open Sauce resta per il corpo */
h1, h2, h3, .logo-nome, .tagline {
  font-family: var(--font-titoli);
  line-height: 1.2;
  color: var(--testo);
}

h1 { font-size: clamp(2.2rem, 6vw, 4rem); }
h2 { font-size: clamp(1.8rem, 4vw, 2.8rem); margin-bottom: 0.75rem; }
h3 { font-size: clamp(1.3rem, 3vw, 1.8rem); }

p {
  max-width: 68ch;
  margin-bottom: 1rem;
  line-height: 1.6;
}

a {
  color: var(--testo);
  text-decoration: none;
  transition: color var(--transizione);
}

a:hover,
a:focus-visible {
  color: var(--salvia);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

.mobile-br { display: none; }
@media (max-width: 767px) { .mobile-br { display: block; } }

ul, ol {
  list-style: none;
}

/* ---------- Utilities ---------- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: 1.25rem;
}

.testo-centrato { text-align: center; }

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

/* Classe di reveal per IntersectionObserver */
.rivela {
  opacity: 0;
  transform: translateY(2rem);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.rivela.visibile {
  opacity: 1;
  transform: none;
}
